CN112214328A - Load balancing method for transaction processing in isomorphic multilink - Google Patents

Load balancing method for transaction processing in isomorphic multilink Download PDF

Info

Publication number
CN112214328A
CN112214328A CN202011147316.5A CN202011147316A CN112214328A CN 112214328 A CN112214328 A CN 112214328A CN 202011147316 A CN202011147316 A CN 202011147316A CN 112214328 A CN112214328 A CN 112214328A
Authority
CN
China
Prior art keywords
chain
subnet
index
transaction
weight
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011147316.5A
Other languages
Chinese (zh)
Other versions
CN112214328B (en
Inventor
孙毅
刘彦秀
贾林鹏
王鑫
姜鑫
于雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Institute of Computing Technology of CAS
Original Assignee
Institute of Computing Technology of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Institute of Computing Technology of CAS filed Critical Institute of Computing Technology of CAS
Priority to CN202011147316.5A priority Critical patent/CN112214328B/en
Publication of CN112214328A publication Critical patent/CN112214328A/en
Application granted granted Critical
Publication of CN112214328B publication Critical patent/CN112214328B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a load balancing method for transaction processing in isomorphic multilink, which comprises the following steps: t1, acquiring index information corresponding to each subnet chain and used for evaluating the load capacity of the subnet chain; t2, calculating the load capacity of each subnet chain according to the index information obtained in the step T1 and the index weight of each index, and performing descending sorting to form a list of subnet chain load capacity; and T3, sequentially packaging the actual transactions of the current to-be-performed logical transactions according to the sequence of the subnet chain load capacity list until the to-be-performed logical transactions are completed, wherein the actual transaction amount packaged on each subnet chain is limited by the account amount of the consumed source account on the subnet chain. The method of the invention combines the operation state of the sub-network chain network and dynamically collects the load information of each sub-network chain, thereby dynamically judging the current load condition of the sub-network chain and better exerting the load balancing distribution strategy of the algorithm.

Description

Load balancing method for transaction processing in isomorphic multilink
Technical Field
The invention relates to the field of blockchain, in particular to the field of transaction processing parallelization in a block chain system of a homogeneous multi-chain parallelization architecture, and more particularly to a load balancing method for transaction processing in homogeneous multi-chain.
Background
The block chain technology provides a brand new trust mechanism, and the advantages of non-tampering, traceability and the like of the block chain technology show the advantages which are completely different from those of the traditional technology, so that the block chain technology is correspondingly utilized in various fields. However, the current blockchain technology faces the problems of poor scalability, low transaction rate and the like, which severely limits the large-scale use of the blockchain technology. At present, representative bitcoin blockchain and ether house blockchain data exceed 200GB, and the total data amount of 'archival nodes' for completely operating all data of the ether house exceeds 2TB according to the latest statistics of Etherscan. In the current block chain consensus protocol, the data volume of the block chain account book is increasingly large along with time, especially represented by a public chain in the block chain, and the block chain global account book data needs to be stored in full copy at nodes of the public chain as much as possible, so that the admission threshold of the system is greatly improved, and the expandability of the system is greatly reduced.
In order to improve the overall flux level of the block chain system, researchers have proposed various block chain capacity expansion methods: comparing the typical scheme of capacity expansion on the chain and the capacity expansion under the chain. The system mainly comprises a block capacity expansion scheme, an isolation witness scheme for taking information such as digital signatures out of original transactions, and a related scheme for improving a block chain consensus mechanism. And the expansion scheme under the chain does not change the related protocol of the public chain, the transaction is carried out in an off-chain mode, and a layer of related network is additionally arranged on the main chain of the block chain for transaction processing, so that the whole transaction flux is not influenced by the performance of the block chain. However, at present, the throughput of the conventional blockchain system is limited by the serial structure, and the throughput improvement of the blockchain system is influenced by the unified consensus process of the whole network and the system architecture design of global account book replication.
In order to solve the problems of flux optimization and limited expansibility faced by a block chain infrastructure and a core protocol, researchers provide a parallel block chain architecture with isomorphic multiple chains. Based on the problem of low performance of the existing single-chain transaction processing, the isomorphic multi-chain block chain system starts from the point of dividing the existing single chain into a plurality of isomorphic chains (partitions) to process transactions in parallel, and provides a block chain (subnet chain) parallel transaction processing method based on the isomorphic multi-chain on the basis of a block chain infrastructure and a core protocol, so that the bottleneck problem of the original flux optimization scheme is solved. Based on this, the block chain parallelization (fragmentation) technology is developed at the same time and becomes the main scheme for improving the overall throughput level of the block chain system, this scheme partitions the entire state of the blockchain network into a series of partitions, called slices, each containing its own independent state and transaction history, in such systems, a particular node only processes transactions for a particular slice, allowing the overall throughput of the system to be much higher than processing all transactions in a single slice, but, again, presents new problems in implementing an application, because a fixed fragmentation strategy is mostly adopted (namely an account belongs to a certain fixed fragmentation), the problem of single-point overheating exists, only the related affairs of the fragmentation are processed among the fragmentation, the problem of uneven processing load of each fragment transaction can be brought, and the overall expandability and flux level of the system are limited to be improved. In the parallelization architecture scheme, an account of a user is fixed on a certain segment, and when the user conducts a transaction, namely, the execution and determination of related transactions are conducted in the corresponding segment, the problems of unbalanced utilization efficiency of the whole system and the like may be caused.
In order to solve the throughput and load problems in the tiled blockchain system, some researchers have proposed dynamic tiling strategies. For example, chinese patent application with publication number CN111046437A proposes a block chain parallelization architecture with homogeneous multi-chains, in which a dynamic fragmentation policy is adopted, that is, an account can own assets and send transactions on multiple (or all) fragments, thereby effectively solving the problem of single-point overheating caused by a fixed fragmentation policy. In a homogeneous multi-chain system, assets of a user are distributed on a plurality of subnet chains, and the user submits transactions to the plurality of homogeneous chains through a client. Each subnet chain can independently complete consensus and transaction processing in the partition, simultaneously can execute received transactions related to account state change in the partition, and maintain the latest state of the related accounts in the partition, and the same user can own account assets on different subnet chains to perform distributed storage of the assets. The system divides the logic transaction into a series of actual transactions which can be executed in parallel according to the asset distribution condition of the user on each chain, the load information of each sub-network chain and other factors, and executes the actual transactions on each sub-network chain, thereby converting one logic transaction initiated by the user into a plurality of actual transactions for processing, and ensuring the atomicity of the logic transaction, namely all the actual transactions divided by one logic transaction are considered to be the completion of the logic transaction after all the actual transactions are completed, and if one actual transaction is not completed or the execution fails in the middle, the logic transaction is considered to be the execution failure. The architecture comprises a plurality of subnet chains, and each subnet chain has the same block chain architecture; a user may have asset accounts on one or more subnet chains and the user's accounts on multiple subnet chains may cooperate to complete a transfer transaction when the transaction is performed. The framework can realize the one-way multi-chain transfer transaction process of the user, namely when the user A initiates a transfer transaction with the sum of V to the user B, the isomorphic multi-chain system can transfer accounts in a plurality of accounts of the user A on a plurality of sub-network chains to the user B, and finally the total sum of the transfer transactions on all the sub-network chains is V. In the one-way multi-chain transfer transaction process, a logic transaction (namely, a transfer transaction from a user A to a user B is initiated, and the transfer amount is V) to be executed by the user can be divided into a plurality of actual transactions (namely, a plurality of transactions transferred from an account of the user A in a plurality of subnet chains to an account of the user B in a corresponding chain are really processed by the system) during execution, and the transactions are distributed to the corresponding subnet chains to perform parallel transaction processing, so that the transaction processing speed is greatly improved. The blockchain framework converts the existing single-chain serial transaction processing process of the blockchain into multi-chain parallel transaction processing, and distributes a logic transfer transaction initiated by a user to a plurality of subnet chains for processing after splitting, thereby greatly improving the transaction processing speed. However, when the transaction processing and scheduling are performed on a plurality of subnet chains, the load condition of the subnet chains needs to be considered, so that the generation of the load excess of some subnet chains is avoided, and the stable and efficient operation of the system is ensured.
In the isomorphic multi-chain parallelization blockchain architecture, traditional classical load balancing algorithms such as a polling method and a minimum connection number algorithm can also be applied to the parallelization blockchain architecture to complete the process, but the basic schemes have some problems and defects.
The polling method is that when dividing the logic transaction initiated by the user, the generated actual transaction is directly distributed to the load balancing algorithm of each available subnet chain in turn, and when the polling algorithm carries out the load balancing processing of the subnet chain, a simple alternate selection strategy is used. The algorithm substantially equally processes the performance of each subnet chain, but the method has a defect that the load distribution of the subnet chain cannot be flexibly adjusted according to the actual situation due to the dynamic change of the load condition existing in different subnet chains and the difference of account balances of different users on the subnet chains when facing different transaction initiators.
In the blockchain isomorphic multi-chain system, the connection number is defined as the number of transactions to be packaged in the current subnet chain transaction pool. The minimum connection number algorithm is used for reasonably scheduling the transaction according to the number of the transactions to be packaged in the transaction pool in the current subnet link node when the logic transaction is divided into the actual transaction. The minimum connection number algorithm can dynamically consider the number of transactions to be packaged of each subnet chain in a current block chain platform, the transactions are preferentially distributed to the subnet chain with less connection numbers for processing, and compared with a polling algorithm, the minimum connection number algorithm takes the congestion degree in a transaction pool in the subnet chain into consideration, so that the minimum connection number algorithm has certain superiority, but the algorithm does not well consider the asset distribution condition of a user in different subnet chain accounts, lacks the consideration of other load conditions of the subnet chain, and the number of the connections cannot reflect the service capability of the subnet chain, so that the minimum connection number algorithm is just one-sided but deadfront.
In summary, the traditional polling algorithm and the load balancing algorithm with the minimum number of connections cannot be perfectly adapted in the homogeneous multi-chain system, and if the actual load condition of each subnet chain (segment) is not considered, the transaction is simply split, so that the problems of single-point overheating and uneven load occur, and the related function of the parallelization architecture cannot be well played. Meanwhile, because a plurality of sub-network chains have certain differences in factors such as the congestion degree of a transaction pool, the average transaction fee, the distribution condition of user accounts on the plurality of sub-network chains and the like, in the process of converting a logical transaction initiated by a user to an actual transaction on the plurality of sub-network chains, the simple transaction splitting ignores the performance difference among the sub-network chains, and the reasonable scheduling of the transaction load cannot be performed by utilizing the existing related information in the system. Meanwhile, a traditional load balancing algorithm usually sends a request to a service processing node according to a distribution rule, but in the framework, according to actual business requirements, in order to improve the system efficiency, when a user performs one-way multi-chain transfer, one logical transaction is converted into a plurality of actual transactions, and the plurality of transactions are distributed to a plurality of chains to perform atomic cooperative processing. In one load balancing decision, a load balancing algorithm is used to select a plurality of subnet chains to distribute a plurality of actual transactions, and the selection result can achieve a good effect as much as possible, so that the traditional load balancing method is not applicable.
Disclosure of Invention
Therefore, the present invention is directed to overcome the above-mentioned drawbacks of the prior art, and to provide a new load balancing method, which implements efficient partitioning and distribution of transaction transactions in a homogeneous multi-chain system.
According to a first aspect of the present invention, the present invention provides a load balancing method for transaction processing in a homogeneous multi-chain, which is used for converting a logical transaction to be performed from a source account to a destination account into a plurality of actual transactions, wherein the homogeneous multi-chain includes a plurality of subnet chains, and the load balancing method includes the following steps: t1, acquiring index information for subnet chain load capacity evaluation corresponding to each current subnet chain; t2, calculating the load capacity of each subnet chain according to the index information acquired in the step T1 and the index weight of each index, and sorting the subnet chains in a descending order according to the load capacities to form a list of the load capacities of the subnet chains; and T3, packing actual transactions of the current to-be-processed logical transactions according to the sequence of the capacities in the subnet chain load capacity list from large to small until the to-be-processed logical transactions are completed, wherein the actual transaction amount packed to each subnet chain is limited by the account amount of the consumed source account on the subnet chain.
Preferably, the indexes for evaluating the load capacity of the subnet chain corresponding to each subnet chain include three types, which are the actual transaction quantity to be packaged of the subnet chain, the average transaction fee of the subnet chain, and the account balance of the source account of the currently-to-be-performed logical transaction initiator on the subnet chain.
Preferably, in the step T2, the load capacity of each subnet chain is calculated as follows:
F(ci)=w1*Vi+w2*ni+w3*gasPricei
wherein, ciRepresents the ith subnet chain, ViAccount balance, n, representing source account in ith subnet chainiRepresenting the current transaction amount to be packed, gasSource, of the ith subnetwork chainiRepresenting the average transaction fee, w, of the ith subnetwork chain1Is the combined weight, w, of account balances of the sub-network chains2For the total weight, w, of the number of transactions to be packed in the subnet chain3The composite weight of the average transaction fee of the subnet chain. Wherein, the comprehensive weight of the account balance of the subnet chain and the subnet chain are to be packaged and handed overThe comprehensive weight of the number of the easy matters and the comprehensive weight of the average transaction fee of the subnet chain are calculated by the following method:
q1, determining the initial weight of each index by adopting a subjective analysis method;
q2, periodically collecting index data used for evaluating the load capacity of the subnet chains of all subnet chains at a certain time according to a preset time node to form a data sample set, wherein the index data of one subnet chain is a sample;
q3, normalizing each index value in each sample in the data sample set, adopting a forward index standardization processing mode for all values corresponding to the account balance of the subnet chain, and adopting a different index standardization processing mode for the transaction quantity to be packaged of the subnet chain and all values corresponding to the average transaction fee of the subnet chain;
q4, calculating the objective evaluation weight of each index according to the normalized index value by adopting an objective weighting method;
q5, calculating the comprehensive weight of each type of index according to the initial weight and the objective evaluation weight of each type of index, wherein the comprehensive weight is calculated by the following method:
Figure BDA0002740073190000051
wherein, wjThe composite weight, P, representing the j-th class indexjInitial weight, Q, representing the j-th class indexjAnd j is 1,2, and 3, which represents the objective evaluation weight of the j-th index.
Preferably, the chromatographic analysis method is adopted to determine the initial subjective weight of each index, and the method comprises the following steps:
q11, constructing a subnet chain load capacity analysis model, which comprises a target layer and a criterion layer, wherein the target layer is the load capacity of the subnet chain, and the criterion layer is three indexes of the subnet chain: actual transaction quantity to be packaged of the subnet chain, average transaction fee of the subnet chain, account balance of a source account of a current logic transaction initiator to be performed on the subnet chain;
q12, scaling each type of index of the criterion layer by adopting a 1-9 value method, and then scaling the index according to expert opinions to form an index pairwise comparison matrix;
q13, carrying out normalization processing on the pairwise comparison matrix formed in the step Q12 to form a criterion layer standard pairwise comparison matrix;
q14, calculating the maximum characteristic root and the corresponding characteristic vector of each line according to the standard pairwise comparison matrix of the criterion layer, wherein the standard characteristic vector of each line is the initial subjective weight of the corresponding index of the line.
Preferably, in the step Q3, the forward direction index normalization processing method is:
Figure BDA0002740073190000061
the abnormal index standardization processing mode is as follows:
Figure BDA0002740073190000062
xijthe value of j index of ith sub-net chain is 1,2,3,. and m; j is 1,2,3, m is the number of subnet chains.
Preferably, in step Q4, an entropy weight method is used in the objective analysis method to calculate an entropy weight of the index according to the normalized index value, wherein the entropy weight of the index is calculated as follows:
Figure BDA0002740073190000063
Qjentropy weights representing the j-th index, j being 1,2, 3;
ajan entropy value representing a jth index of a set of data samples, and:
Figure BDA0002740073190000064
where m denotes the number of subnet chains, bijIndicates the jth evaluation indexThe proportion of the next ith sample, i ═ 1,2,3,. the next ith sample, m,
Figure BDA0002740073190000065
according to a second aspect of the present invention, a homogeneous multi-chain system is provided, in which the method according to the first aspect of the present invention is adopted to perform load balancing processing on logical transactions in the system.
Compared with the prior art, the invention has the advantages that: the invention provides a dynamic weighting load balancing algorithm aiming at the flux improvement problem of a multi-partition block chain, which can measure the current load condition of different sub-network chains according to the transaction amount to be packaged in transaction pools in different sub-network chains, the transaction cost in the sub-network chains and the account balance information of a user in the sub-network chains, so that the splitting and the conversion of one logic transaction of the user to a plurality of actual transactions are carried out, a better system load balancing effect is realized, and the overall flux level of the system is improved.
Drawings
Embodiments of the invention are further described below with reference to the accompanying drawings, in which:
FIG. 1 is a schematic structural diagram of a constructed chromatography model according to an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail by embodiments with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The inventor finds that in order to realize efficient partitioning and distribution of transaction transactions in a homogeneous multi-chain system, an algorithm needs to be designed according to related load information of different subnet chains. Because the state information of the subnet chain and the related information of the user account can be dynamically changed in the system, the subnet chain performance can be greatly different at different times and different logic transactions in the system operation process. In order to divide transactions efficiently and instantly, a load balancing algorithm needs to acquire the latest state information of a local account on each subnet chain, and simultaneously acquires and applies the related state information of the subnet chain in real time, including the current load information, transaction cost, congestion degree and the like of the subnet chain. Furthermore, the inventor discovers that when one-way multi-chain transfer transaction of a certain user in the isomorphic multi-chain system is carried out, the logic transaction initiated by the user can be split into multiple actual transactions on multiple sub-network chains (fragments) for carrying out parallelization transaction processing by researching the existing block chain flux optimization technology and the block chain isomorphic multi-chain parallelization architecture design. In the splitting of the logic transaction and the process of executing the actual transaction on the plurality of subnet chains, the whole system should keep the load performance balance of each subnet chain, namely, the division scheduling of the actual transaction can be carried out according to the real-time dynamic load information of each subnet chain, so that the efficient parallel transaction processing of the plurality of subnet chains is realized, and the block chain parallel architecture is better utilized. Therefore, the invention provides a transaction processing load balancing algorithm under the isomorphic multi-chain block chain parallelization architecture, so that the transaction processing speed of the system can be improved, and the performance of the whole system is improved.
According to an embodiment of the present invention, the present invention provides a load balancing method for transaction processing in isomorphic multiple chains, which is used for converting a logic transaction to be performed from a source account to a destination account into a plurality of actual transactions in a load balancing manner, wherein a load balancing algorithm determines a corresponding evaluation index of a load condition of a subnet chain in a dynamic weighting manner, then determines a real-time load capacity of each subnet chain by using a weighted evaluation function, and then performs allocation of actual transactions in the load algorithm according to a ranking of the current load capacity. The method of the invention dynamically collects the load information of each subnet chain by combining the operation state of the subnet chain network, thereby dynamically judging the current load condition of the subnet chain and better exerting the load balancing distribution strategy of the algorithm. In summary, the load balancing method comprises the following steps: t1, acquiring index information corresponding to each subnet chain and used for evaluating the load capacity of the subnet chain; t2, calculating the load capacity of each subnet chain according to the index information obtained in the step T1 and the index weight of each index, and performing descending sorting to form a list of subnet chain load capacity; and T3, sequentially packaging the actual transactions of the current to-be-performed logical transactions according to the sequence of the subnet chain load capacity list until the to-be-performed logical transactions are completed, wherein the actual transaction amount packaged on each subnet chain is limited by the account amount of the consumed source account on the subnet chain.
In step T1, the sub-network chain load capacity evaluation index corresponding to each sub-network chain is preferably used for the sub-network chain load capacity evaluation index, and includes the following categories:
subnet chain account balance (V)i): the amount of the account balance of the subnet chain not only directly determines whether the subnet chain can process the actual transaction, but also the subnet chain with more account balance is a priority object in task scheduling, because the concurrency degree of the whole system can be improved by dispersing a logical transaction on a small number of subnet chains as much as possible, and the benefit of the isomorphic multi-chain architecture is improved.
The current transaction number (n) to be packed of the subnet chaini): the current quantity of the transactions to be packaged of the subnet chain can truly reflect the current congestion degree of the subnet chain, the direct consequence of excessive quantity of the transactions to be packaged is queuing and waiting of the transactions, and the dispatch of the transactions again only can further deteriorate the performance of the subnet chain and cannot timely meet the transaction requirements of users.
Subnet chain average transaction fee (gasSource)i): the subnet chain transaction fee is the average gasrice for a certain subnet chain. The gasSource value of one transaction initiated by a user directly determines whether a miner is willing to pack, the miner always preferentially selects the transaction with higher transaction fee to pack, and the size of the gasSource value directly influences the length of transaction delay.
The load capacity of each subnet chain in step T2 is weighted by an evaluation function, according to one embodiment of the present invention, a weighted sum method is usedIs an evaluation function. The weighted sum method can well reflect the effect of independent evaluation indexes on the overall evaluation. The evaluation indexes can linearly superpose the overall generated related influence, and meanwhile, a plurality of indexes can be complemented. In the weighted sum method, each index is represented as fiThe index correspondence weight is represented as wiIn one embodiment of the present invention, only 3 indices are used, so i is 1,2, 3. In the invention fiNamely, the load capacity evaluation indexes of the corresponding three sub-network chains are as follows: balance of subnet chain account, number of transactions to be packaged in subnet chain and average transaction fee, w, of subnet chainiNamely, the corresponding index weights of the three evaluation indexes in the weighted sum evaluation function are expressed as formula (1):
Figure BDA0002740073190000091
w in the above formulaiThe weight coefficient can reflect the importance degree of each index in the evaluation function, so that the determination of the weight vector is the key for determining the evaluation function. By combining the evaluation indexes determined in the above with the function selection of this section, a performance evaluation function of each subnet chain, i.e. a multi-index comprehensive evaluation function, can be obtained as shown in formula (2):
F(ci)=w1*Vi+w2*ni+w3*gasPricei (2)
wherein, the formula (2) reflects the subnet chain ciCurrent load situation of (a), wherein ciRepresents the i-th subnet chain number, ViBalance n in the ith subnet chain account on behalf of the source account initiating the transactioniRepresenting the current transaction amount to be packed, gasSource, of the ith subnetwork chainiRepresents the average transaction fee of the ith subnet chain, and w1,w2,w3And the comprehensive weights of the three indexes, namely the account balance of the subnet chain, the number of transactions to be packaged of the subnet chain and the average transaction fee of the subnet chain, respectively represent the importance degree of each index on the current performance condition of the subnet chain. Therefore, in the invention, the load energy of the subnet chain is evaluated by adopting the evaluation functionIn force, first, the comprehensive weight of each evaluation index is determined. After a sub-network chain in an isomorphic multi-chain block chain architecture determines a load capacity evaluation function, two types of methods for determining corresponding weight indexes in a multi-index comprehensive evaluation function are provided, namely a subjective weighting method and an objective weighting method. The subjective weighting method obtains weight information through artificial subjective opinions, and mainly reflects the economic or technical significance of indexes; the objective weighting method obtains the relevant index weight according to the relevant actual data of each index, and can reflect the information quantity of the index in the aspect of data. The two methods respectively have respective characteristics and defects, and according to one embodiment of the invention, the comprehensive evaluation method is combined with a subjective weighting method and an objective weighting method to determine the comprehensive index weight, so that the unification of the comprehensive index weight in a subjective evaluation system and an objective evaluation system is realized.
According to one embodiment of the present invention, the comprehensive weight of each evaluation index is determined by: firstly, determining the initial weight of each index of a subnet chain performance evaluation function by utilizing an analytic hierarchy process in a subjective weighting method, and then realizing a load balancing algorithm by utilizing the evaluation function. And then after the isomorphic multi-chain system operates for a period of time by applying the algorithm, acquiring relevant data information of the evaluation index, and obtaining the index objective evaluation weight based on the entropy weight method by using the entropy weight method in the objective weighting method. And finally, determining the comprehensive weight values of the three evaluation indexes in the subnet chain performance evaluation function by using the weights obtained by an analytic hierarchy process and an entropy weight method.
The calculation of the chromatographic analysis method, the entropy weight method and the comprehensive weight is explained in detail below with reference to the embodiments of the present invention:
1. analytic hierarchy process
Analytic Hierarchy Process (AHP) is a multi-criteria decision-making method for qualitative and quantitative analysis. According to an embodiment of the present invention, a subnet chain load capacity analysis model as shown in fig. 1 is established, wherein a target layer is the load capacity of a subnet chain, and a criterion layer is three evaluation indexes: the available balance of the account of the subnet chain, the number of transactions to be packaged by the subnet chain and the average transaction fee of the subnet chain.
In the analytic hierarchy process, two-by-two comparison judgment needs to be carried out on three indexes provided by the invention, a 1-9 value method is adopted to scale the indexes, the evaluation table of the 1-9 value method is shown in table 1, and then the scaling is carried out according to expert opinions to form an index two-by-two comparison matrix table.
TABLE 11-9 value method Scale Table
Figure BDA0002740073190000101
And then, a judgment matrix is constructed by combining an actual situation through a 1-9 value method, wherein the influence of the account amount of the subnet chain and the transaction number to be packaged of the subnet chain on the load capacity of the subnet chain is large, the influence of the average transaction fee of the subnet chain is relatively weak, and preferably, a pairwise comparison matrix is constructed as shown in table 2.
TABLE 2 criterion layer pairwise comparison matrix
Figure BDA0002740073190000102
Next, normalization processing is performed on the criterion layer pairwise comparison matrix, the sum of each column is calculated, each element in the matrix table 2 is divided by the sum of the column, and the obtained result constitutes the criterion layer criterion pairwise comparison matrix shown in table 3.
TABLE 3 Standard pairwise comparison matrix
Figure BDA0002740073190000111
Next, the maximum feature root and the corresponding feature vector in each row are calculated according to the criterion layer standard pairwise comparison matrix, and normalization processing is performed on the feature vectors to obtain the corresponding weight of each evaluation index, as shown in table 4.
TABLE 4 criterion layer feature vectors
Figure BDA0002740073190000112
From Table 4, three evaluation index weight vectors P determined by the analytic hierarchy process are obtained, wherein P1Indexing the subnet chain account balance with an initial weight, P2Indicating an initial weight, P, for the number of transactions to be packed in the subnet chain3The initial weight of the subnet chain flat transaction fee index is shown, and the weight vector P is as follows:
P=(P1,P2,P3)=(0.4286,0.4286,0.1429) (3)
2. entropy weight method
Entropy is a description of uncertainty, and the dispersion degree of an index can be judged according to an entropy value, so that the influence of a certain index on a total evaluation system is determined. The entropy weight method is an objective weighting method, and related weight reference information can be obtained from data.
Firstly, data of three load capacity evaluation indexes of a subnet chain are obtained at regular time, and after normalization processing is carried out on positive and negative indexes, weight calculation of the three indexes is carried out by utilizing an entropy weight method. Namely, periodically acquiring index values V used for evaluating the load capacity of the subnet chains of all the subnet chains at a certain time according to preset time nodesi,ni,gasPriceiForming a data sample set, wherein the index data of each subnet chain is a sample, evaluating m samples (namely m subnet chains) according to the three evaluation indexes, and recording xijThe j index of the ith subnet chain is the value (i is 1,2, 3.. multidot.m; j is 1,2, 3). Next, these indices are normalized because the unit and meaning of different indices are different, and before use, the indices are normalized, and the normal index and the anisotropic index are also normalized by different calculation methods.
The formula of the forward index standardization treatment is formula (4):
Figure BDA0002740073190000121
the negative index standardization processing formula is shown as formula (5):
Figure BDA0002740073190000122
the subnet chain account balance is a positive indicator, that is, the more the subnet chain account balance is, the better the effect of load processing by using the subnet chain is, and the subnet chain is preferentially selected. Therefore, the positive index standardization processing is carried out on the balance of the subnet chain account by using the formula (4). The number of transactions to be packaged by the subnet chain and the average transaction fee of the subnet chain are negative indexes, that is, the more the number of transactions to be packaged by the subnet chain is, the worse the load capacity of the subnet chain is, the more the average transaction fee of the subnet chain is, the smaller the tendency of selecting the subnet chain is. Therefore, the negative index standardization processing is carried out on the number of transactions to be packaged in the sub-network chain and the average transaction fee of the sub-network chain by using the formula (5).
Then, based on the information obtained at the timing, the entropy a of the j-th index of the sample is calculatedjComprises the following steps:
Figure BDA0002740073190000123
wherein, bijIs the proportion of the ith sample under the jth evaluation index, i.e.
Figure BDA0002740073190000124
The entropy weight Q of the jth index can be foundjComprises the following steps:
Figure BDA0002740073190000125
so the final entropy weight method can obtain a weight vector of the evaluation index as Q, wherein Q1Objective evaluation weight, Q, of balance index of account in sub-network chain obtained by entropy weight method2Indexing objective weights, Q, for the number of transactions to be packed of the subnet chain derived by the entropy weight method3Subnet chain flat transaction fee index obtained by entropy weight methodAnd objectively evaluating the weight.
Q=(Q1,Q2,Q3)
3. Calculation of synthetic weights
The index weight P determined by the analytic hierarchy process represents subjective weights of the three indexes in the aspect of subnet chain performance, the index weight Q determined by the entropy weight method represents the relation among data under the three indexes, and in order to be capable of integrating weight information of a subjective evaluation method and an objective evaluation method, according to one embodiment of the invention, the comprehensive weight of the subnet chain performance evaluation index is obtained by using the following formula.
Figure BDA0002740073190000131
Wherein, wjThe j-th evaluation index integrated weight, P, determined for the analytic hierarchy process and the entropy weight processjSubjective weight, Q, of the jth evaluation index determined for analytic hierarchy processjThe j-th evaluation index objective weight determined for the entropy weight method, where j is 3, indicates that there are three evaluation indexes in total.
Therefore, in summary, after the corresponding evaluation indexes are obtained by the analytic hierarchy process and the entropy weight process, the final weight evaluation function of the subnet chain obtained by integrating the weight vector information of the two processes is:
F(ci)=w1*Vi+w2*ni+w3*gasPricei
wherein, w1Account balance V for subnet chainiIntegrated weight of w2Number n of transactions to be packed for subnet chainiIntegrated weight of w3Average transaction fee gasSource for subnet chainiThe integrated weight of (2).
For a better understanding of the present invention, the load balancing process of the present invention is described in detail below with reference to a specific embodiment.
According to an embodiment of the invention, a homogeneous multi-chain system is provided, and the load balancing method of the invention is applied to execute the flow of the logic transaction submitted by the user, and the logic transaction is executed through the loadThe balance method realizes the conversion of the logic transaction into a plurality of actual transactions, supposing that the user A carries out one transfer transaction with the transfer amount of V to the user B, and the transfer transaction has m subnet chains in total and is marked as c1,c2,c3,…,cm(ii) a The number of the transactions to be packed of the m subnet chains is ni(i ═ 1,2,3, … m); the average transaction fee of m subnet chains is gasbridgei(i ═ 1,2,3, … m); the account balance of the user A on the m subnet chains is Vi(i ═ 1,2,3, …, m), the load balancing scheduling process includes:
step S1, first, querying assets of user A on all subnet links, if yes
Figure BDA0002740073190000132
Indicating that the total assets of A are not enough to carry out the transaction, and returning an error;
step S2, periodically acquiring the number n of transactions to be packaged of each subnet chainiBusiness fee gaswire of subnetwork chainiInformation and obtaining account balance information V of user A of current transaction initiator on each subnet chaini
Step S3, calculating the current load capacity priority of each subnet chain according to the subnet chain performance evaluation function (formula (2)), and sorting the subnet chains in descending order according to the size of the subnet chain load capacity to form a List List, namely, the load capacities of the subnet chains in the List are gradually reduced;
the division of the logical transactions initiated by user a, i.e. the determination of the actual transactions, is performed starting from the first subnet chain of the List S4, using as much as possible of the account of user a on each available subnet chain as the transfer amount of the actual transactions performed on that subnet chain, i.e. the maximum amount is ViThen, selecting the next subnet chain in the list to determine the next actual transaction until the sum of all actual transaction amounts is the total transfer amount V;
step S5, return to real transaction set realTx ═ final leaf<ci,amounti>|i∈[1,m]The set, namely the logic transaction that the user A initiates the transfer to the user B, is divided into a plurality of sub-networks after passing through the dynamic weighting load balancing algorithm provided by the inventionA set of actual transactions performed on the chain, wherein the actual transactions<ci,amounti>Indicating that this actual transaction is divided into subnet chain ciIs executed, i.e. user A is in subnet chain ciWill generate an amount of money of amountiThe transfer transaction is sent to the user B in the subnet chain ciThe account of (2).
The invention provides a dynamic weighting load balancing algorithm aiming at the flux improvement problem of a multi-partition block chain, which can measure the current load condition of different sub-network chains according to the transaction amount to be packaged in transaction pools in different sub-network chains, the transaction cost in the sub-network chains and the account balance information of a user in the sub-network chains, so that the splitting and the conversion of one logic transaction of the user to a plurality of actual transactions are carried out, a better system load balancing effect is realized, and the overall flux level of the system is improved.
It should be noted that, although the steps are described in a specific order, the steps are not necessarily performed in the specific order, and in fact, some of the steps may be performed concurrently or even in a changed order as long as the required functions are achieved.
The present invention may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied therewith for causing a processor to implement various aspects of the present invention.
The computer readable storage medium may be a tangible device that retains and stores instructions for use by an instruction execution device. The computer readable storage medium may include, for example, but is not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (10)

