Public chain sharding method and system based on graph partition algorithm

By using a graph partitioning algorithm in the blockchain system to divide the transaction graph into several non-overlapping transaction subgraphs, the problem of excessive cross-shard transactions during blockchain sharding is solved, achieving load balancing and performance improvement.

CN117389741BActive Publication Date: 2026-06-19SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN
Filing Date
2023-11-09
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Blockchain systems suffer from high communication overhead, load imbalance, and low transaction efficiency due to excessive cross-shard transactions during the sharding process, making it difficult to meet the needs of high-frequency transactions.

Method used

A sharding method based on graph partitioning algorithm is adopted. The transaction graph is constructed by collecting transaction information in real time through the main shard, and the improved LDG algorithm is used to divide it into several non-overlapping transaction subgraphs to achieve load balancing and transaction optimization.

Benefits of technology

It effectively reduces cross-shard transactions, improves the transaction performance and load balancing of the blockchain system, and enhances the system's availability and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117389741B_ABST
    Figure CN117389741B_ABST
Patent Text Reader

Abstract

This invention discloses a public blockchain sharding method and system based on a graph partitioning algorithm. The method includes: setting up a main shard and several ordinary shards for the public blockchain; the main shard collects account and transaction information from all ordinary shards in real time, using accounts as vertices and transactions as connecting edges between vertices to create a complete transaction graph; the main shard uses a graph partitioning algorithm to partition the complete transaction graph into several non-overlapping transaction subgraphs; the main shard outputs the final partitioning result, resulting in several transaction subgraphs, each of which is considered a sharding graph; the main shard reaches a consensus on the sharding result and broadcasts the sharding graph to all ordinary shards; at the start of a new period, the ordinary shards verify the sharding graph broadcast by the main shard; after successful verification, each ordinary shard updates its own account information according to the sharding graph, and each account is transferred to the sharding graph, with the updated state synchronized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, and in particular to a public blockchain sharding method and system based on graph partitioning algorithms. Background Technology

[0002] The statements in this section merely refer to the background art related to this invention and do not necessarily constitute prior art.

[0003] Blockchain is the underlying technology of Bitcoin. It integrates peer-to-peer networks, distributed data storage, cryptography, distributed consensus mechanisms, and smart contracts to construct a new distributed application model with key characteristics such as decentralization, data immutability, collaborative operation, and anonymity and privacy protection. As a cornerstone of the digital economy, blockchain is currently widely used in finance, supply chain management, digital copyright protection, the Internet of Things, smart manufacturing, and digital asset trading, providing strong support for digital transformation.

[0004] Currently, some technical bottlenecks in blockchain technology are most prominent in areas such as performance and scalability. For example, Bitcoin's throughput is only 7 transactions per second, and Ethereum's throughput is only a dozen transactions per second, far below the performance requirements of industrial-grade applications and unable to meet the needs of high-frequency trading applications. These performance bottlenecks severely hinder the large-scale application of blockchain in the development of the digital economy.

[0005] To address the performance and scalability issues of blockchain, researchers have proposed various technical solutions, including the Lightning Network, Directed Acyclic Graph (DAG) technology, state channels, and sharding mechanisms. Among these, sharding is a promising on-chain scaling technology that effectively improves blockchain scalability while maintaining high decentralization. Sharding divides the blockchain network into several sub-networks (shards), each shard comprising a subset of blockchain nodes. Transactions in the network are distributed across these shards for processing. Multiple shards can execute and verify transactions in parallel, thereby significantly enhancing the transaction processing capacity of the blockchain system.

[0006] Currently, sharding faces several challenges. First, a large number of asynchronous cross-shard transactions increase communication costs. Cross-shard transactions require at least two shards to execute, and their transaction processing logic is much more complex than intra-shard transactions. The transaction process includes not only transaction output and input to shards but also cross-shard synchronization of transaction states, thus making it slower than intra-shard transactions. As the number of shards increases, so do the number of cross-shard transactions. Excessive cross-shard transactions result in significant cross-shard communication overhead, offering limited improvement to system performance. Second, inter-shard load imbalance affects transaction efficiency. Shards with excessive transaction volume experience transaction congestion, leading to transaction confirmation delays; while shards with insufficient transactions waste computing power, bandwidth, and other resources. Summary of the Invention

[0007] To improve the transaction performance of sharded blockchain systems, this invention provides a public blockchain sharding method and system based on graph partitioning algorithms. By partitioning the transaction graph, workload balancing between shards is achieved, cross-shard transactions are reduced, and the availability of the blockchain system is improved.

