Block chain fragment optimization method and system

By generating the initial sharding solution and optimizing sharding resource allocation based on the collaboration coefficient and load, the problems of uneven resource allocation and node load imbalance in the blockchain sharding solution are solved, efficient sharding collaboration and load balancing are achieved, and the performance and efficiency of the blockchain network are improved.

CN120050234APending Publication Date: 2025-05-27CHONGQING NORMAL UNIVERSITY
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202510120019.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-25
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The existing blockchain sharding scheme has inefficient problems in resource allocation, node load balancing and cross-chain interaction delay, which has affected system performance.

Method used

By obtaining the global sharding topology of the blockchain network, an initial sharding scheme is generated, and the collaboration coefficient is calculated based on the cross-chain interaction frequency and node connection degree to identify high-frequency interaction sub-chain. Then, the high-frequency interactive sub-chain is analyzed in sub-node grouping, and the candidate shards are screened and reconstructed, and the load distribution is optimized through node migration simulation and inter-chain communication prediction to form a shard migration scheme.

Benefits of technology

It realizes efficient division of resources and balanced configuration inside and outside shards, improves collaborative efficiency between shards, reduces network latency and cross-chain interaction costs, and improves the overall performance and resource utilization of blockchain networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050234A_ABST
    Figure CN120050234A_ABST
Patent Text Reader

Abstract

The invention discloses a block chain fragment optimization method and system, and particularly relates to the technical field of block chains. The method comprises the steps of generating an initial fragmentation scheme by obtaining a global fragmentation topological structure of a target block chain network; based on an initial fragmentation scheme, analyzing cross-chain interaction frequency and internal node connectivity between fragments, calculating a cooperation coefficient of each fragment, and identifying a high-frequency interaction subchain to form a fragment collaborative optimization subset; then, sub-node grouping analysis is carried out on high-frequency interaction sub-chains in the optimization subset, and reconstruction candidate fragments are screened out by combining in-chain transaction confirmation time and resource consumption; carrying out load state evaluation on nodes for reconstructing the candidate fragments, and optimizing load distribution through node migration simulation and inter-chain communication prediction to form an optimal fragment migration scheme; the migration scheme is applied to the target fragment, the consensus protocol path is adjusted in real time, the optimization effect is evaluated based on interaction data, fragment resource allocation can be dynamically optimized, network delay is reduced, and the overall performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the wide application of blockchain technology, it shows great potential in fields such as finance, Internet of Things, and supply chain. However, the scalability and efficiency issues of blockchain networks have always been bottlenecks restricting further development. As a key solution to improve the performance of blockchain, sharding technology divides the blockchain network into multiple shards to process transactions in parallel, improving transaction processing capabilities and network throughput. However, existing sharding solutions still face many challenges in practical applications, such as uneven sharding resource allocation, node load imbalance, and cross-chain interaction latency. These problems lead to low collaboration efficiency between shards and seriously affect system performance. At the same time, due to the complex node distribution and dynamic changes in resource requirements, how to effectively evaluate the collaboration relationship between shards and optimize sharding resource allocation has become an important technical problem waiting to be solved.

[0003] To solve the above problems, a technical solution is provided. Summary of the Invention

[0004] In order to overcome the above-mentioned defects of the prior art, embodiments of the present invention provide a blockchain sharding optimization method and system to solve the problems raised in the above background art.

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

[0006] A blockchain sharding optimization method, comprising the following steps:

[0007] Obtain the global sharding topology of the target blockchain network, and generate an initial sharding scheme according to network load, node distribution, and sharding resource weights;

[0008] According to the initial sharding scheme, calculate the collaboration coefficient of each shard based on the cross-chain interaction frequency and internal node connectivity between shards, and identify cross-chain high-frequency interaction sub-chains to generate a shard collaboration optimization subset;

[0009] Perform sub-node grouping analysis on the high-frequency interaction sub-chains in the shard collaboration optimization subset, and screen to obtain reconstructed candidate shards based on in-chain transaction confirmation time and resource consumption;

