Multi-dimensional evaluation and intelligent dynamic reconstruction method for fragmented block chain nodes
By combining a two-layer sharded blockchain architecture and multi-dimensional evaluation with deep reinforcement learning, and dynamically adjusting sharding parameters, the scalability bottleneck of blockchain systems in large-scale applications is solved, achieving a balance between throughput and security, and improving the stability and efficiency of the system.
Patent Information
- Application Number
- CN202511217356.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-11-21
AI Technical Summary
Existing blockchain technologies face scalability bottlenecks and low throughput in large-scale applications. Sharding technology suffers from redundant communication, state dimension expansion, single node evaluation dimension, and insufficient dynamic optimization, making it difficult to maintain a balance between system performance and security in complex environments.
It adopts a two-layer sharded blockchain architecture, combining multi-dimensional evaluation and deep reinforcement learning. By dynamically adjusting sharding parameters through node performance and reputation scores, it achieves a balance between system throughput and security.
It significantly improves the stability and efficiency of blockchain systems in large-scale application scenarios, increases throughput and reduces sharding risks, and achieves a long-term dynamic balance between throughput and security.
Smart Images

Figure CN121000367A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of blockchain sharding, and particularly relates to a multi-dimensional evaluation and intelligent dynamic reconstruction method for sharded blockchain nodes based on deep reinforcement learning technology. BACKGROUND
[0002] In recent years, blockchain has received extensive attention from the academic and industrial communities due to its decentralized approach to building trust mechanisms. Blockchain is a distributed ledger technology that maintains a public transaction record through the joint efforts of multiple participants. Each blockchain participant serves as a peer node in the blockchain network, and peer nodes are connected using a P2P (Peer-to-Peer) communication protocol. Blockchain uses cryptographic algorithms and hash algorithms to ensure communication security and data integrity, and uses consensus mechanisms to coordinate different nodes to reach an agreement on transaction information or transaction order. However, current blockchain technology faces scalability bottlenecks in large-scale applications. Blockchain is difficult to expand to large-scale scenarios due to low throughput. How to improve performance, especially to solve the scalability bottleneck, has become a key core problem for promoting the widespread application of blockchain technology.
[0003] To improve the performance of blockchain systems, researchers have proposed various blockchain scaling technologies, among which sharding technology is considered the most direct and promising solution to improve the scalability of blockchain. Sharding follows the "divide and conquer" philosophy, dividing the blockchain network into multiple parallel running parts, each part being a shard (i.e., a committee), and each committee independently processing a subset of transactions. Therefore, sharding technology can theoretically significantly improve system throughput.
[0004] In the prior art, SkyChain discloses a dynamic blockchain sharding method based on deep reinforcement learning, which adjusts the sharding strategy through DRL to adapt to environmental changes and optimize performance and security. However, this method has the following defects:
[0005] First, in terms of architecture design, SkyChain uses an architecture mode where each node maintains an agent and the shard leaders collaborate to determine actions, which leads to the following problems: all agents need to perform sharding calculations simultaneously, and the parallel operation of a large number of nodes generates redundant communication and data interaction, significantly increasing the data synchronization time during the resharding process and reducing the response speed of system dynamic adjustment. In addition, the decentralized agent architecture causes the state space of the agent to contain a large amount of repetitive or conflicting node-level information, leading to state dimension expansion, feature redundancy, and interference with the training convergence of the deep reinforcement learning model, ultimately reducing the accuracy and stability of the policy output.
[0006] Secondly, the node evaluation dimension design is single, does not cover the hardware performance dimensions such as computing capability, communication capability and storage capability, and the behavior dimensions such as consensus contribution, voting behavior and reputation performance, cannot extract accurate and non-redundant node features, and it is difficult to form a comprehensive node portrait.
[0007] Thirdly, in the dynamic optimization and distribution aspect, only the static configuration of the sharding parameters (such as the number of shards and the block size) is focused on, the sharding strategy (such as the dynamic allocation of nodes and the reconfiguration triggering mechanism) is not included in the optimization category, and it is difficult to maintain the trade-off between system performance and security in complex environments. SUMMARY
[0008] In order to solve the performance bottleneck problem of the blockchain in a large-scale scenario, effectively improve the throughput and reduce the sharding risk, and realize the long-term dynamic balance of throughput and security, the present application proposes a multi-dimensional evaluation and intelligent dynamic reconstruction method for sharding blockchain nodes based on deep reinforcement learning, which comprises:
[0009] S1, a two-layer sharding blockchain architecture comprising an upper committee and a plurality of lower committees is built;
[0010] S2, each epoch is divided into a consensus phase and a reconfiguration phase;
[0011] S3, the misbehavior of the nodes is described, a multi-dimensional evaluation is designed to calculate the performance and reputation of the nodes, a comprehensive and dynamic portrait of the nodes is provided, and the evaluation results are used for quantitative analysis of the sharding throughput and security;
[0012] S4, the system state is adaptively executed based on the system state to implement the dynamic adjustment of the sharding parameters in the reconfiguration process, and a deep reinforcement learning method is used to determine the sharding strategy to balance the system throughput and security;
[0013] S5, the nodes randomly selected from the upper committee act as proposers of the sharding strategy, other members judge and vote according to whether the state difference is within a threshold, the upper committee reaches an agreement on the sharding strategy, and the verifiability and fault tolerance of the reconfiguration decision are guaranteed;
[0014] S6, whether the node can participate in the consensus is determined according to the score of the node, an effective access mechanism is formed, a node allocation optimization algorithm is executed based on the performance and reputation score of the node, the distribution of the node in the system is adjusted, and the performance and security are balanced.
[0015] Further, in the step S3, the calculation of the node performance comprises: the node performance score comprises the inherent attribute score of the node and the throughput contribution score of the consensus phase, and the performance value score formula of the node is:
[0016]
[0017] represents the number of transactions in block j, m is the total number of nodes in represents the number of nodes that behave correctly in the consensus process of block j; B represents the sum of the number of blocks successfully submitted and the number of blocks unsuccessfully submitted during the epoch; is a block submission penalty identifier; is an identifier of the behavior in block j submission; 、 、 respectively represent the total computing power, communication capability and storage capability of all nodes.
[0018] Further, in the step S3, the reputation of the computing node comprises:
[0019] S31, the update of the node reputation value is based on whether there is block proposal error, delay, fake voting and other behaviors in each round of consensus, and a reputation penalty coefficient and a reward mechanism are provided;
[0020] S32, the stage reputation value of the node is defined as:
[0021]
[0022] wherein is the score of the block proposal behavior of the node i, is the score of the voting behavior of the node i, and p is a reputation increase coefficient; and The specific calculation is as follows:
[0023]
[0024]
[0025] wherein is the total number of block proposal behaviors of the node, is the total number of voting behaviors of the node, 、 、 respectively represent three kinds of malicious behaviors in block proposal, represents malicious behavior in the voting process, 、 、 and respectively represent the corresponding penalty coefficients;
[0026] S33, the overall reputation value of the node is updated in the following manner: .
[0027] Further, in step S4, the fragmentation strategy is performed using a deep reinforcement learning method, specifically including:
[0028] S41, model the fragmentation throughput and security as an optimization problem, and train an intelligent agent using a deep reinforcement learning method to decide the number of fragments, block size, and time interval at each epoch;
[0029] S42, state space including the throughput indicators and security indicators of all fragments; action space including increasing, decreasing, or maintaining the current number of fragments, adjusting the block size or time interval;
[0030] S43, the reward function is calculated based on the overall throughput of the system and the security penalty factor of the fragments, with the goal of maximizing throughput while minimizing the concentration of malicious nodes, i.e.
[0031] .
[0032] Further, in step S5, the step of reaching an agreement on the fragmentation strategy by the upper committee includes:
[0033] S51, node broadcast the system state, fragmentation action, and neural network parameters to other nodes of the upper committee.
[0034] S52, the node receiving the message uses a label to indicate the acceptance or rejection of the difference between state and system state, judges the rationality of the difference according to the pre-defined error threshold, and broadcasts the message with the label to each other.
[0035] S53, when an honest node receives more than half of the action reasonable messages, it will agree to as the fragmentation strategy, and broadcast the agreement message again.
[0036] S54, when receives more than half of the messages agreed by other nodes, it will take this combination of dynamic space, state space, reward function, and next state as the final fragmentation update.
[0037] Further, in step S6, the node allocation optimization algorithm specifically includes:
[0038] S61, initial division, initially allocate nodes according to the average historical score;
[0039] S62, fragment score sorting, sort the scores according to the average performance and reputation of the fragments;
[0040] S63, iteratively balancing optimization, randomly selecting nodes in low-scored shards to exchange with nodes in high-scored shards;
[0041] S64, updating the score variance of each shard, if the shard variance is lower than the threshold or reaches the maximum iteration number, outputting the shard result.
[0042] Further, in step S1, the upper committee is responsible for global information maintenance, node multi-dimensional evaluation, shard number decision and allocation scheduling, collects transaction processing and node behavior information fed back by the lower committee, carries out consensus on shard strategy proposals, forms a consistent shard configuration of the whole network and broadcasts; the lower committee is responsible for distributed transaction processing and state maintenance, and does not participate in the decision-making process.
[0043] Compared with the prior art, the present application has the following advantages:
[0044] The present application calculates the performance and reputation of nodes by characterizing the malicious behavior of nodes and innovatively designing a multi-dimensional evaluation mechanism to build a more comprehensive and dynamic node portrait combining performance indicators and behavior reputation, and effectively applies the evaluation results to the quantitative analysis of shard throughput and security, providing accurate basis for system optimization. The shard throughput and security targets are converted into quantifiable optimization problems, and the adaptive shard decision based on the system state is realized relying on the deep reinforcement learning algorithm, the shard parameters in the dynamic adjustment and reconfiguration process are adjusted, and the adaptability of the system to complex environment is improved. An effective access mechanism is built based on node scoring to accurately screen the nodes participating in consensus, and by optimizing the node distribution strategy, the rational allocation of nodes in the system is realized, and finally the long-term dynamic balance of throughput and security in the reconfiguration process is achieved, which significantly enhances the stability and efficiency of the shard blockchain system in large-scale application scenarios. BRIEF DESCRIPTION OF DRAWINGS
[0045] Figure 1 is a schematic diagram of the shard blockchain architecture of the present application;
[0046] Figure 2 is a schematic diagram of the workflow of the present application;
[0047] Figure 3 is a logic diagram of the DRL algorithm of the present application;
[0048] Figure 4 is a schematic diagram of the consensus protocol phase of the present application;
[0049] Figure 5 is a schematic diagram of the decision consensus process of the present application;
[0050] Figure 6 is a schematic diagram of the node allocation process of the present application;
[0051] Figure 7The system reward and convergence trend analysis chart of the present application;
[0052] Figure 8 The system reward comparison chart of the present application under different malicious node proportions. DETAILED DESCRIPTION
[0053] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the protection scope of the present application.
[0054] I. System architecture and epoch design
[0055] The present application adopts a double-layer sharding blockchain structure to realize function decoupling. The double-layer sharding blockchain is composed of two types of shards, namely 1 upper committee and K lower committees. The upper committee performs multi-dimensional evaluation of nodes, runs a deep reinforcement learning algorithm, determines the number of lower shards, decides the node allocation of the next round of epochs, and finally broadcasts the sharding results to the lower committees. The upper committee maintains the global state of the sharding system and is responsible for the update of all lower layers, so it consumes more network resources and computing resources. The tasks it undertakes are different from those of the lower layers, and the status and required computing resources are also different from those of the lower layers. The lower committees maintain local ledgers and store subsets of states, and the nodes in each lower layer jointly process transactions, package transaction blocks, and realize intra-shard consensus. The committee members are composed of nodes selected by the allocation algorithm based on multi-dimensional evaluation, and the rewards of the upper shard nodes should be higher than those of the lower shard nodes to encourage nodes to act honestly.
[0056] Each epoch is divided into two stages: a consensus stage: containing multiple rounds of consensus process, the shard committee processes transactions, verifies transactions and packages them into blocks for on-chain in this stage. A reconfiguration stage: the upper committee collects information, executes shard number decision and node reallocation.
[0057] The present application realizes function decoupling through a double-layer sharding architecture, with the upper layer focusing on decision-making and global management, and the lower layer focusing on transaction processing, improving the efficiency of system division; dividing stages by epochs, combining multi-dimensional evaluation, reinforcement learning decision-making and dynamic node allocation to achieve a balance between throughput and security, and enhance the scalability and attack resistance of the system in a large-scale heterogeneous network.
[0058] II. Multi-dimensional evaluation of nodes
[0059] By carefully depicting the malicious behavior of nodes, combining performance indicators (hardware capabilities) and behavior reputation (consensus performance), a comprehensive and dynamic node portrait is formed, providing quantitative basis for sharding throughput and security analysis. Based on the computing power, communication ability, storage capacity and behavior of nodes in the consensus process, the performance value and reputation value of the nodes are calculated respectively.
[0060] Performance value calculation includes node inherent attributes (computing, communication, storage capacity) and throughput contribution score in consensus phase. Through orthogonal design, it is ensured that performance value only depends on hardware capability and throughput contribution, and there is no overlap with reputation value. The performance value is calculated by integrating hardware attributes and consensus contribution, which reflects the inherent ability of the node and the actual cooperation value; the orthogonal design avoids index redundancy, ensures the accuracy and independence of performance evaluation, provides reliable basis for sharding load balancing, and improves the overall transaction processing efficiency of the system.
[0061] Reputation value calculation is based on the behavior update of nodes in the consensus, including block proposal error, delay, fake voting and other malicious behaviors, with a penalty coefficient and a reward mechanism. Reputation value only depends on behavior rewards and punishments, and there is no overlap with performance value (such as malicious nodes may have high computing power, but fake voting will directly lead to reputation decline). The present application dynamically updates the reputation value by carefully depicting the malicious behavior and setting the reward and punishment mechanism, and accurately identifies malicious nodes; the historical reputation and stage performance are weighted and updated, which not only retains the coherence of node behavior, but also responds to the latest performance, providing a safe basis for node access and allocation, and reducing the risk of malicious node concentration.
[0062] The leader node of each lower committee adds the successfully submitted block to the respective local blockchain after the block is successfully submitted, and reports to the upper committee. The uploaded information includes the voting behavior and block submission result of the node. The upper committee continuously collects newly arrived blocks generated by each lower committee and loads the information, and dynamically updates the reputation value and performance value of all nodes based on the designed multi-dimensional evaluation algorithm.
[0063] Each node is evaluated in the following two dimensions after each epoch ends: performance score and reputation score. The core goal is to build a precise, dynamic and multi-dimensional node portrait, which goes beyond a single indicator, provides more reliable data support for sharding allocation decisions, and ultimately improves the security and efficiency of the sharding blockchain network.
[0064] The performance dimension aims to quantify the capacity and contribution of nodes, and the quantitative indicators include computing power, communication ability, storage capacity and contribution value, i.e. performance value which not only depends on the inherent attributes of the node itself the computing power of the node the communication ability and the storage capacity , where T is the total number of transactions in epoch e, and Tj is the number of transactions in block j. The performance score of node i in each epoch can be represented as follows:
[0065]
[0066] , where T is the total number of transactions in epoch e, and Tj is the number of transactions in block j. , where N is the total number of nodes in the network, , where B is the total number of blocks successfully committed and unsuccessfully committed during the epoch. is the block commit penalty indicator, which is 0 when the block is successfully committed, and 1 otherwise. is the behavior indicator in block j, which is 1 if the node behaves correctly, and 0 otherwise. , , , where C, C, and C represent the total computing, communication, and storage capabilities of all nodes, respectively.
[0067] The heterogeneous performance indicators are normalized by a standardization function to map them to a comparable numerical range. Different sharding tasks have different performance requirements (such as compute-intensive or network-intensive), and the weights can be dynamically adjusted to avoid redundancy or conflict. In addition, load balancing can be achieved by assigning compute-intensive tasks to nodes with strong CPUs and high-bandwidth tasks to nodes with good networks, achieving more refined load balancing. According to the score, nodes with poor performance are removed from critical shards or roles, and nodes with improved performance are included. This allows the sharding network to adapt to changes in node status.
[0068] The throughput of a shard can be obtained by summing the performance values of the nodes within the same shard:
[0069]
[0070] Next, the definition of consensus delay is introduced. The specific process of the PBFT algorithm used is shown in Figure 3 . Consensus is achieved through three stages: pre-preparation, preparation, and commitment.
[0071] The consensus phase in each epoch will undergo multiple rounds of consensus, with the number of rounds denoted by r, is determined by the slowest shard with the largest delay:
[0072]
[0073] The shard The consensus delay is represented as the message propagation time and the message verification time The total of which is given by:
[0074]
[0075] For the message verification time :
[0076]
[0077] where M denotes the batch size of the block, and denote the time for the primary and replica to verify the request message in the shard . It is assumed that verifying one signature takes θ CPU cycles and generating and verifying one message authentication code (MAC) takes φ CPU cycles when calculating the cost of cryptographic operations. and are the computational power of the primary and replica in the shard . So and are calculated as follows:
[0078]
[0079]
[0080] For the message propagation, three phases (i.e., pre-prepare, prepare, and commit) are considered. Since the message passing of the nodes is performed in parallel, we have:
[0081]
[0082] , denote the primary and replica nodes in the shard , denotes the data transfer rate of the two nodes, denotes the block size, denote the propagation time of each request in the pre-prepare, prepare, and commit phases of the consensus process within each shard .
[0083] The reputation dimension quantifies the historical behavior reliability and honesty of the node. The quantification indicators are the historical shard participation success rate, malicious behavior record, and voting / consensus participation degree. The reputation value is used to measure the behavior of the node and serves as the basis for selecting a trusted node as a consensus member in the shard. The reputation value is updated according to the voting behavior of the node in each round of consensus. The reputation evaluation is based on the behavior of the node participating in the consensus, and the node is divided into two types according to its performance: normal and malicious. Normal node: normally completes the block proposal and voting in the consensus process according to the protocol; malicious node: tampering with information, fault delay, and intent to hinder the normal consensus process. The focus is on two aspects of malicious behavior, namely block proposal and voting. The specific malicious behavior performance is as follows:
[0084] 1) Block proposal related malicious behavior: proposing invalid or format error blocks; intentionally delaying block proposal, affecting consensus efficiency; multiple proposals (broadcasting different blocks to different nodes in the same round).
[0085] 2) Voting related malicious behavior: refusing to vote on legal blocks (unjustified abstention), forging signatures or tampering with voting information.
[0086] The reputation of the node that produces improper behavior is reduced, and the reputation of the node that produces good behavior is praised. The reputation value of node i at epoch e is defined as follows:
[0087]
[0088] wherein is the score of the block proposal behavior of node i, is the score of the voting behavior of node i, and p is the reputation increase coefficient. The initial reputation value of the node will be set in the initial stage. and The specific calculation is as follows:
[0089]
[0090]
[0091] wherein is the total number of block proposal behaviors of the node, is the total number of voting behaviors of the node, , , represent the three kinds of malicious behaviors in block proposal, represents the malicious behavior in the voting process, , , and respectively. So the overall reputation value of a node can be updated in a history cumulative and phase incremental weighted manner as follows:
[0092]
[0093] The reputation value of a node increases when it makes honest block proposals and votes. The reputation value is deducted when malicious behavior exists. By judging the change of the reputation value of such nodes, malicious nodes are identified and deleted in the next round of shard reconfiguration. Nodes can rejoin the consensus by improving their reputation scores in the subsequent period. The higher the reputation, the higher the possibility of becoming a shard leader.
[0094] The effect of this part of the design is to solve the abstract nature of reputation. Honesty and reliability are abstract concepts that can be broken down into observable and quantifiable behaviors. Each behavior is accurately translated into an increase or decrease in reputation score. Considering dynamics and decay, recent behavior is given higher weight than long-term behavior. Evidence for reputation assessment is collected and verified efficiently and at low cost through malicious behavior. Consider how initial reputation and newly added nodes obtain initial reputation to avoid cold start. At the same time, try to rely on objective behaviors that can be verified on-chain (such as block signature, data submission proof) to avoid excessive reliance on subjective evaluation.
[0095] In addition, this method improves the competence and honesty probability of key roles. Key roles are held by high-reputation nodes, reducing the likelihood of malicious behavior during the consensus process and encouraging honest behavior. Good reputation is a prerequisite for joining high-value shards and assuming important roles. This encourages nodes to remain honest and run stably.
[0096] The increase in the number of shards results in insufficient number of nodes per shard, making it easier for attackers to control a shard. Therefore, it is necessary to ensure that there are enough honest nodes in each shard. After obtaining the overall reputation value of each node at epoch e, the reputation value of the shard can be calculated as a security credential for the shard.
[0097]
[0098] Each shard has limited Byzantine fault tolerance, and the ratio of the number of malicious devices to the size of the shard is a primary concern. Therefore, a security penalty factor will be designed to measure the security level of a shard, i.e., the proportion of honest / malicious IoT devices to the total number of nodes in the shard. The security problem of the shard is represented by the reputation problem of the shard to measure the extent to which the current shard reputation deviates from the global average:
[0099]
[0100] When the reputation value of a shard is closer to the average reputation value, it indicates that the score is closer to the average, that is, the proportion of honest / malicious verifiers is more similar, and the penalty factor is smaller; on the contrary, it indicates that malicious nodes are excessively concentrated in a shard. Therefore, the minimum value is to disperse malicious nodes as evenly as possible to the shards, so that malicious nodes are difficult to control a shard. The security of the system is formalized as the reputation value of all shards.
[0101] By overcoming the difficulties of quantitative formula and dimension relationship processing, the final result is no longer a simple ranking. It combines the performance and subjective reliability of the node, and can better reflect the comprehensive value and risk of the node in the shard network. It realizes the independence of each dimension and sub-index, provides complementary information, and calculates a final comprehensive reward by weighting and summing the scores of each sub-index in the performance and reputation dimensions through a fusion function. This is the most direct basis for shard allocation, and the weight value can be adjusted according to the specific network. The algorithm balances historical contribution and current ability, and can identify and handle dangerous nodes such as high-performance low-reputation nodes (high-performance nodes committing evil), significantly reducing their comprehensive score, or even directly excluding them; for low-performance high-reputation nodes (nodes with good reputation but performance degradation and hardware aging), allow their comprehensive score to be lower than that of high-performance new nodes.
[0102] Through multi-dimensional evaluation, a reliable basis is provided for shard allocation. When selecting a shard member, you can preferentially select nodes with high scores to ensure that the shard as a whole has high capacity and reliability. Avoid concentrating nodes with poor reputation in a shard (reduce the risk of successful attacks on the shard). Within a shard, when electing key roles such as leaders (shard master nodes), you can preferentially select nodes with the highest scores (or performance / reputation scores that meet the role requirements) from within the shard.
[0103] III. Sharding Decision
[0104] The upper committee runs a deep reinforcement learning algorithm to determine the number of lower committees required for the next epoch in a dynamically changing environment. The upper committee node deploys a DRL agent, selects a node as a shard strategy proposer according to the randomness of the epoch, takes the system state as the input of the agent, and outputs the formulated shard strategy. After the other members of the upper committee agree, the final strategy for the next epoch e+1 is determined to adjust the shard parameters of the system.
[0105] The present application combines Markov decision process (MDP) modeling system state, converts the sharding parameter decision problem into an optimization problem, and balances between the throughput and security of the sharding blockchain system. By optimizing the number of shards, the overall throughput of the system is maximized while ensuring the security of the blockchain. The optimization problem of the present application is constructed by the following factors:
[0106]
[0107] The throughput optimization goal is the number of valid transactions successfully processed per unit of time, the security optimization goal is the minimization of the penalty factor, and the constraint condition is the shard number limit and the maximum delay time that the system can tolerate. Therefore, the objective function of the final optimization problem is converted to:
[0108]
[0109] Where ω is the weight coefficient, which can be used to dynamically adjust the priority of the two optimization goals of the optimized system in different application scenarios.
[0110] State space: the state of the environment in which the system is at time t is called the environment state, and the state space contains the set of all environment states that the system can transition. Considering a dynamic and heterogeneous system with N nodes, where nodes will frequently move. For the performance and security trade-off under the proposed sharding blockchain architecture, the definition of state needs to reflect the dynamic changing performance value and reputation value of the blockchain nodes. Based on discrete t, the state space of the system is represented as follows:
[0111]
[0112] Sharding throughput , represents the throughput of each shard when the number of shards is K, which is calculated by the node performance score formula in the above. Sharding security , represents the security of each shard when the number of shards is K, which is calculated by the reputation score. Through the design of the state space, dimension compression is achieved, which compresses the multi-dimensional capability (performance and reputation) matrix of the nodes into the key indicators of sharding throughput and sharding security, avoiding dimension explosion of the state space. The design also realizes dynamic perception, and the sharding throughput and sharding security dynamically change with the number of shards K, directly reflecting the coupling relationship between the number of shards and security, throughput.
[0113] Action space: the set of actions that the agent can perform, the action taken by the DRL agent is to adjust the number of shards. At the beginning of each interval, when trying to adjust the parameters of the blockchain based on the current system state space, the agent needs to decide what strategy to take. By observing the state, the block size is selected for each epoch , block interval , bounded number of shards K, the agent can choose to increase, decrease or remain unchanged.
[0114]
[0115] The block size space and block interval are divided into discrete levels, with a maximum block capacity size limit and a maximum block generation interval limit . Based on the shard space, K∈{1,2,…, } represents the number of shards in the epoch, where is the maximum integer that satisfies the security constraint. Through joint optimization, the agent can flexibly trade off high-throughput scenarios (increase block size, reduce block interval, and moderately increase the number of shards) and high-security scenarios (reduce the number of shards to dilute the risk of single-shard). The design of the action space is discrete to prevent oscillation, and the action value is divided into discrete levels (such as the number of shards in integer steps), avoiding frequent reconfiguration caused by parameter fine-tuning.
[0116] Reward function: the reward obtained by the agent after performing action in the environment state . The reward function will be designed according to the performance and security of the system, which is the combination of objective 1 and objective 2 in the optimization problem described above. Unlike other designs, the invention converts the multi-objective reward function into a single objective by establishing the objective function, which optimizes the throughput objective to the number of valid transactions successfully processed in a unit of time, and the security optimization objective to the minimization of the penalty factor, with the constraint conditions being the limit of the number of shards and the maximum delay time that the system can tolerate. Therefore, the objective function of the final optimization problem is converted into a single objective, which maximizes the overall throughput of the system while ensuring the security of the blockchain. By dynamically adjusting the priority of throughput and security through weights, the invention adapts to different demand scenarios (such as high-load priority throughput).
[0117] (17)
[0118] To address the complex trade-off between sharding parameters and system performance, security, according to the above modeling of the MDP process, the optimization problem is solved. Deep reinforcement learning is used to train the agent to quickly learn when the environment state changes frequently. The DRL agent deployed in the upper layer shard continuously interacts with the blockchain environment for training, perceives the system state, and then the policy network generates actions. After the action is executed, the blockchain system enters the next state and feeds back the reward. During the training process, the agent will try different sharding settings, evaluate the trade-off between system performance and security, and adjust according to the feedback to find the appropriate number of shards. Under different dynamic environments, the balance between safety and performance is ensured.
[0119] The present application models the sharding decision as a Markov process, and realizes dynamic parameter optimization combined with deep reinforcement learning, so that the system can adapt to changes in load and security state. Through multi-dimensional state space and action space design, the throughput and safety goals are balanced, the long-term effectiveness and environmental adaptability of the strategy are improved, and it is suitable for complex dynamic network scenarios.
[0120] IV. Sharding decision consensus
[0121] In the consensus phase of each epoch, each lower committee collects and packages transactions from the local transaction pool, and then reaches consensus through the PBFT protocol to generate the corresponding transaction block. The new block is followed by the previous block, and the first block is followed by the state block recording the state partition result of the previous epoch.
[0122] The upper committee runs a deep reinforcement learning algorithm to determine the number of lower committees required for the next epoch in a dynamically changing environment. To respond to multi-factor coupling changes in real time, the DRL agent is deployed in a distributed manner, with a DRL agent deployed on all nodes of the upper committee. In each round, a node is randomly selected as the sharding strategy proposer for the next round based on the randomness of the epoch. This node takes the system state as the input of the agent and outputs the proposed sharding strategy. The upper committee conducts a lightweight consensus verification, and other nodes in the committee verify whether the proposer's strategy is within a reasonable threshold range to confirm the vote. Finally, after the unanimous agreement of the upper members, the final strategy for the next epoch e+1 is determined, and the system sharding parameters are adjusted.
[0123] Please refer to Figure 4 and Figure 5 , the sharding strategy of each epoch in the decision consensus process is determined by the consensus of the upper committee. First, a node of the upper committee where the agent is deployed will be randomly selected as the decision proposer according to the randomness of the current epoch . Then the current system state is determined to determine the input of the agent, and the sharding strategy is obtained. Finally The sharding strategy of the next epoch is agreed by the members of the upper committee. The specific process is as follows:
[0124] 1) Node Broadcast the system state, shard action and neural network parameters to other nodes of the upper committee.
[0125] 2) The node receiving the message uses a label to indicate the acceptance or rejection of the difference between the state of and the system state, judges the rationality of the difference according to the pre-defined error threshold, and broadcasts the message with the label to each other.
[0126] 3) When an honest node receives more than half of the action reasonable message, it will agree as the sharding strategy, and broadcast the agreement message again.
[0127] 4) When receives more than half of the messages agreed by other nodes, it will take this group as the final shard update.
[0128] The application ensures the verifiability and fault tolerance of the sharding strategy through the processes of random proposal, state verification, majority consensus and PBFT final confirmation, reduces decision conflicts, improves the efficiency of policy consensus, ensures the safety and consistency of the reconfiguration process, and provides decision support for stable operation of the system.
[0129] Five, node allocation optimization algorithm
[0130] In the initial stage, the system adopts random allocation, and divides the nodes into K+1 intervals according to the node identifier, and the nodes with identity in the K+1 interval join the upper committee, and the remaining nodes join the respective lower committee. In the subsequent epoch, the upper committee will run the allocation algorithm based on the node score calculated by multi-dimensional evaluation to determine the distribution of nodes in the lower committee.
[0131] Combined with Figure 6 , the node allocation algorithm based on multi-dimensional evaluation allocates nodes according to the reputation and performance of each node calculated, elects high-score nodes to participate in intra-shard consensus and adjusts the distribution. The specific process is as follows:
[0132] Step 1: Collect information. First, get the reputation value, performance value and current node shard mapping relationship of each node in the last round. Then calculate the reputation value and performance value of each shard according to the formula, and sort the shards according to the reputation value and performance value.
[0133] Step 2: Initial division. First, process new nodes, assign the calculated average reputation and performance values to the nodes that joined the system in the last epoch. Then, reassign to the nodes that were not in the lower layer shard in the last epoch (such as the upper committee nodes). When m is greater than m', that is, the number of nodes in the new round of sharding is greater than the last round, if the score of node i is greater than the average value, add node i to the shard with the smallest comprehensive score, otherwise add it to the shard with the largest score; when m is less than m', node i is added to the newly created shard.
[0134] Step 3: Adjust node distribution. Set the initial value of the output, the number of iterations and the condition threshold. First, balance the node size, according to the number of new round shards obtained, use random method to merge or split the shards. Then randomly select a node in the shard with the smallest comprehensive score and exchange it with a randomly selected node in the shard with the largest comprehensive score, update the score variance and reorder until the score variance is less than the threshold or the maximum number of iterations is reached.
[0135] Finally, output the shard result and update the next round of lower layer shard configuration.
[0136] Based on the dynamic allocation algorithm of node score, through initial division, iterative optimization and variance control, the performance balance between shards is realized, and the concentration of malicious nodes is avoided; the overall collaboration efficiency of the shard is improved, the system attack resistance is enhanced, and the dynamic changes of node joining / leaving are adapted, ensuring the stability of the system.
[0137] Please refer to Figure 7 and Figure 8The experimental results show that in the early stage of learning, the reward is low, and the system has not yet reached the balance between throughput and security, but as the curve rises during the training process, the agent is learning quickly. As the DQN agent finds the optimal parameters, the system reward gradually increases, and the final reward stabilizes, indicating that the strategy has basically converged, and the balance between throughput and security is ultimately achieved. The convergence of the algorithm reward indicates that the DQN agent has learned a strategy that maximizes the action value function, so it can be shown that the proposed optimization scheme is effective in large-scale scenarios. As the proportion of malicious nodes in the network increases, the probability of selecting and assigning malicious nodes into shards also increases, and a decrease in global security probability can lead to shard failure and disrupt normal transaction processing, so the system reward decreases. When the proportion of malicious nodes in the system is fixed, the more shards there are, the lower the security of a single shard. The security of the PoW consensus in the Ethereum scheme is based on the 51% rule: as long as the malicious node computing power does not exceed 51% of the network, it can resist attacks. However, the high energy consumption and low throughput of PoW make it difficult to support large-scale scenarios, and the problem is exacerbated when shards are expanded, and the dispersion of network computing power weakens the defense capabilities of a single shard. The proposed DRL scheme is based on parallel processing of shards and optimization of parameters, so even if malicious nodes disrupt consensus, the system reward is still high. In the absence of malicious nodes, the reward of the proposed scheme is 29.6% higher than that of the baseline scheme, and in the presence of 20% malicious nodes, it is 96.7% higher.
[0138] The main purpose of the present application is to improve the scalability and security of sharded blockchains in large-scale application environments. By adopting partitioning technology, nodes in different partitions can be processed in parallel. The double-layer sharding architecture design, dynamic parameter optimization model, and multi-dimensional node evaluation mechanism enable the reconfiguration of sharded blockchains in large-scale heterogeneous networks. In the designed double-layer sharding architecture, the upper layer committee performs node evaluation and parameter optimization, and the lower layer performs transaction consensus. The designed multi-dimensional evaluation algorithm calculates node performance and reputation, and the deep reinforcement learning algorithm dynamically adjusts the shard parameters during the reconfiguration process, and adjusts the distribution of nodes according to their scores, achieving node performance and shard load balancing, and maintaining global security. The present application can effectively improve the throughput while balancing the risk of sharding, achieving a trade-off between throughput and security during the reconfiguration process.
[0139] The above describes the embodiments of the present application in detail, but the content described is only the preferred embodiments of the present application, and cannot be considered as limiting the scope of the present application. Any equivalent changes and improvements made within the scope of the present application should still be included in the scope of the present application.
Claims
1. A method for multi-dimensional evaluation and intelligent dynamic reconstruction of sharded blockchain nodes, characterized in that, Includes the following steps: S1. Build a two-tier sharded blockchain architecture that includes an upper-level committee and multiple lower-level committees; S2. Divide each epoch into a consensus phase and a reconfiguration phase; S3. Characterize the malicious behavior of nodes, design multi-dimensional evaluation to calculate node performance and reputation, provide a comprehensive and dynamic profile of nodes, and use the evaluation results for quantitative analysis of sharding throughput and security. S4. Based on the adaptive execution of sharding decisions according to the system state, the sharding parameters are dynamically adjusted during the reconfiguration process. A deep reinforcement learning method is used to determine the sharding strategy to achieve a balance between system throughput and security. S5. A node randomly selected from the upper-level committee serves as the proposer of the sharding strategy. Other members vote based on whether the state difference is within the threshold. The upper-level committee reaches a consensus on the sharding strategy to ensure the verifiability and fault tolerance of the reconfiguration decision. S6. Determine whether a node can participate in consensus based on its rating, forming an effective admission mechanism. Execute a node allocation optimization algorithm based on the node's performance and reputation rating to adjust the distribution of nodes in the system and balance performance and security.
2. The method for multi-dimensional evaluation and intelligent dynamic reconstruction of sharded blockchain nodes according to claim 1, characterized in that, In step S3, calculating node performance includes: the node performance score includes the node's inherent attribute score and the throughput contribution score during the consensus phase. The node performance score formula is: , Let m represent the number of transactions in block j, where m is... The total number of nodes in the system B represents the number of nodes that behaved correctly during the consensus process of block j; B represents the sum of the number of blocks successfully committed and the number of blocks that were not successfully committed during the epoch. It is a block submission penalty flag; It is an identifier of the behavior in block j submission; , , These represent the total computing power, communication power, and storage power of all nodes, respectively.
3. The method for multi-dimensional evaluation and intelligent dynamic reconstruction of sharded blockchain nodes according to claim 1, characterized in that, In step S3, calculating the node reputation includes: S31. The node reputation value is updated based on whether it has made mistakes such as block proposal errors, delays, or forged votes in each round of consensus, and a reputation penalty coefficient and reward mechanism are set up. S32. The formula for the stage reputation score of a node is defined as follows: , in It is a score of node i's block proposal behavior. ρ is the score for node i's voting behavior, and ρ is the reputation increase coefficient; and The specific calculations are as follows: , , in It represents the total number of node block proposal actions. It is the total number of node voting actions. , , These represent three malicious behaviors in the block proposal. This indicates malicious behavior during the voting process. , , and These represent the corresponding penalty coefficients; S33. The overall reputation value of a node is updated according to the following formula: .
4. The method for multi-dimensional evaluation and intelligent dynamic reconstruction of sharded blockchain nodes according to claim 1, characterized in that, In step S4, a deep reinforcement learning method is used for the segmentation strategy, specifically including: S41. Model sharding throughput and security as an optimization problem, and use deep reinforcement learning to train an intelligent agent to decide the number of shards, block size and time interval at each epoch. S42, State Space This includes throughput and security metrics for all fragments; action space. This includes increasing, decreasing, or maintaining the current number of fragments, adjusting block size, or time intervals; S43. The reward function is calculated based on the overall system throughput and the security penalty factor of sharding, with the goal of maximizing throughput while minimizing the concentration of malicious nodes, i.e.: 。 5. The method for multi-dimensional evaluation and intelligent dynamic reconstruction of sharded blockchain nodes according to claim 1, characterized in that, In step S5, the steps for the upper-level committee to reach a consensus on the sharding strategy include: S51, Node Broadcast the system status, sharding actions, and neural network parameters to other nodes of the upper-level committee; S52. The node that receives the message uses a label to represent it. Whether to accept the difference between the state and the system state is determined based on a predefined error threshold to judge the reasonableness of the difference, and messages with this label are broadcast to each other. S53, When an honest node receives more than half of the actions Reasonable information will be agreed upon As a fragmentation strategy, the agreement message will be broadcast again; S54, when Upon receiving a message agreeing to more than half of the other nodes, this combination of dynamic space, state space, reward function, and next state is... This serves as the final shard update.
6. The method for multi-dimensional evaluation and intelligent dynamic reconstruction of sharded blockchain nodes according to claim 1, characterized in that, In step S6, the node allocation optimization algorithm specifically includes: S61. Initial partitioning: Initially allocate nodes according to the average historical score. S62. Shard rating and sorting: Rank the shards according to their average performance and reputation. S63. Iterative balance optimization: Randomly select nodes in low-scoring segments and swap them with nodes in high-scoring segments; S64. Update the score variance of each slice. If the slice variance is lower than the threshold or the maximum number of iterations is reached, output the slice result.
7. The method for multi-dimensional evaluation and intelligent dynamic reconstruction of sharded blockchain nodes according to claim 1, characterized in that, In step S1, the upper-level committee is responsible for global information maintenance, multi-dimensional evaluation of nodes, decision-making on the number of shards and allocation scheduling, collecting transaction processing and node behavior information fed back by the lower-level committee, reaching consensus on sharding strategy proposals, forming a consistent sharding configuration across the entire network and broadcasting it; the lower-level committee is responsible for distributed transaction processing and state maintenance, and does not participate in the decision-making process.
Citation Information
Cited By
Reinforcement learning driven unmanned aerial vehicle block chain network dynamic fragmentation method and device
CN121568117A