Fragmentation recombination method based on evolutionary game and related equipment

By employing an evolutionary game-based sharding and reassembly method, utilizing verifiable random functions and a practical Byzantine fault-tolerant integral consensus protocol to handle transactions, and combining the sharding and reassembly evolutionary game algorithm, the problems of prolonged reassembly time and high communication overhead in blockchain sharding protocols are solved, thereby improving the system's efficiency and security.

CN121644048AActive Publication Date: 2026-03-10GUANGZHOU UNIVERSITY
View PDF 7 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing blockchain sharding protocols suffer from issues such as prolonged reconfiguration time, high communication overhead, and low resistance to attacks when sharding nodes are reconfigured, which affect system operating efficiency and security.

Method used

An evolutionary game-based fragmentation and reorganization method is adopted. Nodes are randomly assigned through a verifiable random function. A practical Byzantine fault-tolerant integral consensus protocol is used to process transactions and reward fragmented nodes. Accumulated and sorted integrals are combined with a fragmentation and reorganization evolutionary game algorithm to switch nodes between fragments and reach a Nash equilibrium state.

Benefits of technology

It improves the operating efficiency and security of the blockchain sharding system, optimizes throughput, and ensures system stability and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121644048A_ABST
    Figure CN121644048A_ABST
Patent Text Reader

Abstract

The invention discloses an evolutionary game-based fragment recombination method and related equipment, and the method comprises the steps: randomly distributing a target node in a block chain fragment system to a plurality of initial fragments, and obtaining fragment nodes; a practical Byzantine fault-tolerant integral consensus protocol is adopted to carry out processing and reward distribution on the target transaction to obtain a transaction integral; after the initial fragment is submitted to the block, accumulating transaction points of the fragment nodes to obtain first accumulated points of the fragment nodes; deleting the fragment nodes with the maximum and minimum first accumulative integrals to obtain first residual nodes and second accumulative integrals of the first residual nodes; and when the extreme value difference of the second accumulated integral is greater than a preset threshold value and the distribution of the second accumulated integral is in an aggregation state, performing node switching fragmentation operation between the initial fragments through a fragment recombination evolutionary game algorithm to obtain a target fragment. The operation efficiency and safety of the block chain fragmentation system can be improved, and the method can be widely applied to the technical field of block chain fragmentation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain sharding technology, and in particular to a sharding and reorganization method and related equipment based on evolutionary game theory. Background Technology

[0002] Node configuration is the cornerstone and key to enabling parallel transaction processing in a blockchain sharding system. The allocation of nodes in a blockchain system needs to consider three aspects: randomness, activity, and unbiasedness. The core function of sharding node configuration or reconfiguration is to use random numbers to achieve randomness in node allocation. The selected random numbers need to satisfy three attributes: availability, unpredictability, and verifiability. Only sharding configuration methods that meet these conditions can ensure that malicious nodes do not simultaneously gather in a single shard, causing shard failure. It also ensures that nodes do not have the right to autonomously choose their allocation addresses and that the entire allocation process is not subject to any external interference or influence. However, in most mainstream blockchain sharding protocols, the initial node configuration schemes generally meet these three attributes, thus exhibiting good configuration performance. However, in their sharding node reconfiguration schemes, issues such as prolonged shard reassembly, excessive communication overhead, or low resistance to attacks affect the operational efficiency and security of the blockchain sharding system. Summary of the Invention

[0003] In view of this, the main objective of the embodiments of the present invention is to provide a sharding and reorganization method and related equipment based on evolutionary game theory, in order to solve at least one of the problems of the prior art. The present invention can improve the operating efficiency and security of the blockchain sharding system.

[0004] To achieve the above objectives, one aspect of the present invention provides a fragmentation and recombination method based on evolutionary game theory, the method comprising: By using a verifiable random function, the target node in the blockchain sharding system is randomly assigned to multiple initial shards to obtain sharded nodes; In the initial sharding, a practical Byzantine fault-tolerant integral consensus protocol is used to process and distribute rewards for several target transactions, thereby obtaining several transaction integrals for the sharding nodes; After the initial shard commits a block, the transaction score of the shard node is accumulated to obtain the first accumulated score of the shard node; Sort the first cumulative integrals of all the nodes in the initial partition, delete the partition node with the largest first cumulative integral, and delete the partition node with the smallest first cumulative integral to obtain the first remaining node and the second cumulative integral of the first remaining node. Within the initial partition, when the difference between the maximum and minimum values ​​of the second cumulative integral is greater than a preset threshold, and the distribution of the second cumulative integral is clustered, a partitioning and reorganization evolutionary game algorithm is used to perform node switching partitioning operations between the initial partitions to obtain the target partition.

