Block chain system optimization method based on dynamic hybrid fragmentation mechanism

By adopting dynamic hybrid sharding mechanism and reputation mechanism in the blockchain system, the problems of vulnerability and low performance of traditional random sharding solutions are solved, and higher transaction throughput and better security are achieved.

CN119675839APending Publication Date: 2025-03-21SUZHOU UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411840937.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

Traditional random sharding schemes are vulnerable to collaborative attacks, have low performance, and insufficient sharding security, resulting in low throughput and transaction delays of blockchain systems.

Method used

The blockchain system optimization method based on the dynamic hybrid sharding mechanism is adopted, random node grouping is carried out through VRF-DPOS, committee nodes and leader nodes with high reputation are elected, Merkle root hash is generated, and trusted paths are selected through the reputation mechanism for block propagation.

Benefits of technology

It improves the transaction throughput and security of the blockchain system, reduces the risk of malicious node attacks, and ensures the security and reliability of the sharded blockchain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119675839A_ABST
    Figure CN119675839A_ABST
Patent Text Reader

Abstract

The invention discloses a block chain system optimization method based on a dynamic hybrid fragmentation mechanism, and the method comprises the steps: carrying out the system initialization, carrying out the random node grouping through VRF-DPOS before each consensus, and dividing the nodes in a block chain network into different fragments; then, the nodes are defined; a DPOS is adopted, and a leader node and a core node of a committee node are selected according to the reputation; the transaction is processed, a corresponding subMerkleRoot hash value is generated, a final Merkle root hash is formed in the fragments, and a plurality of new blocks are generated according to the Merkle root hash; and finally, a credible path is selected through a reputation mechanism, and a plurality of new blocks are published to the whole block chain network through the core node. The block chain system optimization scheme provided by the invention has relatively high security and performance in the aspect of secure transmission of network data, thereby being suitable for secure transmission and forwarding of transaction data in a fragmented network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a blockchain system optimization method based on a dynamic hybrid sharding mechanism. Background Art

[0002] Blockchain is a distributed ledger technology that provides a decentralized, transparent and secure system. Throughput and latency are two key indicators for measuring the performance of blockchain systems. Poor scalability has become one of the biggest challenges facing the practical application of blockchain, which is manifested in low throughput and long transaction times. As a way to expand the capacity on the chain, sharding technology can significantly improve the throughput and speed of transaction processing in the blockchain, and improve the performance of the blockchain without sacrificing the degree of centralization. Therefore, sharding technology has gradually become one of the mainstream methods for blockchain expansion. At present, blockchain systems such as Elastico, OmniLedger and RapidChain mainly adopt random sharding schemes. However, random sharding may lead to a high proportion of malicious nodes in some shards. A high proportion of malicious nodes may coordinate actions to steal funds or tamper with transaction history. If malicious nodes in a single shard launch a 51% attack, the collapse or attack of a single shard may have a chain effect on the security of the entire blockchain system.

[0003] Based on this, there is an urgent need to provide a blockchain system that can solve the problems of traditional random sharding schemes being vulnerable to coordinated attacks and having poor performance, as well as improve the security of sharding. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a blockchain system optimization method based on a dynamic hybrid sharding mechanism. The present invention has the advantages of security, stability, and data reliability, and is therefore suitable for the secure dissemination and forwarding of transaction data in a sharding network.

[0005] In order to solve the above technical problems, the present invention provides a blockchain system optimization method based on a dynamic hybrid sharding mechanism, comprising the following steps:

[0006] Step S1: System initialization. Before each round of consensus, VRF-DPOS is used to randomly group nodes and divide the nodes in the blockchain network into different shards.

[0007] Step S2: Use DPOS to define the nodes in each shard;

[0008] Step S3: Use DPOS to elect committee nodes and leader nodes in each shard based on reputation; use DPOS in all shards and re-elect all leader nodes based on reputation to obtain core nodes;

[0009] Step S4: Allocate the transactions to each committee node and process the transaction information therein to generate corresponding subMerkleRoot hash values;

[0010] Step S5: In a shard, the leader node packs all the subMerkleRoot hash values in this shard to form the final Merkle root hash, and generates multiple new blocks based on the Merkle root hashes of multiple shards;