1. A load balancing method for transaction processing in isomorphic multilink is used for converting a logic transaction to be performed from a source account to a destination account into a plurality of actual transactions, wherein the isomorphic multilink comprises a plurality of subnet chains, and the load balancing method comprises the following steps:
t1, acquiring index information for subnet chain load capacity evaluation corresponding to each current subnet chain;
t2, calculating the load capacity of each subnet chain according to the index information acquired in the step T1 and the index weight of each index, and sorting the subnet chains in a descending order according to the load capacities to form a list of the load capacities of the subnet chains;
and T3, packing actual transactions of the current to-be-processed logical transactions according to the sequence of the capacities in the subnet chain load capacity list from large to small until the to-be-processed logical transactions are completed, wherein the actual transaction amount packed to each subnet chain is limited by the account amount of the consumed source account on the subnet chain.
2. The load balancing method for transaction processing in isomorphic multiple chains according to claim 1, wherein the indexes for evaluating the load capacity of the subnet chains corresponding to each subnet chain include three types, which are the actual transaction amount to be packaged of the subnet chain, the average transaction fee of the subnet chain, and the account balance of the source account of the current logical transaction initiator to be performed on the subnet chain.
3. The method for load balancing of transaction processing in isomorphic multichain according to claim 2, wherein in step T2, the load capacity of each subnet chain is calculated as follows:
F(ci)=w1*Vi+w2*ni+w3*gasPricei
wherein, ciRepresents the ith subnet chain, ViAccount balance, n, representing source account in ith subnet chainiRepresenting the current transaction amount to be packed, gasSource, of the ith subnetwork chainiRepresenting the average transaction fee, w, of the ith subnetwork chain1Is the combined weight, w, of account balances of the sub-network chains2For the total weight, w, of the number of transactions to be packed in the subnet chain3The composite weight of the average transaction fee of the subnet chain.
4. The load balancing method for transaction processing in isomorphic multi-chain according to claim 3, wherein the comprehensive weight of the balance of the subnet chain accounts, the comprehensive weight of the transaction amount to be packaged in the subnet chain, and the comprehensive weight of the average transaction fee of the subnet chain are calculated as follows:
q1, determining the initial weight of each index by adopting a subjective analysis method;
q2, periodically collecting index data used for evaluating the load capacity of the subnet chains of all subnet chains at a certain time according to a preset time node to form a data sample set, wherein the index data of one subnet chain is a sample;
q3, normalizing each index value in each sample in the data sample set, adopting a forward index standardization processing mode for all values corresponding to the account balance of the subnet chain, and adopting a different index standardization processing mode for the transaction quantity to be packaged of the subnet chain and all values corresponding to the average transaction fee of the subnet chain;
q4, calculating the objective evaluation weight of each index according to the normalized index value by adopting an objective weighting method;
q5, calculating the comprehensive weight of each type of index according to the initial weight and the objective evaluation weight of each type of index, wherein the comprehensive weight is calculated by the following method:
Figure FDA0002740073180000021
wherein, wjThe composite weight, P, representing the j-th class indexjInitial weight, Q, representing the j-th class indexjAnd j is 1,2, and 3, which represents the objective evaluation weight of the j-th index.
5. The method according to claim 4, wherein the step Q1 of determining the initial subjective weight of each index by chromatography comprises:
q11, constructing a subnet chain load capacity analysis model, which comprises a target layer and a criterion layer, wherein the target layer is the load capacity of the subnet chain, and the criterion layer is three evaluation indexes of the subnet chain: actual transaction quantity to be packaged of the subnet chain, average transaction fee of the subnet chain, account balance of a source account of a current logic transaction initiator to be performed on the subnet chain;
q12, scaling each type of index of the criterion layer by adopting a 1-9 value method, and then scaling the index according to expert opinions to form an index pairwise comparison matrix;
q13, carrying out normalization processing on the pairwise comparison matrix formed in the step Q12 to form a criterion layer standard pairwise comparison matrix;
q14, calculating the maximum characteristic root and the corresponding characteristic vector of each line according to the standard pairwise comparison matrix of the criterion layer, wherein the standard characteristic vector of each line is the initial subjective weight of the corresponding index of the line.
6. The method according to claim 4, wherein in the step Q3, the forward direction index standardization processing mode is as follows:
Figure FDA0002740073180000022
the abnormal index standardization processing mode is as follows:
Figure FDA0002740073180000023
xijthe value of j index of ith sub-net chain is 1,2,3,. and m; j is 1,2,3, m is the number of subnet chains.
7. The method according to claim 6, wherein in the step Q4, an entropy weight method is used to calculate an entropy weight of the index according to the normalized index value, wherein the entropy weight of the index is calculated by:
Figure FDA0002740073180000031
Qjentropy weights representing the j-th index, j being 1,2, 3;
ajan entropy value representing a jth index of a set of data samples, and:
Figure FDA0002740073180000032
where m denotes the number of subnet chains, bijRepresents the proportion of the ith sample in the jth evaluation index, i is 1,2, 3.. times.m,
Figure FDA0002740073180000033
8. a homogeneous multi-chain system, wherein the method according to any of claims 1-7 is used to load balance logical transactions in the system.
9. A computer-readable storage medium having embodied thereon a computer program, the computer program being executable by a processor to perform the steps of the method of any one of claims 1 to 7.
10. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the electronic device to carry out the steps of the method according to any one of claims 1 to 7.
CN202011147316.5A 2020-10-23 2020-10-23 Load balancing method for transaction processing in isomorphic multiple chains Active CN112214328B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011147316.5A CN112214328B (en) 2020-10-23 2020-10-23 Load balancing method for transaction processing in isomorphic multiple chains

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011147316.5A CN112214328B (en) 2020-10-23 2020-10-23 Load balancing method for transaction processing in isomorphic multiple chains