[0005] In some embodiments, the initial sharding employs a practical Byzantine fault-tolerant integral consensus protocol to process and allocate rewards for several target transactions, obtaining several transaction integrals for the sharding nodes, including the following steps: Allocate an equal total score to each of the target transactions; The target transaction is processed to obtain the consensus behavior of each shard node; Based on the points rules and the total points, a reward is allocated for each consensus action to obtain the transaction points of the shard node.

[0006] In some embodiments, the step of allocating rewards to each consensus action based on the points rules and the total points to obtain the transaction points of the shard node includes the following steps: The total score is evenly distributed based on the number of nodes in the initial partition to obtain the base score; Rewards are allocated to the shard nodes according to the points rules and consensus behavior to obtain reward points; The transaction points are obtained based on the base points and the reward points.

[0007] In some embodiments, in the initial sharding, a practical Byzantine fault-tolerant integral consensus protocol is used to process and allocate rewards for several target transactions to obtain several transaction integrals for the sharding nodes. The formula used includes: ; In the formula, Indicates the first The transaction integral of each shard node; This represents the base integral for each shard node; Indicates the number of malicious nodes; This indicates the total number of shard nodes within the initial shard; Indicates cost integral; Indicates penalty points; This indicates the first shard node to send a preparation message.

[0008] In some embodiments, the step of obtaining the target fragment by performing node switching fragmentation operations between the initial fragments through a fragmentation and reorganization evolutionary game algorithm includes the following steps: Using the shard nodes within the current initial shard, randomly select a neighboring initial shard as the neighboring shard; Obtain the third cumulative score of the shard node in the last committed block; Obtain the fourth cumulative score of the second remaining node in the neighboring shard in the last committed block; The average block reward is obtained by averaging all the fourth cumulative scores. The third cumulative integral and the average block reward are compared, and the switching probability is obtained through the Fermi function. Update the game strategy based on the switching probability; Based on the updated game strategy, node switching operations are performed between the initial fragments to obtain the target fragment.

[0009] In some embodiments, the step of obtaining the target fragment by performing node switching fragmentation operations between the initial fragments through a fragmentation and reorganization evolutionary game algorithm includes the following steps: After performing node switching operations between the initial shards, it is determined whether the blockchain sharding system has reached a Nash equilibrium state. If the blockchain sharding system has not reached the Nash equilibrium state, the step of randomly selecting a neighboring initial shard as the neighbor shard through the target node in the current initial shard is returned. If the blockchain sharding system has reached the Nash equilibrium state, the target shard is obtained.

[0010] To achieve the above objectives, another aspect of this invention proposes a fragmentation and recombination device based on evolutionary game theory, the device comprising: The node allocation module is used to randomly allocate target nodes in the blockchain sharding system to multiple initial shards using a verifiable random function, thereby obtaining sharded nodes; The first revenue acquisition module is used to process and distribute rewards for several target transactions in the initial shard using a practical Byzantine fault-tolerant integral consensus protocol, thereby obtaining several transaction points for the shard node. The second revenue acquisition module is used to accumulate the transaction points of the shard nodes after the initial shard commits the block, and obtain the first accumulated points of the shard nodes. The third revenue acquisition module is used to sort the first cumulative points of all the shard nodes in the initial shard, delete the shard node with the largest first cumulative point, and delete the shard node with the smallest first cumulative point, to obtain the first remaining node and the second cumulative points of the first remaining node. The fragmentation and reorganization module is used to perform node switching fragmentation operations between the initial fragments when the difference between the maximum and minimum values ​​of the second cumulative integral is greater than a preset threshold and the distribution of the second cumulative integral is in a clustered state, within the initial fragment, to obtain the target fragment by means of a fragmentation and reorganization evolutionary game algorithm.

[0011] To achieve the above objectives, another aspect of the present invention provides an electronic device, the electronic device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method described above.

[0012] To achieve the above objectives, another aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.

[0013] To achieve the above objectives, another aspect of the present invention provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions to cause the computer device to perform the aforementioned method.

[0014] The embodiments of the present invention include at least the following beneficial effects: The present invention provides a sharding and reorganization method and related equipment based on evolutionary game theory. This scheme uses a verifiable random function to randomly allocate target nodes in a blockchain sharding system to multiple initial shards, thus obtaining sharding nodes. In the initial shards, a practical Byzantine fault-tolerant integral consensus protocol is used to process and distribute rewards for several target transactions, obtaining several transaction points for the sharding nodes, laying the foundation for downstream steps. After the initial shard submits a block, the transaction points of the sharding nodes are accumulated to obtain the first accumulated point of the sharding nodes, which is used for subsequent exclusion... Extreme integral values ​​provide the data foundation; the first cumulative integral of all shard nodes within the initial shard is sorted, the shard node with the largest first cumulative integral is deleted, and the shard node with the smallest first cumulative integral is also deleted, resulting in the first remaining node and its second cumulative integral, thus eliminating the influence of extreme integral values; within the initial shard, when the difference between the maximum and minimum values ​​of the second cumulative integral is greater than a preset threshold, and the distribution of the second cumulative integral is clustered, a sharding reorganization evolutionary game algorithm is used to perform node switching operations between the initial shards to obtain the target shard, improving the operating efficiency and security of the blockchain sharding system. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a flowchart of the fragmentation and recombination method based on evolutionary game theory provided in this embodiment of the invention; Figure 2 This is a schematic diagram of the fragmentation and recombination framework based on evolutionary game theory provided in an embodiment of the present invention; Figure 3 This is a flowchart of the revenue function provided in an embodiment of the present invention; Figure 4 This is a flowchart of the strategy update process provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the fragmentation and recombination algorithm based on evolutionary game theory provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this invention; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this invention as detailed in the appended claims.

