A blockchain sharding committee scheduling method and device, a terminal and a storage medium
By using a scheduling scheme in the form of Markov chain nodes in blockchain sharded transactions, the committee arrangement is optimized, the problems of committee formation latency and uneven processing capacity are solved, and the transaction efficiency is improved.
Patent Information
- Application Number
- CN202111495931.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-08
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2041-12-08
AI Technical Summary
现有的区块链分片交易存在交易效益低的问题,主要由于委员会形成时延过长和不同委员会处理能力不平衡导致的共识时延不均衡,导致交易效率低下。
A scheduling scheme using Markov chain nodes is adopted. By calculating the utility coefficient of the scheduling scheme within a preset time period, the arrangement of the committee is optimized to maximize the total transaction volume and minimize the transaction accumulation time. The scheduling process is optimized using the Log-Sum-Exp approximation algorithm and the random exploration algorithm.
It increases the throughput of the blockchain, reduces unnecessary waiting latency, improves transaction efficiency, and solves the problem of low transaction efficiency.
Smart Images

Figure CN114154893B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain sharding technology, and in particular to a blockchain sharding committee scheduling method, device, terminal and storage medium. Background Technology
[0002] The development of big data technology has created excellent development opportunities for data transaction technologies such as blockchain, which have been widely applied in many fields. With the widespread application of blockchain technology, the scale of transactions is also increasing. Traditional blockchain transaction mechanisms rely too heavily on nodes, which affects transaction efficiency. To address the urgent need to improve transaction efficiency, blockchain-based sharding technology has emerged.
[0003] Sharding is a committee-based approach to blockchain transaction management. It divides a transaction group into different shards and selects multiple committees to process these shards in parallel. For example, the Elastico mechanism's key idea is to divide blockchain network nodes into smaller committees. Each committee consists of a group of miners who collaborate to process a set of disjoint transactions called shards. Each epoch typically includes the following five phases: (1) Committee Formation: Some processor groups, i.e. miners, will be elected to form a committee according to the PoW election mechanism; (2) Overlay Configuration: Processors are configured to discover and identify each other by exchanging committee members; (3) Intra-Committee Consensus: Processors in each committee implement a set of agreed transactions, i.e., shards, by running a standard Byzantine protocol (such as PBFT[3]); (4) Final Consensus: Next, all shards generated by the committees will be submitted to the final committee, which will generate a new global block for the root chain; (5) Epoch Randomness Refreshing: Finally, the final committee generates a set of random strings to help other committees form new strings in the next epoch.
[0004] However, some blockchain node groups consume significant formation latency at the start of each epoch to form a committee. Furthermore, the varying processing capabilities of different committees lead to unbalanced consensus latency. These two phases of latency ultimately result in a large accumulation time for transactions waiting in the final committee, causing the existing blockchain sharding transaction technology to suffer from low transaction efficiency. Summary of the Invention
[0005] This application provides a blockchain sharding committee scheduling method, apparatus, terminal, and storage medium to solve the technical problem of low transaction efficiency in existing blockchain sharding transactions.
[0006] The first aspect of this application provides a blockchain sharding committee scheduling method, including:
[0007] In response to the triggering of committee scheduling conditions, the system begins listening for dynamic events of the committee. Based on the number of arriving committee shards, several scheduling schemes for committee shards are initialized, and a timer is set for each of the scheduling schemes, wherein each scheduling scheme is associated with nodes in a Markov chain.
[0008] Within the timer's timing period, based on a preset scheduling objective function, the utility coefficient of the current benchmark scheme is calculated. Then, according to the node composition and state transition probabilities of the Markov chain, the next scheduling scheme of the benchmark scheme is set as the new benchmark scheme. Based on the new benchmark scheme, the utility coefficient of the benchmark scheme is calculated. The scheduling objective function is a function that quantifies the total allowed transaction volume and transaction accumulation time of the benchmark scheme into a utility coefficient. The benchmark scheme is any one of the several scheduling schemes. The state transition probability is calculated based on the difference between the estimated utility coefficient of the new benchmark scheme and the utility coefficient of the current benchmark scheme.
[0009] When any timer expires, the state transition of the Markov chain is triggered and a reset signal is broadcast to other scheduling schemes, so that the other scheduling schemes respond to the reset signal and refresh their respective timers based on the first utility coefficient. This is so that if the calculation result of the utility coefficient does not meet the convergence condition, the utility coefficient of each scheduling scheme is recalculated based on the refreshed timer. The first utility coefficient is the utility coefficient calculated according to the scheduling scheme corresponding to the timer that has expired.
[0010] When the calculation result of the utility coefficient meets the convergence condition, the listening is terminated and no new blocks submitted by committee fragments are accepted. Then, based on the current utility coefficient, the target scheduling scheme corresponding to the maximum utility coefficient is determined so as to determine the committee fragments to join the final committee according to the target committee scheduling scheme.
[0011] Preferably, the formula for calculating the timing period is:
[0012]
[0013] In the formula, T is the timing period, and I jThis represents all shards generated by each committee in the j-th epoch, where n is the number of blockchain shards, τ is a conditional constant, β is a non-negative constant, and U f U is the utility coefficient of the current benchmark scheme. f' This is the estimated utility coefficient of the new benchmark scheme.
[0014] Preferably, the formula for calculating the state transition probability is:
[0015]
[0016] In the formula, q f,f' Let τ be the state transition probability, β be a conditional constant, and U be a non-negative constant. f U is the utility coefficient of the current benchmark scheme. f' This is the estimated utility coefficient of the new benchmark scheme.
[0017] Preferably, the formula for calculating the scheduling objective function is:
[0018]
[0019] In the formula, U is the utility coefficient, J is the set of epochs, and I... j Y represents all the fragments generated by each committee in the j-th epoch. i j Let i be the cumulative transaction time for the i-th committee during the j-th epoch. For the i-th committee in the j-th epoch, Let N be the transaction volume of the shard corresponding to the i-th committee in the j-th epoch. min The minimum threshold for the number of committee members, This represents the capacity of transactions that can be packaged into the final block in each epoch, where α is an adjustable weight used to measure the deviation from the total allowed number of transactions. Let t be a binary variable used to indicate whether the i-th committee is allowed to participate in the consensus phase. j This refers to the fragment received in the j-th epoch under a given timing period.
[0020] Preferably, the step of calculating the utility coefficient of the current baseline scheme based on a preset scheduling objective function within a preset timing period specifically includes:
[0021] Within a preset timing period, based on a preset scheduling objective function, the utility coefficient of the current baseline scheme is calculated using the Log-Sum-Exp approximation algorithm.
[0022] A second aspect of this application provides a blockchain sharding committee scheduling device, comprising:
[0023] The scheduling scheme initialization unit is used to start listening to dynamic events of the committee in response to the triggering of committee scheduling conditions. Based on the number of arriving committee shards, several scheduling schemes for committee shards are initialized, and a timer is set for each of the scheduling schemes, wherein each scheduling scheme is associated in the form of nodes in a Markov chain.
[0024] The utility coefficient calculation execution unit is used to calculate the utility coefficient of the current benchmark scheme based on a preset scheduling objective function within the timer's timing period. Then, according to the node composition and state transition probability of the Markov chain, it sets the next scheduling scheme of the benchmark scheme as a new benchmark scheme, so as to calculate the utility coefficient of the benchmark scheme based on the new benchmark scheme. The scheduling objective function is a function that quantifies the total allowed transaction volume and transaction accumulation time of the benchmark scheme into a utility coefficient. The benchmark scheme is any one of the plurality of scheduling schemes. The state transition probability is calculated based on the difference between the estimated utility coefficient of the new benchmark scheme and the utility coefficient of the current benchmark scheme.
[0025] The timing refresh unit is used to trigger the state transition of the Markov chain and broadcast a reset signal to other scheduling schemes when any timer finishes timing out. This causes the other scheduling schemes to respond to the reset signal and refresh their respective timers based on a first utility coefficient. This allows the utility coefficients of each scheduling scheme to be recalculated based on the refreshed timers when the calculation result of the utility coefficient does not meet the convergence condition. The first utility coefficient is the utility coefficient calculated based on the scheduling scheme corresponding to the timer that has finished timing out.
[0026] The target scheme determination unit is used to terminate listening and no longer accept blocks submitted by newly arrived committee fragments when the calculation result of the utility coefficient meets the convergence condition. Then, based on the current utility coefficient, it determines the target scheduling scheme corresponding to the maximum utility coefficient, so as to determine the committee fragments to join the final committee according to the target committee scheduling scheme.
[0027] A third aspect of this application provides a blockchain sharding committee scheduling terminal, comprising: a memory and a processor.
[0028] The memory is used to store program code, which corresponds to the blockchain sharding committee scheduling method provided in the first aspect of this application.
[0029] The processor is used to execute the program code to implement the blockchain sharding committee scheduling method as provided in the first aspect of this application.
[0030] The fourth aspect of this application provides a computer-readable storage medium storing program code corresponding to the blockchain sharding committee scheduling method provided in the first aspect of this application.
[0031] As can be seen from the above technical solutions, this application has the following advantages:
[0032] The blockchain sharding committee scheduling method provided in this application, based on an initialized scheduling scheme associated with Markov chain nodes, calculates the utility coefficient of the scheduling scheme within a preset time period based on a preset scheduling objective function. This allows for the final committee to be assigned a committee with higher utility value. It maximizes the total allowed transactions for the final committee and minimizes the waiting latency of transactions within the committee, thereby improving blockchain throughput, reducing unnecessary waiting latency, and solving the technical problem of low transaction efficiency in existing blockchain sharding transactions. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 This is a schematic diagram of the committee scheduling process for forming the final committee in a blockchain.
[0035] Figure 2 The impact of the number of nodes participating in the committee formation process on the latency of the two phases of the committee.
[0036] Figure 3 This is a schematic diagram showing the time-domain distribution of delays in the two stages of the committee scheduling process.
[0037] Figure 4 This is a flowchart illustrating an embodiment of a blockchain sharding committee scheduling method provided in this application.
[0038] Figure 5 This is a schematic diagram of one embodiment of a blockchain sharding committee scheduling device provided in this application.
[0039] Figure 6 This is a diagram illustrating the relationship between the committee and the random exploration algorithm. Detailed Implementation
[0040] like Figure 1 As shown, Figure 1This demonstrates the Elastico committee formation and consensus process. During the committee formation phase, some blockchain node groups incur significant latency at the start of each epoch to form a committee. Furthermore, the varying processing capabilities of different committees lead to uneven consensus latency. These two phases of latency introduce substantial cumulative time for transactions waiting in the final committee. Consequently, blockchain throughput can be significantly reduced due to the accumulated time of large transactions, highlighting the technical issue of low transaction efficiency inherent in existing blockchain sharding.
[0041] To understand the latency of these two phases, the applicant measured the latency overhead of the committee formation phase and the intra-committee consensus phase based on the Elastico sharding protocol. The results are as follows: Figure 2 and Figure 3 As shown.
[0042] Figure 2 This demonstrates the two-stage latency when the network size changes, namely the number of nodes participating in committee formation. Compared to consensus latency, committee formation latency consumes a significant portion of the latency, and while the number of transactions a committee can handle increases with network size, the formation latency also increases linearly.
[0043] Depend on Figure 3 It is known that both latency periods exhibit a random distribution within a specific range. For Phase 3 of the Elastico protocol, it has been proven that the intra-committee consensus latency differs between different committees. This is because committees perform their local consensus through heterogeneous network connections and transaction verification functions. Therefore, when committees complete their local PBFT protocol and submit their respective shard blocks to the final committee, the consensus latency will show an unbalanced distribution. Consequently, this unbalanced two-phase latency will cause some laggards in the final committee, hindering the final committee from initiating final consensus as early as possible.
[0044] The above experimental results reflect the relationship between different sizes of blockchain committees, different node compositions, and the changes in latency between the two phases. However, a suitable blockchain committee must consider both the cumulative transaction time and the total number of transactions contributed by the committee. Therefore, how to determine a suitable scheduling scheme and improve the transaction efficiency of blockchain sharding transactions has become a technical problem that urgently needs to be solved by those skilled in the art.
[0045] In view of this, embodiments of this application provide a blockchain sharding committee scheduling method, apparatus, terminal, and storage medium to solve the technical problem of low transaction efficiency in existing blockchain sharding transactions.
[0046] In order to make the purpose, features, and advantages of the invention of this application more obvious and easy to understand, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described below are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0047] Please see Figure 4 The first embodiment of this application provides a blockchain sharding committee scheduling method, including:
[0048] Step 101: In response to the triggering of the committee scheduling condition, start listening for committee dynamic events. Based on the number of arriving committee fragments, initialize several committee fragment scheduling schemes and set a timer for each scheduling scheme.
[0049] Each scheduling scheme is associated with nodes in a Markov chain.
[0050] First, in response to the triggering of committee scheduling conditions, the system begins listening for dynamic events of the committee. Based on the number of arriving committee shards, several scheduling schemes for committee shards are initialized. A timer is set for each scheduling scheme. This application treats each scheduling scheme as a node in a Markov chain, linking each scheduling scheme together as nodes in the Markov chain for use in subsequent steps.
[0051] Step 102: Within the timer's timing period, calculate the utility coefficient of the current baseline scheme based on the preset scheduling objective function. Then, according to the node composition and state transition probability of the Markov chain, set the next scheduling scheme of the baseline scheme as the new baseline scheme so that the utility coefficient of the baseline scheme can be calculated based on the new baseline scheme.
[0052] The scheduling objective function is a function that quantifies the total allowed transaction volume and transaction accumulation time of the baseline scheme into a utility coefficient. The baseline scheme is any one of several scheduling schemes. The state transition probability is calculated based on the difference between the estimated utility coefficient of the new baseline scheme and the utility coefficient of the current baseline scheme.
[0053] It should be noted that the method provided in this embodiment adopts the algorithmic idea of the random exploration (SE) algorithm, wherein the scheduling objective function includes the following two aspects: (1) maximizing the total number of transactions allowed by the final committee; (2) minimizing the cumulative time of these transactions. Based on the above principles, it can be understood that the relationship between the utility coefficient obtained by calculating the scheduling objective function and the total number of transactions allowed and the cumulative time of transactions in the scheduling scheme should satisfy the following: the value of the total number of transactions allowed is positively correlated with the value of the utility coefficient, while the value of the cumulative time of transactions is negatively correlated with the value of the utility coefficient. Thus, the ability of a scheduling scheme to balance transaction throughput and transaction cumulative time can be judged by the utility coefficient calculated within a finite timing period.
[0054] It should be noted that a Markov chain is a stochastic process existing in a discrete exponential state space. In a stochastic process, a Markov chain transitions from one state to another in the state space. Furthermore, this process is "memoryless," meaning the probability of the next state depends only on the current state and is independent of other historical states. Since the two states are independent of each other, using a Markov chain to associate the scheduling schemes in step 101, and setting the next scheduling scheme as the new baseline scheme in step 102, avoids the utility coefficient calculation of the latter scheme being affected by the former scheme, thus preventing any impact on the accuracy of the calculation results. Moreover, at each step of the Markov chain, according to the probability distribution, the current state can either transition to another state or remain unchanged. A change of state is called a transition, and the probability associated with different state changes is called the transition probability. Based on this, the state transition probability in this embodiment is calculated based on the difference between the estimated utility coefficient of the new baseline scheme and the utility coefficient of the current baseline scheme. This can accelerate the transition rate of the Markov chain when the estimated utility coefficient of the latter scheme is significantly higher than that of the current scheme. The higher the estimated utility coefficient of the latter scheme is compared to the utility coefficient of the current scheme, the faster the transition rate will be, and vice versa.
[0055] Step 103: When any timer expires, the state transition of the Markov chain is triggered and a reset signal is broadcast to other scheduling schemes, so that the other scheduling schemes respond to the reset signal and refresh their respective timers based on the first utility coefficient. This is so that if the calculation result of the utility coefficient does not meet the convergence condition, the utility coefficient of each scheduling scheme is recalculated based on the refreshed timer. The first utility coefficient is the utility coefficient calculated according to the scheduling scheme corresponding to the timer that has expired.
[0056] Step 104: When the calculation result of the utility coefficient meets the convergence condition, stop listening and no longer accept blocks submitted by newly arrived committee fragments. Then, based on the current utility coefficient, determine the target scheduling scheme corresponding to the maximum utility coefficient, so as to determine the committee fragments to be added to the final committee according to the target committee scheduling scheme.
[0057] It should be noted that when any timer expires, a state transition of the Markov chain is triggered and a reset signal is broadcast to other scheduling schemes. This causes the other scheduling schemes to respond to the reset signal and refresh their respective timers based on the first utility coefficient. If the calculated utility coefficient does not meet the convergence condition, the utility coefficient of each scheduling scheme is recalculated based on the refreshed timer using the calculation method in step 102 until the convergence condition is met. Then, based on the maximum utility coefficient, the target scheduling scheme corresponding to the maximum utility coefficient is determined, so as to determine the final committee of each blockchain shard according to the target scheduling scheme.
[0058] The above content is a detailed description of an embodiment of the blockchain sharding committee scheduling method provided in this application. The blockchain sharding committee scheduling method provided in this application, based on an initialized scheduling scheme associated with Markov chain nodes, calculates the utility coefficient of the scheduling scheme within a preset time period based on a preset scheduling objective function. This allows for the final committee to be assigned a committee with higher utility value. It maximizes the total allowed transactions for the final committee and minimizes the waiting latency of transactions within the committee, thereby improving blockchain throughput, reducing unnecessary waiting latency, and solving the technical problem of low transaction efficiency in existing blockchain sharding transactions.
[0059] Based on the first embodiment described above, the second embodiment of this application provides a more specific blockchain sharding committee scheduling method, including:
[0060] More specifically, the formula for calculating the scheduling objective function is:
[0061]
[0062] In the formula, U is the utility coefficient, J is the set of epochs, and I... j Y represents all the fragments generated by each committee in the j-th epoch. i j Let i be the cumulative transaction time for the i-th committee during the j-th epoch. For the i-th committee in the j-th epoch, Let N be the transaction volume of the shard corresponding to the i-th committee in the j-th epoch. minThe minimum threshold for the number of committee members, This represents the capacity of transactions that can be packaged into the final block in each epoch, where α is an adjustable weight used to measure the deviation from the total allowed number of transactions. Let t be a binary variable used to indicate whether the i-th committee is allowed to participate in the consensus phase, where 1 indicates permission and 0 indicates no permission. j This refers to the fragment received in the j-th epoch under a given timing period.
[0063] According to the scheduling objective function expression above, in objective function (1), α is an adjustable weight used to measure the deviation of the total number of allowed transactions. Formula (2) calculates the cumulative time of all transactions packaged in each shard, that is, the cumulative waiting time from the start of committee formation to the specified deadline. Constraint (3) specifies that the number of selected member committees should be greater than the predefined minimum number N for each epoch. min In constraint (4), This represents the capacity of the number of transactions that can be packaged into the final block in each epoch.
[0064] In some possible embodiments, calculating the utility coefficient of the current baseline scheme based on a preset scheduling objective function within a preset timing period specifically includes:
[0065] Within a preset timing period, based on a preset scheduling objective function, the utility coefficient of the current baseline scheme is calculated using the Log-Sum-Exp approximation algorithm.
[0066] It should be noted that, to better understand the log-sum-exp approximation, we first use f to represent a feasible solution to the MVCom problem, and F to represent the set of all feasible solutions. Using U... f Let f represent the objective function corresponding to a given solution f. Let each solution f be associated with the probability p. f The associated probability represents the percentage of time the system uses solution f. Here, β is defined as a non-negative constant related to the approximation performance. The motivation behind this time-averaged approximation is that the log-sum-exp approximation algorithm may produce random solutions. Among these random solutions, a near-optimal solution can be obtained by constructing a well-designed transition rate matrix over the solution set F. Let... This is the optimal solution to the MVCom(β) problem. Then, by solving the Karush-Kuhn-Tucker (KKT) conditions for MVCom(β), we obtain the stationary probability of each solution f:
[0067]
[0068] More specifically, the formula for calculating the state transition probability is:
[0069]
[0070] In the formula, q f,f' U is the state transition probability, used to control the state transition rate of the Markov chain. τ is a conditional constant used to prevent the exp(·) function from being too small to equal 0 in the calculation. β is a non-negative constant. f U is the utility coefficient of the current benchmark scheme. f' This is an estimate of the utility coefficient for the new benchmark scheme. When U f' -U f As the conversion rate increases, the conversion rate also increases, and vice versa. Therefore, this conversion rate is designed to drive the system toward a better solution f' with greater utility.
[0071] Understandably, the design of a Markov chain involves a state space containing all feasible solutions f and a stationary distribution. Since the system operates under different solutions, the transition between two states in the designed Markov space represents replacing any accepted slice generated by the member committee. Therefore, in the implemented Markov chain, if the transitions between states can be trained to converge to the desired stationary distribution... Then the system can achieve near-optimal performance.
[0072] Furthermore, the algorithm provided in this embodiment is based on Markov chain theory and the implementation of a stochastic exploration algorithm for the transition rate matrix designed in the previous section. First, according to Figure 6 The diagram illustrates the interaction between the committee and the proposed algorithm. The algorithm in this embodiment can be executed on several independent parallel threads. Each thread runs a set of feasible solutions and its own timers. When a timer expires, the feasible solution with the highest system utility is selected from the multiple feasible solutions. Further iterations can then be performed to obtain the feasible solution with the highest utility across all rounds, which is a suboptimal solution very close to the optimal solution. In the designed algorithm, all parallel threads communicate with the committee in real time, solely to share very limited state information, such as reset signals and the current system utility. When a thread receives a reset signal, it updates the system utility U... f' Refresh its timer T.
[0073] More specifically, the formula for calculating the timing period is:
[0074]
[0075] In the formula, T is the timing period, and I jThis represents all shards generated by each committee in the j-th epoch, where n is the number of blockchain shards, τ is a conditional constant, β is a non-negative constant, and U f U is the utility coefficient of the current benchmark scheme. f' This is an estimate of the utility coefficients for the new benchmark scheme.
[0076] The above is a detailed description of the second embodiment of a blockchain sharding committee scheduling method provided in this application. The following is a description of an embodiment of a blockchain sharding committee scheduling device provided in this application.
[0077] Please see Figure 5 The third embodiment of this application provides a blockchain sharding committee scheduling device, including:
[0078] The scheduling scheme initialization unit 201 is used to start listening to the dynamic events of the committee in response to the triggering of the committee scheduling conditions. Based on the number of arriving committee shards, several scheduling schemes for committee shards are initialized, and a timer is set for each scheme. Each scheduling scheme is associated with nodes in a Markov chain.
[0079] The utility coefficient calculation execution unit 202 is used to calculate the utility coefficient of the current benchmark scheme based on a preset scheduling objective function within a timing period. Then, according to the node composition and state transition probability of the Markov chain, the next scheduling scheme of the benchmark scheme is set as the new benchmark scheme, so that the utility coefficient of the benchmark scheme can be calculated based on the new benchmark scheme. The scheduling objective function is a function that quantifies the total allowed transaction volume and transaction accumulation time of the benchmark scheme into the utility coefficient. The benchmark scheme is any one of several scheduling schemes. The state transition probability is calculated based on the difference between the estimated utility coefficient of the new benchmark scheme and the utility coefficient of the current benchmark scheme.
[0080] The timing refresh unit 203 is used to trigger the state transition of the Markov chain and broadcast a reset signal to other scheduling schemes when any timer ends, so that the other scheduling schemes respond to the reset signal and refresh their respective timers based on the first utility coefficient. This is so that when the calculation result of the utility coefficient does not meet the convergence condition, the utility coefficient of each scheduling scheme is recalculated based on the refreshed timer. The first utility coefficient is the utility coefficient calculated according to the scheduling scheme corresponding to the timer that has ended.
[0081] The target scheme determination unit 204 is used to terminate listening and no longer accept blocks submitted by newly arrived committee fragments when the calculation result of the utility coefficient meets the convergence condition. Then, based on the current utility coefficient, it determines the target scheduling scheme corresponding to the maximum utility coefficient, so as to determine the committee fragments to be added to the final committee according to the target committee scheduling scheme.
[0082] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the terminals, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0083] In the several embodiments provided in this application, it should be understood that the disclosed terminals, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.
[0084] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0085] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0086] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0087] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part 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 of the various embodiments of the present 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.
[0088] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A blockchain sharding committee scheduling method, characterized in that, include: In response to the triggering of committee scheduling conditions, the system begins to listen for dynamic events of the committee, initializes several scheduling schemes for committee shards based on the number of arriving committee shards, and sets a timer for each of the scheduling schemes, wherein each scheduling scheme is associated in the form of nodes in a Markov chain. Within the timer's timing period, based on a preset scheduling objective function, the utility coefficient of the current benchmark scheme is calculated. Then, according to the node composition and state transition probabilities of the Markov chain, the next scheduling scheme of the benchmark scheme is set as the new benchmark scheme. Based on the new benchmark scheme, the utility coefficient of the benchmark scheme is calculated. The scheduling objective function is a function that quantifies the total allowed transaction volume and transaction accumulation time of the benchmark scheme into a utility coefficient. The benchmark scheme is any one of the several scheduling schemes. The state transition probability is calculated based on the difference between the estimated utility coefficient of the new benchmark scheme and the utility coefficient of the current benchmark scheme. When any timer expires, the state transition of the Markov chain is triggered and a reset signal is broadcast to other scheduling schemes, so that the other scheduling schemes respond to the reset signal and refresh their respective timers based on the first utility coefficient. This is so that if the calculation result of the utility coefficient does not meet the convergence condition, the utility coefficient of each scheduling scheme is recalculated based on the refreshed timer. The first utility coefficient is the utility coefficient calculated according to the scheduling scheme corresponding to the timer that has expired. When the calculation result of the utility coefficient meets the convergence condition, the listening is terminated and no new blocks submitted by committee fragments are accepted. Then, based on the current utility coefficient, the target scheduling scheme corresponding to the maximum utility coefficient is determined so as to determine the committee fragments to be added to the final committee according to the target committee scheduling scheme. The formula for calculating the scheduling objective function is as follows: In the formula, U is the utility coefficient, J is the set of epochs, and I... j Y represents all the fragments generated by each committee in the j-th epoch. i j Let i be the cumulative transaction time for the i-th committee during the j-th epoch. For the i-th committee in the j-th epoch, Let N be the transaction volume of the shard corresponding to the i-th committee in the j-th epoch. min The minimum threshold for the number of committee members, This represents the capacity of transactions that can be packaged into the final block in each epoch, where α is an adjustable weight used to measure the deviation from the total allowed number of transactions. Let t be a binary variable used to indicate whether the i-th committee is allowed to participate in the consensus phase. j This refers to the fragment received in the j-th epoch under a given timing period.
2. The blockchain sharding committee scheduling method according to claim 1, characterized in that, The formula for calculating the timing period is: In the formula, T is the timing period, and I j This represents all shards generated by each committee in the j-th epoch, where n is the number of blockchain shards, τ is a conditional constant, β is a non-negative constant, and U f U is the utility coefficient of the current benchmark scheme. f' This is the estimated utility coefficient of the new benchmark scheme.
3. The blockchain sharding committee scheduling method according to claim 1, characterized in that, The formula for calculating the state transition probability is: In the formula, q f,f' Let τ be the state transition probability, β be a conditional constant, and U be a non-negative constant. f U is the utility coefficient of the current benchmark scheme. f' This is the estimated utility coefficient of the new benchmark scheme.
4. The blockchain sharding committee scheduling method according to claim 1, characterized in that, The calculation of the utility coefficient of the current baseline scheme based on a preset scheduling objective function within the timer's timing period specifically includes: Within the timer's timing period, the utility coefficient of the current baseline scheme is calculated using the Log-Sum-Exp approximation algorithm based on a preset scheduling objective function.
5. A blockchain sharding committee scheduling device, characterized in that, include: The scheduling scheme initialization unit is used to respond to the triggering of committee scheduling conditions, start listening to the dynamic events of the committee, initialize several scheduling schemes for committee shards based on the number of arriving committee shards, and set a timer for each of the scheduling schemes, wherein each scheduling scheme is associated in the form of nodes in a Markov chain. The utility coefficient calculation execution unit is used to calculate the utility coefficient of the current benchmark scheme based on a preset scheduling objective function within the timer's timing period, and then set the next scheduling scheme of the benchmark scheme as a new benchmark scheme according to the node composition and state transition probability of the Markov chain, so as to calculate the utility coefficient of the benchmark scheme based on the new benchmark scheme. The scheduling objective function is a function that quantifies the total allowed transaction volume and transaction accumulation time of the benchmark scheme into a utility coefficient. The benchmark scheme is any one of the plurality of scheduling schemes. The state transition probability is calculated based on the difference between the estimated utility coefficient of the new benchmark scheme and the utility coefficient of the current benchmark scheme. The timing refresh unit is used to trigger the state transition of the Markov chain and broadcast a reset signal to other scheduling schemes when any timer finishes timing out. This causes the other scheduling schemes to respond to the reset signal and refresh their respective timers based on a first utility coefficient. This allows the utility coefficients of each scheduling scheme to be recalculated based on the refreshed timers when the calculation result of the utility coefficient does not meet the convergence condition. The first utility coefficient is the utility coefficient calculated based on the scheduling scheme corresponding to the timer that has finished timing out. The target scheme determination unit is used to terminate listening and no longer accept blocks submitted by newly arrived committee fragments when the calculation result of the utility coefficient meets the convergence condition. Then, based on the current utility coefficient, it determines the target scheduling scheme corresponding to the maximum utility coefficient, so as to determine the committee fragments to be added to the final committee according to the target committee scheduling scheme. The formula for calculating the scheduling objective function is as follows: In the formula, U is the utility coefficient, J is the set of epochs, and I... j Y represents all the fragments generated by each committee in the j-th epoch. i j Let i be the cumulative transaction time for the i-th committee during the j-th epoch. For the i-th committee in the j-th epoch, Let N be the transaction volume of the shard corresponding to the i-th committee in the j-th epoch. min The minimum threshold for the number of committee members, This represents the capacity of transactions that can be packaged into the final block in each epoch, where α is an adjustable weight used to measure the deviation from the total allowed number of transactions. Let t be a binary variable used to indicate whether the i-th committee is allowed to participate in the consensus phase. j This refers to the fragment received in the j-th epoch under a given timing period.
6. A blockchain sharding committee scheduling terminal, characterized in that, include: memory and processor; The memory is used to store program code, which corresponds to the blockchain sharding committee scheduling method as described in any one of claims 1 to 4; The processor is used to execute the program code to implement the blockchain sharding committee scheduling method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code corresponding to the blockchain sharding committee scheduling method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Markov chain-based method for evaluating supply chain selection under block chains
CN108665156A
Block chain performance analysis method and device based on Markov chain
CN112001571A