[0008] On the one hand, it provides a public blockchain sharding method based on graph partitioning algorithms;

[0009] Public blockchain sharding methods based on graph partitioning algorithms include:

[0010] A public blockchain is configured with a main shard and several ordinary shards. The main shard includes several blockchain nodes and is used to implement sharding. The ordinary shards also include several blockchain nodes and are used to process transaction tasks. Each blockchain node has an account.

[0011] The main shard collects account and transaction information from all ordinary shards in real time, using accounts as vertices and transactions as connecting edges between vertices to create a complete transaction graph.

[0012] The main partitioning uses a graph partitioning algorithm to divide the complete transaction graph into several non-overlapping transaction subgraphs. During the partitioning process, the transactions within each transaction subgraph are balanced, and the number of transactions between each transaction subgraph is minimized.

[0013] The primary shard outputs the final partitioning result, resulting in several transaction subgraphs, each of which is considered a shard graph. The primary shard reaches a consensus on the sharding result and broadcasts the shard graph to all ordinary shards.

[0014] At the start of a new period, ordinary shards verify the sharding graph broadcast by the main shard. Once the verification is successful, the ordinary shards update their own account information based on the sharding graph, and each account is transferred to the sharding graph and synchronized with the updated status.

[0015] On the other hand, it provides a public blockchain sharding system based on graph partitioning algorithms;

[0016] A public blockchain sharding system based on graph partitioning algorithms, including: blockchain;

[0017] A public blockchain is configured with a main shard and several ordinary shards. The main shard includes several blockchain nodes and is used to implement sharding. The ordinary shards also include several blockchain nodes and are used to process transaction tasks. Each blockchain node has an account.

[0018] The main shard collects account and transaction information from all ordinary shards in real time, using accounts as vertices and transactions as connecting edges between vertices to create a complete transaction graph.

[0019] The main partitioning uses a graph partitioning algorithm to divide the complete transaction graph into several non-overlapping transaction subgraphs. During the partitioning process, the transactions within each transaction subgraph are balanced, and the number of transactions between each transaction subgraph is minimized.

[0020] The primary shard outputs the final partitioning result, resulting in several transaction subgraphs, each of which is considered a shard graph. The primary shard reaches a consensus on the sharding result and broadcasts the shard graph to all ordinary shards.

[0021] At the start of a new period, ordinary shards verify the sharding graph broadcast by the main shard. Once the verification is successful, the ordinary shards update their own account information based on the sharding graph, and each account is transferred to the sharding graph and synchronized with the updated status.

[0022] The above technical solution has the following advantages or beneficial effects:

[0023] 1. New nodes join the blockchain shard by solving the Proof-of-Work (PoW) hash problem and establish a unique on-chain node identity, effectively defending against Sybil attacks and ensuring the security of the blockchain system.

[0024] 2. To address the issue that the LDG (Linear Deterministic Greedy partitioning) algorithm cannot solve the transaction load balancing problem in sharded blockchain systems, this invention improves the LDG graph partitioning algorithm, thereby achieving transaction load balancing in sharded blockchain systems.

[0025] 3. This invention transforms the sharding problem into a graph partitioning problem by starting with the transaction allocation method, and proposes an efficient public chain sharding method based on graph partitioning algorithm load balancing. This method dynamically shards the blockchain system, breaking away from the traditional static sharding approach and solving the problem of excessive cross-shard transactions in existing blockchain sharding methods. By setting shard load thresholds, the transaction load within shards is effectively balanced, thereby improving the performance of the blockchain system.

[0026] 4. This invention establishes a dedicated master shard for blockchain sharding, which improves the sharding efficiency and security of the blockchain system compared to traditional fixed random sharding, and balances the transaction processing burden of ordinary shards. Attached Figure Description

[0027] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0028] Figure 1 This is a schematic diagram illustrating the graph-based partitioning algorithm construction of Embodiment 1 of this application;

[0029] Figure 2 This is a transaction diagram from Embodiment 1 of this application;

[0030] Figure 3 This is a schematic diagram of the public blockchain sharding process in Embodiment 1 of this application. Detailed Implementation

[0031] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0032] Terminology Explanation:

[0033] PoW, or Proof of Work, is a commonly used consensus mechanism in public blockchains. Nodes compete for the right to record transactions by calculating the numerical solution of a random hash and receive corresponding rewards.

[0034] VRF, or Verifiable Random Function, is a verifiable random function that does not expose a seed. It has advantages such as randomness, unpredictability, and verifiability.

