CN112214328B - Load balancing method for transaction processing in isomorphic multiple chains - Google Patents

Load balancing method for transaction processing in isomorphic multiple chains Download PDF

Info

Publication number
CN112214328B
CN112214328B CN202011147316.5A CN202011147316A CN112214328B CN 112214328 B CN112214328 B CN 112214328B CN 202011147316 A CN202011147316 A CN 202011147316A CN 112214328 B CN112214328 B CN 112214328B
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.)
Active
Application number
CN202011147316.5A
Other languages
Chinese (zh)
Other versions
CN112214328A (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

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 multiple chains, which comprises the following steps: t1, acquiring index information corresponding to each current 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 and the index weight of each index obtained in the step T1, and performing descending order sequencing to form a subnet chain load capacity list; and T3, sequentially carrying out actual transaction packaging on the logic transactions to be carried out at present according to the sequence of the load capacity list of the subnet chain until the logic transactions to be carried out are completed, wherein the actual transaction amount packaged on each subnet chain is limited by the account amount of the source account on the subnet chain after being consumed. The method combines the running state of the subnet chain network to dynamically collect the load information of each subnet chain, thereby dynamically judging the current load condition of the subnet chain and enabling the load balance distribution strategy of the algorithm to be better exerted.

Description

Load balancing method for transaction processing in isomorphic multiple chains
Technical Field
The present invention relates to the field of blockchains, and more particularly to the field of transaction parallelization in a homogeneous multi-chain parallelization architecture blockchain system, and more particularly to a load balancing method for transaction processing in a homogeneous multi-chain.
Background
The advent of blockchain technology provides a brand new trust mechanism, and its advantages such as non-tampering, traceability, etc. exhibit distinct advantages from the traditional technology, and thus are correspondingly utilized in various fields. However, current blockchain techniques suffer from poor scalability, low transaction rates, and the like, which severely limit the large-scale use of blockchain techniques. At present, the representative data of the bitcoin blockchain and the Ethernet blockchain are both over 200GB, and the total data amount of an archiving node for completely running all the data of the Ethernet exceeds 2TB according to the Etherscan latest statistics. In the current blockchain consensus protocol, the data volume of the blockchain ledger is larger and larger along with time, and the data volume is particularly represented by a public chain in the blockchain, so that the global ledger data of the blockchain needs to be fully copied and stored at as many nodes as possible in the public chain, thereby greatly improving the admission threshold of the system and greatly reducing the expandability of the system.
To increase the overall throughput level of a blockchain system, researchers have proposed a variety of blockchain expansion schemes: there are typically in-chain and out-chain dilatation schemes. The on-chain capacity expansion scheme mainly improves and optimizes the public chain protocol, so that the expandability of the block chain system is improved, and the on-chain capacity expansion scheme mainly comprises a block capacity expansion scheme, an isolation witness scheme for taking out information such as a digital signature and the like from an original transaction, and a related scheme for improving a block chain consensus mechanism. The under-chain capacity expansion scheme does not change the public chain related protocol, adopts a mode of separating the transaction from the chain, and adds a layer of related network on the main chain of the blockchain to carry out transaction processing, so that the whole transaction flux is not influenced by the performance of the blockchain. However, at present, the throughput of the conventional blockchain system is limited by the serial structure, and the system architecture design of the unified consensus process of the whole network and the global ledger replication affects the improvement of the throughput of the blockchain system.
In order to solve the problems of flux optimization and limited expansibility faced by a blockchain infrastructure and a core protocol, researchers propose a parallelized blockchain architecture of isomorphic multiple chains. Based on the problem of low performance of the existing single-chain transaction, the isomorphic multi-chain blockchain system starts from the perspective of dividing the existing single chain into a plurality of isomorphic chains (partitions) for parallel transaction processing, and on the basis of a blockchain infrastructure and a core protocol, the isomorphic multi-chain-based blockchain (subnet chain) parallel transaction processing method is provided, so that the bottleneck problem of the original flux optimization scheme is solved. Based on this, the blockchain parallelization (slicing) technology has been developed and becomes a mainstream scheme for improving the overall throughput level of a blockchain system, this scheme divides the overall state of the blockchain network into a series of partitions called slices, each slice contains its own independent state and transaction history record, in this system, a specific node processes transactions only for a specific slice, thus allowing the overall throughput of the system to be much higher than that of all transactions processed in a single slice, but this presents a new problem in the implementation and application process, since a fixed slicing strategy (i.e. accounts belong to a certain fixed slice) is adopted in most cases, single point overheating problem exists, only processing related transactions among slices may bring about uneven load of processing transactions of each slice, and the overall scalability and throughput level improvement of the system are limited. In such a parallelization architecture scheme, the account of the user is fixed to a certain segment, and when the user performs a transaction, that is, performs execution and determination of a related transaction in a corresponding segment, the problem of unbalanced utilization efficiency of the whole system may be brought.
In order to solve the throughput and load problems in a tiled blockchain system, researchers have proposed dynamic tiling strategies. For example, chinese patent application publication No. CN111046437a proposes a homogeneous multi-chain blockchain parallelization architecture, in which a dynamic sharding policy is adopted, that is, an account can have assets on multiple (or all) shards and send transactions, so that the problem of single-point overheating caused by a fixed sharding policy is effectively solved. In an isomorphic multi-chain system, a user's assets are distributed across multiple sub-network chains, and the user submits transactions to the multiple isomorphic chains through a client. Each sub-network chain can independently complete consensus and transaction processing in the partition, meanwhile, can execute received transaction related to account state change in the partition, maintain the latest state of related accounts in the partition, and the same user can own account assets on different sub-network chains to perform distributed storage of the assets. The transaction submitted by the user is called a logic transaction, the system divides the logic transaction into a series of actual transactions which can be executed in parallel and executed on each subnet chain according to the asset distribution condition of the user on each chain, the load information of each subnet chain and other factors, so that one logic transaction initiated by the user is converted into a plurality of actual transactions to be processed, the atomicity of the logic transaction is ensured, namely, after all the actual transactions divided into one logic transaction are completed, the completion of the logic transaction is considered, and if one actual transaction is not completed or fails to be executed in the middle, the logic transaction is considered as the execution failure. This architecture includes a plurality of subnetwork chains, each subnetwork chain having the same blockchain architecture; the user may have an asset account on one or more of the subnetwork chains and, in performing the transaction, the user's accounts on the subnetwork chains may cooperate to complete the transfer transaction. The framework can realize the unidirectional multi-chain transfer transaction process of the user, namely when the user A initiates a transfer transaction with the sum of money V to the user B, the isomorphic multi-chain system can transfer the sum of money in a plurality of accounts of the user A on a plurality of subnet chains to the account of the user B on the corresponding subnet chain, and finally the total sum of the transfer transactions on all the subnet chains is V. In the unidirectional multi-chain transfer transaction process, a logic transaction to be executed by a user (namely, a transfer transaction to a user B is initiated by a user A, and the transfer amount is V) can be divided into a plurality of actual transactions (namely, a plurality of transactions that the system really processes that accounts of the user A in a plurality of sub-network chains transfer accounts to the user B on corresponding chains) when being executed, and the transactions are distributed to the corresponding sub-network chains for parallel transaction processing, so that the transaction processing speed is greatly improved. The blockchain architecture converts the existing single-chain serial transaction processing process of the blockchain into multi-chain parallel transaction processing, distributes a logic transfer transaction initiated by a user to a plurality of subnet chains for processing after splitting, and therefore transaction processing speed is greatly improved. However, when the processing and scheduling of transactions are carried out on a plurality of subnet chains, the load condition of the subnet chains needs to be considered, so that the excessive load of a plurality of subnet chains is avoided, and the stable and efficient operation of the system is ensured.
In the isomorphic multi-chain parallelization blockchain architecture, the traditional classical load balancing algorithm 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 characterized in that when a logic transaction initiated by a user is divided, the generated actual transaction is directly distributed to the load balancing algorithm of each available subnet chain in turn, and when the polling algorithm performs load balancing processing of the subnet chains, a simple alternate selection strategy is used, so that the polling method has the advantages of simple algorithm design and easy execution, but the defects are obvious. The algorithm essentially carries out equivalent treatment on the performance of each subnet chain, but because of the dynamic change of the load condition in different subnet chains and the account balances of different users on the subnet chains when facing different transaction originators, the method has defects, and the adjustment of the subnet chain load distribution cannot be flexibly carried out according to actual conditions.
In a 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 quantity of the transaction to be packaged in the transaction pool in the current subnet chain node when the logical 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 the current blockchain platform, and the transactions are preferentially distributed to the subnet chains with fewer connection numbers for processing.
In summary, the conventional polling algorithm and the load balancing algorithm with the minimum connection number cannot be perfectly adapted in the isomorphic multi-chain system, if the actual load condition of each subnet chain (slicing) is not considered, the transaction is simply split, and the problems of single-point overheating and uneven load can occur, so that the related effect of the parallelization architecture cannot be well exerted. Meanwhile, because the plurality of sub-network chains have certain differences in factors such as the congestion degree of a transaction pool, average transaction cost, the distribution condition of a user account on the plurality of sub-network chains and the like, in the process of converting a logic transaction initiated by a user into an actual transaction on the plurality of sub-network chains, the performance difference among the sub-network chains can be ignored by simple transaction splitting, and the load of transaction can not be reasonably scheduled by utilizing the existing related information in the system, for example, under the condition that the transaction load of one sub-network chain is large, the to-be-packaged transaction is continuously sent to the transaction pool of the sub-network chain, so that the completion time of the transaction is greatly delayed, and the resource waste of other sub-network chains of the system is also caused. Meanwhile, in the traditional load balancing algorithm, a request is usually sent to a service processing node according to a distribution rule, but in the framework, in order to improve the system efficiency according to actual service requirements, when a user performs unidirectional multi-chain transfer, one logical transaction is converted into a plurality of actual transactions, and a plurality of transactions are distributed to a plurality of chains to perform atomic collaborative processing. In one load balancing decision, a load balancing algorithm is utilized to select a plurality of subnet chains to distribute a plurality of actual transactions, and the selection result achieves a better effect as much as possible, so that the traditional load balancing method is not applicable.
Disclosure of Invention
Therefore, an object of the present invention is to overcome the above-mentioned drawbacks of the prior art, and to provide a new load balancing method, which enables efficient division and distribution of transaction transactions in an isomorphic multi-chain system.
According to a first aspect of the present invention, there is provided a load balancing method for processing transactions in isomorphic multiple chains, for converting a logical transaction from a source account to a destination account to be performed into a plurality of actual transactions, wherein the isomorphic multiple chains comprise a plurality of subnetwork chains, the load balancing method comprising the steps of: t1, acquiring index information corresponding to each current 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 and the index weight of each index obtained in the step T1, and ordering the subnet chains in descending order according to the load capacity to form a subnet chain load capacity list; and T3, packaging the current logic transaction to be performed according to the order of the capacities in the subnet chain load capacity list from large to small until the logic transaction to be performed is completed, wherein the actual transaction amount packaged on each subnet chain is limited by the account amount of the source account on the subnet chain after being consumed.
Preferably, the indexes for evaluating the load capacity of the subnet chain corresponding to each subnet chain include three types, namely 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 current logic transaction initiator to be performed on the subnet chain.
Preferably, in the step T2, the load capacity of each subnet chain is calculated by:
F(c i )=w 1 *V i +w 2 *n i +w 3 *gasPrice i
wherein c i Represents the ith subnet chain, V i Representing the account balance of the source account in the ith subnet chain, n i gasPrice representing the number of transactions currently to be packaged for the ith subnet chain i Represents the average transaction fee, w, of the ith subnet chain 1 Comprehensive weight for account balance of subnet chain, w 2 Comprehensive weight for number of transactions to be packaged for subnet chain, w 3 The comprehensive weight of the average transaction fee of the subnet chain. The comprehensive weight of the balance of the subnet chain account, the comprehensive weight of the number of the transactions to be packaged of the subnet chain and the comprehensive weight of the average transaction fee of the subnet chain are calculated by the following modes:
q1, determining the initial weight of each type of index by adopting a subjective analysis method;
q2, periodically collecting index data for evaluating the load capacity of the subnet chains of all the subnet chains at a certain moment according to a preset time node to form a data sample set, wherein the index data of one subnet chain is one sample;
q3, carrying out normalization processing on each index value in each sample in the data sample set, adopting a forward index standardization processing mode on all values corresponding to the balance of the sub-network chain account, and adopting an anisotropic index standardization processing mode on all values corresponding to the number of transactions to be packaged of the sub-network chain and the average transaction fee of the sub-network chain;
q4, calculating the objective evaluation weight of each type of 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 mode:
wherein w is j Comprehensive weight representing j-th class index, P j Initial weight, Q, representing class j index j Objective evaluation weights for the j-th class of index are shown, j=1, 2,3.
Preferably, the initial subjective weight of each class of indicators is determined using a chromatographic analysis method, comprising:
q11, constructing a subnet chain load capacity analysis model, wherein the model comprises a target layer and a criterion layer, the target layer is the load capacity of the subnet chain, and the criterion layer is three indexes of the subnet chain: the method comprises the steps of packaging actual transaction quantity of a subnet chain, average transaction fee of the subnet chain and account balance of a source account of a logic transaction initiator to be performed currently on the subnet chain;
q12, scaling each type of index of the criterion layer by adopting a 1-9 value method, and scaling the index according to expert opinion to form an index pairwise comparison matrix;
q13, carrying out normalization treatment 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 row according to the criterion layer standard pairwise comparison matrix, wherein the standard characteristic vector of each row is the initial subjective weight of the corresponding index of the row.
Preferably, in the step Q3, the forward index normalization processing method is as follows:
the standard treatment mode of the anisotropic index is as follows:
x ij the value of the j index of the i-th subnet chain, i=1, 2,3,..m; j=1, 2,3, m is the number of subnet chains.
Preferably, in the step Q4, an entropy weight method is adopted in the objective analysis method to calculate the entropy weight of the index according to the normalized index value, where the entropy weight of the index is calculated by the following method:
Q j entropy weight indicating the j-th index, j=1, 2,3;
a j entropy value of the j-th index representing the data sample set, and:
wherein m represents the number of subnet chains, b ij Represents the proportion of the i-th sample at the j-th evaluation index, i=1, 2,3,..m,
according to a second aspect of the present invention, there is provided an isomorphic multiple chain system in which a method according to the first aspect of the present invention is used to perform load balancing processing on a logical transaction in the system.
Compared with the prior art, the invention has the advantages that: aiming at the flux lifting problem of the multi-segment block chain, the invention provides a dynamic weighting load balancing algorithm which can measure the current load conditions of different sub-network chains according to the transaction amount to be packaged in transaction pools in different sub-network chains, the transaction fee in the sub-network chains and the account balance information of users in the sub-network chains, so that the splitting and conversion from one logic transaction of the users to a plurality of actual transactions can be carried out, the better system load balancing effect can be realized, and the overall flux level of the system can be 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 chromatographic analysis model constructed according to an embodiment of the invention.
Detailed Description
For the purpose of making the technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail by way of specific embodiments with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The inventor finds that in order to realize efficient division and distribution of transaction transactions in an isomorphic multi-link system, an algorithm is required to be designed according to related load information of different sub-network chains. Because the state information of the subnet chain and the related information of the user account can dynamically change in the system, the performance of the subnet chain can be greatly different at different moments and under different logic transactions in the running process of the system. In order to divide the transaction efficiently and immediately, the load balancing algorithm needs to acquire the latest state information of the local account on each subnet chain, and simultaneously acquire and apply the relevant state information of the subnet chain in real time, including the current load information of the subnet chain, transaction cost, congestion degree and the like, and finally, divide a logical transaction into a plurality of actual transactions according to comprehensive dynamic information so as to realize efficient processing of concurrent transactions. Furthermore, the inventor discovers through researching the existing blockchain flux optimization technology and the design of a blockchain isomorphic multi-chain parallelization architecture that when unidirectional multi-chain transfer transaction of a certain user in the isomorphic multi-chain system is performed, logic transaction initiated by the user can be split into a plurality of actual transactions on a plurality of sub-network chains (fragments) to perform parallelization transaction processing. In the splitting of the logic transaction and the execution of the actual transaction on a plurality of sub-network chains, the whole system should keep the load performance balance of each sub-network chain, namely, the dividing and scheduling of the actual transaction can be carried out according to the real-time dynamic load information of each sub-network chain, so that the efficient parallel transaction processing of the plurality of sub-network chains is realized, and the block chain parallelization 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 overall system performance is improved.
According to one embodiment of the invention, the invention provides a load balancing method for processing transactions in isomorphic multiple chains, which is used for converting a logic transaction from a source account to a destination account to be performed into a plurality of actual transactions in a load balancing manner, wherein the load balancing algorithm determines corresponding subnet chain load condition evaluation indexes in a dynamic weighting manner, then judges the real-time load capacity of each subnet chain by using a weighting evaluation function, and then distributes the actual transactions in the load algorithm according to the size sequence of the current load capacity. The method of the invention combines the running state of the subnet chain network to dynamically collect the load information of each subnet chain, thereby dynamically judging the current load condition of the subnet chain and enabling the load balance distribution strategy of the algorithm to be better exerted. In general terms, the load balancing method comprises the steps of: t1, acquiring index information corresponding to each current 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 and the index weight of each index obtained in the step T1, and performing descending order sequencing to form a subnet chain load capacity list; and T3, sequentially carrying out actual transaction packaging on the logic transactions to be carried out at present according to the sequence of the load capacity list of the subnet chain until the logic transactions to be carried out are completed, wherein the actual transaction amount packaged on each subnet chain is limited by the account amount of the source account on the subnet chain after being consumed.
The load capacity evaluation index for the subnet chain corresponding to each subnet chain in the step T1 preferably includes the following classes:
subnet chain account balance (V) i ): the account balance of the subnet chain not only directly determines whether the subnet chain can process actual transactions, but also is a target to be preferentially considered when the tasks are scheduled, and the concurrency degree of the whole system can be improved by dispersing one logic transaction on a few subnet chains as much as possible, so that the benefits of the isomorphic multi-chain architecture are improved.
The subnet chain current number of transactions to be packaged (n i ): the current congestion degree of the subnet chain can be truly reflected by the current transaction quantity to be packaged, the result of the direct transaction queuing and waiting caused by the excessive transaction quantity to be packaged is that the performance of the subnet chain is further deteriorated only by dispatching the transaction again at the moment, and the transaction requirement of a user cannot be met timely.
Subnet chain average transaction fee (gasPrice) i ): the subnet chain transaction fee is the average gasPrice for a certain subnet chain. The gasPrice value of a transaction initiated by a user directly determines whether a miner is willing to pack, the miner always selects the transaction with higher transaction cost to pack, and the size of the gasPrice value directly influences the length of the transaction delay.
The load capacity of each subnetwork chain in step T2 is weighted with an evaluation function, according to one embodiment of the invention a weighted sum method is used as the evaluation function. The weighting sum method can well reflect the effect of mutually independent evaluation indexes on the whole evaluation. The relevant influence of the evaluation index on the whole can be linearly overlapped, and meanwhile, the indexes can be complemented. In the weighted sum method, each index is expressed as f i The index corresponding weight is expressed as w i In one embodiment of the present invention, only 3 indices are used, so i=1, 2,3. In the present invention f i Namely, corresponding three sub-network chain load capacity evaluation indexes: account balance of subnet chain, number of transactions to be packaged of subnet chain and average transaction fee of subnet chain, w i I.e. the three evaluation indexes are addedThe weight sum method evaluates the corresponding index weight in the function, and the expression formula is formula (1):
w in the above formula i The 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. And selecting the determined evaluation indexes in combination with the functions of the section to obtain the performance evaluation function of each subnet chain, namely a multi-index comprehensive evaluation function, wherein the multi-index comprehensive evaluation function is shown in a formula (2):
F(c i )=w 1 *V i +w 2 *n i +w 3 *gasPrice i (2)
wherein equation (2) reflects the subnet chain c i Wherein c i Represents the ith subnet chain number, V i Account balance in the ith subnet chain on behalf of source account initiating transaction, n i gasPrice representing the number of transactions currently to be packaged for the ith subnet chain i Representing the average transaction fee of the ith subnet chain, and w 1 ,w 2 ,w 3 The comprehensive weights of the three indexes including the account balance of the subnet chain, the number of transactions to be packaged of the subnet chain and the average transaction cost of the subnet chain represent the importance degree of each index on the current performance condition of the subnet chain. Therefore, in the present invention, when the load capacity of the subnet chain is evaluated by using the evaluation function, the comprehensive weight of each evaluation index is first determined. After the subnet chains in the isomorphic multi-chain block chain architecture determine the load capacity evaluation function, two types of methods for determining the corresponding weight index in the multi-index comprehensive evaluation function are needed, namely a subjective weighting method and an objective weighting method. The subjective weighting method obtains weight information through artificial subjective opinion, and mainly reflects the economic or technical significance of the index; the objective weighting method obtains the related index weight according to the related actual data of each index, and can embody the information quantity of the index in the aspect of data. The two methods have the characteristics and the disadvantages respectively, and are according to the inventionIn one embodiment, the comprehensive evaluation method is combined with the subjective weighting method and the objective weighting method to determine the comprehensive weights of the indexes, so that the comprehensive weights of the indexes are unified in a subjective and objective evaluation system.
According to one embodiment of the 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 using an analytic hierarchy process in a subjective weighting method, and then realizing a load balancing algorithm by using the evaluation function. And then, after the isomorphic multi-chain system is operated 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 utilizing the entropy weight method in the objective weighting method. And finally, determining the comprehensive weight value of the three evaluation indexes in the subnet chain performance evaluation function by using weights obtained by an analytic hierarchy process and an entropy weight process.
The following describes the chromatography, entropy weighting, and calculation of the comprehensive weights in detail in connection with the embodiments of the present invention:
1. analytic hierarchy process
The analytic hierarchy process (Analytic Hierarchy Process, AHP) is a multi-criterion decision method for qualitative and quantitative analysis. According to one embodiment of the present invention, a subnet chain load capacity analysis model as shown in fig. 1 is first established, the target layer is the load capacity of the subnet chain, and the criterion layer is three evaluation indexes: the available balance of the subnet chain account, the number of transactions to be packaged by the subnet chain and the average transaction fee by the subnet chain.
In the analytic hierarchy process, the three indexes provided by the invention are required to be compared and judged pairwise, the indexes are scaled by adopting a 1-9 value method, the evaluation table of the 1-9 value method is shown in a table 1, and then the indexes are scaled according to expert opinion to form a pairwise comparison matrix table.
Table 1 1-9 value method Scale
Next, a judgment matrix is constructed by combining a 1-9 value method with actual conditions, wherein the account amount of the subnet chain and the number of transactions to be packed of the subnet chain have a larger influence on the load capacity of the subnet chain, and the average transaction cost of the subnet chain has a relatively weaker influence, and preferably, the two-to-two comparison matrices are constructed as shown in table 2.
Table 2 criterion layer two-by-two comparison matrix
And carrying out normalization processing on the criterion layer two-by-two comparison matrixes, calculating the sum of each column, dividing each element in the matrix table 2 by the sum of the columns, and forming the criterion layer two-by-two comparison matrixes by the obtained result, wherein the criterion layer standard two-by-two comparison matrixes are shown in the table 3.
Table 3 criterion layer criteria two-by-two comparison matrix
Next, the maximum feature root and the corresponding feature vector of each row are calculated according to the criterion layer standard pairwise comparison matrix, and the feature vector is normalized to obtain the corresponding weight of each evaluation index, as shown in table 4.
TABLE 4 criterion layer feature vectors
Three evaluation index weight vectors P determined by analytic hierarchy process are obtained from Table 4, where P 1 Initial weight for account balance index of subnet chain, P 2 Initial weight, P, of transaction number index to be packaged for subnet chain 3 For the initial weight of the sub-network chain flat transaction fee index, the weight vector P is as follows:
P=(P 1 ,P 2 ,P 3 )=(0.4286,0.4286,0.1429) (3)
2. entropy weight method
Entropy is a description of the degree of uncertainty, and the degree of dispersion 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 weighting method is used as an objective weighting method, and can obtain related weight reference information from the data.
Firstly, data of three load capacity evaluation indexes of a subnet chain are obtained at fixed time, and after the normal and abnormal indexes are subjected to standardized processing, the weights of the three indexes are calculated by using an entropy weight method. Namely, acquiring index values V for evaluating the load capacity of the subnet chain of all the subnet chains at a certain moment at fixed time according to a preset time node i ,n i ,gasPrice i The index data of each subnet chain is one sample, and the invention evaluates m samples (namely m subnet chains) against the three evaluation indexes and marks x ij The value of the j index (i=1, 2,3,..m; j=1, 2, 3) for the i-th subnet chain. The indexes are normalized, and the units and meanings of different indexes are different, so that the indexes are normalized before use, and the forward indexes and the different indexes are normalized in different calculation modes.
The forward index normalization processing formula is formula (4):
the negative index standardization processing formula is formula (5):
the account balance of the subnet chain is a forward index, that is, the more the account balance of the subnet chain is, the better the effect of carrying out load processing by using the subnet chain is, and the subnet chain is preferably selected. Therefore, the forward index normalization process will be performed on the subnet chain account balance using equation (4). The number of the sub-network chain to be packed and the average transaction cost of the sub-network chain are negative indexes, namely, the greater the number of the sub-network chain to be packed is, the poorer the load capacity of the sub-network chain is, the greater the average transaction cost of the sub-network chain is, and the smaller the tendency of the sub-network chain to be selected is. Therefore, the sub-network link transaction number to be packaged and the sub-network link average transaction fee are subjected to negative index standardization processing by using the formula (5).
Then, based on the information obtained at the timing, the entropy value a of the j-th index of the sample is calculated j The method comprises the following steps:
wherein b ij For the proportion of the ith sample under the jth evaluation index, i.e
Then the entropy weight Q of the jth index can be found j The method comprises the following steps:
the final entropy weighting method can obtain a weight vector of the evaluation index as Q, wherein Q is as follows 1 Objective evaluation weight of account balance index of subnet chain obtained by entropy weight method, Q 2 Objective weight of sub-network chain transaction number index to be packaged and obtained by entropy weight method, Q 3 And objectively evaluating the weight of the sub-network chain flat transaction fee index obtained by the entropy weight method.
Q=(Q 1 ,Q 2 ,Q 3 )
3. Calculation of comprehensive weights
The index weight P determined by the analytic hierarchy process represents the subjective weight of the three indexes in the aspect of the performance of the subnet chain, and the index weight Q determined by the entropy weight process represents the relation between the data under the three indexes, so that the weight information of the subjective evaluation method and the objective evaluation method can be integrated, and according to one embodiment of the invention, the comprehensive weight of the performance evaluation index of the subnet chain is obtained by using the following formula.
Wherein w is j J-th evaluation index comprehensive weight determined for analytic hierarchy process and entropy weight process, P j Subjective weight, Q, of j-th evaluation index determined for analytic hierarchy process j The j-th evaluation index determined by the entropy weight method is objectively weighted, j=3, and indicates that three evaluation indexes are total.
Therefore, in summary, after the corresponding evaluation indexes are obtained by the analytic hierarchy process and the entropy weight process, the final subnet chain weight evaluation function can be obtained by integrating the weight vector information of the two methods, and the weight evaluation function is as follows:
F(c i )=w 1 *V i +w 2 *n i +w 3 *gasPrice i
wherein w is 1 Account balance V for a subnet chain i Is w 2 To-be-packaged transaction number n for subnet chain i Is w 3 Average transaction fee gasPrice for a subnet chain i Is a complex weight of (a).
For a better understanding of the present invention, the load balancing process of the present invention is described in detail below in connection with one specific embodiment.
According to one embodiment of the present invention, there is provided a process for executing a logical transaction submitted by a user by using the load balancing method of the present invention in an isomorphic multiple chain system, wherein the conversion of the logical transaction into a plurality of actual transactions is achieved by a load balancing algorithm, and assuming that a transfer transaction with a transfer amount V is performed by a user a to a user B, there are m subnet chains in total, denoted as c 1 ,c 2 ,c 3 ,...,c m The method comprises the steps of carrying out a first treatment on the surface of the The number of transactions to be packaged of m subnet chains is n i (i=1, 2,3, m); the average transaction fee of m sub-network chains is gasPrice i (i=1,2,3, m); user A has an account balance V on the m subnetwork chains i (i=1, 2,3,., m.) the load balancing scheduling procedure includes:
step S1, firstly inquiring the assets of the user A on all the subnet chains, ifIndicating that the total assets of A are insufficient to conduct the transaction, returning an error;
step S2, periodically acquiring the transaction number n to be packaged of each subnet chain i Subnet chain transaction fee gasPrice i Information and obtaining account balance information V of current transaction initiator user A on each subnet chain i
Step S3, calculating the current load capacity priority sequence of each subnet chain according to a subnet chain performance evaluation function (formula (2), and sorting the subnet chains in descending order according to the load capacity of the subnet chains to form a List, namely, the load capacities of the subnet chains in the List are gradually reduced;
step S4, starting from the first subnet chain of the List to divide the logical transaction initiated by the user A, i.e. determine the actual transaction, using the sum of as much as possible of the user A account on each available subnet chain as the transfer sum of the actual transaction executed on the subnet chain, i.e. the maximum sum is V i Then selecting the next subnet chain in the list to determine the next actual transaction until the sum of all the actual transaction amounts is the total transfer amount V;
step S5, return the actual transaction set realtx= {<c i ,amount i >|i∈[1,m]The set, namely the logical transaction that the user A initiates the transfer to the user B, is divided into a plurality of actual transaction sets executed on the subnet chains after the dynamic weighted load balancing algorithm provided by the invention, wherein the actual transaction sets are divided into a plurality of actual transaction sets<c i ,amount i >Indicating that this actual transaction is divided into a chain of subnets c i Execution takes place, i.e. user a is in subnet chain c i The account will generate an amount of amountof i The transfer transaction sent to user B in subnet chain c i Is a part of the account of the computer.
Aiming at the flux lifting problem of the multi-segment block chain, the invention provides a dynamic weighting load balancing algorithm which can measure the current load conditions of different sub-network chains according to the transaction amount to be packaged in transaction pools in different sub-network chains, the transaction fee in the sub-network chains and the account balance information of users in the sub-network chains, so that the splitting and conversion from one logic transaction of the users to a plurality of actual transactions can be carried out, the better system load balancing effect can be realized, and the overall flux level of the system can be improved.
It should be noted that, although the steps are described above in a specific order, it is not meant to necessarily be 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 thereon for causing a processor to implement 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 storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage 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: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing.
The foregoing description of embodiments of the invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or 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 various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the technical improvements in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (8)

1. A load balancing method for transaction processing in a homogeneous multi-chain for converting a logical transaction from a source account to a destination account to be conducted into a plurality of actual transactions, wherein the homogeneous multi-chain comprises a plurality of subnetwork chains, the load balancing method comprising the steps of:
t1, acquiring index information corresponding to each current subnet chain and used for evaluating the load capacity of the subnet chain; the indexes for evaluating the load capacity of the subnet chain corresponding to each subnet chain comprise three types, namely the actual transaction quantity to be packaged of the subnet chain, the average transaction cost of the subnet chain and the account balance of the source account of the current logic transaction initiator to be performed on the subnet chain;
t2, calculating the load capacity of each subnet chain according to the index information and the index weight of each index obtained in the step T1, and ordering the subnet chains in descending order according to the load capacity to form a subnet chain load capacity list; wherein the load capacity of each subnet chain is calculated by:
F(c i )=w 1 *V i +w 2 *n i +w 3 *gasPrice i
wherein c i Represents the ith subnet chain, V i Representing the account balance of the source account in the ith subnet chain, n i gasPrice representing the number of transactions currently to be packaged for the ith subnet chain i Represents the average transaction fee, w, of the ith subnet chain 1 Comprehensive weight for account balance of subnet chain, w 2 Comprehensive weight for number of transactions to be packaged for subnet chain, w 3 Comprehensive weight of average transaction fee for the subnet chain;
and T3, packaging the current logic transaction to be performed according to the order of the capacities in the subnet chain load capacity list from large to small until the logic transaction to be performed is completed, wherein the actual transaction amount packaged on each subnet chain is limited by the account amount of the source account on the subnet chain after being consumed.
2. The load balancing method for isomorphic multi-chain transaction processing according to claim 1, wherein the comprehensive weight of the account balance of the sub-network chain, the comprehensive weight of the number of transactions to be packaged of the sub-network chain and the comprehensive weight of the average transaction fee of the sub-network chain are calculated by the following modes:
q1, determining the initial weight of each type of index by adopting a subjective analysis method;
q2, periodically collecting index data for evaluating the load capacity of the subnet chains of all the subnet chains at a certain moment according to a preset time node to form a data sample set, wherein the index data of one subnet chain is one sample;
q3, carrying out normalization processing on each index value in each sample in the data sample set, adopting a forward index standardization processing mode on all values corresponding to the balance of the sub-network chain account, and adopting an anisotropic index standardization processing mode on all values corresponding to the number of transactions to be packaged of the sub-network chain and the average transaction fee of the sub-network chain;
q4, calculating the objective evaluation weight of each type of 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 mode:
wherein w is j Comprehensive weight representing j-th class index, P j Initial weight, Q, representing class j index j Objective evaluation weights for the j-th class of index are shown, j=1, 2,3.
3. The method for load balancing for isomorphic multiple chain transaction processing according to claim 2, wherein the step Q1 of determining the initial subjective weight of each class of indicators by using a chromatographic analysis method comprises:
q11, constructing a subnet chain load capacity analysis model, wherein the model comprises a target layer and a criterion layer, the target layer is the load capacity of the subnet chain, and the criterion layer is three evaluation indexes of the subnet chain: the method comprises the steps of packaging actual transaction quantity of a subnet chain, average transaction fee of the subnet chain and account balance of a source account of a logic transaction initiator to be performed currently on the subnet chain;
q12, scaling each type of index of the criterion layer by adopting a 1-9 value method, and scaling the index according to expert opinion to form an index pairwise comparison matrix;
q13, carrying out normalization treatment 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 row according to the criterion layer standard pairwise comparison matrix, wherein the standard characteristic vector of each row is the initial subjective weight of the corresponding index of the row.
4. The method for load balancing for isomorphic multiple-chain transaction processing according to claim 2, wherein in the step Q3, the forward index standardization processing method is as follows:
the standard treatment mode of the anisotropic index is as follows:
x ij the value of the j index of the i-th subnet chain, i=1, 2,3,..m; j=1, 2,3, m is the number of subnet chains.
5. The load balancing method for isomorphic multi-chain transaction processing according to claim 4, wherein in the step Q4, an entropy weight method is adopted to calculate the entropy weight of the index according to the normalized index value, wherein the entropy weight of the index is calculated by the following method:
Q j entropy weight indicating the j-th index, j=1, 2,3;
a j entropy value of the j-th index representing the data sample set, and:
wherein m represents the number of subnet chains, b ij Represents the proportion of the ith sample under the jth evaluation index, i=1, 2,3, m,
6. an isomorphic multiple chain system, characterized in that the method as claimed in any one of claims 1-5 is adopted in the isomorphic multiple chain system to perform load balancing processing on logic transactions in the system.
7. A computer readable storage medium having embodied thereon a computer program executable by a processor to perform the steps of the method of any of claims 1 to 5.
8. 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 perform the steps of the method of any of claims 1-5.
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 CN112214328A (en) 2021-01-12
CN112214328B true 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)

Families Citing this family (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
CN117808602B (en) * 2024-03-01 2024-06-25 联动优势电子商务有限公司 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
一种多指标综合评价负载均衡路由策略研究;倪晓军;段元新;章韵;张敏敏;;计算机技术与发展(06);第52-56页 *

Also Published As

Publication number Publication date
CN112214328A (en) 2021-01-12

Similar Documents

Publication Publication Date Title
CN112214328B (en) Load balancing method for transaction processing in isomorphic multiple chains
Tang et al. An intermediate data placement algorithm for load balancing in spark computing environment
CN109561148B (en) Distributed task scheduling method based on directed acyclic graph in edge computing network
Ge et al. GA-based task scheduler for the cloud computing systems
US9201690B2 (en) Resource aware scheduling in a distributed computing environment
CN109120715A (en) Dynamic load balancing method under a kind of cloud environment
US10412023B2 (en) Resource allocation method under heterogeneous network under intermediate processing constraints
US8185909B2 (en) Predictive database resource utilization and load balancing using neural network model
CN107357652B (en) Cloud computing task scheduling method based on segmentation ordering and standard deviation adjustment factor
Liu et al. Resource preprocessing and optimal task scheduling in cloud computing environments
CN103701886A (en) Hierarchic scheduling method for service and resources in cloud computation environment
US20080244072A1 (en) Distributed resource allocation in stream processing systems
CN112486690A (en) Edge computing resource allocation method suitable for industrial Internet of things
Mostafa et al. Fog resource selection using historical executions
CN104239141A (en) Task optimized-scheduling method in data center on basis of critical paths of workflow
CN103699433B (en) One kind dynamically adjusts number of tasks purpose method and system in Hadoop platform
CN110347515B (en) Resource optimization allocation method suitable for edge computing environment
CN105373426B (en) A kind of car networking memory aware real time job dispatching method based on Hadoop
Li et al. An efficient scheduling optimization strategy for improving consistency maintenance in edge cloud environment
CN108881432A (en) Cloud computing cluster load dispatching method based on GA algorithm
US11531982B2 (en) Optimal transactions sharding for scalable blockchain
CN106095582A (en) The task executing method of cloud platform
CN114358286A (en) Mobile equipment federal learning method and system
CN106502790A (en) A kind of task distribution optimization method based on data distribution
CN110048966B (en) Coflow scheduling method for minimizing system overhead based on deadline

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