[0010] Evaluate the load status of the nodes of the reconstructed candidate shards, and optimize the load distribution through node migration simulation and inter-chain communication prediction to form a shard migration scheme;

[0011] Apply the shard migration scheme to the target shard, reorganize the consensus protocol path between nodes, and evaluate the optimization effect based on real-time interaction data.

[0012] In a preferred embodiment, the global sharding topology of the target blockchain network is obtained, and an initial sharding scheme is generated according to network load, node distribution, and shard resource weights. Specifically:

[0013] Based on the real-time load data of all shards in the target blockchain network, the average processing capacity of each shard is evaluated;

[0014] According to the geographical distribution, hardware performance, and on-chain resource utilization of the nodes in the shard, a resource distribution matrix is generated;

[0015] The resource distribution matrix is subjected to weight normalization processing, and an initial shard partitioning scheme is generated according to the shard performance differences.

[0016] In a preferred embodiment, according to the initial sharding scheme, based on the cross-chain interaction frequency and internal node connectivity between shards, the collaboration coefficient of each shard is calculated, and the cross-chain high-frequency interaction sub-chains are identified to generate a shard collaboration optimization subset. Specifically:

[0017] The cross-chain interaction data between shards is divided into time windows to generate a cross-chain interaction frequency matrix between shards;

[0018] Based on the communication links and message transfer delays between nodes, an internal connectivity model of each shard is constructed;

[0019] Combining the cross-chain interaction frequency matrix and the connectivity model, the shard collaboration coefficient is calculated;

[0020] According to the sorting rule of the shard collaboration coefficient from high to low, the high-frequency interaction sub-chains are extracted to generate a shard collaboration optimization subset.

[0021] In a preferred embodiment, subgroup analysis of the sub-nodes of the high-frequency interaction sub-chains in the shard collaboration optimization subset is performed, and based on the in-chain transaction confirmation time and resource consumption, the reconstruction candidate shards are screened. Specifically:

[0022] The node set of the high-frequency interaction sub-chain is extracted, and logical subgroups are divided based on the transaction processing records of the nodes;

[0023] The in-chain transaction confirmation time and resource consumption of the logical subgroups are confirmed, and a performance evaluation matrix is constructed;

[0024] Perform multi-objective optimization evaluation on the performance evaluation matrix, and screen the logical subgroups with the longest transaction confirmation time or the highest resource consumption;

[0025] The screened logical subgroups are used as the reconstruction candidate shards.

[0026] In a preferred embodiment, the load status of the nodes of the reconstructed candidate shards is evaluated, and through node migration simulation and inter-chain communication prediction, the load distribution is optimized to form a shard migration plan, specifically as follows:

[0027] Sample and analyze the current load status of the nodes of the reconstructed candidate shards to determine the average load and peak load of each node;

[0028] Conduct node migration simulation to predict the overall load balance status of the target shards after migration;

[0029] Evaluate the inter-chain communication effect based on the inter-chain communication delay and cross-chain interaction frequency after migration;

[0030] Generate an optimal shard migration plan according to the overall load balance status of the target shards and the inter-chain communication effect.

[0031] In a preferred embodiment, apply the shard migration plan to the target shards, reorganize the consensus protocol path between the nodes, and evaluate the optimization effect based on the real-time interaction data, specifically as follows:

[0032] Execute the shard migration plan and adjust the consensus path between the nodes in real time;

[0033] Monitor the real-time interaction data after shard migration, including the cross-chain interaction success rate and transaction processing time;

[0034] Compare the shard performance data before and after migration to obtain the migration optimization gain and evaluate the optimization effect.

[0035] On the other hand, the present invention provides a blockchain shard optimization system, including a shard plan generation module, a cooperation coefficient calculation module, a candidate shard screening module, a migration plan generation module, and an optimization effect evaluation module;

[0036] Shard plan generation module: Obtain the global shard topology of the target blockchain network, and generate an initial shard plan according to the network load, node distribution, and shard resource weights;