[0035] PBFT, Practical Byzantine Fault Tolerance, is a distributed system consensus algorithm that can tolerate Byzantine faults.

[0036] LDG, or Linear Deterministic Greedy, is an algorithm that attempts to place adjacent vertices into the same partition to reduce edge cuts. It assigns a vertex to the partition containing the majority of its neighbors while satisfying capacity constraints.

[0037] Example 1

[0038] This embodiment provides a public chain sharding method based on a graph partitioning algorithm;

[0039] like Figure 1 As shown, the public chain sharding method based on graph partitioning algorithm includes:

[0040] S101: Set up a main shard and several ordinary shards for the public chain of the blockchain. The main shard includes several blockchain nodes and is used to implement sharding. The ordinary shards include several blockchain nodes and are used to process transaction tasks. Each blockchain node has an account.

[0041] S102: The main shard collects account and transaction information from all ordinary shards in real time, using accounts as vertices and transactions as connecting edges between vertices to create a complete transaction graph;

[0042] S103: The main partitioning uses a graph partitioning algorithm to divide the complete transaction graph into several non-overlapping transaction subgraphs. During the partitioning process, the transactions within each transaction subgraph are balanced, and the number of transactions between each transaction subgraph is minimized.

[0043] S104: The primary shard outputs the final partitioning result, resulting in several transaction subgraphs, each of which is considered a shard graph; the primary shard reaches a consensus on the sharding result and broadcasts the shard graph to all ordinary shards;

[0044] S105: At the start of a new period, ordinary shards verify the sharding graph broadcast by the main shard. After successful verification, ordinary shards update their own account information according to the sharding graph, and each account is transferred to the sharding graph. The ordinary shards then synchronize and update their status.

[0045] Furthermore, S101: setting up a primary shard and several ordinary shards for the blockchain, specifically including:

[0046] Blockchain nodes that meet the constraints can choose to join either the primary shard or a regular shard; blockchain nodes that do not meet the constraints will continue to search for random values ​​that satisfy the constraints until the constraints are met.

[0047] The constraint is that each blockchain node needs to find a valid random value (Nonce) that satisfies the following constraints:

[0048]

[0049] Output=H(ER||IP||PK||Type||Nonce);

[0050] Where IP and PK represent the node's IP address and public key, respectively, parameter γ is the bit length of the random output of the hash function H(·), and D Type It represents the computing power of the blockchain node; Type indicates the shard type to which the node joins; ER indicates epoch randomness; and || indicates taking the union of sets.

[0051]

[0052]

[0053] Where D0 represents the hash rate, D0 ensures that nodes joining the primary shard have strong computing power while also limiting the number of nodes that can join the primary shard.

[0054] It should be noted that adding a primary shard is more difficult than adding a regular shard.

[0055] For example, new nodes can freely choose to join either the main shard or a regular shard. To defend against Sybil attacks, nodes join the blockchain by solving a Proof-of-Work (PoW) hash puzzle and establishing a unique on-chain node identity. Blockchain nodes that meet the constraints are added to a shard; for those that do not, the search continues for a random value that does meet the constraints.

[0056] Furthermore, such as Figure 2 As shown, step S102 involves the main shard collecting account and transaction information from all ordinary shards in real time, using accounts as vertices and transactions as connecting edges between vertices to create a complete transaction graph. Specifically, this includes:

[0057] By treating accounts as vertices, transactions as edges connecting vertices, and the number of transactions as the weights of the edges, a complete transaction graph can be obtained.

[0058] For example, the primary shard creates a transaction graph by monitoring the account and transaction information of all ordinary shards and the pending transactions in the transaction pool. In the graph, vertices represent the accounts of blockchain nodes, edges represent transactions between two accounts, and the number of edges represents the number of transactions between accounts.

[0059] Furthermore, such as Figure 3As shown, in step S103: the main partitioning uses a graph partitioning algorithm to divide the complete transaction graph into several disjoint transaction subgraphs. During the partitioning process, the transactions within each transaction subgraph are balanced, and the number of transactions between each transaction subgraph is minimized. The graph partitioning algorithm includes:

[0060] S103-1: The primary shard assigns an initial shard number to each account based on the shard number of the account it is currently in, and stores the initial shard number in the shard mapping; the shard number is used to identify different shards; the shard mapping is used to store the one-to-one correspondence between account numbers and the shard numbers of the accounts.

