Block chain network fragment division method and system

Through the blockchain network sharding method that comprehensively considers multi-dimensional factors, the traditional blockchain network performance bottlenecks and sharding technology defects are solved, and efficient, secure and flexible blockchain network operation is achieved.

CN119922198AActive Publication Date: 2025-05-02CHONGQING NORMAL UNIVERSITY

Patent Information

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

AI Technical Summary

Technical Problem

The single-chain structure of traditional blockchain networks leads to performance bottlenecks. The existing sharding technology cannot effectively solve the problems of node differences, uneven load, waste of resources and difficulty in dynamic adjustment, and it is difficult to meet the needs of large-scale high-frequency transactions.

Method used

A method of sharding partitioning of blockchain networks that comprehensively considers multi-dimensional factors is proposed. Through initial hashing problems, the ranking, historical computing power evaluation and dynamic adjustment of the shard structure is achieved to achieve initial effective sharding and long-term efficient and stable operation.

Benefits of technology

It improves the scalability and transaction processing efficiency of the blockchain network, enhances the network's adaptability to dynamic changes, reduces the risk of attack by 51%, and promotes node performance improvement and long-term stable development of the network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922198A_ABST
    Figure CN119922198A_ABST
Patent Text Reader

Abstract

The invention discloses a block chain network fragment division method and system, and relates to the technical field of block chains. In the first period, a plurality of nodes enter a network to calculate a Hash problem, ranking is performed according to an SHA256 operation result, reward is performed according to the ranking, the reward is written into a block chain account book, and all the nodes run in the same fragment after the reward is finished; in the second period, the number of fragments and the number of nodes of each fragment are calculated based on the total number of nodes, nodes are distributed according to node historical computing power ranking, redundant nodes are processed, and network fragmentation is completed; nodes in the fragments carry out block chain conventional operation, and the system shows regular rewards according to node history; and after a certain period, the system restarts the network fragmentation adjustment process, and network fragmentation is carried out again according to the updated node historical computing power and performance. According to the method, dynamic fragmentation is carried out by comprehensively considering multi-aspect performance of the nodes, network changes can be effectively handled, resource configuration can be balanced, expandability and operation efficiency of the block chain network are improved, and stable and efficient operation of the block chain network is guaranteed.
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 blockchain network sharding method and system. Background Art

[0002] Blockchain technology is widely used, but the traditional single-chain blockchain network faces performance bottlenecks. With the expansion of applications, the number of nodes and transactions increases. Under the Proof of Work (PoW) consensus mechanism adopted by Bitcoin, since all nodes participate in all operations, the increase in nodes makes consensus time longer and throughput limited, making it difficult to meet the needs of large-scale high-frequency transactions, and there is an urgent need to improve scalability.

[0003] Existing sharding technologies have defects. The random allocation method ignores node differences, which can easily lead to uneven load and waste of resources; the solution based on hardware computing power does not comprehensively consider the actual performance of nodes and cannot achieve the optimal configuration; most solutions lack a dynamic adjustment mechanism and are difficult to adapt to the increase and decrease of nodes, performance changes, and business load fluctuations, and cannot guarantee the long-term efficient and stable operation of the network.

[0004] In view of the above limitations, this plan proposes a blockchain network sharding method and system that comprehensively considers multi-dimensional factors, aiming 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 deficiencies in the prior art, the object 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, and are ranked according to the number of answers found. Rewards are distributed based on the ranking and written into the blockchain ledger. After the first cycle, all nodes run in 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, and the nodes are allocated to each shard in the order of the node historical computing power ranking. If there are excess nodes, they are allocated again according to the ranking, 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, and the system periodically issues rewards based on the historical performance of the nodes.

