A blockchain network sharding method and system

Through the method of node historical computing power ranking and dynamic sharding adjustment, the performance bottleneck and security issues of the blockchain network under high-frequency transactions are solved, and efficient, secure network operation and long-term stability are achieved.

CN119922198BActive Publication Date: 2025-10-10CHONGQING NORMAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411980745.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-10-10
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

As the number of nodes and transactions in traditional blockchain networks increases, consensus takes longer and throughput is limited. Existing sharding technology cannot achieve optimal configuration and dynamic adjustment, resulting in uneven load and waste of resources, making it difficult to meet the needs of large-scale high-frequency transactions.

Method used

Through the sharding method of distributing and dynamically adjusting the node historical computing power ranking, combined with the reward mechanism of transaction verification and consensus, the shards are scientifically divided and adjusted in real time to optimize resource utilization and security.

Benefits of technology

It improves the transaction processing speed and throughput of the blockchain network, alleviates network congestion, enhances security and adaptability, forms a virtuous ecological cycle, and extends the network life cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922198B_ABST
    Figure CN119922198B_ABST
Patent Text Reader

Abstract

The application discloses a blockchain network sharding method and system, and relates to the technical field of blockchains.In the first period, a plurality of nodes enter a network to calculate a hash puzzle, are ranked according to the results of SHA256 operation, are rewarded according to the ranking and are written into a blockchain ledger, and after the end, all nodes run in the same shard;in the second period, the number of shards and the number of nodes in each shard are calculated based on the total number of nodes, the nodes are distributed according to the historical calculation power ranking, the redundant nodes are processed, and the network sharding is completed;the nodes in the shard carry out regular blockchain operations, the system rewards the nodes regularly according to the historical performance;after a certain period, the system starts the network sharding adjustment process again, and the network sharding is carried out again according to the updated historical calculation power and performance of the nodes.The application dynamically sharding according to the comprehensive consideration of the performance of the nodes in multiple aspects, can effectively cope with the network changes, balance the resource allocation, improve the scalability and operation efficiency of the blockchain network, and guarantee the stable and efficient operation of the blockchain network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and more specifically, to a method and system for sharding a blockchain network. Background Art

[0002] Blockchain technology is widely used, but traditional single-chain blockchain networks face performance bottlenecks. As applications expand, the number of nodes and transactions increases. Proof-of-Work (PoW) consensus mechanisms, such as Bitcoin's, increase the number of nodes involved in all operations, leading to longer consensus times and limited throughput. This makes it difficult to meet the demands of large-scale, high-frequency transactions, necessitating increased scalability.

[0003] Existing sharding technologies have flaws. Random allocation methods ignore node differences, leading to uneven load and wasted resources. Solutions based on hardware computing power fail to comprehensively consider actual node performance and fail to achieve optimal configuration. Most solutions lack dynamic adjustment mechanisms, making it difficult to adapt to node additions and subtractions, performance changes, and business load fluctuations, thus failing to ensure long-term, efficient, and stable network operation.

[0004] In view of the above limitations, this solution proposes a blockchain network sharding method and system that comprehensively considers multi-dimensional factors. It aims to achieve initial effective sharding and dynamic adjustment through scientific mechanisms, improve scalability and transaction processing efficiency, enhance the network's adaptability to dynamic changes, and help blockchain be deeply applied in multiple fields. Summary of the Invention

[0005] In view of the shortcomings of the existing technology, the purpose of the present invention is to provide a blockchain network sharding method and system.

[0006] To achieve the above object, the present invention provides the following technical solutions:

[0007] In a first aspect, a method for sharding a blockchain network comprises the following steps:

[0008] Step 1: In the first cycle, several nodes are allowed to join the network to jointly calculate a hash puzzle. They are ranked according to the number of answers they find, and rewards are distributed based on the ranking and written into the blockchain ledger. After the first cycle, all nodes operate within one shard.

[0009] Step 2: In the second cycle, the total number of nodes is calculated to determine the number of shards and the number of nodes in each shard. Nodes are then allocated to each shard in the order of their historical computing power rankings. If there are any excess nodes, they are redistributed according to their rankings, completing the first round of network sharding.