[0061] S103-2: The main shard traverses the complete transaction graph for each account and each account's neighbors, calls the target function, calculates the function value of each account to the shard where its neighbor is located, selects the shard where the neighbor node with the largest function value is located as the target shard for each account, and updates the shard mapping; the shard mapping is updated to: a one-to-one correspondence between account number and target shard number;

[0062] S103-3: Repeat step S103-2 until the maximum number of iterations is reached. After each update iteration, accounts with the same target shard number are assigned to the same shard to obtain the sharding result.

[0063] Further, S103-2: The main shard traverses the complete transaction graph for each account and each account's neighbors, calls the target function, and calculates the function value for each account to be assigned to the shard where its neighbors are located. Specifically, this includes:

[0064] The main shard traverses each account and its neighbors in the transaction graph, and calls the objective function f(v,i) to calculate the function value of account v assigned to the shard i where its neighbor is located. The objective function f(v,i) is defined as follows:

[0065] f(v,i)=|E i ∩E(v)|g(i);

[0066]

[0067]

[0068] Where v represents the account being partitioned, E(v) represents the edge set between the account and its neighbors, i is the ID identifier of partition i, and E i Represents the edge set of partition i, including edges within the partition and edges across partitions;

[0069] The algorithm computes a function value f(v,i) for account v in each slice i. The objective function f(v,i) consists of two parts, |Ei ∩E(v)| represents the number of edges between account v and its neighbors in partition i, where |E i The larger the value of ∩E(v)|, the fewer cross-shard transactions will be generated when v is divided into shard i;

[0070] g(i) represents the number of transactions that shard i can accommodate in a balanced state. It is also a constraint on the transaction load of the shard. The more transactions a shard has, the fewer transactions it can accommodate and the greater the penalty it will receive.

[0071] C represents the maximum number of transactions per shard, β is an adjustable parameter set by the user, E represents the total number of transactions across all shards, and S represents the number of shards.

[0072] The objective function f(v,i) represents the optimization score of account v in shard i.

[0073] If there are multiple maximum function values, then the partition containing the neighbor node of the maximum value is randomly selected as the target partition.

[0074] Further, S103-3: Assigning accounts with the same target shard number to the same shard to obtain the sharding result includes: after each update iteration, assigning accounts with the same target shard number to the same shard to obtain S shards.

[0075] Understandably, based on the collected information and the constructed transaction graph, the primary shard executes a graph partitioning algorithm. The primary shard uses an improved LDG algorithm to analyze the transaction graph, identifying several disjoint transaction subgraphs that minimize the balance of transactions within each subgraph and the overall transaction volume between subgraphs. These subgraphs will serve as candidates for the next period's ordinary sharding. The specific execution steps of the graph partitioning algorithm are as follows: the algorithm takes the transaction graph G(V,E) and the maximum number of iterations t0 as input, and the sharding mapping as output.

[0076] Furthermore, in S104: the primary shard reaches a consensus on the sharding results and broadcasts the sharding graph to all ordinary shards. The specific process of reaching a consensus includes:

[0077] Each node in the main shard verifies the sharding result generated by the graph partitioning algorithm. If the verification is successful, it votes for the result; if the verification fails, it votes against the result. Finally, a consensus is reached based on the principle of majority rule.

[0078] Furthermore, in S105: at the start of a new period, the ordinary fragment verifies the fragmentation diagram of the main fragment broadcast. The specific verification process includes:

[0079] In a normal shard, the nodes verify the shard mapping of the shard graph broadcast by the main shard. If the target shard number corresponds one-to-one with the account number, the verification passes; otherwise, the verification fails.

[0080] Further, in S105: each ordinary shard updates its own account information according to the sharding graph, each account is transferred to the sharding graph, and the synchronized updated state of each ordinary shard specifically includes:

[0081] Each ordinary shard updates its own account information according to the one-to-one mapping relationship between account number and shard number in the sharding graph; the account information includes: account ID, shard number, and balance;

[0082] Each account is transferred to the sharding graph, and the status of each ordinary shard is synchronized and updated.

[0083] This invention supports efficient and balanced sharding of public blockchains based on an account model. Specifically, it includes: new nodes joining the blockchain by solving a Proof-of-Work (PoW) hashing problem and establishing a unique on-chain node identity. A primary shard and several ordinary shards are set up. The primary shard is used for sharding, and its consensus node is randomly selected via VRF. Ordinary shards are used to process transaction tasks. The primary shard continuously obtains account and transaction information from ordinary shards and the transaction pool, constructing a transaction graph. A graph partitioning algorithm is executed to divide the transaction graph into several non-overlapping transaction subgraphs, and accounts and transactions are assigned to designated shards, forming a complete sharding graph. At the start of a new cycle, ordinary shards execute the sharding graph, perform shard reorganization, and update their own shard's account and transaction information. This invention effectively balances the workload between shards and reduces cross-shard transactions.

