Fragmentation reconfiguration method and system based on node credibility election and electronic equipment
Through the sharded reconfiguration method based on node reputation election, the nodes are reorganized using PoCE and FTS algorithms, the problem of not being able to effectively distinguish between honest nodes and malicious nodes in the existing technology is solved, and the security and attack resistance of the blockchain system are improved.
Patent Information
- Application Number
- CN202510422458.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-04-07
AI Technical Summary
The existing shard reconfiguration technology cannot effectively distinguish between honest nodes and malicious nodes, which may lead to high-reputation nodes being mistakenly eliminated, while low-reputation nodes remain in the system, reducing the overall security of the system.
The sharded reconfiguration method based on node credibility election is adopted, and the nodes are regularly reorganized according to the node credibility through the Proof of Credit Election (PoCE) algorithm and the Follow the Satoshi (FTS) algorithm, so that many honest nodes are retained in the consensus committee, and the security risks brought about by the centralization of equity are avoided through the equity value smoothing.
It improves the security of the consensus process, reduces communication overhead, enhances the system's attack resistance, and ensures the fairness and robustness of the system.
Smart Images

Figure CN120223407A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of blockchain, and particularly relates to a shard reconfiguration method, system and electronic device based on node reputation election. Background Art
[0002] Due to its characteristics such as decentralization, immutability and traceability, blockchain technology has been widely applied in the fields of finance, Internet of Things, supply chain management, etc. As one of the mainstream solutions for blockchain expansion currently, the sharding technology divides the network into multiple independent shards, enabling different shards to process transactions in parallel, thereby improving the throughput capacity of the system and reducing transaction latency. On the premise of ensuring the decentralization and security of the blockchain, the sharding technology can effectively alleviate the performance bottleneck problem of the blockchain network. However, in practical applications, sharded blockchains still face many challenges, among which the effectiveness and security of shard reconfiguration are particularly crucial. How to ensure the stability and anti-attack ability of the system while dynamically adjusting the shard structure is still a problem that needs in-depth study.
[0003] In a sharded blockchain system, shard reconfiguration refers to regularly adjusting the node composition within each shard to improve the security of consensus, reduce communication overhead, and enhance the system's resistance to security threats. If the shard structure remains unchanged for a long time, malicious nodes can control the majority consensus power of a certain shard, thereby destroying the consensus security of that shard. In addition, due to the continuous addition of new nodes and the withdrawal of old nodes, the dynamic changes in shard scale and load also need to be reasonably adjusted. Otherwise, it may lead to uneven utilization of computing resources in some shards, affecting the stability of the overall system.
[0004] The existing shard reconfiguration technologies mainly include two methods: full random sharding and partial random sharding. However, both of these methods have certain limitations in practical applications, affecting the security, computing efficiency and communication overhead of the sharded blockchain system.
[0005] In the full random sharding method, all nodes are completely randomly reassigned during each round of shard reconfiguration, and this method has the following defects: 1. It introduces additional computing and communication overhead. All nodes need to be reassigned, resulting in a large amount of computing resource scheduling in the system and a large amount of data exchange between shards, increasing the communication load and reducing the overall throughput; 2. The consensus nodes need to re-establish connections and synchronize states. This not only affects the stability of the system but also may cause delays in new block confirmations, reducing the transaction processing efficiency.
[0006] During partial random sharding reconfiguration, only some nodes are randomly adjusted to enhance security while maintaining system stability. Compared with full random sharding, this method can reduce the computational and communication overheads and mitigate the impact of frequent node changes on the system. However, when the proportion of malicious nodes in a single shard is relatively high, partial random adjustment may not be sufficient to completely eliminate potential security risks, and malicious nodes may still gradually infiltrate the shard consensus mechanism through long-term latency or collaborative attacks.
[0007] Chinese invention patent document CN112511590B proposes an efficient storage reconfiguration method for blockchain sharding, aiming to achieve the reconfiguration process of a lightweight blockchain network: (1) verification nodes run the network partition reconfiguration protocol; (2) verification nodes switch to the latest network shard state; (3) determine the corresponding node groups according to the transaction hash value; (4) transaction processing, where the main chain block serves as the cross-shard verification routing table for transaction inputs; (5) run the consensus protocol within the shard. This patent solution reduces the system service suspension time and alleviates the network load pressure caused by data exchange between nodes during system switching. In addition, it optimizes the cross-shard verification method for transactions in the sharded blockchain, improving the system's transaction processing rate. However, this invention mainly focuses on how to improve the storage reconfiguration efficiency of the sharded blockchain but has certain limitations in node reputation evaluation and dynamic adjustment.
[0008] Existing sharding reconfiguration mechanisms usually adopt random reconfiguration or regular rotation methods to prevent malicious nodes from controlling a certain shard for a long time. However, the random or fixed rotation methods have certain limitations and cannot effectively distinguish between honest nodes and malicious nodes, which may lead to the incorrect elimination of high-reputation nodes while low-reputation nodes still remain in the system, reducing the overall security of the system. Summary of the Invention
[0009] To solve the above problems existing in the prior art, the present invention proposes a shard reconfiguration method, system and electronic device based on node reputation election. Through the Proof of Credit Election (abbreviated as PoCE) algorithm for election and elimination based on node reputation, the system regularly reorganizes a part of the nodes according to the node reputation, so that as many honest nodes as possible are retained in the consensus committee, thereby greatly reducing the number of nodes in the consensus committee and reducing communication overhead. The present invention adopts an equity value smoothing method to optimize the equity value mechanism, smooth the pledged equity value, so that it does not become the only dominant factor, and ensures that nodes with low equity value but high reputation still have the opportunity to be selected into the consensus committee. In addition, the present invention calculates the reputation based on PoCE and introduces the Follow the Satoshi algorithm (abbreviated as FTS), that is, forms a Merkle tree with all node equity values. The weight of a non-leaf node is the sum of the weights of the left and right subtrees, and the weight of a leaf node is the equity value of a certain equity owner. Select according to the random number in the left and right subtrees. Eliminate the 5% nodes with the lowest reputation to ensure that malicious nodes and nodes with lower reputation are gradually removed from the consensus committee.
[0010] To achieve the above object, the technical solution of the present invention includes two parts: the first part is to establish a reputation mechanism for shard nodes; the second part is to randomly reconfigure some of the nodes in the shard, specifically as follows:
[0011] A shard reconfiguration method based on node reputation election, comprising the following steps:
[0012] S1. Initialize the Epoch, generate and broadcast a random number r;
[0013] S2. Calculate the increment of the equity value Stake, for node S i Calculate the equity increment where represents the pledged equity value of node i in the current Epoch, represents the pledged equity value of node i in the previous Epoch, and according to the calculated δ i obtain the median Med(|δ|) of the absolute values of all node increments and the interquartile range IQR = Q3(|δ|) - Q1(|δ|), where Q1 and Q3 are the 25% and 75% percentiles of the absolute value of the increment, and set the abnormal equity increment threshold δ thres = Med(|δ|) + 1.5 × IQR, if |δ i | > δ thres then it means that the equity increment of this node is abnormal and it is an abnormal node.
[0014] S3. When each new node joins the network and enters the candidate committee of a certain shard, it needs to send a transaction participating in the election and successfully reach a consensus on the block. The transaction will record the current staked Stake value S of the node. i . To prevent Stake hegemony, smooth the Stake. At this time, after smoothing, the minimum value S of the node's equity value is obtained. min and the maximum value S max , and other values will be mapped to the range (S min , S max ).
[0015] S4. Calculate the node reputation. In each Epoch, the system calculates based on the staked equity value S of any node i in each shard i , the contribution E in the most recent Epoch i and the historical contribution H i . Calculate the reputation of node i in the next Epoch through the PoCE consensus. The PoCE formula for a certain node i is as follows:
[0016] PoCE i = τ0S i + τ1H i + τ2E i + τ3P i
[0017] where τ0 + τ1 + τ2 + τ3 = 1, representing the weights of different influencing factors.
[0018] S5. Consensus committee node elimination: The contribution E in the most recent Epoch i is defined as the number of transactions in which the node was elected as the leader in the current shard in the previous Epoch and successfully completed the consensus, and the nodes are sorted according to the E i value, and directly eliminate the top 5% of the nodes participating in the consensus in the shard with the highest E i value; according to the PoCE formula, calculate the PoCE of each node i and the maximum PoCE max , run the FTS algorithm (follow the Satoshi algorithm), and use PoCE max - PoCE iCalculate the difference as the elimination weight, map it to the corresponding nodes according to the weight distribution, and repeat the selection until 5% of the nodes participating in the consensus within the shard are eliminated; a total of 10% of the consensus nodes in the system are eliminated. The FTS algorithm uses an improved Merkle tree structure to implement the equity distribution mechanism, where the weight value of each non-leaf node is recursively formed by summing the weights of its left and right child nodes, and the leaf nodes directly store the actual equity values of the corresponding equity owners. In the path selection stage, the system determines the traversal direction of the left and right subtrees through a random seed. The random seed is the global random number of the current Epoch, and the eliminated nodes will join the candidate committee of this shard.
[0019] S6. Consensus committee election. Apply the PoCE formula to calculate the reputation of all candidate nodes, and select n / 10 + min(m / 10, 1024 - n) nodes as the new consensus nodes through the FTS algorithm. Among them, the size of the consensus committee before update is n, and the size of the candidate committee is m. The final number of consensus nodes after update is n + min(m / 10, 1024 - n), ensuring that the number of consensus nodes gradually increases to 1024 after the update.
[0020] Preferably, in step S3, the Stake smoothing process is as follows: Calculate the median Med(S current ) of the current equity values of all consensus nodes, set the maximum allowable change amount Δ max = 0.1 × Med(S current ), set the equity value truncation value That is, it is expressed as
[0021]
[0022] Select the smoothing coefficient α according to the anomaly mark i Calculate the new equity value of the node:
[0023]
[0024] Preferably, in step S4, for the consensus marginalization degree P i , the system saves an election cumulative status value for each node, and its calculation method is: this value starts counting from 0, and once the node is selected as a consensus node, this value is incremented by 1, otherwise it is decremented by 1. After determining the maximum election cumulative status value among all nodes in the system, subtract the election cumulative status value of each node from the maximum value of the election cumulative status value, and use the obtained difference as the consensus marginalization degree P i .
[0025] The present invention also discloses a shard reconfiguration system based on node reputation election for executing the above method, including the following modules:
[0026] Initialization module: Initialize the Epoch, generate and broadcast a random number r;
[0027] Equity value increment calculation module; for node S i Calculate the equity increment where represents the staked equity value of node i in the current Epoch, represents the staked equity value of node i in the previous Epoch. According to the calculated δ i obtain the median Med(|δ|) of the absolute values of all node increments and the interquartile range IQR = Q3(|δ|) - Q1(|δ|), where Q1 and Q3 are the 25% and 75% percentiles of the absolute values of the increments. Set the abnormal equity increment threshold δ thres = Med(|δ|) + 1.5 × IQR. If |δ i | > δ thres then it indicates that the equity increment of this node is abnormal and it is an abnormal node;
[0028] Smoothing module: When each new node joins the network and enters the candidate committee of a shard, it sends a transaction participating in the election and successfully reaches a consensus to produce a block; the current staked Stake value S of this node is recorded in the transaction i ; Smooth the Stake. After smoothing, obtain the minimum value S min and the maximum value S max of the node equity value, and other values will be mapped to the range (S min , S max );
[0029] Node reputation calculation module: In each Epoch, according to the staked equity value StakeS i of any node i in each shard, the contribution degree E i in the most recent Epoch, the historical contribution degree H i and the consensus marginalization degree P i calculate the reputation of node i in the next Epoch through the election elimination algorithm PoCE consensus; the PoCE formula for node i is as follows:
[0030] PoCE i = τ0S i + τ1H i + τ2E i + τ3P i
[0031] where τ0 + τ1 + τ2 + τ3 = 1, representing the weights of different influencing factors;
[0032] Consensus committee node elimination module: The contribution degree E iIt is defined as the number of transactions that the node was elected as the leader in the current shard in the previous Epoch and successfully completed consensus, and the nodes are sorted according to the E i value, and directly eliminate the 5% of the nodes participating in consensus within the shard with the highest E i value; According to the PoCE formula, calculate the PoCE of each node i and the maximum PoCE max , run the FTS algorithm, and use the PoCE max -PoCE i calculated difference as the elimination weight, map it to the corresponding nodes according to the weight distribution, and repeat the selection until 5% of the nodes participating in consensus within the shard are eliminated; A total of 10% of the consensus nodes in the system are eliminated. The FTS algorithm uses an improved Merkle tree structure to implement the equity distribution mechanism, where the weight value of each non-leaf node is composed of the recursive sum of the weights of its left and right child nodes, and the leaf nodes directly store the actual equity values of the corresponding equity owners. In the path selection stage, the system determines the traversal direction of the left and right subtrees through a random seed. The random seed is the global random number of the current Epoch, and the eliminated nodes will join the candidate committee of this shard;
[0033] Consensus Committee Election Module: Use the PoCE formula to calculate the credibility of all candidate nodes, and select n / 10 + min(m / 10, 1024 - n) nodes as the new consensus nodes through the FTS algorithm; where, the size of the consensus committee before update is n, and the size of the candidate committee is m; The final number of consensus nodes after update is n + min(m / 10, 1024 - n).
[0034] The present invention also discloses an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above method or system is implemented.
[0035] The present invention innovatively proposes a shard reconfiguration method, system and electronic device based on node credibility election, aiming to improve the shard reorganization efficiency, and combine the node credibility evaluation mechanism. By comprehensively considering factors such as node pledge equity value, historical contribution degree, consensus contribution degree and consensus marginalization degree, more accurate node election and elimination strategies are formulated, and the node management strategy is further optimized to ensure the high throughput of the system while enhancing the consensus security and anti-attack ability of the system, and can meet the load requirements in different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a flowchart of a shard reconfiguration method based on node credibility election according to a preferred embodiment of the present invention;
[0037] Figure 2It is a block diagram of a shard reconfiguration system based on node reputation election in a preferred embodiment of the present invention;
[0038] Figure 3 It is a schematic diagram of the changes in the number of malicious nodes and honest nodes under different epochs in the simulation experiment based on the present invention. Specific implementation manners
[0039] The following will describe in detail the preferred embodiments of the present invention with reference to the accompanying drawings.
[0040] As Figure 1 shown, taking a certain node N5 as an example, the specific steps of a shard reconfiguration method based on node reputation election in this embodiment are as follows:
[0041] 1) Epoch initialization, generating and broadcasting a random number r.
[0042] 2) Calculation of the stake value increment. Taking node A as an example, its stake value in the previous epoch was The current epoch stake value The 25th percentile and 75th percentile of the absolute value of the increment in the system are Q1 = 8 and Q3 = 15 respectively, the interquartile range IQR = 7, the median of the increment Med(|δ|) = 10, and the anomaly threshold δ thres = 20.5. At this time, the absolute value of the increment of node A |δ A | = 100 > 20.5, and it is marked as an abnormal node.
[0043] 3) Taking node A as an example, assuming that the median of the current stake values of all nodes Med(S current ) = 100, then the maximum allowable change amount Δ of the consensus nodes max = 10, calculate the truncation of the stake value of node A At this time, the α value of the abnormal node is 0.8, then the weighted smoothing calculation of node A
[0044] 4) Calculate the node reputation. According to the PoCE calculation formula, assuming that the weights are the same at this time, the influence factors of node NA are (SA = 102, HA = 10, EA = 4, PA = 1), and the value of PoCE5 calculated at this time is 29.25.
[0045] 5) Taking the stake value smoothing and node reputation calculation of node NA as an example, directly eliminate the 5% of the nodes with the lowest historical contribution degree and the 5% of the nodes with the lowest reputation according to the historical contribution degree Ei and PoCE ranking of the nodes.
[0046] 6) Consensus committee election; Calculate the reputation of all candidate nodes using the PoCE formula, and select 2 nodes as the new consensus nodes through the FTS algorithm; among them, the size of the consensus committee before the update is 20; the number of consensus nodes after the final update is 20.
[0047] As Figure 2 shown, this embodiment discloses a shard reconfiguration system based on node reputation election for executing the above method, including the following modules:
[0048] Initialization module: Initialize the Epoch, generate and broadcast a random number r;
[0049] Equity value increment calculation module; For node S i Calculate the equity increment where represents the pledged equity value of node i in the current Epoch, represents the pledged equity value of node i in the previous Epoch, and according to the calculated δ i obtain the median Med(|δ|) of the absolute values of all node increments and the interquartile range IQR = Q3(|δ|) - Q1(|δ|), where Q1 and Q3 are the 25% and 75% percentiles of the absolute values of the increments, and set the abnormal equity increment threshold δ thres = Med(|δ|) + 1.5 × IQR. If |δ i | > δ thres then it means that the equity increment of this node is abnormal and it is an abnormal node;
[0050] Smoothing module: When each new node joins the network and enters the candidate committee of a shard, it sends a transaction participating in the election and successfully reaches a consensus on the block; the current pledged Stake value S of this node is recorded in the transaction i ; Smooth the Stake. After smoothing, obtain the minimum value S of the node equity value min and the maximum value S max , and other values will be mapped to the range (S min , S max );
[0051] Node reputation calculation module: In each Epoch, according to the pledged equity value (Stake) S of any node i in each shard i , the contribution degree E in the most recent Epoch i , the historical contribution degree H i and the consensus marginalization degree P i calculate the reputation of node i in the next Epoch through the election elimination algorithm PoCE consensus; the PoCE formula of node i is as follows:
[0052] PoCEi = τ0S i + τ1H i + τ2E i + τ3P i
[0053] where τ0 + τ1 + τ2 + τ3 = 1, representing the weights of different influencing factors;
[0054] Consensus Committee Node Elimination Module: Count the number of transactions that the nodes in each shard were elected as the leader and successfully completed consensus among all nodes in the current shard in the previous Epoch, calculate the historical contribution situation E of all consensus nodes i , sort the nodes according to the value of E i , directly eliminate the 5% of the nodes with the smallest sorting; according to the PoCE formula, calculate the PoCE of each node, calculate the maximum PoCE max , based on PoCE max - PoCE i eliminate 5% of the nodes, and run the FTS algorithm to randomly assign the nodes to a shard network; among them, the random seed in FTS is the global random number of the current Epoch; the eliminated nodes will join the candidate committee of this shard.
[0055] Consensus Committee Election Module: Use the PoCE formula to calculate the reputation of all candidate nodes, and select n / 10 + min(m / 10, 1024 - n) nodes as the new consensus nodes through the FTS algorithm; among them, the size of the consensus committee before update is n, and the size of the candidate committee is m; the final number of consensus nodes after update is n + min(m / 10, 1024 - n).
[0056] For other contents of this embodiment, reference can be made to the above method embodiment.
[0057] In the simulation experiment, it is assumed that the total number of nodes in the system is 1000, and each newly added node is an honest node. The number of malicious nodes in the initial state meets the Byzantine fault tolerance requirements. Figure 3 shows the changing trends of the number of malicious nodes and honest nodes under different epochs. As the epoch increases, the malicious nodes are gradually eliminated based on the node reputation election mechanism, and finally, at the 60th epoch, all malicious nodes in the system are completely removed.
[0058] The preferred embodiment of the present invention also discloses an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above method or system is implemented.
[0059] In summary, the present invention has the following remarkable technical effects:
[0060] 1. The present invention proposes an election and elimination algorithm based on node reputation, abbreviated as PoCE. The system regularly reorganizes a part of the nodes according to the node reputation, so as to retain as many honest nodes as possible in the consensus committee, optimize the committee scale, reduce the system overhead, and improve the security of the consensus process.
[0061] 2. The present invention optimizes the staked equity value of nodes by using the equity value smoothing method, so that the equity value is no longer the only decisive factor, thus avoiding the phenomenon that high-equity nodes monopolize the consensus committee. This method ensures that nodes with low equity value but high reputation still have the opportunity to participate in the consensus, effectively reducing the security risks brought by equity centralization. In addition, this method improves the accuracy of the system's evaluation of node reputation, so that even when the equity value is low, high-quality nodes with high long-term contribution and stable behavior can still be selected, thus enhancing the fairness of the blockchain system.
[0062] 3. On the basis of PoCE reputation calculation, the present invention introduces the FTS algorithm to regularly eliminate the 5% nodes with the lowest reputation, ensuring that malicious nodes and nodes with low long-term reputation are gradually removed from the consensus committee. Further improving the security of the consensus committee, preventing the manipulation of the reputation scoring mechanism, and preventing nodes with high equity but low reputation from occupying the seats of the consensus committee for a long time, enhancing the robustness of the blockchain network.
[0063] The above is only a detailed description of the preferred embodiments and principles of the present invention. For those of ordinary skill in the art, according to the idea provided by the present invention, there will be changes in the specific implementation manners, and these changes should also be regarded as the protection scope of the present invention.
Claims
1. The shard reconfiguration method based on node reputation election is characterized by: Follow these steps: S1. Initialize the consensus node rotation period Epoch, generate and broadcast the random number r; S2. Calculate the equity value Stake increment; for node S i Calculating Equity Increase in Indicates the pledge equity value of the current Epoch node i, Indicates the pledged equity value of the previous Epoch node i, based on the calculated δ i The median Med(|δ|) and interquartile range IQR=Q3(|δ|)-Q1(|δ|) of the absolute value of all node increments are obtained, where Q1 and Q3 are the 25% and 75% quantiles of the absolute value of the increments; the abnormal equity increment threshold δ is set thres =Med(|δ|)+1.5×IQR, if |δ i |>δ thres This means that the node's equity increment is abnormal and it is an abnormal node; S3. When each new node joins the network and enters a shard candidate committee, it sends a transaction to participate in the election and successfully reaches consensus on the block; the transaction records the current stake value S of the node i ; Stake is smoothed, and the minimum value S of the node equity value is obtained after smoothing min and the maximum value S max , other values will be mapped to (S min ,S max ) S4. Calculate the node reputation. In each Epoch, calculate the stake value S of any node i in each shard. i 、The contribution of the most recent Epoch E i 、Historical Contribution H i and consensus marginalization degree P i , the credibility of node i in the next Epoch is calculated through the election elimination algorithm PoCE consensus; the PoCE formula of node i is as follows: PoCE i =τ0S i +τ1H i +τ2E i +τ3P i Among them, τ0+τ1+τ2+τ3=1, representing the weights of different influencing factors; S5. Consensus committee node elimination; the contribution of the most recent Epoch E i It is defined as the number of transactions in which the node was selected as the leader in the previous Epoch and successfully completed consensus in the current shard, and the node is divided into E i Value sorting, directly eliminating the consensus node E in the shard i The top 5% of values; According to the PoCE formula, calculate the PoCE of each node i And the maximum PoCE max , run the FTS algorithm, and PoCE max -PoCE i Calculate the difference as the elimination weight, map it to the corresponding node according to the weight distribution, and repeat the selection until 5% of the nodes participating in the consensus in the shard are eliminated; a total of 10% of the consensus nodes in the system are eliminated; The FTS algorithm uses an improved Merkle tree structure to implement a stake distribution mechanism, where the weight value of each non-leaf node is composed of the recursive sum of the weights of its left and right child nodes, and the leaf node directly stores the actual stake value of the corresponding stake owner; in the path selection stage, the system determines the traversal direction of the left and right subtrees through a random seed; the random seed is the global random number of the current Epoch, and the eliminated nodes will join the candidate committee of this shard; S6, consensus committee election; The PoCE formula is applied to calculate the reputation of all candidate nodes, and n / 10+min(m / 10,1024-n) nodes are selected as new consensus nodes through the FTS algorithm; the size of the consensus committee before the update is n, and the size of the candidate committee is m; the number of consensus nodes after the final update is n+min(m / 10,1024-n).
2. The shard reconfiguration method based on node reputation election as claimed in claim 1, characterized in that: In step S3, the Stake smoothing process is as follows: Calculate the median Med(S) of the current equity value of all consensus nodes current ), set the maximum allowable change in equity value Δ max =0.1×Med(S current ), set the equity value cutoff value That is, Select the smoothing coefficient α based on the abnormality mark i Calculate the new node equity value:
3. The shard reconfiguration method based on node reputation election as claimed in claim 1 is characterized in that The consensus marginalization degree P of step S4 i During the calculation process, an election cumulative state value is saved for each node. The corresponding calculation method is as follows: the election cumulative state value starts counting from 0. Once the node is selected as a consensus node, the value is increased by 1, otherwise it is reduced by 1. After determining the largest election cumulative state value among all nodes in the system, the election cumulative state value of each node is subtracted from the maximum election cumulative state value, and the difference is used as the consensus marginalization degree P of each node. i .
4. A shard reconfiguration system based on node reputation election, used to execute the method according to any one of claims 1 to 3, characterized in that: Includes the following modules: Initialization module: Initialize the consensus node rotation period Epoch, generate and broadcast the random number r; Equity value increment calculation module; for node S i Calculating Equity Increase in Indicates the pledge equity value of the current Epoch node i, Indicates the pledged equity value of node i in the previous Epoch, based on the calculated δ i The median Med(|δ|) and interquartile range IQR=Q3(|δ|)-Q1(|δ|) of the absolute value of all node increments are obtained, where Q1 and Q3 are the 25% and 75% quantiles of the absolute value of the increments, and the abnormal equity increment threshold δ is set. thres =Med(|δ|)+1.5×IQR, if |δ i |>δ thres This means that the node's equity increment is abnormal and it is an abnormal node; Smoothing module: When each new node joins the network and enters a shard candidate committee, it sends a transaction to participate in the election and successfully reaches consensus on the block; the transaction records the current stake value S of the node i ; Stake is smoothed, and the minimum value S of the node equity value is obtained after smoothing min and the maximum value S max , other values will be mapped to (S min ,S max ) Node reputation calculation module: In each Epoch, according to the stake value StakeS pledged by any node i in each shard i 、The contribution of the most recent Epoch E i and historical contribution H i , the credibility of node i in the next Epoch is calculated through the election elimination algorithm PoCE consensus; the PoCE formula of node i is as follows: PoCE i =τ0S i +τ1H i +τ2E i +τ3P i Among them, τ0+τ1+τ2+τ3=1, representing the weights of different influencing factors; Consensus committee node elimination module: the contribution of the most recent Epoch E i It is defined as the number of transactions in which the node was selected as the leader in the previous Epoch and successfully completed consensus in the current shard, and the node is divided into E i Value sorting, directly eliminating the consensus node E in the shard i The top 5% of values; According to the PoCE formula, calculate the PoCE of each node i And the maximum PoCE max , run the FTS algorithm, and PoCE max -PoCE i Calculate the difference as the elimination weight, map it to the corresponding node according to the weight distribution, and repeat the selection until 5% of the nodes participating in the consensus in the shard are eliminated; a total of 10% of the consensus nodes in the system are eliminated; Consensus committee election module: The PoCE formula is used to calculate the credibility of all candidate nodes, and n / 10+min(m / 10,1024-n) nodes are selected as new consensus nodes through the FTS algorithm; the size of the consensus committee before the update is n, and the size of the candidate committee is m; the number of consensus nodes after the final update is n+min(m / 10,1024-n).
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 3 or the system according to claim 4 is implemented.
Citation Information
Patent Citations
Supervisable block chain dynamic fragment design method and system
CN116389483A
System and method of blockchain consensus mechanism with custom hardware based on geographic distribution, density, node asset and reputation
US20200162261A1
Block chain power transaction system, consensus method, device and storage medium
WO2024040796A1
Cited By
Block chain fragmentation method combining node contribution mechanism and two-round consensus
CN121619085A
A blockchain sharding method combining node contribution mechanism and two-round consensus
CN121619085B