[0010] Step 3: In each shard, nodes verify transactions and reach consensus according to the rules of the blockchain. The system periodically issues rewards based on the node's historical performance.

[0011] Step 4: After a certain period of time, the system restarts the network sharding adjustment process and re-shards the network based on the updated node historical computing power and performance.

[0012] Preferably, the step 1 is specifically:

[0013] In the first cycle, several nodes are allowed to join the network and jointly calculate a hash puzzle. The hash puzzle is calculated by performing a SHA256 operation on the node's IP address, a random number given by the system, and a random number required for each calculation. The answer that meets the conditions is found by continuously adjusting the size of the random number required for each calculation.

[0014] Nodes are ranked based on the number of answers they find. Nodes with higher rankings have stronger computing power.

[0015] The system distributes rewards based on rankings. Nodes with higher rankings receive more rewards than those with lower rankings, and the rewards are written into the ledger. After the first cycle, all nodes run within one shard.

[0016] Preferably, the step 2 is specifically:

[0017] The result of rounding down the total number of nodes minus 2 is set as the number of shards; the system obtains the total number of nodes in the current network ; First calculate the number of shards , the calculation formula is ,in represents the floor function, represents the square root function;

[0018] The result of dividing the total number of nodes by the number of shards and rounding down is set as the number of nodes in the shard; then calculate the number of nodes that should be allocated to each shard , the calculation formula is ;

[0019] According to the historical computing power ranking information of the node, all Arrange the nodes to form an ordered node list;

[0020] Starting from the node ranked first, assign the nodes to each shard in order;

[0021] For the extra nodes, calculate the remainder of the total number of nodes divided by the number of shards. This remainder is the number of extra nodes. The calculation formula is: ,in Indicates remainder operation; according to the order of the node's historical computing power ranking, the excess nodes are allocated to the shards one by one, with priority given to shards with relatively weak computing power.

[0022] Preferably, the step 3 is specifically:

[0023] In each shard, nodes perform transaction verification and consensus-building operations according to the rules of the blockchain;

[0024] The monitoring module in the system will regularly collect the operation data of the nodes in the shard, including the speed of transaction verification and the efficiency of consensus;

[0025] Collect transaction verification speed data. For each node, the monitoring module records the time when each transaction enters the node and starts verification. And the time when the transaction verification is completed , then the single transaction verification takes time The formula can be Calculated;

[0026] The total number of transactions processed by the statistical node within a certain statistical period And the total transaction verification time , then the average transaction verification speed of the node during the statistical period is You can use the formula Calculated;

[0027] Collect consensus efficiency data under the proof-of-work mechanism. The monitoring module counts the total number of attempts by nodes to find hash values ​​that meet the difficulty requirements in each statistical period, which is recorded as ; This data can be obtained by counting each time the node changes the random number during hash calculation;

[0028] The number of times a statistical node successfully finds a hash value that meets the difficulty requirement and generates a valid block within the same statistical period is recorded as ;

[0029] Record the time when the node starts competing for the right to generate blocks And the time when the block is successfully generated and broadcast , for each block generation process, calculate the time taken for a single block generation , the formula is ; During the statistical period, the average block time is obtained by averaging the time taken for all single block productions. ;

[0030] Based on these historical performance data, the reward module recalculates the rewards that each node deserves;

[0031] Transaction verification speed reward part: Set the weight of this part of the reward to the total reward The basic reward amount is The actual reward amount is adjusted based on the comparison between the transaction verification speed of the node and the average transaction verification speed of the entire network. The specific adjustment coefficient is calculated by a function. Suppose the transaction verification speed of the node is , the average transaction verification speed of the entire network is , then the transaction verification speed adjustment coefficient The calculation formula can be: ,in Adjust the scaling parameters for rewards;