[0018] It should be noted that although functional modules are divided in the system diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first / S100" and "second / S200" in the specification, claims, and the foregoing drawings may be used herein to describe various concepts, but unless specifically stated otherwise, these concepts are not limited by these terms. These terms are used only to distinguish one concept from another. For example, first information may also be referred to as second information without departing from the scope of the embodiments of the invention, and similarly, second information may also be referred to as first information. Depending on the context, the words "if" or "when" as used herein may be interpreted as "when," "in response to a determination," or "in the event of a determination."

[0019] The terms “at least one,” “multiple,” “each,” “any,” etc., used in this invention, “at least one” includes one, two, or more than two; “multiple” includes two or more than two; “each” refers to each of the corresponding multiple; and “any” refers to any one of the multiple.

[0020] Unless otherwise defined, 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. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.

[0021] In most mainstream blockchain sharding protocols, the initial node configuration schemes generally meet the requirement that the selected random numbers satisfy the three attributes of availability, unpredictability, and verifiability. However, in their sharding node reconfiguration schemes, the extended sharding reassembly time and excessive communication overhead may lead to Byzantine node aggregation, affecting system throughput. While some node reassembly protocols improve latency and resource consumption, they lack security and have low resistance to attacks. Furthermore, in blockchain sharding systems, the default node self-adaptation can cause the sharding scheme to fail to guarantee security, and malicious nodes may periodically disrupt system operation.

[0022] In view of this, this invention provides a sharding reorganization method and related equipment based on evolutionary game theory. This scheme utilizes sharding and the game theory between nodes. During the sharding reorganization process, for each shard submitting a block, the cumulative scores of all nodes within the shard need to be sorted and the average block reward of the entire shard needs to be calculated. Secondly, at each game cycle, a node randomly selects a neighboring shard and uses the node's reward from its most recent block submission and the average block reward of the neighboring shards' most recent blocks to calculate the probability of the node updating its strategy, determining whether the node can switch to a neighboring shard. Finally, after multiple game cycles, the sharding reorganization of the system evolves to a Nash equilibrium state, where all malicious nodes are evenly distributed across each shard, and each node is in the shard that maximizes its reward. This invention, through sharding and the game theory between nodes, can effectively improve system throughput and demonstrates good performance in ensuring system stability and security.

[0023] Figure 1 This is an optional flowchart of a fragmentation and recombination method based on evolutionary game theory provided in an embodiment of the present invention. Figure 1 The method may include, but is not limited to, steps S100 to S500: Step S100: Using a verifiable random function, the target node in the blockchain sharding system is randomly assigned to multiple initial shards to obtain sharded nodes; Step S200: In the initial sharding, the Practical Byzantine Fault-Tolerant Integral Consensus Protocol is used to process and distribute rewards for several target transactions, thereby obtaining several transaction scores for the sharding nodes. Step S300: After the initial shard commits the block, the transaction points of the shard nodes are accumulated to obtain the first accumulated points of the shard nodes. Step S400: Sort the first cumulative integrals of all shard nodes in the initial shard, delete the shard node with the largest first cumulative integral, and delete the shard node with the smallest first cumulative integral to obtain the first remaining node and the second cumulative integral of the first remaining node. In step S500, within the initial partition, when the difference between the maximum and minimum values ​​of the second cumulative integral is greater than a preset threshold, and the distribution of the second cumulative integral is clustered, the partitioning and reorganization evolutionary game algorithm is used to perform node switching partitioning operations between the initial partitions to obtain the target partition.

[0024] In step S100 of some embodiments, the blockchain sharding system randomly assigns all target nodes to each initial shard using a Verifiable Random Function (VRF), so that each initial shard contains several shard nodes, thereby completing the initial configuration of the shards.

[0025] In step S200 of some embodiments, each initial shard reaches consensus on the target transaction through FC-PBFT (FirstCommitter-Practical Byzantine Fault Tolerance, a practical Byzantine fault-tolerant algorithm based on the first node to send a preparation message) integral consensus. Each target transaction is assigned an equal total score by the blockchain sharding system. According to the scoring rules, the consensus behavior of each target transaction of the shard nodes in the initial shard is rewarded with points, so that the corresponding transaction points obtained by the shard nodes in each target transaction processing can be obtained.