[0037] Cooperation coefficient calculation module: According to the initial shard plan, calculate the cooperation coefficient of each shard based on the cross-chain interaction frequency and internal node connectivity between the shards, and identify the cross-chain high-frequency interaction sub-chains to generate a shard collaborative optimization subset;

[0038] Candidate shard screening module: Conduct sub-node grouping analysis on the high-frequency interaction sub-chains in the shard collaborative optimization subset, and filter to obtain the reconstructed candidate shards based on the in-chain transaction confirmation time and resource consumption;

[0039] Migration plan generation module: Evaluate the load status of the nodes of the reconstructed candidate shards, and optimize the load distribution through node migration simulation and inter-chain communication prediction to form a shard migration plan;

[0040] Optimization effect evaluation module: Apply the shard migration plan to the target shard, reorganize the consensus protocol path among nodes, and evaluate the optimization effect based on real-time interaction data.

[0041] Technical effects and advantages of a blockchain shard optimization method and system of the present invention:

[0042] 1. Utilize the global shard topology data in combination with network load, node distribution, and shard resource weights to generate an initial shard plan, achieving efficient resource partitioning and balanced configuration inside and outside the shards. Secondly, by analyzing the cross-chain interaction frequency between shards and the internal node connectivity, calculate the shard cooperation coefficient, and identify the high-frequency interaction sub-chains, which can dynamically evaluate the cooperation relationship between shards and effectively improve the cooperation efficiency between shards. In addition, through the sub-node grouping analysis of the high-frequency interaction sub-chains, combined with the in-chain transaction confirmation time and resource consumption, screen and reconstruct the candidate shards, enabling the shard optimization to focus on adjusting the bottleneck nodes. Subsequently, optimize the load distribution through node migration simulation and inter-chain communication prediction to form a shard migration plan, achieving load balancing and improving the cross-chain interaction efficiency.

[0043] 2. By adjusting the consensus protocol path between nodes in real time and evaluating the optimization effect based on the interaction data, ensure the continuous effectiveness of the optimization plan, provide a dynamic, accurate, and efficient shard optimization mechanism, improve the overall performance, resource utilization rate, and transaction processing ability of the blockchain network, while reducing network latency and cross-chain interaction costs. Brief Description of the Drawings

[0044] Figure 1 It is a schematic diagram of a blockchain shard optimization method of the present invention;

[0045] Figure 2 It is a schematic structural diagram of a blockchain shard optimization system of the present invention. Detailed Embodiments

[0046] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0047] Embodiment 1

[0048] Figure 1 A blockchain shard optimization method of the present invention is given, which includes the following steps:

[0049] Obtain the global sharding topology of the target blockchain network and generate an initial sharding plan based on network load, node distribution, and sharding resource weights;

[0050] According to the initial sharding plan, based on the cross-chain interaction frequency and internal node connectivity between shards, the collaboration coefficient of each shard is calculated, and the cross-chain high-frequency interaction sub-chains are identified to generate the shard collaborative optimization subset;

[0051] Perform sub-node grouping analysis on the high-frequency interactive sub-chains in the shard collaborative optimization subset, and screen out candidate shards for reconstruction based on the transaction confirmation time and resource consumption within the chain;

[0052] Evaluate the load status of nodes for reconstructing candidate shards, optimize load distribution through node migration simulation and inter-chain communication prediction, and form a shard migration plan;

[0053] Apply the shard migration solution to the target shard, reorganize the consensus protocol path between nodes, and evaluate the optimization effect based on real-time interaction data.

[0054] Specifically, the global sharding topology of the target blockchain network is obtained, and the initial sharding scheme is generated according to the network load, node distribution, and sharding resource weight, including:

[0055] Based on the real-time load data of all shards in the target blockchain network, the average processing capacity of each shard is evaluated; specifically, the real-time load data includes the transaction processing rate of nodes in each shard, network bandwidth usage, and block generation time, etc.; for example, assuming that a blockchain network has three shards, where the transaction processing volume of shard A is 500TPS (Transactions Per Second), shard B is 1000TPS, and shard C is 2000PS; based on these data, the average processing capacity of each shard can be evaluated as 500, 1000, and 2000TPS respectively;