Publications (2)

Publication Number Publication Date
CN112214328A true CN112214328A (en) 2021-01-12
CN112214328B CN112214328B (en) 2023-07-21

Family

ID=74055157

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011147316.5A Active CN112214328B (en) 2020-10-23 2020-10-23 Load balancing method for transaction processing in isomorphic multiple chains

Country Status (1)

Country Link
CN (1) CN112214328B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113886081A (en) * 2021-09-29 2022-01-04 南京地铁建设有限责任公司 Station multi-face-brushing array face library segmentation method based on load balancing
CN117034361A (en) * 2023-07-31 2023-11-10 广州承启医学检验有限公司 Gene detection and inspection laboratory information management method and system
CN117808602A (en) * 2024-03-01 2024-04-02 联动优势电子商务有限公司 Hot account billing method and related device based on sub-account expansion

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1557986A1 (en) * 2004-01-22 2005-07-27 Alcatel Multi-criteria load balancing device for a network equipment of a communication network
CN109088881A (en) * 2018-09-12 2018-12-25 杭州趣链科技有限公司 A kind of shared platform chain and method for interchanging data for realizing cross-platform data exchange
CN110134513A (en) * 2019-04-17 2019-08-16 平安科技(深圳)有限公司 Load-balancing method, device, computer equipment and storage medium
CN111046437A (en) * 2019-10-31 2020-04-21 中国科学院计算技术研究所 Block chain parallel transaction processing method and system based on isomorphic multi-chain and terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1557986A1 (en) * 2004-01-22 2005-07-27 Alcatel Multi-criteria load balancing device for a network equipment of a communication network
CN109088881A (en) * 2018-09-12 2018-12-25 杭州趣链科技有限公司 A kind of shared platform chain and method for interchanging data for realizing cross-platform data exchange
CN110134513A (en) * 2019-04-17 2019-08-16 平安科技(深圳)有限公司 Load-balancing method, device, computer equipment and storage medium
CN111046437A (en) * 2019-10-31 2020-04-21 中国科学院计算技术研究所 Block chain parallel transaction processing method and system based on isomorphic multi-chain and terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
倪晓军;段元新;章韵;张敏敏;: "一种多指标综合评价负载均衡路由策略研究", 计算机技术与发展, no. 06, pages 52 - 56 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113886081A (en) * 2021-09-29 2022-01-04 南京地铁建设有限责任公司 Station multi-face-brushing array face library segmentation method based on load balancing
CN117034361A (en) * 2023-07-31 2023-11-10 广州承启医学检验有限公司 Gene detection and inspection laboratory information management method and system
CN117808602A (en) * 2024-03-01 2024-04-02 联动优势电子商务有限公司 Hot account billing method and related device based on sub-account expansion