[0084] The blockchain described in this invention sets up a primary shard and several ordinary shards. The primary shard is used for sharding, and the ordinary shards are used for processing transaction tasks. Each epoch constructs a new sharding graph for the next epoch. At the beginning of a new epoch, the shards are first reorganized according to the sharding graph.

[0085] Example 2

[0086] This embodiment provides a public blockchain sharding system based on a graph partitioning algorithm;

[0087] A public blockchain sharding system based on graph partitioning algorithms, including: blockchain;

[0088] The blockchain is configured with a main shard and several ordinary shards. The main shard includes several blockchain nodes and is used to implement sharding. The ordinary shards also include several blockchain nodes and are used to process transaction tasks. Each blockchain node has an account.

[0089] The main shard collects account and transaction information from all ordinary shards in real time, using accounts as vertices and transactions as connecting edges between vertices to create a complete transaction graph.

[0090] The main partitioning uses a graph partitioning algorithm to divide the complete transaction graph into several non-overlapping transaction subgraphs. During the partitioning process, the transactions within each transaction subgraph are balanced, and the number of transactions between each transaction subgraph is minimized.

[0091] The primary shard outputs the final partitioning result, resulting in several transaction subgraphs, each of which is considered a shard graph. The primary shard reaches a consensus on the sharding result and broadcasts the shard graph to all ordinary shards.

[0092] At the start of a new period, ordinary shards verify the sharding graph broadcast by the main shard. Once the verification is successful, the ordinary shards update their own account information based on the sharding graph, and each account is transferred to the sharding graph and synchronized with the updated status.

[0093] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A public chain sharding method based on graph partitioning algorithm, characterized by: include: A public blockchain is configured with a main shard and several ordinary shards. The main shard includes several blockchain nodes and is used to implement sharding. The ordinary shards also include several blockchain nodes and are used to process transaction tasks. Each blockchain node has an account. The main shard collects account and transaction information from all ordinary shards in real time, using accounts as vertices and transactions as connecting edges between vertices to create a complete transaction graph. The main partitioning uses a graph partitioning algorithm to divide the complete transaction graph into several non-overlapping transaction subgraphs. During the partitioning process, the transactions within each transaction subgraph are balanced, and the number of transactions between each transaction subgraph is minimized. The graph partitioning algorithms include: The primary shard assigns an initial shard number to each account based on the shard number it currently belongs to, and stores the initial shard number in the shard mapping; the shard number is used to identify different shards; the shard mapping is used to store the one-to-one correspondence between account numbers and the shard numbers of the accounts. The main shard traverses each account and each account's neighbors in the complete transaction graph, calls the target function, calculates the function value of each account to the shard where its neighbor is located, selects the shard where the neighbor node with the largest function value is located as the target shard for each account, and updates the shard mapping; the shard mapping is updated to: a one-to-one correspondence between account number and target shard number; Repeat the previous step until the maximum number of iterations is reached. After each update iteration, assign accounts with the same target shard number to the same shard to obtain the sharding result. The primary shard outputs the final partitioning result, resulting in several transaction subgraphs, each of which is considered a shard graph. The primary shard reaches a consensus on the sharding result and broadcasts the shard graph to all ordinary shards. At the start of a new era, ordinary shards verify the sharding graph broadcast by the main shard. Once the verification is successful, each ordinary shard updates its own account information according to the sharding graph, and each account is transferred to the sharding graph and synchronized with the updated status.

2. The public chain sharding method based on graph partitioning algorithm as described in claim 1, characterized in that, the main... Sharding collects account and transaction information from all ordinary shards in real time, using accounts as vertices and transactions as edges connecting the vertices to create a complete transaction graph. Specifically, this involves using accounts as vertices, transactions as edges connecting the vertices, and the number of transactions as the weights of the edges to obtain the complete transaction graph.