[0056] Generate a resource distribution matrix based on the geographical distribution, hardware performance, and on-chain resource utilization of each node in the shard. Specifically, geographical distribution can affect network communication latency, hardware performance determines node processing capabilities, and on-chain resource utilization includes storage capacity and computing resource utilization. The resource distribution matrix aggregates this information into a unified indicator to evaluate the resource status of the shard.

[0057] The resource distribution matrix is ​​weighted normalized, and an initial sharding plan is generated based on the performance differences of the shards. Specifically, weight normalization refers to normalizing data of different dimensions (such as bandwidth, storage utilization, etc.) to the same range, and then calculating the comprehensive performance score of each node based on the set weight. The sharding plan is adjusted based on these comprehensive scores to ensure load balance between shards.

[0058] Specifically, according to the initial sharding scheme, based on the cross-chain interaction frequency and internal node connectivity between shards, the collaboration coefficient of each shard is calculated, and the cross-chain high-frequency interaction sub-chains are identified to generate the shard collaborative optimization subset, including:

[0059] The cross-chain interaction data between shards is divided into time windows to generate a cross-chain interaction frequency matrix between shards; specifically, cross-chain interaction data refers to transaction requests or information transmission between shards. For example, the number of transactions from shard A to shard B. Time window division is to divide the data into fixed time intervals (such as every minute, every hour) to facilitate the statistics of cross-chain interaction frequency;

[0060] Based on the communication links and message transmission delays between nodes, an internal connectivity model for each shard is constructed; specifically, the internal connectivity reflects the communication density of nodes within the shard, and is usually calculated based on the number of message transmissions and delay time between nodes; for example, if the delay between nodes is low and message transmission is frequent, the connectivity is high; for example, there are 3 nodes in shard A, the delay between node 1 and node 2 is 10ms, the number of message transmissions is 100 times, the delay between node 2 and node 3 is 20ms, and the number of message transmissions is 50 times, then the internal connectivity can be expressed in the form of a weighted graph;

[0061] Combine the cross-chain interaction frequency matrix and the connectivity model to calculate the shard collaboration coefficient. Specifically, if the internal connectivity of shard A is 0.8 and the cross-chain interaction frequency is 0.6, the collaboration coefficient can be calculated as a weighted average: collaboration coefficient = 0.5 × 0.8 + 0.5 × 0.6 = 0.7.

[0062] According to the sorting rule of shard collaboration coefficient from high to low, high-frequency interaction sub-chains are extracted to generate shard collaborative optimization subsets; specifically, shards with high collaboration coefficients may have resource competition or uneven load, and need to be optimized first; for example, if the collaboration coefficients of shards A, B, and C are 0.7, 0.8, and 0.5 respectively, the high-frequency interaction sub-chain is the interaction between shards B and A.

[0063] Specifically, the sub-nodes of the high-frequency interactive sub-chains in the shard collaborative optimization subset are grouped and analyzed, and the candidate shards for reconstruction are screened based on the transaction confirmation time and resource consumption within the chain, including:

[0064] Extract the node set of the high-frequency interaction subchain and divide it into logical subgroups based on the transaction processing records of the nodes; specifically, the node set of the high-frequency interaction subchain refers to the set of nodes that participate in transactions most frequently in cross-chain interactions. Logical subgroup division is to aggregate nodes with similar functions or intensive interactions based on the transaction processing records of the nodes; for example, in the high-frequency interaction subchain, assume that there are 6 nodes (N1, N2, N3, N4, N5, N6), among which N1, N2 and N3 have a higher interaction frequency and mainly participate in the same type of transactions (such as asset transfer); therefore, N1, N2 and N3 can be divided into a logical subgroup;