[0011] Step S6: Select a trusted path through the reputation mechanism, and publish multiple new blocks to the entire blockchain network through the core nodes.

[0012] Furthermore, in Step S1, the system uses the RSA algorithm to generate a private key sk and a public key pk; configure with n / (3f + 1) shards, where n represents the total number of nodes in the blockchain network, and f represents the number of faulty or potentially malicious nodes.

[0013] Furthermore, when generating the private key sk and the public key pk, first select two different large prime numbers, denoted as p and q, select the public key pk such that 1 < pk < (p - 1)×(q - 1) and pk is relatively prime to (p - 1)×(q - 1), and finally calculate the private key sk: pk ≡ e -1 {mod[(p - 1)×(q - 1)]}.

[0014] Furthermore, in Step S2, each node runs the DPOS algorithm, uses the private key sk and the transaction data as inputs to obtain a result value v, and defines the current node as a competing node, a main node, or a sub node according to the result value v.

[0015] Furthermore, in Step S3, after the node receives all user transactions or reaches the maximum waiting time Tw, it enters the committee node election stage; the election criterion is based on the reputation score of the node, where the reputation score is the local reputation R l and the global reputation R g , the local reputation R l is the score of each node, and the global reputation R g is the score of the current shard. The global reputation R l is calculated by the weighted average of the local reputation R g ; in each shard, each committee is composed of multiple nodes with the highest local reputation R l scores in the sorting to obtain committee nodes; in each shard, all competing nodes participate in the competition verification process. Among the competing nodes, the competing node with the highest local reputation R l score is elected as the leader node of this round; in all shards, the global reputation R gThe leader node in the shard with the highest score serves as the core node.

[0016] Furthermore, the transaction includes transaction data of the transaction initiator, recipient, and account property information.

[0017] Furthermore, in step S4, the transaction set T in the blockchain network is screened by the account address A of the leader node to obtain the transaction subset TA of the shard where the leader node is located, and then the committee nodes are used to participate in the transaction processing, the transaction subset TA is allocated to each committee node in the current shard, and the transaction information in the transaction subset TA is processed to generate the corresponding subMerkleRoot hash value.

[0018] Furthermore, in step S5, the transactions verified by each shard are used to calculate the subMerkleRoot hash value of the shard, including the transaction information within the shard. Each node generates a subMerkleRoot hash value. After that, the main node signs it with the private key sk to ensure that the wrong Merkle root hash signature will not affect the subMerkleRoot hash value of other honest main nodes. After confirming the identity, it is transmitted to the leader node. The leader node packages all the subMerkleRoot hash values ​​to generate a new block.

[0019] Furthermore, in step S6, the new block is first propagated within the shard, and nodes in the shard verify and accept the new block. Each shard is effectively managed by a leader node, and multiple leader nodes share network topology information to form a global view of the entire network. The global view is used for cross-shard routing, calculating trusted paths, and securely propagating new blocks between multiple shards, and publishing them to the entire blockchain network.

[0020] Furthermore, in step S6, after the release is completed, it is determined whether the epoch is completed. If not, the process jumps to step S2 to continue execution.

[0021] Beneficial effects of the present invention:

[0022] Sharding is performed through a hybrid sharding method, and a random trusted committee is elected to lead the subsequent sharding stage. Subsequently, a reputation-based blockchain sharding security routing mechanism is introduced in the block propagation stage. Based on the status and behavior data of the sharding nodes stored in the trusted blockchain, the node reputation is calculated and applied to find a reliable block propagation path, effectively ensuring the security of the sharded blockchain.

[0023] In the case of malicious nodes in the network, the BODH of the present invention can quickly and accurately identify honest nodes and malicious nodes through the reputation mechanism, thereby reducing the risk of blockchain being attacked. In a complex real network environment, it can achieve higher transaction throughput compared to other sharding schemes. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 This is an operation flow chart of an improved sharding scheme based on block verification results and transmission behavior of the present invention.

[0025] Figure 2 The present invention is an abstract topology diagram for concealing specific network information.

[0026] Figure 3 This is a malicious node behavior pattern diagram of the present invention.