3. The public chain sharding method based on graph partitioning algorithm as described in claim 1, characterized in that, the main... The process involves traversing the complete transaction graph by shard, examining each account and its neighbors, calling the target function, and calculating the function value for each account to be assigned to the shard containing its neighbors. Specifically, this includes: The main shard iterates through each account and its neighbors in the transaction graph, and then calls the target function. Calculate the function value of account v assigned to the partition i where the neighbor is located, where the objective function is... The definition is as follows: ; ; ; Where v represents the account being partitioned, E(v) represents the edge set between the account and its neighbors, i is the ID identifier of partition i, and E i Represents the edge set of partition i, including edges within the partition and edges across partitions; The algorithm is executed to compute a function value for account v in each slice i. objective function It consists of two parts. This represents the number of edges between account v and its neighbors in partition i. The larger the value, the fewer cross-shard transactions will be generated when v is divided into shard i; This represents the number of transactions that shard i can accommodate in a balanced state. It also serves as a constraint on the transaction load of the shard. The more transactions a shard has, the fewer transactions it can accommodate and the greater the penalty it will receive. This represents the maximum number of transactions per shard, where β is an adjustable parameter set by the user. This represents the number of transactions across all shards. Indicates the number of partitions; objective function This represents the optimization score of account v in shard i.

4. The public chain sharding method based on graph partitioning algorithm as described in claim 1, characterized in that, Accounts with the same target shard number are grouped into the same shard to obtain the sharding result. This includes: after each update iteration, accounts with the same target shard number are grouped into the same shard to obtain... Each segment.

5. The public chain sharding method based on graph partitioning algorithm as described in claim 1, characterized in that, The primary shard reaches a consensus on the sharding results and broadcasts the sharded graph to all ordinary shards. The specific process of reaching a consensus includes: each node in the primary shard verifies the sharding results generated by the graph partitioning algorithm. If the verification is successful, it votes in favor of the result; if the verification fails, it votes against the result. Finally, a consensus is reached based on the principle of majority rule.

6. The public chain sharding method based on graph partitioning algorithm as described in claim 1, characterized in that, At the start of a new era, ordinary fragments verify the fragmentation graph of the main fragment broadcast. The specific verification process includes: In a normal shard, the nodes verify the shard mapping of the shard graph broadcast by the main shard. If the target shard number corresponds one-to-one with the account number, the verification passes; otherwise, the verification fails.

7. The public chain sharding method based on graph partitioning algorithm as described in claim 1, characterized in that, Each ordinary shard updates its own account information according to the sharding graph. After each account is transferred to the sharding graph, the state of each ordinary shard is synchronized and updated. Specifically, each ordinary shard updates its own account information according to the one-to-one mapping relationship between account number and shard number in the sharding graph. The account information includes: account ID, shard number, and balance. After each account is transferred to the sharding graph, the state of each ordinary shard is synchronized and updated.

8. The public chain sharding method based on graph partitioning algorithm as described in claim 1, characterized in that, Each period builds a new slice map for the next period.

9. A public blockchain sharding system based on a graph partitioning algorithm, characterized by: include: Blockchain; A public blockchain is configured with a main shard and several ordinary shards. The main shard includes several blockchain nodes and is used to implement sharding. The ordinary shards also include several blockchain nodes and are used to process transaction tasks. Each blockchain node has an account. The main shard collects account and transaction information from all ordinary shards in real time, using accounts as vertices and transactions as connecting edges between vertices to create a complete transaction graph. The main partitioning uses a graph partitioning algorithm to divide the complete transaction graph into several non-overlapping transaction subgraphs. During the partitioning process, the transactions within each transaction subgraph are balanced, and the number of transactions between each transaction subgraph is minimized. The graph partitioning algorithms include: The primary shard assigns an initial shard number to each account based on the shard number it currently belongs to, and stores the initial shard number in the shard mapping; the shard number is used to identify different shards; the shard mapping is used to store the one-to-one correspondence between account numbers and the shard numbers of the accounts. The main shard traverses each account and each account's neighbors in the complete transaction graph, calls the target function, calculates the function value of each account to the shard where its neighbor is located, selects the shard where the neighbor node with the largest function value is located as the target shard for each account, and updates the shard mapping; the shard mapping is updated to: a one-to-one correspondence between account number and target shard number; Repeat the previous step until the maximum number of iterations is reached. After each update iteration, assign accounts with the same target shard number to the same shard to obtain the sharding result. The primary shard outputs the final partitioning result, resulting in several transaction subgraphs, each of which is considered a shard graph. The primary shard reaches a consensus on the sharding result and broadcasts the shard graph to all ordinary shards. At the start of a new era, ordinary shards verify the sharding graph broadcast by the main shard. Once the verification is successful, each ordinary shard updates its own account information according to the sharding graph, and each account is transferred to the sharding graph and synchronized with the updated status.