[0032] Consensus efficiency reward under the proof-of-work mechanism: Set the weight of this part of the reward to the total reward The basic reward amount is ; The adjustment coefficient is determined based on the different performance indicators of the node in reaching consensus; for example, the number of successful block production of the node is comprehensively considered , average block time And the average number of successful blocks in the entire network , average block time , a comprehensive adjustment coefficient can be constructed The calculation formula is: ,in A weight parameter to balance the importance of block generation times and block generation time;

[0033] Stability reward part: Set the weight of this part of the reward to the total reward The basic reward amount is ; According to the proportion of online time of the node To determine the adjustment factor , using a simple linear relationship: ,in Adjust parameters for stability rewards;

[0034] Calculate the rewards that each node deserves: For each node, calculate the final reward amount it deserves based on the reward rules set above and the calculated adjustment coefficients of each part , the calculation formula is: .

[0035] Preferably, the step 4 is specifically:

[0036] After a certain period of time, the number of shards is recalculated according to the same method of calculating the number of shards and nodes as in step 2. and the number of nodes per shard ;

[0037] Reassign nodes to each shard based on the updated node historical computing power and performance ranking order.

[0038] Secondly, a blockchain network sharding system includes a node access module, an initial computing power assessment module, a sharding planning module, a node operation monitoring module, a reward module, and a resharding module;

[0039] Node access module: responsible for managing the process of nodes joining the blockchain network and monitoring and maintaining the status of connected nodes;

[0040] Initial computing power evaluation module: In the first cycle of network operation, nodes are asked to participate in the calculation by generating specific hash problems, and the number of valid answers found by each node is collected and ranked accordingly;

[0041] Sharding planning module: In the second cycle of network operation, the number of shards is calculated based on the current total number of nodes, and then nodes are reasonably allocated to each shard according to the order of the node's historical computing power ranking, taking into account the handling of redundant nodes;

[0042] Node operation monitoring module: During network operation, it continuously focuses on multiple dimensions such as transaction verification, consensus achievement, and comprehensive operation status of nodes in the shard, collects relevant data, and records and stores them;

[0043] Reward Module: Based on the historical performance data of nodes collected by the node operation monitoring module, the reward amount that each node deserves is calculated according to the pre-set reward rules;

[0044] In the re-sharding module, after a certain period of time, the system restarts the network sharding adjustment process and re-shards the network based on the updated node historical computing power and performance.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] 1. This invention accurately determines the number of shards and the number of nodes within each shard by evaluating and stratifying the historical computing power of nodes, and rationally allocates nodes, enabling more efficient utilization of the network's computing resources. The computing power of nodes within each shard is relatively balanced, avoiding resource waste or processing bottlenecks caused by excessive or insufficient computing power on some nodes. This significantly improves the overall transaction processing speed and throughput of the blockchain network, alleviates network congestion, and optimizes network operational efficiency.

[0047] 2. This invention effectively addresses the threat of a 51% attack caused by uneven node computing power. By adopting a sharding strategy based on historical computing power stratification, it is difficult for malicious attackers to concentrate sufficient computing power to control a single shard or the entire network. Because the node distribution and sharding construction are based on multi-cycle computing power data and a complex allocation algorithm, this significantly improves the network's security and anti-attack capabilities, ensuring the integrity and immutability of blockchain data.

[0048] 3. This invention incorporates a clear incentive mechanism, awarding rewards based on node performance at each stage. Nodes with outstanding performance, whether ranking in the first cycle's hash puzzle calculations or in subsequent sharding operations like transaction verification and consensus, will receive increased rewards. This incentive encourages nodes to actively improve their performance and participate in network maintenance and operation, contributing to the long-term stability of the network and forming a virtuous cycle, attracting more nodes to join the network and contribute computing resources.

[0049] 4. In this invention, resharding is performed after a certain period of time, and the sharding structure can be dynamically adjusted based on the historical computing power and performance changes of the nodes during operation. As the network scale expands, the node computing power fluctuates, or business needs change, the network sharding can promptly adapt to these changes, maintaining efficient and secure operation. This ensures that the blockchain network can maintain good performance at different stages of development, with strong flexibility and adaptability, extending the network lifecycle and enhancing its competitiveness. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A flowchart of a blockchain network sharding method proposed by the present invention;