[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. The higher the ranking, the stronger the computing power.

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

[0016] Preferably, the step 2 is specifically:

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

[0018] The result obtained by 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 K that should be allocated to each shard, and the calculation formula is

[0019] According to the historical computing power ranking information of the nodes, all N nodes are arranged in descending order to form an ordered node list;

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

[0021] For the redundant nodes, calculate the remainder of the total number of nodes divided by the number of shards. This remainder is the number of redundant nodes. The calculation formula is: R=NmodM, where mod represents the remainder operation. Allocate the redundant nodes to the shards one by one according to the historical computing power ranking of the nodes, giving priority to shards with relatively weak computing power.

[0022] Preferably, the step 3 is specifically:

[0023] In each shard, nodes perform transaction verification and consensus-reaching 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 t when each transaction enters the node and starts verification. start And the time point t when the transaction verification is completed end , then the time required for a single transaction verification is The formula can be Calculated;

[0026] In a certain statistical period, the total number of transactions processed by the statistical node n transactions And the total transaction verification time Then the average transaction verification speed of the node in this statistical period is v verify 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, recorded as n attempts ; 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 n blocks ;

[0029] Record the time when the node starts competing for the right to generate blocks each time 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 ω verify The basic reward amount is The actual reward amount is adjusted according to 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; let the transaction verification speed of the node be vverify , the average transaction verification speed of the entire network is Then the transaction verification speed adjustment coefficient k verify The calculation formula can be: Where α is the reward adjustment ratio parameter;

[0032] Consensus efficiency reward under the proof-of-work mechanism: Set the weight of this part of the reward to the total reward as ω block 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 generation of the node n is comprehensively considered. blocks , average block time T block And the average number of successful blocks in the entire network Average block time A comprehensive adjustment coefficient k can be constructed block The calculation formula is: Where β is a weight parameter that weighs the importance of the number of blocks and the block time;

[0033] Stability reward part: Set the weight of this part of the reward to ω stable The basic reward amount is According to the proportion of online time of the node p online To determine the adjustment factor k stable , using a simple linear relationship: k stable =γ×p online , where γ is the stability reward adjustment parameter;

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

[0035] Preferably, the step 4 is specifically:

[0036] After a certain period of time, recalculate the number of shards M and the number of nodes K for each shard using the same method as step 2;

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

[0038] In the second aspect, a blockchain network sharding system includes a node access module, an initial computing power evaluation module, a sharding planning module, a node operation monitoring module, a reward module, and a re-sharding module;

[0039] Node access module: responsible for managing the relevant processes 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, collecting the situations in which each node finds valid answers and ranking them 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 historical computing power ranking of the nodes, taking into account the processing of redundant nodes;

[0042] Node operation monitoring module: During the network operation process, 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 node historical performance data collected by the node operation monitoring module, the reward amount that each node deserves is calculated according to the pre-set reward rules;

[0044] 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. In the present invention, the number of shards and the number of nodes in each shard are accurately determined by evaluating and stratifying the historical computing power of the nodes, and the nodes are reasonably allocated, so that the computing resources of the network can be used more efficiently. The computing power of the nodes in each shard is relatively balanced, avoiding resource waste or processing bottlenecks caused by excessive or weak computing power of some nodes, thereby significantly improving the overall transaction processing speed and throughput of the blockchain network, alleviating network congestion, and optimizing network operation efficiency.

[0047] 2. The present invention effectively responds to the threat of 51% attacks caused by uneven node computing power. Due to the adoption of a sharding strategy based on historical computing power stratification, it is difficult for malicious attackers to concentrate enough computing power to control a shard or the entire network, because the distribution of nodes and the construction of shards are based on multi-cycle computing power data and complex allocation algorithms, which greatly improves the security and anti-attack capabilities of the network and ensures the integrity and immutability of blockchain data.

[0048] 3. In the present invention, a clear reward mechanism is set up to give corresponding rewards according to the performance of the nodes at each stage. Whether it is the ranking of the hash puzzle calculation in the first cycle, or the transaction verification, consensus achievement and other operational performance in the subsequent shards, the nodes with excellent performance can get more rewards. This incentive measure encourages nodes to actively improve their own performance and actively participate in network maintenance and operation, which is conducive to the long-term stable development of the network, forming a virtuous ecological cycle, and attracting more nodes to join the network and contribute computing resources.

[0049] 4. In the present invention, re-sharding is performed after a certain period of time, and the sharding structure can be dynamically adjusted according to the historical computing power and performance changes of the nodes during operation. With the expansion of the network scale, the fluctuation of node computing power or the change of business needs, network sharding can adapt to these changes in a timely manner, always maintain an efficient and safe operation state, ensure that the blockchain network can maintain good performance at different stages of development, have strong flexibility and adaptability, extend the life cycle of the network and enhance its competitiveness. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0051] Figure 2 A flowchart of a blockchain network sharding system is proposed for the present invention. 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, and are ranked according to the number of answers found. Rewards are distributed based on the ranking and written into the blockchain ledger. After the first cycle, all nodes run in 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, and the nodes are allocated to each shard in the order of the node historical computing power ranking. If there are excess nodes, they are allocated again according to the ranking, 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, and the system periodically issues rewards based on the historical performance of the nodes.