[0027] Figure 4 This is a comparison chart of the average transaction throughput of different solutions under Mode I of the present invention.

[0028] Figure 5 This is a comparison chart of the average transaction throughput of different solutions under Mode II of the present invention.

[0029] Figure 6 This is a test chart of the transaction processing time overhead under different numbers of shards of the present invention.

[0030] Figure 7 This is a trend diagram of the block transmission success rate changes of different methods under different malicious node ratios of the present invention.

[0031] Figure 8 This is a packet loss rate comparison diagram of the present invention. DETAILED DESCRIPTION

[0032] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0033] Reference Figure 1As shown, an embodiment of the blockchain system optimization method based on the dynamic hybrid sharding mechanism of the present invention is used to process transactions generated by users and submitted to the blockchain network. The sharding system architecture includes the following aspects: the system is initialized to generate a private key sk and a public key pk, and the system uses VRF-DPOS to randomly group nodes and divide the nodes in the blockchain network into different shards. The nodes in each shard execute the DPOS algorithm locally and use the private key and transaction data as input to obtain a result value, wherein the DPOS algorithm is a consensus algorithm that combines the VRF verifiable random function and the DPOS consensus mechanism, and the transaction data is the data generated by the user and submitted to the blockchain network. Assume that the result of DPOS is v, and the account property owned by the node is a. The nodes of this system are divided into three types of nodes according to their different identities: If v<1, the node participates in the competitive verification process and is a competitive node. In the shard, the node with the highest reputation among all nodes that meet the conditions becomes the leader node, which is used to package the subMerkleRoot hash value submitted by the node, create a new block and forward it to the verification node for block verification. The verification node is a number of nodes selected inherent in the blockchain network. The blocks that pass the verification then select a trusted path through the reputation mechanism. If v≥1 and v / a<1, the node is the main node, which is used to initiate transaction requests, package transactions belonging to the shard, calculate and sign the subMerkleRoot hash result with the private key sk, and complete the consensus. If v≥1 and v / a≥1, the node is a sub node, which is used to broadcast the transaction to the current shard, assist in completing the signature of the subMerkleRoot hash result, and determine the end of each round epoch based on the timestamp, that is, whether the transaction information has been processed each time. After receiving all user transactions or reaching the maximum waiting time, all blockchain nodes select committee nodes based on reputation. The leader node forwards the packaged blocks to the committee nodes, verifies their legitimacy, and then selects a trusted path through the reputation mechanism. The BODH of the present invention is a sharding scheme that evaluates the reputation of nodes based on block verification results and transmission behaviors. It is designed to implement a mechanism for securely forwarding new blocks between multiple shards based on the reputation value of the node at the end of each epoch. The flowchart of the present invention running in one round epoch is shown in the figure. Figure 1 As shown, the three types of nodes in the blockchain system are responsible for the three tasks of epoch reconfiguration, transaction verification, and block packaging and propagation. In order to enhance the security of the blockchain, the present invention also designs a monitoring and reputation scoring mechanism for malicious nodes to reduce the potential risk of shards being controlled by malicious nodes. The core algorithm of the present invention mainly includes three components: hybrid sharding strategy, transaction block generation, and reputation evaluation mechanism for node behavior. A blockchain system optimization scheme based on a dynamic hybrid sharding mechanism specifically includes the following steps:

[0034] (1) The system uses the RSA algorithm to generate a private key sk and a public key pk. First, two different large prime numbers are selected and denoted as p and q. The public key pk is selected such that 1 < pk < (p - 1)×(q - 1) and pk is relatively prime to (p - 1)×(q - 1). Calculate the private key sk: pk ≡ e -1 {mod[(p - 1)×(q - 1)]}. Each node runs the VRF - DPOS algorithm to obtain a result value v: v = VRF_DPOS(sk, input). Finally, the result v is mapped to the range [0, value). At the same time, blockchain sharding is constructed. In a sharded network, to ensure the security of the system, it is necessary to ensure that enough "honest" nodes can resist potential attacks or errors. Therefore, a configuration of n / (3f + 1) shards is adopted, where n represents the total number of nodes in the blockchain, and f represents the number of faulty or potentially malicious nodes. Before each round of consensus, the VRF - DPOS can be used for random node grouping to divide the nodes in the blockchain network into different shards, and each shard includes several nodes.