[0051] Figure 2 The present invention proposes a flowchart of a blockchain network sharding system. DETAILED DESCRIPTION

[0052] The embodiment further illustrates a blockchain network sharding method and system proposed in the present invention.

[0053] Reference Figure 1 , a blockchain network sharding method, comprising the following steps:

[0054] Step 1: In the first cycle, several nodes are allowed to join the network to jointly calculate a hash puzzle. They are ranked according to the number of answers they find, and rewards are distributed based on the ranking and written into the blockchain ledger. After the first cycle, all nodes operate within one shard.

[0055] Step 2: In the second cycle, the total number of nodes is calculated to determine the number of shards and the number of nodes in each shard. Nodes are then allocated to each shard in the order of their historical computing power rankings. If there are any excess nodes, they are redistributed according to their rankings, completing the first round of network sharding.

[0056] Step 3: In each shard, nodes verify transactions and reach consensus according to the rules of the blockchain. The system periodically issues rewards based on the node's historical performance.

[0057] Step 4: After a certain period of time, the system restarts the network sharding adjustment process and re-shards the network based on the updated node historical computing power and performance.

[0058] The step 1 is specifically as follows:

[0059] In the first cycle, several nodes are allowed to join the network and jointly calculate a hash puzzle. The hash puzzle is calculated by performing a SHA256 operation on the node's IP address, a random number given by the system, and a random number required for each calculation. The answer that meets the conditions is found by continuously adjusting the size of the random number required for each calculation.

[0060] Nodes are ranked based on the number of answers they find. The higher the ranking, the stronger the computing power of the node.

[0061] The system distributes rewards based on rankings. Nodes with higher rankings receive more rewards than those with lower rankings, and the rewards are written into the ledger. After the first cycle, all nodes run within one shard.

[0062] The step 2 is specifically as follows:

[0063] The result of rounding down the total number of nodes minus 2 is set as the number of shards; the system obtains the total number of nodes in the current network ; First calculate the number of shards , the calculation formula is ,in represents the floor function, Represents the square root function; for example, if the total number of nodes in the network is currently counted , then first calculate , then round down to 10, and finally subtract 2 to get the number of fragments .

[0064] The result of dividing the total number of nodes by the number of shards and rounding down is set as the number of nodes in the shard; then calculate the number of nodes that should be allocated to each shard , the calculation formula is ; Continue with the above , For example, the calculation can be , that is, each shard is initially planned to be allocated 12 nodes.

[0065] According to the historical computing power ranking information of the node, all Arrange the nodes to form an ordered list of nodes; starting from the first-ranked node, assign the nodes to each shard in order; taking the example calculated above, first assign the nodes ranked 1 to 12 to the 1st to 8th shards respectively (one node is assigned to each shard, and the assignment is cyclical), and then continue to assign nodes ranked 13th in order until all shards are assigned. (Right now nodes).

[0066] For the extra nodes, calculate the remainder of the total number of nodes divided by the number of shards. This remainder is the number of extra nodes. The calculation formula is: ,in Indicates the remainder operation; , In the example, , that is, there are 4 redundant nodes; according to the order of the historical computing power ranking of the nodes, these 4 redundant nodes are allocated to the shards one by one, with priority given to shards with relatively weak computing power (this can be determined by comparing the comprehensive computing power of the allocated nodes in each shard) to try to maintain the computing power balance between the shards; for example, the nodes ranked 97th, 98th, 99th, and 100th are respectively allocated to the 4 shards with relatively low computing power.

[0067] The step 3 is specifically as follows:

[0068] In each shard, nodes perform transaction verification and consensus-building operations according to the rules of the blockchain. Transaction verification includes accepting transaction information, verifying the legitimacy of the transaction format, and verifying the legitimacy of the transaction funds. Consensus building is achieved using a proof-of-work mechanism, including preparing block data, performing hash calculations to find hash values ​​that meet difficulty requirements, block packaging and broadcasting, and verification and confirmation by other nodes.