[0065] Confirm the transaction confirmation time and resource consumption of the logical subgroups, and build a performance evaluation matrix; specifically, the transaction confirmation time refers to the time interval from the transaction initiation to the confirmation by the blockchain, and the resource consumption includes computing resources (such as CPU utilization) and storage resources (such as block size). These data are expressed in matrix form;

[0066] Perform multi-objective optimization evaluation on the performance evaluation matrix to screen the logical subgroups with the longest transaction confirmation time or the highest resource consumption; specifically, determine the logical subgroups that need to be optimized first through multi-objective optimization methods (such as weighted average method or Pareto optimization); for example, nodes with too long confirmation time or too high resource consumption need to be reconstructed; illustratively, in the above matrix, N3 has the longest confirmation time (200ms) and N2 has the highest computing resource consumption (50%). These two nodes may be the bottleneck of system performance and should be optimized first;

[0067] The selected logical subgroups are used as candidate shards for reconstruction; specifically, logical subgroups that meet the optimization conditions are marked as candidate shards for reconstruction for subsequent load balancing and migration solution design.

[0068] Specifically, the load status of the nodes for reconstructing candidate shards is evaluated, and the load distribution is optimized through node migration simulation and inter-chain communication prediction to form a shard migration plan, including:

[0069] Sampling and analyzing the current load status of the nodes of the reconstructed candidate shards to determine the average load and peak load of each node; specifically, the node load status includes CPU, memory usage, and network bandwidth utilization, etc. Sampling and analysis refers to regularly collecting these data to calculate the average load and peak load of the node; assuming that the CPU usage sampling data of node N1 is 40%, 50%, and 60%, its average load is 50% and its peak load is 60%;

[0070] Conduct node migration simulation to predict the overall load balancing status of the target shard after migration. Specifically, node migration simulation uses software tools to simulate the process of migrating a node from one shard to another to evaluate the load balancing effect after migration. If node N3 is migrated from shard A to shard B, the simulation results show that the load of shard A drops from 80% to 60%, while the load of shard B increases from 50% to 65%, indicating that migration helps balance the load.

[0071] Evaluate the inter-chain communication effect based on the inter-chain communication delay and cross-chain interaction frequency after migration. Specifically, the inter-chain communication effect measures the efficiency of cross-chain interaction after migration, including the delay of message transmission and the success rate of interaction. If the delay of cross-chain interaction after migration is reduced from 100ms to 80ms, and the success rate is increased by 5%, it means that the communication effect has improved.

[0072] Generate the optimal shard migration plan based on the overall load balancing status of the target shard and the inter-chain communication effect; specifically, the optimal shard migration plan is a node migration plan determined under the conditions of satisfying load balancing and improving communication efficiency; the migration plan may include migrating N2 to shard B and migrating N3 to shard C.

[0073] Specifically, the shard migration solution is applied to the target shard, the consensus protocol path between nodes is reorganized, and the optimization effect is evaluated based on real-time interaction data, including:

[0074] Execute the shard migration plan and adjust the consensus path between nodes in real time. Specifically, after executing the migration plan, it is necessary to reconfigure the consensus communication path between the migrated node and other nodes to ensure the normal processing of transactions. If node N3 is migrated to shard B, it is necessary to update the consensus participant list of N3 to the node list in shard B.

[0075] Monitor the real-time interaction data after shard migration, including the cross-chain interaction success rate and transaction processing time. Specifically, the monitoring data is used to verify the performance improvement after migration, such as whether the success rate of cross-chain interaction is improved and whether the transaction processing time is shortened. If the success rate of cross-chain interaction is increased from 90% to 95% and the transaction processing time is shortened from 200ms to 150ms after migration, it indicates that the migration effect is good.

[0076] Compare the shard performance data before and after migration to obtain the migration optimization gain and evaluate the optimization effect. Specifically, quantify the improvement effect brought by the migration by comparing the performance data before and after migration. For example, if the overall load balancing index of the shards before migration is 0.6 and increases to 0.8 after migration, it indicates that the migration optimization has brought significant benefits.

[0077] Example 2