[0035] (2) The user generates a transaction and submits it to the blockchain network. The transaction contains information such as the transaction initiator, recipient, and account property.

[0036] (3) DPOS is responsible for determining node identities. Through the DPOS process, a dedicated committee is selected to lead the subsequent stages of the entire network. Assume the number of shards in the network is M. Each validator uses the remainder obtained by dividing V (taking two significant digits for V) by M to get the shard number S i . The committee nodes are selected based on reputation: DPOS is responsible for the election of committee nodes and leader nodes. The selected leader node generates a new block. The specific process is as follows: When a node receives all user transactions or reaches the maximum waiting time Tw, it enters the committee node election stage; the election criteria are based on the reputation scores of blockchain nodes, where the reputation score is the local reputation R l and the global reputation R g . To improve the stability of the system, a node behavior reputation evaluation mechanism is designed. The committee is composed of several nodes with the highest reputation; among them, all nodes with v < 1 (i.e., competing nodes) will participate in the competition verification process, and the node with the highest reputation in the nodes is elected as the leader node of this round. Through the reputation evaluation and sorting among nodes, it is ensured that there is exactly one node becoming the leader in each shard. To reduce the degree of centralization of the system, the node that has been elected as the leader cannot be elected as the leader node again in subsequent elections.

[0037] (4) Transaction processing. The transaction set T in the blockchain network is screened by the node’s account address A to obtain the transaction subset TA of the same network shard. Subsequently, the committee nodes selected by the DPOS process participate in the transaction processing, assign the transaction subset TA to each committee node, process the transaction information in TA, and generate the corresponding subMerkleRoot hash value.

[0038] (5) Block generation and publication. Transactions verified by each shard are used to calculate the subMerkleRoot hash value of the shard, which contains the transaction information within the shard. Each shard generates a subMerkleRoot hash value. After that, the main node uses sk to sign it, creating a guarantee that an incorrect Merkle root hash signature will not affect the subMerkleRoot hash value of other honest main nodes. After confirming the identity, it is transmitted to the leader node. The leader node packages all subMerkleRoots and generates a new block.

[0039] (6) Secure routing selection. The new block is first propagated within the shard, and the nodes in the shard verify and accept the new block. Each shard is effectively managed by a leader node. These leader nodes share network topology information with each other to form a global view of the entire network. This global view is used for cross-shard routing, calculating trusted paths, and achieving secure propagation of new blocks between multiple shards. The core node publishes it to the entire blockchain network.

[0040] Among them, the verification process of the verification node is as follows: the time complexity of the improved algorithm is O(n), and the hash value res is calculated by using the private key sk and the height h of the previous block, and the VRF proof proof is generated. Subsequently, the hash value res is mapped to the range [0, value) using the space mapping function. Multiple verification nodes are randomly selected from all nodes. The verification node needs to check whether the proof and the hash value res are correct. If the verification passes, the verification node information is updated and a new result new_result is generated; if the verification fails, false and the original result hash value res are returned. Finally, the verification node checks whether the hash value res and new_result match. If the match is successful, new_result and true are output; otherwise, null and false are output.

[0041] This invention proposes a reputation-based blockchain sharding secure routing mechanism, which includes the following elements:

[0042] 1. Use abstract topology to hide specific network information, such as Figure 2As shown, a reputation concept consisting of local reputation and global reputation is introduced to calculate the trusted path.