[0069] The monitoring module in the system will regularly collect the operation data of the nodes in the shard, including the speed of transaction verification and the efficiency of consensus;

[0070] Collect transaction verification speed data. For each node, the monitoring module records the time when each transaction enters the node and starts verification. And the time when the transaction verification is completed , then the single transaction verification takes time The formula can be Calculated;

[0071] The total number of transactions processed by the statistical node within a certain statistical period (such as one day) And the total transaction verification time (obtained by summing up the time taken to verify all single transactions), then the average transaction verification speed of the node during the statistical period is You can use the formula Calculated, the unit is usually seconds / tick or milliseconds / tick, etc.

[0072] Collect consensus efficiency data under the proof-of-work mechanism. The monitoring module counts the total number of attempts by nodes to find hash values ​​that meet the difficulty requirements in each statistical period, which is recorded as This data can be obtained by counting each time the node changes the random number (Nonce) during hash calculation;

[0073] The number of times a statistical node successfully finds a hash value that meets the difficulty requirement and generates a valid block within the same statistical period is recorded as ;

[0074] Record the time when the node starts competing for the right to generate a block (i.e., starts the first hash calculation to find a hash value that meets the difficulty requirement) And the time when the block is successfully generated and broadcast , for each block generation process, calculate the time taken for a single block generation , the formula is ; During the statistical period, the average block time is obtained by averaging the time taken for all single block productions. If no block is successfully generated within the statistical period, the average block generation time can be set to a larger value according to the actual situation or marked as a special case such as no block generation.

[0075] Based on these historical performance data, the reward module recalculates the rewards that each node deserves;

[0076] Transaction verification speed reward part: Set the weight of this part of the reward to the total reward (For example ), the basic reward amount is (For example digital currency units); the actual reward amount is adjusted based on the comparison between the transaction verification speed of the node and the average transaction verification speed of the entire network. The specific adjustment coefficient is calculated through a function (such as a linear function, a piecewise function, etc., here we take a simple linear function as an example); let the transaction verification speed of the node be , the average transaction verification speed of the entire network is , then the transaction verification speed adjustment coefficient The calculation formula can be: ,in Adjust the scaling parameters for rewards (e.g. , indicating that the reward amount is adjusted by 20% based on the difference from the average speed);

[0077] Consensus efficiency reward under the proof-of-work mechanism: Set the weight of this part of the reward to the total reward (For example ), the basic reward amount is (For example digital currency units); the adjustment coefficient is determined based on the different performance indicators of the node in reaching consensus; for example, the number of successful block production of the node is comprehensively considered. , average block time And the average number of successful blocks in the entire network , average block time , a comprehensive adjustment coefficient can be constructed The calculation formula is: ,in The weight parameter (e.g. , indicating that they attach more importance to the impact of the number of block production on rewards);

[0078] Stability reward part: Set the weight of this part of the reward to the total reward (For example ), the basic reward amount is (For example digital currency units); based on the proportion of the node's online time To determine the adjustment factor , for example, a simple linear relationship can be used: ,in Tuning parameters for stability rewards (e.g. , indicating that the higher the proportion of online time, the more obvious the increase in reward amount);