[0078] The difference between Embodiment 2 and Embodiment 1 of the present invention is that this embodiment introduces a blockchain sharding optimization system.

[0079] Figure 2 The structural schematic diagram of a blockchain sharding optimization system according to the present invention is given. A blockchain sharding optimization system includes a sharding scheme generation module, a cooperation coefficient calculation module, a candidate shard screening module, a migration scheme generation module, and an optimization effect evaluation module;

[0080] Sharding scheme generation module: Obtain the global sharding topology of the target blockchain network, and generate an initial sharding scheme according to the network load, node distribution, and shard resource weights;

[0081] Cooperation coefficient calculation module: According to the initial sharding scheme, calculate the cooperation coefficient of each shard based on the cross-chain interaction frequency and internal node connectivity between shards, identify the cross-chain high-frequency interaction sub-chains, and generate a shard cooperation optimization subset;

[0082] Candidate shard screening module: Conduct sub-node grouping analysis on the high-frequency interaction sub-chains in the shard cooperation optimization subset, and screen to obtain reconstructed candidate shards based on the in-chain transaction confirmation time and resource consumption;

[0083] Migration scheme generation module: Evaluate the load status of the nodes of the reconstructed candidate shards, optimize the load distribution through node migration simulation and inter-chain communication prediction, and form a shard migration scheme;

[0084] Optimization effect evaluation module: Apply the shard migration scheme to the target shard, reorganize the consensus protocol path between nodes, and evaluate the optimization effect based on real-time interaction data.

[0085] The above formulas are all dimensionless and take their numerical values for calculation. The formulas are obtained by collecting a large amount of data for software simulation to get a formula closest to the real situation. The preset parameters and threshold selection in the formulas are set by those skilled in the art according to the actual situation.

[0086] The above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more collections of available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.

[0087] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or in a combination of computer software and electronic hardware. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. A professional technician can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0088] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and modules described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0089] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there can be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or modules can be in electrical, mechanical, or other forms.

[0090] The module described as a separation component may or may not be physically separated. The component shown as a module may or may not be a physical module. It may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0091] In addition, in each embodiment of this application, each functional module can be integrated into a processing module, or each module can exist physically alone, or two or more modules can be integrated into one module.

[0092] If the above-mentioned function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0093] As described above, this is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application, and all should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

[0094] Finally: The above is only the preferred embodiment of the present invention and is not used to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A blockchain sharding optimization method, characterized in that: The steps include: Obtain the global sharding topology of the target blockchain network and generate an initial sharding plan based on network load, node distribution, and sharding resource weights; According to the initial sharding plan, based on the cross-chain interaction frequency and internal node connectivity between shards, the collaboration coefficient of each shard is calculated, and the cross-chain high-frequency interaction sub-chains are identified to generate the shard collaborative optimization subset; Perform sub-node grouping analysis on the high-frequency interactive sub-chains in the shard collaborative optimization subset, and screen out candidate shards for reconstruction based on the transaction confirmation time and resource consumption within the chain; Evaluate the load status of nodes for reconstructing candidate shards, optimize load distribution through node migration simulation and inter-chain communication prediction, and form a shard migration plan; Apply the shard migration solution to the target shard, reorganize the consensus protocol path between nodes, and evaluate the optimization effect based on real-time interaction data.

2. A blockchain sharding optimization method according to claim 1, characterized in that: Obtain the global sharding topology of the target blockchain network, and generate an initial sharding plan based on network load, node distribution, and sharding resource weights, specifically: Based on the real-time load data of all shards in the target blockchain network, the average processing capacity of each shard is evaluated; Generate a resource distribution matrix based on the geographical distribution, hardware performance, and on-chain resource utilization of each node in the shard; The resource distribution matrix is ​​weighted normalized and an initial sharding partitioning scheme is generated based on sharding performance differences.