[0026] In some embodiments, a target transaction can be an operation request initiated by a user in the network. This data structure, constructed and signed by the user, instructs the network to perform a specific operation. The target transaction can trigger state changes in the blockchain system, such as resource transfers, smart contract deployments, and invocations. The target transaction needs to be verified, packaged into a block, and ultimately added to the blockchain to ensure its network acceptance and effectiveness.

[0027] In some embodiments, step S200 may include, but is not limited to, steps S210 to S230: Step S210: Allocate an equal total score to each target transaction; Step S220: Process the target transaction to obtain the consensus behavior of each shard node; Step S230: Based on the points rules and total points, allocate rewards for each consensus action to obtain the transaction points of the shard nodes.

[0028] In steps S210 to S220 of some embodiments, a block contains multiple target transactions. Through a blockchain sharding system, each target transaction is allocated an equal total score, thereby providing basic scores for each shard node in the initial shard. Each initial shard performs consensus processing on the target transactions through FC-PBFT score consensus, thus obtaining the consensus behavior of each shard node for a given target transaction.

[0029] In step S230 of some embodiments, point rewards are allocated to each consensus behavior according to the point rules and the total points of the target transaction, so as to obtain the transaction points obtained by each shard node in the initial shard.

[0030] In some embodiments, step S230 may include, but is not limited to, steps S231 to S233: Step S231: Distribute the total score evenly according to the number of nodes in the initial partition to obtain the basic score; Step S232: Based on the points rules and consensus behavior, distribute rewards to the sharded nodes to obtain reward points; Step S233: Obtain transaction points based on basic points and bonus points.

[0031] In step S231 of some embodiments, the total points obtained by the target transaction are evenly distributed to the shard nodes within the initial shard, so that each shard node can obtain the base points.

[0032] In step S232 of some embodiments, based on the consensus behavior of the shard node and according to the points rules, the shard node is rewarded or punished accordingly. That is, after the shard node is rewarded, the shard node can obtain the corresponding reward points.

[0033] In step S233 of some embodiments, each shard node accumulates its base points and reward points, thus each shard node receives a corresponding transaction point. Since a block contains multiple target transactions, each shard node can have multiple transaction points.

[0034] In some embodiments, during consensus-building for a target transaction, different shard nodes correspond to various roles, and different roles correspond to different consensus behaviors. Optionally, roles include master nodes, first-committers, nodes that have reached consensus, and nodes that have not reached consensus. The consensus behaviors corresponding to each role include: (1) Master node: responsible for collecting target transactions and packaging them into blocks, and then broadcasting this block proposal (preparation message) to all other shard nodes (backup nodes) in the initial shard. (2) First-Committer: The first committer is the backup node that is the first to successfully complete the validity verification and the first to send the preparation message after receiving the block proposal from the master node. (3) Nodes that reach consensus: After receiving the preparation message from the First-Committer, the nodes that successfully complete the verification within the specified time and broadcast their own preparation message, and finally successfully reach the correct consensus; (4) Nodes that have not reached consensus: Nodes that have not participated in consensus, nodes that have participated in consensus but have failed to complete verification within the specified time, or nodes that have participated in consensus but have failed to broadcast the necessary preparation messages within the specified time, may be due to network latency, poor performance or malicious behavior.

[0035] For example, a blockchain sharding system includes There are 1 target node, and the target node is randomly assigned to... In each of the initial shards, it is assumed that each initial shard receives the same number of shard nodes. In an initial shard, for a given target transaction, the total score of that target transaction is obtained, based on the total number of shard nodes within the initial shard. The total score is then averaged, and each partition node receives a base score. Based on the points rules and consensus behavior, rewards are distributed to the shard nodes whose roles are master nodes, resulting in reward points. Rewards are distributed to shard nodes whose role is First-Committer, and reward points are obtained. Rewards are distributed to shard nodes that have reached consensus, and reward points are awarded accordingly. Rewards are distributed to shard nodes whose roles do not reach consensus, and reward points are awarded accordingly. Combining the base points and reward points, we can obtain the transaction points earned by shard nodes with different roles during the consensus period of each target transaction, as expressed below: ; In the formula, After consensus is reached on the target matter, the first Transaction integral of each shard node This is the index for the shard node; The base score represents the score reward that each shard node receives for sharing the total score of the target transaction within the initial shard. The number of malicious nodes represents the number of shard nodes in each initial shard that did not participate in consensus or participated in consensus but failed to reach the correct consensus. Represents the total number of shard nodes within the initial shard; The representative cost integral represents the integral cost that a shard node needs to pay each time it participates in the target transaction and reaches the correct consensus. The penalty points represent the points deducted from shard nodes that did not participate in consensus or participated in consensus but failed to reach the correct consensus. This indicates the first shard node to send a preparation message.