[0043] 2. Global reputation: Based on the verification results of the abstract topology, a mechanism is further adopted to reflect the behavior of blockchain nodes using the concept of reputation. Leader nodes that share the correct abstract topology will increase their global reputation. Nodes with high reputation values ​​perform well, reflecting that they are good-intentioned nodes in historical behavior; on the contrary, nodes with low reputation values ​​may be regarded as malicious nodes. Through the verified abstract topology and global reputation, users are protected from the threat of privacy leakage. The present invention estimates the global reputation by adopting a weighted method based on local reputation. In this mechanism, the leader node verifies the abstract topology by checking the connection relationship, communication quality and sharding between nodes to generate a local reputation R. l . The specific steps are as follows: Connection status check, the leader node first performs a Ping operation on all nodes to check the reachability of the nodes. The connection status is evaluated by the success rate and response time of the Ping to ensure that each node is correctly connected to its expected neighboring nodes. Communication quality monitoring, secondly, monitor the communication quality between nodes, use traceroute to analyze the round-trip time (RTT) between nodes, evaluate network latency, and ensure that network performance meets expected standards. Topology verification, based on the results of the above steps, verify whether the actual network topology is consistent with the expected abstract topology, and generate the corresponding local reputation R l Subsequently, the leader node sends the local reputation Rl to the smart contract, and the smart contract uses the local reputation R l The weighted average of is used to calculate the global reputation Rg. The global reputation calculation formula is: Where R gi represents the global reputation of node i, It represents the local reputation sent by leader node k to the smart contract, and n represents the number of nodes in the shard network. The model of the present invention uses indicators such as block verification and transmission behavior to calculate and normalize the reputation value of the node.

[0044] 3. Local reputation value: The calculation formula of the local reputation value of node i at time t is: Where α1 and α2 satisfy α1+α2=1, representing the current reputation and historical reputation coefficient of node i, respectively. i t is the current reputation value of node i at time t, h i t is the historical reputation value of node i at time t.

[0045] 4. Current reputation value and historical reputation value: the current reputation value of the node p i tThe direct reputation value (c i t ) and the indirect reputation value of node i at time t (g i t ) is composed of: Among them A i represents the set of nodes adjacent to node i, |A i | indicates A i The number of nodes in the direct reputation value c i t The calculation formula is Where T i Indicates the last online time of node i. Indirect reputation value g i t The calculation formula is Among them, H j ,j∈A i Indicates whether node j is online to synchronize blockchain data. If online, it is assigned a value of 1, otherwise it is 0. The longer the online time and the more online neighbor nodes there are, the higher the reputation value. Historical reputation value h i t The calculation formula is where μ i and U represent the total online time of node i and the time of node i in μ respectively. i The total number of blocks received during the period. s i t Indicates whether node i successfully transmits the block at time t. Successful transmission is assigned a value of 1, otherwise it is 0.

[0046] 5. Through the evaluation of local reputation, each leader node has a corresponding local reputation R l Then, by evaluating the local reputation R l The weighted average of the global reputation R g , the leader node calculates a trusted path with the help of all verified abstract topologies and global reputations in the blockchain. This path avoids low-reputation domains and uses the shortest distance algorithm under limited bandwidth to ensure that data packets can be securely forwarded between multiple shards. Compared with the baseline architecture, this theoretical architecture can effectively build global trust between multiple shards and ensure the reliability of routing between multiple shards.

[0047] The present invention analyzes the performance of the improved sharding scheme through experiments. It simulates the scenario where random nodes continuously send transaction data, where these data are randomly and equally distributed to the verification nodes in each shard. The node sample of the experiment includes 400 nodes, where the ratio of malicious nodes to honest nodes is 1:3. In the experiment, the honest nodes are responsible for directly verifying all transactions they receive, while the behavior of the dishonest nodes is affected by their predefined behavior patterns. Figure 3 As shown in the figure, malicious nodes have two different behavior modes. Mode I, in this mode, the node performs wrong operations under any circumstances, such as refusing to verify correct transactions. Mode II, in this mode, when the node is not selected as the leader node, the transaction will be verified normally according to the behavior mode of the honest node and wait to become the leader node. Once it becomes the leader node, the node begins to refuse to verify correct transactions, and other malicious nodes in the shard support the behavior of the node. The ASCIR secure sharding scheme evaluates the reputation of the target shard based on the inter-domain routing reputation model, and punishes shards with continuous malicious behavior to ensure the security of the shard network. Figure 4 As shown, when the malicious node adopts mode I, the average transaction throughput of random sharding, ASCIR and BODH of the present invention within 100 minutes. Under mode I, the malicious node causes the average transaction throughput of the three blockchains to remain at a relatively low level in the first 30 minutes. After 30 minutes, the average throughput of ASCIR and the present invention gradually increased, both exceeding the average throughput of random sharding. During this stage, the throughput of the present invention fluctuated upward, and the throughput of ASCIR basically increased linearly, and the throughput of the present invention increased by 15% compared with ASCIR. This is because the dishonest nodes in the experiment are in mode I and refuse to verify all transactions. Therefore, both ASCIR with a reputation mechanism and the present invention can identify malicious nodes. However, ASCIR needs to detect continuous abnormal behavior to avoid malicious domains and achieve reliable propagation, while the present invention can detect abnormal behavior in a shorter time, so that the transaction throughput of the blockchain of the present invention can be stably higher than other blockchains. As shown in FIG. Figure 5 As shown, when the malicious node adopts mode II, the transaction throughput of random sharding, ASCIR and BODH of the present invention within 2 hours. It can be clearly seen from the experimental results that the TPS of the present invention significantly exceeds random sharding, which is 30% higher than that of ASCIR. This is because when a malicious node is elected as a leader, it stops verifying transactions and refuses to perform the duties of a leader. At this time, other nodes broadcast an emergency message and immediately elect a new leader node to perform the verification operation. In this process, the entire blockchain system is paralyzed until the leader node is re-elected to verify the transaction, which is the reason for the fluctuation in throughput. The above results show that in the presence of malicious nodes in the network, the BODH of the present invention can quickly and accurately identify honest nodes and malicious nodes through a reputation mechanism, thereby reducing the risk of blockchain attacks. And in a complex real network environment, compared with other sharding schemes, it can achieve a higher transaction throughput.