3. A blockchain sharding optimization method according to claim 2, characterized in that: According to the initial sharding scheme, based on the cross-chain interaction frequency and internal node connectivity between shards, the collaboration coefficient of each shard is calculated, and the cross-chain high-frequency interaction sub-chains are identified to generate the shard collaborative optimization subset, specifically: Divide the cross-chain interaction data between shards into time windows to generate the cross-chain interaction frequency matrix between shards; Build an internal connectivity model for each shard based on the communication links and message delivery delays between nodes; Combine the cross-chain interaction frequency matrix and connectivity model to calculate the shard collaboration coefficient; According to the sorting rule of shard collaboration coefficient from high to low, high-frequency interaction sub-chains are extracted to generate shard collaboration optimization subsets.

4. A blockchain sharding optimization method according to claim 3, characterized in that: The high-frequency interactive sub-chains in the shard collaborative optimization subset are analyzed by sub-node grouping. Based on the transaction confirmation time and resource consumption within the chain, the candidate shards for reconstruction are screened, specifically: Extract the node set of high-frequency interactive sub-chains and divide them into logical sub-groups based on the transaction records of the nodes; Confirm the transaction confirmation time and resource consumption of the logical subgroups and build a performance evaluation matrix; Perform multi-objective optimization evaluation on the performance evaluation matrix to screen out logical subgroups with the longest transaction confirmation time or the highest resource consumption; The selected logical subgroups are used as candidate shards for reconstruction.

5. A blockchain sharding optimization method according to claim 4, characterized in that: Evaluate the load status of nodes for reconstructing candidate shards, optimize load distribution through node migration simulation and inter-chain communication prediction, and form a shard migration plan, specifically: Sampling and analyzing the current load status of nodes for reconstruction candidate shards to determine the average load and peak load of each node; Perform node migration simulation to predict the overall load balance status of the target shard after migration; Evaluate the inter-chain communication effect based on the inter-chain communication latency and cross-chain interaction frequency after migration; Generate the optimal shard migration plan based on the overall load balancing status of the target shard and the inter-chain communication effect.

6. A blockchain sharding optimization method according to claim 5, characterized in that: Apply the shard migration solution to the target shard, reorganize the consensus protocol path between nodes, and evaluate the optimization effect based on real-time interaction data. Specifically: Execute shard migration plan and adjust the consensus path between nodes in real time; Monitor real-time interaction data after shard migration, including cross-chain interaction success rate and transaction processing time; Compare the shard performance data before and after migration to obtain the migration optimization gain and evaluate the optimization effect.

7. A blockchain sharding optimization system, used to implement a blockchain sharding optimization method according to any one of claims 1 to 6, characterized in that: It includes a sharding scheme generation module, a collaboration coefficient calculation module, a candidate sharding screening module, a migration scheme generation module, and an optimization effect evaluation module; Sharding plan generation module: obtains the global sharding topology of the target blockchain network and generates an initial sharding plan based on network load, node distribution, and sharding resource weight; Collaboration coefficient calculation module: According to the initial sharding plan, based on the cross-chain interaction frequency and internal node connectivity between shards, the collaboration coefficient of each shard is calculated, and the cross-chain high-frequency interaction sub-chains are identified to generate the shard collaborative optimization subset; Candidate shard screening module: performs sub-node grouping analysis on the high-frequency interactive sub-chains in the shard collaborative optimization subset, and screens out candidate shards for reconstruction based on the transaction confirmation time and resource consumption within the chain; Migration plan generation module: evaluates the load status of nodes for reconstructing candidate shards, optimizes load distribution through node migration simulation and inter-chain communication prediction, and forms a shard migration plan; Optimization effect evaluation module: applies the shard migration solution to the target shard, reorganizes the consensus protocol path between nodes, and evaluates the optimization effect based on real-time interaction data.

Citation Information

Cited By

  • Resource replacement method and device based on block chain, equipment and storage medium

    CN120692278A

  • Block chain fragment optimization method and device, electronic equipment and readable storage medium

    CN120935191A

  • Power transmission line monitoring data disaster recovery method and system

    CN121144115A

  • Improved verification cross-chain query method based on block chain

    CN121901311A

  • An improved verification cross-chain query method based on blockchain

    CN121901311B