[0036] In step S300 of some embodiments, after the initial shard submits a block, the transaction scores of several shard nodes are accumulated to obtain the first accumulated score of the shard node. Since the initial shard contains multiple shard nodes, the initial shard can contain multiple first accumulated scores.

[0037] In step S400 of some embodiments, if a block contains multiple target transactions, then all target transactions in the block constitute the block transaction, and the sum of the total scores of all target transactions in the block is the total block transaction score. Whenever an initial shard submits a block, the blockchain sharding system sorts the first cumulative scores corresponding to all shard nodes within the initial shard in descending order, removes the shard node corresponding to the largest first cumulative score, and removes the shard node corresponding to the smallest first cumulative score. After removing the shard nodes with extreme scores (the largest and smallest first cumulative scores), the remaining shard nodes in the initial shard are the first remaining nodes, and the first cumulative score corresponding to the remaining shard nodes is the second cumulative score of the first remaining nodes. By removing the shard nodes corresponding to the largest and smallest first cumulative scores, the influence of extreme score values ​​on the authenticity of the average block revenue can be eliminated, providing a data basis for calculating the average shard revenue in subsequent game theory.

[0038] In some optional embodiments, the average of all second cumulative integrals within the initial slice is also calculated. And the proportion of this average in the total score of this block transaction, and the second cumulative score of each first remaining node. The proportion of the total points in this block transaction. Average. This represents the average block reward of the initial shard. (Set the average.) This is because the cumulative points of each node within the initial shard are not necessarily evenly distributed. Under bounded rationality, each node's consensus on each transaction may not be completely consistent with that of other nodes, and malicious or inactive nodes may influence the consensus behavior of other nodes. Therefore, after rewarding or penalizing nodes according to the point system, nodes with larger cumulative points tend to be those ranked higher, while nodes ranked lower may have extremely small points.

[0039] In some embodiments, a block contains multiple target transactions. Submitting a block in the initial shard means that after reaching a consensus on all target transactions in the block within the initial shard, the block is persistently stored and linked to the blockchain.

[0040] In step S500 of some embodiments, in a blockchain sharding system, each target node wants to obtain higher block rewards by changing its own game strategy. When a node changes its strategy, its neighboring nodes or neighboring shards may be affected by the strategy change. Figure 5 As shown, when the blockchain sharding system detects that there is a large and relatively concentrated difference between the first and last extreme values ​​of the second cumulative score in an initial shard, the blockchain sharding system will enter a shard reorganization game cycle. In each initial shard, nodes randomly select a neighboring shard for comparison and calculate the switching probability of that node to a neighboring shard using the Fermi function. This determines the node's game strategy: whether to update or wait. After completing the game reorganization, the blockchain sharding system updates the database information to prepare for the next round of the game. The blockchain sharding system undergoes multiple shard reorganization game cycles. After the sharded nodes are reorganized, the system evolves to a stable Nash equilibrium state, where all nodes eventually occupy the target shard that maximizes their own gains.

[0041] In some embodiments, within an initial shard, the second cumulative scores are sorted. When the blockchain sharding system detects that the difference between the maximum and minimum values ​​of the second cumulative scores (i.e., the difference between the maximum and minimum second cumulative scores) is greater than a preset threshold, and the numerical distribution of the second cumulative scores exhibits a clustered state, a sharding reorganization evolutionary game algorithm is needed to resolve the issue during the game time. The system internally facilitates the exchange of nodes between shards, completing one round of shard reorganization. The preset threshold used to determine the magnitude of the difference between the maximum and minimum values ​​of the second cumulative integral can be adaptively adjusted as needed. Optionally, whether the second cumulative integral is clustered can be determined by a preset numerical range, a preset proportion or quantity condition, or by using statistical methods, but is not limited to these. For example, a specific numerical range can be set; when the majority of the second cumulative integrals fall within this specific range, the distribution of the second cumulative integral is clustered. Alternatively, a proportion or quantity condition can be set; when a certain proportion (e.g., exceeding 70%) or a certain number (e.g., exceeding 20 nodes) of the nodes' second cumulative integrals fall within a specific numerical range, the distribution of the second cumulative integral is clustered. Alternatively, statistical methods can be used; when the standard deviation of the second cumulative integral is less than a certain preset threshold, the distribution of the second cumulative integral is clustered.

[0042] In some embodiments, the step of obtaining the target fragment by performing node switching fragmentation operations between initial fragments through a fragmentation and reorganization evolutionary game algorithm may include, but is not limited to, steps S510 to S570: Step S510: Randomly select a neighbor's initial fragment as the neighbor fragment through the fragment nodes in the current initial fragment; Step S520: Obtain the third cumulative score of the shard node in the last committed block; Step S530: Obtain the fourth cumulative score of the second remaining node in the neighboring shard in the last committed block; Step S540: Obtain the average of all fourth-accumulated points to get the average block reward; Step S550: Compare the third cumulative score and the average block reward, and obtain the switching probability through the Fermi function; Step S560: Update the game strategy according to the switching probability; Step S570: Based on the updated game strategy, perform node switching operations between the initial fragments to obtain the target fragment.