[0079] Calculate the rewards that each node deserves: For each node, calculate the final reward amount it deserves based on the reward rules set above and the calculated adjustment coefficients of each part , the calculation formula is: The distribution of rewards can be automatically executed through smart contracts. Based on the calculated reward amount for each node, the smart contract will accurately allocate the corresponding digital currency (if the reward is in the form of digital currency) or other rights (such as increasing the node's voting rights and reputation value in the network) to the corresponding account of each node or record the changes in rights and interests, ensuring that the reward distribution process is fair, just and transparent.

[0080] The step 4 is specifically as follows:

[0081] As the blockchain network continues to operate, after a certain period of time, the total number of nodes in the network changes. In this case, the number of shards and nodes will be recalculated using the same calculation method as in step 2. and the number of nodes per shard .

[0082] During the operation of the network, the historical computing power and performance of the nodes change. Based on the updated historical computing power and performance ranking order of the nodes, the nodes are redistributed to each shard according to this new ranking order.

[0083] Reference Figure 2 , a blockchain network sharding system, including a node access module, an initial computing power evaluation module, a sharding planning module, a node operation monitoring module, a reward module and a resharding module;

[0084] Node access module: responsible for managing the process of nodes joining the blockchain network and monitoring and maintaining the status of connected nodes;

[0085] Initial computing power evaluation module: In the first cycle of network operation, nodes are asked to participate in the calculation by generating specific hash problems, and the number of valid answers found by each node is collected and ranked accordingly;

[0086] Sharding planning module: In the second cycle of network operation, the number of shards is calculated based on the current total number of nodes, and then nodes are reasonably allocated to each shard according to the order of the node's historical computing power ranking, taking into account the handling of redundant nodes;

[0087] Node operation monitoring module: During network operation, it continuously focuses on multiple dimensions such as transaction verification, consensus achievement, and comprehensive operation status of nodes in the shard, collects relevant data, and records and stores them;

[0088] Reward Module: Based on the historical performance data of nodes collected by the node operation monitoring module, the reward amount that each node deserves is calculated according to the pre-set reward rules;

[0089] In the re-sharding module, after a certain period of time, the system restarts the network sharding adjustment process and re-shards the network based on the updated node historical computing power and performance.

[0090] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiment. All technical solutions based on the concept of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should also be considered within the scope of protection of the present invention.

Claims

1. A blockchain network sharding method, characterized in that: The following steps are involved: Step 1: In the first cycle, several nodes are allowed to join the network to jointly calculate a hash puzzle. They are ranked according to the number of answers they find, and rewards are distributed based on the ranking and written into the blockchain ledger. After the first cycle, all nodes operate within one shard. Step 2: In the second cycle, the total number of nodes is calculated to determine the number of shards and the number of nodes in each shard. Nodes are then allocated to each shard in the order of their historical computing power rankings. If there are any excess nodes, they are redistributed according to their rankings, completing the first round of network sharding. The result of rounding down the total number of nodes minus 2 is set as the number of shards; the system obtains the total number of nodes in the current network ; First calculate the number of shards , the calculation formula is ,in represents the floor function, represents the square root function; The result of dividing the total number of nodes by the number of shards and rounding down is set as the number of nodes in the shard; then calculate the number of nodes that should be allocated to each shard , the calculation formula is ; According to the historical computing power ranking information of the node, all Arrange the nodes to form an ordered node list; Starting from the node ranked first, assign the nodes to each shard in order; For the extra nodes, calculate the remainder of the total number of nodes divided by the number of shards. This remainder is the number of extra nodes. The calculation formula is: ,in Indicates the remainder operation; According to the order of the node's historical computing power ranking, the excess nodes are allocated to the shards one by one, with priority given to shards with relatively weak computing power; Step 3: In each shard, nodes verify transactions and reach consensus according to the rules of the blockchain. The system periodically issues rewards based on the node's historical performance. Step 4: After a certain period of time, the system restarts the network sharding adjustment process and re-shards the network based on the updated node historical computing power and performance.

2. A blockchain network sharding method according to claim 1, characterized in that: The step 1 is specifically as follows: In the first cycle, several nodes are allowed to join the network and jointly calculate a hash puzzle. The hash puzzle is calculated by performing a SHA256 operation on the node's IP address, a random number given by the system, and a random number required for each calculation. The answer that meets the conditions is found by continuously adjusting the size of the random number required for each calculation. Nodes are ranked based on the number of answers they find. Nodes with higher rankings have stronger computing power. The system distributes rewards based on rankings. Nodes with higher rankings receive more rewards than those with lower rankings, and the rewards are written into the ledger. After the first cycle, all nodes run within one shard.

3. A blockchain network sharding method according to claim 2, characterized in that: The step 3 is specifically as follows: In each shard, nodes perform transaction verification and consensus-building operations according to the rules of the blockchain; The monitoring module in the system will regularly collect the operation data of the nodes in the shard, including the speed of transaction verification and the efficiency of consensus; Collect transaction verification speed data. For each node, the monitoring module records the time when each transaction enters the node and starts verification. And the time when the transaction verification is completed , then the single transaction verification takes time The formula can be Calculated; The total number of transactions processed by the statistical node within a certain statistical period And the total transaction verification time , then the average transaction verification speed of the node during the statistical period is You can use the formula Calculated; Collect consensus efficiency data under the proof-of-work mechanism. The monitoring module counts the total number of attempts by nodes to find hash values ​​that meet the difficulty requirements in each statistical period, which is recorded as ; This data can be obtained by counting each time the node changes the random number during hash calculation; The number of times a statistical node successfully finds a hash value that meets the difficulty requirement and generates a valid block within the same statistical period is recorded as ; Record the time when the node starts competing for the right to generate blocks And the time when the block is successfully generated and broadcast , for each block generation process, calculate the time taken for a single block generation , the formula is ; During the statistical period, the average block time is obtained by averaging the time taken for all single block productions. ; Based on these historical performance data, the reward module recalculates the rewards that each node deserves; Transaction verification speed reward part: Set the weight of this part of the reward to the total reward The basic reward amount is The actual reward amount is adjusted based on the comparison between the transaction verification speed of the node and the average transaction verification speed of the entire network. The specific adjustment coefficient is calculated by a function. Suppose the transaction verification speed of the node is , the average transaction verification speed of the entire network is , then the transaction verification speed adjustment coefficient The calculation formula can be: ,in Adjust the scaling parameters for rewards; Consensus efficiency reward under the proof-of-work mechanism: Set the weight of this part of the reward to the total reward The basic reward amount is ; The adjustment coefficient is determined based on the different performance indicators of the node in reaching consensus; the number of successful block production of the node is comprehensively considered , average block time And the average number of successful blocks in the entire network , average block time , a comprehensive adjustment coefficient can be constructed The calculation formula is: ,in A weight parameter to balance the importance of block generation times and block generation time; Stability reward part: Set the weight of this part of the reward to the total reward The basic reward amount is ; According to the proportion of online time of the node To determine the adjustment factor , using a simple linear relationship: ,in Adjust parameters for stability rewards; Calculate the rewards that each node deserves: For each node, calculate the final reward amount it deserves based on the set reward rules and the calculated adjustment coefficients of each part , the calculation formula is: .

4. A blockchain network sharding method according to claim 3, characterized in that: The step 4 is specifically as follows: After a certain period of time, the number of shards is recalculated according to the same method of calculating the number of shards and nodes as in step 2. and the number of nodes per shard ; Reassign nodes to each shard based on the updated node historical computing power and performance ranking order.

5. A blockchain network sharding system, characterized in that: A blockchain network sharding method applied to any one of claims 1 to 4, comprising a node access module, an initial computing power assessment module, a sharding planning module, a node operation monitoring module, a reward module, and a resharding module; Node access module: responsible for managing the process of nodes joining the blockchain network and monitoring and maintaining the status of connected nodes; Initial computing power evaluation module: In the first cycle of network operation, nodes are asked to participate in the calculation by generating specific hash problems, and the number of valid answers found by each node is collected and ranked accordingly; Sharding planning module: In the second cycle of network operation, the number of shards is calculated based on the current total number of nodes, and then nodes are reasonably allocated to each shard according to the order of the node's historical computing power ranking, taking into account the handling of redundant nodes; Node operation monitoring module: During network operation, it continuously focuses on transaction verification, consensus achievement, and comprehensive operation status of nodes in the shard, collects relevant data, and records and stores them; Reward Module: Based on the historical performance data of nodes collected by the node operation monitoring module, the reward amount that each node deserves is calculated according to the pre-set reward rules; In the re-sharding module, after a certain period of time, the system restarts the network sharding adjustment process and re-shards the network based on the updated node historical computing power and performance.

Citation Information

Patent Citations

  • A method for implementing a network scalability block chain

    CN109544334A

  • Transaction-based blockchain consensus mechanism

    CN110580653A