[0048] The present invention dynamically analyzes the trend of transaction processing time overhead under different numbers of shards through experiments. Figure 6 As shown in the figure. It can be seen that as the number of shards increases, the transaction processing time decreases exponentially. When the number of shards is 1, that is, when there is no sharding, the transaction volume on the chain gradually increases, while the transaction processing delay increases exponentially. This shows that a blockchain without sharding is prone to transaction blocking when processing a large number of transactions. The experimental results show that the optimal transaction processing time overhead is about 0.5s. Once the number of shards exceeds a certain threshold, the transaction processing time fluctuates slightly but remains relatively constant, which indicates that changing the number of shards at this stage has little effect on the transaction processing delay. It can be seen that too many shards cause the number of malicious nodes in some shards to exceed the security requirements of the consensus algorithm, resulting in the failure of the shard consensus.

[0049] The present invention evaluates the security performance of the system through experiments based on two indicators: the success rate of test block propagation and the packet loss rate. Figure 7 and Figure 8 As shown. Figure 7 It can be seen that when the proportion of malicious nodes is between 40% and 50%, random sharding performs poorly, especially when it is 50%, the transmission success rate of random sharding drops significantly. It can be seen that random sharding does not detect specific malicious node behaviors and lacks the secure routing selection of the reputation mechanism in the BODH of the present invention. In order to test the packet loss rate of the system, this experiment sent a data packet of 500 bytes to more than 10 nodes in the shard. The results are as follows: Figure 8 As shown. Figure 8 It can be seen that in random sharding, at t=15min, the packet loss rate increases sharply, reaching nearly 100%. This indicates that all data packets passing through the malicious domain are discarded. However, in the present invention, the recovery speed of packet loss is faster than ASCIR, and the packet loss rate is reduced by about 20%. From the above results, it can be seen that the impact of the reputation mechanism on the packet loss rate in the cross-shard path, compared with ASCIR, the present invention is more sensitive to malicious nodes. In summary, incorporating the reputation mechanism into the hybrid sharding scheme enables the present invention to have the advantages of security, stability, and data reliability, and is therefore suitable for the secure propagation and forwarding of transaction data in sharding networks.

[0050] The above embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Any equivalent substitution or change made by a person skilled in the art based on the present invention is within the protection scope of the present invention.

Claims

1. A blockchain system optimization method based on a dynamic hybrid sharding mechanism, characterized in that: The following steps are involved: Step S1: System initialization. Before each round of consensus, VRF-DPOS is used to randomly group nodes and divide the nodes in the blockchain network into different shards. Step S2: Use DPOS to define the nodes in each shard; Step S3: Use DPOS to elect committee nodes and leader nodes in each shard based on their reputation. DPOS is used in all shards and all leader nodes are re-elected to obtain core nodes based on reputation; Step S4: Allocate the transaction to each committee node and process the transaction information therein to generate the corresponding subMerkleRoot hash value; Step S5: In a shard, the leader node packages all subMerkleRoot hash values ​​in the shard to form the final Merkle root hash, and generates multiple new blocks based on the Merkle root hashes of multiple shards; Step S6: Select a trusted path through the reputation mechanism and publish multiple new blocks to the entire blockchain network through core nodes.