[0043] In steps S510 to S540 of some embodiments, during the game time, each shard node in the initial shard randomly selects a neighbor's initial shard as its neighbor shard. Then, the reward earned by that shard node in the most recently committed complete block, i.e., the third cumulative score, is retrieved from the blockchain database. For example, such as Figure 3As shown, after the initial shard successfully committed a block, the extreme-scoring shard nodes in the initial shard containing that node were removed. This remaining node in the initial shard then acquires its corresponding cumulative score, i.e., the third cumulative score, and stores it in the blockchain database. This third cumulative score reflects the individual reward earned by the shard node in the previous block commit. Furthermore, the average block reward of the second remaining node in the neighboring initial shard in the most recently committed full block is obtained from the blockchain database. For example, as shown... Figure 3 As shown, after a neighboring shard successfully committed a block, extreme-integral shard nodes were removed from that neighboring shard, resulting in the second remaining node of that neighboring shard and its fourth cumulative integral. The average of all fourth cumulative integrals within that neighboring shard is calculated. This average is stored in the blockchain database, and it represents the average block reward of the neighboring shard in the last block submission.

[0044] In step S550 of some embodiments, the revenue obtained by the shard node from its most recently committed full block is compared with the average block revenue of neighboring shards from their most recently committed full blocks, and the switching probability of the shard node switching to a neighboring shard is calculated using the Fermi function. Optionally, the formula for calculating the switching probability using the Fermi function is: ; In the formula, Indicates the probability of switching; Represents the natural base; This represents the difference between the third cumulative score and the average block reward; This represents a constant parameter.

[0045] In some embodiments, steps S560 to S570, such as Figure 4 As shown, based on the calculated switching probability, a game strategy is formulated for each shard node. It is determined whether the switching probability is greater than a preset threshold. If the switching probability is greater than the preset threshold, the shard node can choose to switch to a neighboring shard. If the switching probability is less than or equal to the preset threshold, the shard node remains in its original initial shard. The game strategy is continuously updated before the game cycle is reached. When the game cycle is reached, the strategy update is complete. Based on the continuously updated game strategy, node exchange and reorganization are completed within the game time. After multiple rounds of evolution, the system reaches Nash equilibrium, where each node is in the target shard with the highest payoff and cannot gain more payoff by changing its strategy. At this point, malicious nodes are evenly distributed, and the number of honest nodes in each shard meets the security requirement of 2f+1.

[0046] In some embodiments, after performing node switching operations between initial shards, one round of shard reorganization evolution is completed. Then, it is determined whether the blockchain sharding system has reached a Nash equilibrium. If the blockchain sharding system has not reached a Nash equilibrium, the process returns to the step of randomly selecting a neighboring initial shard from the target node within the current initial shard as the neighboring shard, and continues to the next round of shard reorganization evolution until the blockchain sharding system reaches a Nash equilibrium, obtaining the target shard. When the system evolves to a stable Nash equilibrium, meaning that all nodes ultimately make decisions that place them in the target shard with the highest profit, no node can gain more profit by changing its game strategy, and the number of honest nodes in each shard is greater than or equal to 2f+1 required for practical Byzantine fault tolerance, because when the system reaches a stable Nash equilibrium under an evolutionary strategy, malicious nodes will be evenly distributed across each shard, meeting the security requirements of intra-shard Byzantine fault tolerance.

[0047] like Figure 2 As shown, taking a blockchain sharding system with 3 initial shards (shard A, shard B, and shard C), 90 target nodes (including 81 honest nodes and 9 malicious nodes), and a block containing two target transactions (resource transfer and smart contract deployment) as an example, the steps of this embodiment of the invention are as follows: Step 1: The system uses VRF to randomly and roughly evenly distribute the 90 target nodes to shards A, B, and C. Each shard initially contains 30 nodes, and each shard operates independently. For example, shard A receives a transaction to "transfer 10 resource files" and a transaction to "deploy a voting contract." Within shard A, nodes use the FC-PBFT protocol to reach consensus on these transactions. Transaction points are assigned to each shard node based on its role in the consensus (master node, First-Committer, nodes that reach consensus, and nodes that fail to reach consensus, etc.). For example, the master node of shard A that successfully packages a block receives higher points, while a malicious node attempting to cause consensus failure is penalized with points deduction.

[0048] Step 2: Shard A successfully committed a block containing the two target transactions mentioned above. The system accumulates the transaction points obtained by all 30 shard nodes in Shard A in this block, obtaining the first accumulated point for each node.