[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:

[0059] In the first cycle, several nodes are allowed to join the network and jointly calculate a hash puzzle. The calculation method of the hash puzzle is to perform 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.

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

[0062] The step 2 is specifically:

[0063] The result obtained by rounding down the total number of nodes minus 2 is set as the number of shards; the system obtains the total number of nodes N in the current network; first calculate the number of shards M, 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 N = 100, then first calculate Round down to 10, and finally subtract 2 to get the number of shards.

[0064] The result obtained by 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 K that should be allocated to each shard, and the calculation formula is Continuing with the above N=100, 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 nodes, all N nodes are arranged in descending order to form an ordered node list; starting from the node ranked first, the nodes are allocated to each shard in order; taking the example calculated above, the nodes ranked 1 to 12 are first allocated to the 1 to 8 shards respectively (one node is allocated to each shard, and the allocation is cyclical), and then the allocation continues in order starting from the node ranked 13 until K×M (i.e. 12×8=96 nodes) are allocated.

[0066] For the redundant nodes, calculate the remainder of the total number of nodes divided by the number of shards. This remainder is the number of redundant nodes. The calculation formula is: R = NmodM, where mod represents the remainder operation. When N = 100, In the example, R=100mod8=4, 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, and are preferentially allocated to the shards with relatively weak computing power (which can be judged by comparing the comprehensive computing power of the nodes allocated to each shard) to try to keep the computing power between the shards balanced; 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:

[0068] In each shard, nodes perform transaction verification and consensus-reaching operations according to the rules of the blockchain; the transaction verification includes accepting transaction information, verifying the legality of the transaction format, and verifying the legality of the transaction funds; the consensus is reached under the proof-of-work mechanism, including preparing block data, performing hash calculations to find hash values ​​that meet the 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 t when each transaction enters the node and starts verification. start And the time point t when the transaction verification is completed end , then the time required for a single transaction verification is The formula can be Calculated;

[0071] In a certain statistical period (such as one day), the total number of transactions processed by the statistical node is n transactions 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 in this statistical period is v verify 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, recorded as n attempts; 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 n blocks ;

[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 time can be set to a larger value according to the actual situation or marked as a special case such as no block generated.

[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 ω verify (For example, verify =0.4), the basic reward amount is (For example digital currency units); adjust the actual reward amount according to the comparison between the transaction verification speed of the node and the average transaction verification speed of the whole network, and the specific adjustment coefficient is calculated by 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 v verify , the average transaction verification speed of the entire network is Then the transaction verification speed adjustment coefficient k verify The calculation formula can be: Where α is the reward adjustment ratio parameter (e.g. α = 0.2, 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 as ω block (For example, block =0.3), the basic reward amount is (For example digital currency units); the adjustment coefficient is determined comprehensively based on the different performance indicators of the node in reaching consensus; for example, the number of successful block production of the node n is comprehensively considered blocks , Average block time And the average number of successful blocks in the entire network Average block time A comprehensive adjustment coefficient k can be constructed block The calculation formula is: Where β is a weight parameter that weighs the importance of the number of blocks and the block time (for example, β = 0.6 means that the impact of the number of blocks on the reward is more important);

[0078] Stability reward part: Set the weight of this part of the reward to ω stable (For example, stable =0.3), the basic reward amount is (For example digital currency units); according to the proportion of the node's online time p online To determine the adjustment factor k stable , for example, a simple linear relationship can be used: k stable =γ×p online , where γ is the stability reward adjustment parameter (for example, γ = 1.5, which means 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 R that it deserves based on the reward rules set above and the calculated adjustment coefficients of each part node , the calculation formula is: The distribution of rewards can be automatically executed through smart contracts. According to the calculated reward amount of 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 in the network) to the corresponding account of each node or record the changes in rights and interests to ensure 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 run, after a certain period of time, the total number of nodes in the network changes. In this case, the number of shards M and the number of nodes K for each shard are recalculated using the same method as in step 2.

[0082] During the operation of the network, the historical computing power and performance of the nodes change. The nodes are redistributed to each shard according to the updated historical computing power and performance ranking order, and then 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 re-sharding module;

[0084] Node access module: responsible for managing the relevant processes 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, collecting the situations in which each node finds valid answers and ranking them 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 historical computing power ranking of the nodes, taking into account the processing of redundant nodes;

[0087] Node operation monitoring module: During the network operation process, 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 node historical performance data collected by the node operation monitoring module, the reward amount that each node deserves is calculated according to the pre-set reward rules;

[0089] 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 is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A method for sharding a blockchain network, 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, and are ranked according to the number of answers found. Rewards are distributed based on the ranking and written into the blockchain ledger. After the first cycle, all nodes run in 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, and the nodes are allocated to each shard in the order of the node historical computing power ranking. If there are excess nodes, they are allocated again according to the ranking, completing the first round of network sharding; Step 3: In each shard, nodes verify transactions and reach consensus according to the rules of the blockchain, and the system periodically issues rewards based on the historical performance of the nodes. 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: 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. The higher the ranking, the stronger the computing power. The system distributes rewards based on rankings. Nodes with higher rankings receive more rewards than nodes with lower rankings, and the rewards are written into the ledger. After the first cycle, all nodes run in one shard.

3. A blockchain network sharding method according to claim 2, characterized in that: The step 2 is specifically: The result obtained by rounding down the total number of nodes minus 2 is set as the number of shards; the system obtains the total number of nodes N in the current network; first calculate the number of shards M, the calculation formula is in represents the floor function, represents the square root function; The result obtained by 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 K that should be allocated to each shard, and the calculation formula is According to the historical computing power ranking information of the nodes, all N nodes are arranged in descending order to form an ordered node list; Starting from the node ranked first, assign the nodes to each shard in order; For the redundant nodes, calculate the remainder of the total number of nodes divided by the number of shards. This remainder is the number of redundant nodes. The calculation formula is: R=NmodM, where mod represents the remainder operation. Allocate the redundant nodes to the shards one by one according to the historical computing power ranking of the nodes, giving priority to shards with relatively weak computing power.

4. A blockchain network sharding method according to claim 3, characterized in that: The step 3 is specifically: In each shard, nodes perform transaction verification and consensus-reaching 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 t when each transaction enters the node and starts verification. start And the time point t when the transaction verification is completed end , then the time required for a single transaction verification is The formula can be Calculated; In a certain statistical period, the total number of transactions processed by the statistical node n transactions And the total transaction verification time Then the average transaction verification speed of the node in this statistical period is v verify 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, recorded as n attempts ; 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 n blocks ; Record the time when the node starts competing for the right to generate blocks each time 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 ω verify The basic reward amount is The actual reward amount is adjusted according to 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; let the transaction verification speed of the node be v verify , the average transaction verification speed of the entire network is Then the transaction verification speed adjustment coefficient k verify The calculation formula can be: Where α is the reward adjustment ratio parameter; Consensus efficiency reward under the proof-of-work mechanism: Set the weight of this part of the reward to the total reward as ω block 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 generation of the node n is comprehensively considered. blocks , Average block time And the average number of successful blocks in the entire network Average block time A comprehensive adjustment coefficient k can be constructed block The calculation formula is: Where β is a weight parameter that weighs the importance of the number of blocks and the block time; Stability reward part: Set the weight of this part of the reward to ω stable The basic reward amount is According to the proportion of online time of the node p online To determine the adjustment factor k stable , using a simple linear relationship: k stable =γ×p online , where γ is the stability reward adjustment parameter; Calculate the rewards that each node deserves: For each node, calculate the final reward amount R that it deserves based on the reward rules set above and the calculated adjustment coefficients of each part node , the calculation formula is:

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

6. A blockchain network sharding system, characterized in that: A blockchain network sharding method applied to any one of claims 1 to 5, comprising a node access module, an initial computing power evaluation module, a sharding planning module, a node operation monitoring module, a reward module, and a re-sharding module; Node access module: responsible for managing the relevant processes 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, collecting the situations in which each node finds valid answers and ranking them 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 historical computing power ranking of the nodes, taking into account the processing of redundant nodes; Node operation monitoring module: During the network operation process, 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; Reward module: Based on the node historical performance data collected by the node operation monitoring module, the reward amount that each node deserves is calculated according to the pre-set reward rules; 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

  • Block chain consensus mechanism based on contribution value and credibility

    CN114185995A

  • Consensus method and device based on block chain fragmentation technology

    CN115174565A

  • Block chain consensus method based on credibility and banzhaf index

    CN118138301A

Cited By

  • Block chain partition consensus method and system

    CN120528576A