2. The blockchain system optimization method based on the dynamic hybrid sharding mechanism according to claim 1 is characterized in that: In step S1, the system uses the RSA algorithm to generate a private key sk and a public key pk; n / (3f+1) shards are used for configuration, where n represents the total number of nodes in the blockchain network and f represents the number of faulty or potentially malicious nodes.

3. The blockchain system optimization method based on the dynamic hybrid sharding mechanism as claimed in claim 2 is characterized in that: When generating the private key sk and the public key pk, first select two different large prime numbers, denoted as p and q. Then select the public key pk such that 1 < pk < (p - 1)×(q - 1) and pk is relatively prime to (p - 1)×(q - 1). Finally, calculate the private key sk: pk ≡ e -1 {mod[(p - 1)×(q - 1)]}.

4. The blockchain system optimization method based on the dynamic hybrid sharding mechanism according to claim 1 is characterized in that: In step S2, each node runs the DPOS algorithm, using the private key sk and transaction data as input to obtain a result value v, and defines the current node as a competitive node, main node or sub node based on the result value v.

5. The blockchain system optimization method based on the dynamic hybrid sharding mechanism as claimed in claim 2, characterized in that: In step S3, after the node receives all user transactions or reaches the maximum waiting time Tw, it enters the committee node election phase; the election criteria are based on the node's reputation score, where the reputation score is the local reputation R l and global reputation R g , local reputation R l The score of each node, the global reputation R g is the score of the current shard, through the local reputation R l The weighted average of the global reputation R g ; In each shard, each node has a local reputation R l Multiple nodes ranked first in the scoring list form a committee to obtain a committee node; In each shard, all competing nodes participate in the competitive verification process. Among the competing nodes, the local reputation R l The competitive node with the highest score is elected as the leader node of this round; in all shards, the global reputation R g The leader node in the shard with the highest score serves as the core node.

6. The blockchain system optimization method based on the dynamic hybrid sharding mechanism as claimed in claim 5 is characterized in that: A transaction contains transaction data including the transaction initiator, recipient, and account property information.

7. The blockchain system optimization method based on the dynamic hybrid sharding mechanism as claimed in claim 2 is characterized in that: In step S4, the transaction set T in the blockchain network is screened by the account address A of the leader node to obtain the transaction subset TA of the shard where the leader node is located. Then, the committee nodes are used to participate in the transaction processing, and the transaction subset TA is allocated to each committee node in the current shard. The transaction information in the transaction subset TA is processed to generate the corresponding subMerkleRoot hash value.

8. The blockchain system optimization method based on the dynamic hybrid sharding mechanism as claimed in claim 7 is characterized in that: In step S5, the transactions verified by each shard are used to calculate the subMerkleRoot hash value of the shard, including the transaction information in the shard. Each node generates a subMerkleRoot hash value. After that, the main node signs it with the private key sk to ensure that the wrong Merkle root hash signature will not affect the subMerkleRoot hash value of other honest main nodes. After confirming the identity, it is transmitted to the leader node. The leader node packages all the subMerkleRoot hash values ​​to generate a new block.

9. The blockchain system optimization method based on the dynamic hybrid sharding mechanism as claimed in claim 1, characterized in that: In step S6, the new block is first propagated within the shard, and nodes in the shard verify and accept the new block. Each shard is effectively managed by a leader node, and multiple leader nodes share network topology information to form a global view of the entire network. The global view is used for cross-shard routing, calculating trusted paths, and securely propagating new blocks between multiple shards and publishing them to the entire blockchain network.

10. The blockchain system optimization method based on the dynamic hybrid sharding mechanism according to claim 1 is characterized in that: In step S6, after the release is completed, it is determined whether the epoch has ended. If not, the process jumps to step S2 to continue execution.