[0049] Step 3: The system sorts the first cumulative scores of the 30 nodes in partition A in descending order. Then, it deletes the node with the highest score and the node with the lowest score, resulting in 28 first remaining nodes. The scores of these 28 nodes constitute the second cumulative score set.

[0050] Step 4: The system detects a significant gap in the second cumulative score of shard A (the difference between the maximum and minimum values ​​exceeds a preset threshold), and low-score nodes exhibit a clustering state (indicating that malicious nodes may be concentrated in shard A, colluding to cause harm). This triggers the shard reorganization mechanism, entering a game cycle. During the game period, a low-score node q in shard A (possibly an honest node with low returns due to the influence of malicious nodes) randomly selects a neighboring shard B or C as its neighboring shard. The individual return of the low-score node q in its most recently committed complete block is obtained, along with the average block return of the neighboring shards in their most recently committed complete block (the average of the second cumulative scores of shards B or C). The individual return is compared with the average block return, and the switching probability is calculated based on the Fermi function. If this switching probability exceeds a preset threshold, the low-score node q can choose to switch to a neighboring shard.

[0051] Ultimately, after multiple rounds of reorganization and game-playing, the node migration reached a relatively stable state. The malicious nodes initially clustered in shard A were effectively and evenly distributed across shards A, B, and C. The number of honest nodes in each shard far exceeded the number of malicious nodes, satisfying the Byzantine fault tolerance requirement and thus improving the overall system's security and throughput.

[0052] This invention also provides a fragmentation and recombination device based on evolutionary game theory, which can implement the above-mentioned fragmentation and recombination method based on evolutionary game theory. The device includes: The node allocation module is used to randomly allocate target nodes in the blockchain sharding system to multiple initial shards using a verifiable random function, thereby obtaining sharded nodes; The first revenue-generating module is used to process and distribute rewards for several target transactions in the initial sharding using a practical Byzantine fault-tolerant integral consensus protocol, thereby obtaining several transaction points for the sharding nodes. The second revenue acquisition module is used to accumulate the transaction points of the shard nodes after the initial shard commits the block, and obtain the first accumulated points of the shard nodes. The third revenue acquisition module is used to sort the first cumulative points of all shard nodes in the initial shard, delete the shard node with the largest first cumulative point, and delete the shard node with the smallest first cumulative point to obtain the first remaining node and the second cumulative points of the first remaining node. The fragmentation and reorganization module is used to perform node switching fragmentation operations between the initial fragments when the difference between the maximum and minimum values ​​of the second cumulative integral is greater than a preset threshold and the distribution of the second cumulative integral is in a clustered state, in order to obtain the target fragment.

[0053] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0054] This invention also provides an electronic device, which includes a processor and a memory. The memory stores a computer program, and the processor executes the computer program to implement the above-described method. This electronic device can be any smart terminal, including a tablet computer, an in-vehicle computer, or similar device.

[0055] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0056] refer to Figure 6 , Figure 6 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 601 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention. The memory 602 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 602 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 602 and is called and executed by the processor 601. The input / output interface 603 is used to implement information input and output; The communication interface 604 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 605 transmits information between various components of the device (e.g., processor 601, memory 602, input / output interface 603, and communication interface 604); The processor 601, memory 602, input / output interface 603, and communication interface 604 are connected to each other within the device via bus 605.

[0057] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0058] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0059] This invention also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium and execute the computer instructions to cause the computer device to perform the aforementioned method.

[0060] In summary, the evolutionary game-based fragmentation and recombination method and related equipment of the present invention have the following advantages: The embodiments of the present invention can guarantee system security, optimize throughput and fragment reassembly latency. By sorting the points after fragment submission and calculating the average block revenue, combined with the random selection of neighboring fragments by nodes within the game cycle to compare revenue and determine the switching probability, the system reaches Nash equilibrium after multiple rounds of evolution. Malicious nodes are evenly distributed and each node is in the fragment with the maximum revenue. Compared with other fragment reassembly protocols, it has advantages in performance and convergence.

[0061] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this invention are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is altered and sub-operations described as part of a larger operation are executed independently.

[0062] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the described functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.

[0063] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the 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 cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0064] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0065] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0066] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0067] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0068] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

[0069] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.

Claims

1. An evolutionary game-based sharding reorganization method, characterized in that, The method comprises the following steps: Randomly assigning target nodes in a blockchain sharding system into a plurality of initial shards through a verifiable random function to obtain shard nodes; In the initial shards, a practical Byzantine fault tolerance credit consensus protocol is used to process and distribute rewards for a plurality of target transactions to obtain a plurality of transaction credits of the shard nodes; When the initial shards submit blocks, the transaction credits of the shard nodes are accumulated to obtain first accumulated credits of the shard nodes; The first accumulated credits of all the shard nodes in the initial shards are sorted, the shard node with the maximum first accumulated credit is deleted, and the shard node with the minimum first accumulated credit is deleted to obtain first remaining nodes and second accumulated credits of the first remaining nodes; When the maximum and minimum values of the second accumulated credits have a difference greater than a preset threshold and the distribution of the second accumulated credits is in an aggregated state, a sharding reorganization evolutionary game algorithm is used to perform node switching sharding operation between the initial shards to obtain target shards.

2. The method of claim 1, wherein, The method of using a practical Byzantine fault tolerance credit consensus protocol to process and distribute rewards for a plurality of target transactions in the initial shards to obtain a plurality of transaction credits of the shard nodes comprises the following steps: An equal amount of total credits is allocated to each target transaction; Each consensus behavior of the shard nodes is obtained by processing the target transactions; Rewards are distributed to each consensus behavior according to the total credits and the credit rules to obtain transaction credits of the shard nodes.

3. The method of claim 2, wherein, The method of distributing rewards to each consensus behavior according to the total credits and the credit rules to obtain transaction credits of the shard nodes comprises the following steps: The total credits are evenly distributed according to the number of shard nodes in the initial shards to obtain basic credits; Rewards are distributed to the shard nodes according to the consensus behavior and the credit rules to obtain reward credits; The transaction credits are obtained according to the basic credits and the reward credits.

4. The method of claim 1, wherein, The formula used in the method of using a practical Byzantine fault tolerance credit consensus protocol to process and distribute rewards for a plurality of target transactions in the initial shards to obtain a plurality of transaction credits of the shard nodes comprises: ; In the formula, represents the transaction score of the first slice node; represents the base score of each slice node; represents the number of malicious nodes; represents the total number of slice nodes in the initial slice; represents the cost score; represents the penalty score; represents the first slice node sending the preparation message.

5. The method of claim 1, wherein, The method of performing node switching sharding operation between the initial shards through a sharding reorganization evolutionary game algorithm to obtain target shards comprises the following steps: A neighbor initial shard is randomly selected as a neighbor shard by a shard node in the current initial shard; A third accumulated credit of the shard node in the last block submission is obtained; A fourth accumulated credit of a second remaining node in the neighbor shard in the last block submission is obtained; An average block benefit is obtained by averaging all the fourth accumulated credits; The third accumulated credit and the average block benefit are compared, and a switching probability is obtained through a Fermi function; The game strategy is updated according to the switching probability; The target shards are obtained by performing node switching sharding operation between the initial shards according to the updated game strategy.

6. The method of claim 5, wherein, The node switching and slicing operation between the initial slices is performed by the evolutionary game algorithm of slice recombination to obtain a target slice, including the following steps: After the node switching and slicing operation between the initial slices, it is judged whether the blockchain slicing system reaches a Nash equilibrium state. If the blockchain slicing system does not reach the Nash equilibrium state, the step of randomly selecting an initial slice of a neighbor as a neighbor slice through the target node in the current initial slice is returned. If the blockchain slicing system reaches the Nash equilibrium state, the target slice is obtained.

7. An apparatus for sharding reorganization based on evolutionary game, characterized in that, Comprise: A node allocation module is configured to randomly allocate target nodes in a blockchain slicing system to a plurality of initial slices by a verifiable random function to obtain slice nodes; A first income acquisition module is configured to process and reward distribution of a plurality of target transactions in the initial slice by adopting a practical Byzantine fault tolerance integral consensus protocol to obtain a plurality of transaction integrals of the slice nodes; A second income acquisition module is configured to accumulate the transaction integrals of the slice nodes after the initial slice submits a block to obtain first accumulated integrals of the slice nodes; A third income acquisition module is configured to sort the first accumulated integrals of all slice nodes in the initial slice, delete the slice node with the largest first accumulated integral, and delete the slice node with the smallest first accumulated integral to obtain first remaining nodes and second accumulated integrals of the first remaining nodes; A slice recombination module is configured to perform node switching and slicing operation between the initial slices by an evolutionary game algorithm of slice recombination when the maximum and minimum values of the second accumulated integrals have a difference greater than a preset threshold and the distribution of the second accumulated integrals is in an aggregated state to obtain a target slice.

8. An electronic device, comprising: Comprise a processor and a memory; The memory is configured to store a program; The processor executes the program to realize the method of any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The storage medium stores a program, and the program is executed by the processor to realize the method of any one of claims 1-6.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to realize the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Node excitation method and system under unauthorized block chain architecture based on fragments

    CN113037504A

  • Byzantine fault-tolerant consensus method based on evolutionary game

    CN114003584A

  • Block chain node fragmentation method and device, electronic equipment and storage medium

    CN117220943A

  • Block chain inter-sheet consensus method based on state fragmentation

    CN118134637A

  • Random hierarchical Byzantine fault-tolerant consensus method based on integral value

    CN118677905A