Also Published As

Publication number Publication date
CN112214328B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
CN112214328A (en) Load balancing method for transaction processing in isomorphic multilink
CN106502792B (en) A kind of multi-tenant priority scheduling of resource method towards different type load
US9201690B2 (en) Resource aware scheduling in a distributed computing environment
US8144590B2 (en) Distributed resource allocation in stream processing systems
Mostafa et al. Fog resource selection using historical executions
CN103701886A (en) Hierarchic scheduling method for service and resources in cloud computation environment
CN101873224A (en) Cloud computing load balancing method and equipment
Abdurrab et al. FIRE: A file reunion based data replication strategy for data grids
Li et al. An effective scheduling strategy based on hypergraph partition in geographically distributed datacenters
Grosu et al. Cooperative load balancing in distributed systems
CN106095582A (en) The task executing method of cloud platform
Shao et al. A load balancing strategy based on data correlation in cloud computing
Pasyeka et al. Development algorithmic model for optimization of distributed fault-tolerant web-systems
Li et al. Scalable and dynamic replica consistency maintenance for edge-cloud system
Mostafa Cooperative fog communications using a multi-level load balancing
Yao et al. An intelligent scheduling algorithm for complex manufacturing system simulation with frequent synchronizations in a cloud environment
CN112954012B (en) Cloud task scheduling method based on improved simulated annealing algorithm of load
Jiao et al. Immune optimization of task scheduling on multidimensional QoS constraints
Silberstein Building an online domain-specific computing service over non-dedicated grid and cloud resources: The superlink-online experience
CN105872109A (en) Load running method of cloud platform
CN116048773B (en) Distributed collaborative task assignment method and system based on wave function collapse
CN110430236A (en) A kind of method and dispatching device of deployment business
Wen et al. Load balancing consideration of both transmission and process responding time for multi-task assignment
Sharma et al. A review on data locality in hadoop MapReduce
Mu et al. EfShard: Toward Efficient State Sharding Blockchain via Flexible and Timely State Allocation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant