CN112258321A - Transaction placement method for block chain fragments - Google Patents
Transaction placement method for block chain fragments Download PDFInfo
- Publication number
- CN112258321A CN112258321A CN202011091440.4A CN202011091440A CN112258321A CN 112258321 A CN112258321 A CN 112258321A CN 202011091440 A CN202011091440 A CN 202011091440A CN 112258321 A CN112258321 A CN 112258321A
- Authority
- CN
- China
- Prior art keywords
- transaction
- transactions
- slice
- parent
- average
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 77
- 239000012634 fragment Substances 0.000 title claims abstract description 71
- 238000012545 processing Methods 0.000 claims description 15
- 238000004364 calculation method Methods 0.000 claims description 10
- 238000012795 verification Methods 0.000 claims description 10
- 239000003999 initiator Substances 0.000 claims description 6
- 238000012546 transfer Methods 0.000 claims description 4
- 238000013467 fragmentation Methods 0.000 description 34
- 238000006062 fragmentation reaction Methods 0.000 description 34
- 238000005457 optimization Methods 0.000 description 30
- 238000002474 experimental method Methods 0.000 description 19
- 238000010586 diagram Methods 0.000 description 8
- 230000008569 process Effects 0.000 description 8
- 238000004422 calculation algorithm Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 7
- 238000004458 analytical method Methods 0.000 description 5
- 238000004088 simulation Methods 0.000 description 5
- 230000007423 decrease Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000006872 improvement Effects 0.000 description 3
- RTZKZFJDLAIYFH-UHFFFAOYSA-N Diethyl ether Chemical compound CCOCC RTZKZFJDLAIYFH-UHFFFAOYSA-N 0.000 description 2
- 238000013459 approach Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000005315 distribution function Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000008901 benefit Effects 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 238000013400 design of experiment Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000000556 factor analysis Methods 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000005065 mining Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 239000011541 reaction mixture Substances 0.000 description 1
- 239000000126 substance Substances 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/18—Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
Abstract
The invention discloses a transaction placement method of block chain fragments, which specifically comprises the following steps: s1, calculating the average waiting time of the current transaction u in each fragmentS2 average waiting time in the slice i based on the transaction uCalculating the fitness of the transaction u in the segment i according to the parent transaction number in the segment i; s3, putting the transaction uAnd entering the slice corresponding to the maximum fitness value. The cross-slice transaction is reduced by reasonably placing the transaction, and the expandability of the slice system is further improved.
Description
Technical Field
The invention belongs to the technical field of blockchain, and particularly relates to a transaction placement method of blockchain fragments.
Background
With the advent of digital cryptocurrency, such as bitcoin, blockchains have become a subversive technology that has transformed the next generation of distributed technology. However, current blockchain technology faces poor scalability, which greatly limits the development and application of blockchains. For example, Bingpene can only process 10 transactions per second at most, with an average block generation time of 10 minutes. But also tends to create transaction backlogs and network congestion. In fact, the VISA payment system can easily process 2000 transactions per second, up to 45000 transactions. Therefore, poor scalability makes it difficult for the blockchain system to fulfill the requirements of real-world applications.
In order to improve the expandability of the block chain, a block chain fragmentation technology is provided. The fragmentation technology is derived from the existing database fragmentation, the database is divided into a plurality of fragments, and transactions are processed in each fragment in parallel. The block chain fragmentation technology divides nodes in a network into a plurality of disjoint fragments according to rules, and the nodes in each fragment only need to process part of transactions, so that the concurrency of transaction processing and verification is improved, the transaction processing capacity of a block chain system is increased along with the increase of the number of fragments, and the expandability of a block chain is greatly improved. Blockchain fragmentation has been considered to be the most practical solution to the on-line extended blockchain system so far, leading to extensive research.
However, due to the existence of blockchain fragmentation technology, cross-fragment transactions occur. In current blockchain fragmentation schemes, transactions are randomly distributed among the individual fragments, resulting in a very large number of cross-fragment transactions in the blockchain fragmentation system. And the cross-chip transaction not only has high communication cost, but also has long transaction processing time. If too many cross-slice transactions occur in the blockchain sharding system, the performance of the system is reduced.
Disclosure of Invention
The invention provides a transaction placement method of blockchain fragments, which places transactions on the best fragment to reduce cross-fragment transactions.
The invention is realized in this way, a block chain fragment transaction placement method, the method specifically includes the following steps:
S2 average waiting time in the slice i based on the transaction uCalculating the fitness of the transaction u in the segment i according to the parent transaction number in the segment i;
and S3, putting the transaction u into the segment corresponding to the maximum fitness value.
Further, the method for acquiring the parent transaction quantity specifically comprises the following steps:
s21, constructing a transaction flow chart G;
s22, acquiring the fragment ID of the parent transaction of the transaction u in the transaction flow chart G;
s23, counting the parent transaction number of the transaction u in each fragment;
where G ═ V, E, V denotes a transaction set, each transaction in the transaction set including a transfer of a transaction initiator to another user and an unspent amount of the transaction initiator, E denotes a relationship between transactions.
Further, the average waiting time of the transaction in slice iThe calculation formula of (a) is specifically as follows:
wherein, tiTo be the average processing time for a transaction,for the total processing time from the arrival of the transaction to the completion of the transaction,the average number of transactions in the waiting queue of slice i, b the number of transactions packed in the block, muiDenotes the block generation rate, λ, in slice iiFor the arrival rate of transactions in the queue, p represents the success probability of block verification, E (H)i(t)) represents the mathematical expectation of the chunk generation time in slice i.
Further, the fitness g of the transaction u in the segment iiThe calculation formula of (u) is specifically as follows:
gi(u)=yi(u)-*xi(u)
wherein x isi(u) normalized average latency, y, for transaction u in slice ii(u) represents the normalized parent transaction number of transaction u in slice i.
Further, normalizing the parent transaction number yiThe calculation formula of (u) is specifically as follows:
wherein K is the number of the fragments, the value of K is more than or equal to 2 and less than or equal to 16, and NuSet of all parent transactions, V, representing transaction ui∩NuI represents the number of its parent transaction in the fragment i, ViRepresenting the transaction set in the ith slice of the transaction flow chart.
Further, the average latency x is normalizediThe calculation formula of (u) is specifically as follows:
wherein K is the number of the fragments, the value of K is more than or equal to 2 and less than or equal to 16,is the average waiting time of the transaction in slice i.
The invention provides the fragment fitness as an index for measuring the transaction placement, and the index considers the transaction placement by combining two angles of time and cross-fragment transaction so as to place the transaction into a proper fragment and reduce the cross-fragment transaction.
Drawings
FIG. 1 is a schematic diagram of an embodiment of the present invention
FIG. 2 is a schematic diagram of a transaction flow provided by an embodiment of the present invention;
FIG. 3 is a comparison of transaction throughput provided by embodiments of the present invention against graph one;
FIG. 4 is a comparison of transaction throughput provided by an embodiment of the present invention with FIG. two;
FIG. 5 is a comparison of the impact of parent transaction quantity on transaction throughput provided by embodiments of the present invention;
FIG. 6 is a graph comparing the impact of parent transaction amount on transaction throughput provided by embodiments of the present invention;
FIG. 7 is a comparison of the impact of transaction rate on transaction throughput provided by embodiments of the present invention;
FIG. 8 is a comparison of the impact of transaction rate on transaction throughput provided by embodiments of the present invention;
FIG. 9 is a comparison graph one of the fractional queue ratios over time provided by an embodiment of the present invention;
FIG. 10 is a graph illustrating a comparison of fractional queue ratios with time according to an embodiment of the present invention;
FIG. 11 is a graph I comparing the effect of fractional amounts on transaction latency provided by embodiments of the present invention;
FIG. 12 is a graph illustrating the effect of fragmentation on transaction latency according to an embodiment of the present invention;
FIG. 13 is a comparison of the impact of slice size on transaction latency provided by embodiments of the present invention;
FIG. 14 is a comparison of the impact of slice size on transaction latency provided by embodiments of the present invention;
FIG. 15 is a comparison of the effect of transaction rate on transaction latency provided by embodiments of the present invention;
fig. 16 is a comparison graph of the impact of transaction rate on transaction delay according to the embodiment of the present invention.
Detailed Description
The following detailed description of the embodiments of the present invention will be given in order to provide those skilled in the art with a more complete, accurate and thorough understanding of the inventive concept and technical solutions of the present invention.
The invention provides an optimal transaction layout method for reducing cross-segment transaction quantity under the condition of considering transaction average waiting time and transaction relation. First, the average latency of a transaction when put into different shards is analyzed. Secondly, a transaction flow diagram is constructed, and the relation between the transactions is analyzed according to the transaction sequence. Third, the relationship between the average latency and the transactions is combined to calculate the patch fitness of the transactions. Finally, an optimization algorithm based on fitness is designed. The method can effectively reduce cross-fragmentation transaction and transaction delay. Thus, the transaction throughput of the blockchain system can be greatly improved.
Transaction placement general factor analysis
The establishment of a block chain fragmentation-based transaction placement optimization method needs to consider three basic elements: trades, parent trades, and average wait times for trades.
(1) Trading: defining transactions, denoted by u, transactions can be divided into two categories by the source of the transaction: 1) transactions resulting from mining, referred to as system reward transactions; 2) from other transactions that have been spent, referred to as normal transactions.
(2) Parent transaction: an input transaction of a transaction is referred to herein as a parent transaction. For all parent transactions, NuMeaning that the segment in which the parent transaction is located is called the parent segment.
(3) Average latency of transaction: average latency of transaction is notedRepresents the average waiting time of the transaction in the queue of the transaction to be processed, and the average waiting time of the transaction in the segment i is recorded as
Since the authentication of a transaction is closely related to the parent transaction, the presence of blockchain shards results in the generation of cross-shard transactions. In order to reduce the number of cross-wafer transactions and take into account the timeliness specific to the transactions themselves, a transaction placement optimization method is proposed.
Transaction placement optimization method design
Firstly, carrying out time performance analysis on the fragments, see step (3) to estimate the average waiting time for putting the transaction into the fragments; then, establishing the transactions into a transaction flow diagram according to the time sequence, see (4), so as to analyze the relationship between the transactions; calculating the fitness of the transaction in a slicing way by combining the average waiting time of the transaction and the relationship between the transactions, see (5); and finally, designing a transaction placement optimization algorithm, and placing the transaction into a proper fragment, namely (6).
(3) Time performance analysis
The transaction is analyzed in different segments in time, and the whole process from the time when the transaction reaches the segment to the time when the transaction is verified is analyzed. The average wait time to place the transaction into the segment is then estimated by modeling the process.
Before a transaction reaches a slice, it is first put into a wait queue. The flow is modeled as a transaction arrival flow. Transaction processing in the shards follows FCFS (first come first served) rules. This process is referred to as the transaction processing phase. Let Pn(t) is the probability distribution of n transactions in slice i at time t:
wherein, the transaction of the fragment i is in Poisson flow lambdaiAnd (4) arriving. Suppose that the time interval between two arriving adjacent transactions of slice i is Ti。(P0(t) is the probability that there are 0 transactions in slice i at time t), let Fi(T) is the time interval T during which the transactions arrive consecutivelyiDistribution function of (d):
wherein T isiSatisfaction with having a transaction arrival rate λiIs used as the index distribution of (1). In a blockchain system, transactions are packaged into blocks, so the transaction processing time is the generation time of the block in which the transaction is located. If the blockchain system remains stable, the generation time of the blocks satisfies the exponential distribution. Let Hi(t) generating a time distribution function for the blocks of slice i:
wherein, muiIndicates the block generation rate in slice i, and sets tiFor average processing time of transactions:
where p represents the success probability of block verification, E (H)i(t)) represents the mathematical expectation of the chunk generation time in slice i.
Assuming that b transactions can be packed in a block, when there are transactions in the queue, the current block should maximize the number of transactions packed, otherwise the block will not be able to be processed. As can be seen from the equations (2) and (3), λ must be satisfied to maintain the system stabilityi<b*μi. Because if the transaction arrival rate in the queue is lambdaiGreater than the block processing completion rate muiA backlog of transactions will occur in the queue and the queue size will gradually increase, resulting in an infinite wait condition. In the long term, therefore, the pending transaction queue needs to be stable, i.e., the number of transactions arriving in the queue and the number of transactions leaving the queue are maintained in a stable state.
The average transaction number in the waiting queue set to slice i is denoted asThenThis can be derived from equation (5):
is provided withTo get the total processing time from the transaction arrival to the transaction completion, we know from Little's law in queuing theory:
total time spent by transaction from reaching shard to transaction processing completion in equation (6)It is shown that,including average latencyAnd average processing time t of transactionsi。
Thus, the average waiting time of the transaction in the segment i can be obtainedAs shown in formula (7):
the appropriate degree of putting the transaction into different segments is estimated by calculating the average waiting time of the transaction in different segments, so that the putting of the transaction reaches the aim of short waiting time. In order to enable the placement of the transactions to meet the goal of few cross-piece transactions, the transactions are established into a transaction flow graph, and the placement of the transactions is considered from the relationship among the transactions.
(4) Establishing a transaction flow graph
In order to enable the transaction placement to meet the goal of cross-segment transaction shortage, a transaction flow graph is constructed, and the relationship among transactions is considered on the basis. The transaction flow diagram is defined as:
G=(V,E)
where V and E represent the vertex set and edge set, respectively, in the diagram. V represents a transaction set, consisting of several transactions, each transaction having two parts: the transaction initiator transfers to another user (including the transaction amount) and the transaction initiator's unspent amount. E in the figure represents the relationship between transactions. The transaction flow graph is shown in fig. 2 in chronological order of transaction generation.
In fig. 2, Tx0 represents miner a creating a valid block, earning a system bonus money transaction, where a earns 100 BTC. There are 2100 BTCs (bitcoins) in the unissued currency in the system at this time. After D transfers 40 BTCs to E, there are 20 BTCs in Tx6 that are not spent. The arrowed lines 1 and 2 between the vertices in the figure indicate that Tx6 obtained the BTC transmitted from Tx4 and Tx 5. Assume that there are K slices. The proposed transaction placement optimization method aims at finding the following shards:
G={S1,S2,…,SK}
wherein i belongs to {1, 2.., K }, Si=(Vi,Ei)。And U.Vi=V。And i is not equal to j,let NijFor the number of cross-segment transactions between segments i and j, when the transaction arrives, the placement target with the minimum number of cross-segment transactions and the minimum average waiting time needs to be satisfied:
in the formula (8), the reaction mixture is,the average waiting time of the transaction in the segment i is represented, and the placement of the transaction needs to meet the goals of small number of cross-segment transactions and short transaction waiting time.
On the basis of constructing a transaction flow graph, the relation between transactions can be obtained, and the segment fitness calculation is carried out according to the average waiting time of the transactions.
(5) Slice fitness calculation
In order to reduce the number of cross-segment transactions, it is necessary to put as many related transactions as possible in the same segment, i.e. to put them in the same segment as their parent transactions. If there are multiple parent transactions, then they can be placed in the shard with the most parent transactions. In addition, the more transactions that are waiting in the queue, the longer the time required for subsequent arrival transactions.
Let xi(u) normalized average latency, y, for transaction u in slice ii(u) represents the normalized parent transaction number of transaction u in slice i:
wherein the content of the first and second substances,representing the minimum value of the average waiting time of transaction u in all slices,represents the maximum value of the average waiting time of the transaction u in all the slices; k is the number of the fragments, and the number of K is as follows: k is more than or equal to 2 and less than or equal to 16, NuSet of all parent transactions, V, representing transaction uiRepresents the transaction set in the ith fragment, | V of the transaction flow charti∩NuAnd | represents the number of the parent transactions in the segment i, and the more the parent transactions in the segment i are, the more u is suitable for the segment i. Let gi(u) fitness of transaction u in slice i:
gi(u)=yi(u)-xi(u) (11)
the maximum slice fitness of transaction placement, namely max g, can be obtainedi(u) where i ∈ {1, 2.
If transaction u has no predecessor nodes in shard i, | Vi∩NuAnd | ═ 0. Such transactions do not increase the number of cross-slice transactions. Thus, slice fitness is only related to the average latency of transactions in a slice. If this type of transaction is placed in the slice with the shortest average latency, the transaction can be processed relatively quickly.
(6) Transaction placement optimization algorithm
In order to place the transaction in the most appropriate segment, an optimization algorithm for transaction placement is proposed. The average waiting time of the newly arrived transaction u in K slices is first estimated, and then a transaction flow graph is established to determine the relationship between the transactions. Finally, the transactions are placed in the most appropriate slice according to the relationship between the average latency and the transactions, as shown in algorithm 1.
The description is as follows:
(1) the ParentsShardID is defined to store the tile ID for the parent transaction (line 3), while the ParentsInShardNumber is used to store the number of tiles in each tile (line 4). Line 3 is used to store the slice ID of the parent transaction, and line 4 is used to store the number of parent transactions in each slice.
(2) Lines 6-8 are used to calculate the average waiting time of transaction u in different slices.
(3) And acquiring the parent transaction number (lines 9-13) of u in each fragment. First, the fragment ID of the parent transaction of u is obtained. The transaction flow chart is then updated (lines 11-13).
(4) And (4) counting the parent transaction number of u in each fragment (lines 14-17).
(5) And calculating the fragment fitness of the transaction u of the K fragments (18-22 lines).
(6) The K (23-28 rows) have the best fitness. And obtaining the optimal fragment ID through comparison.
(7) Transaction u is then placed in the best slice (line 29).
(8) Algorithm 1 has 4 single cycles with a temporal complexity of o (k).
By the algorithm 1, the placement of the transaction can meet the placement target with less cross-chip transactions and short transaction waiting time. The validity of the transaction placement method is verified experimentally below.
The invention mainly researches the problem of reasonably placing block chain fragment transactions to reduce the cross-fragment transaction amount, and contributes to the following steps: (1) the transaction placement method is provided, cross-piece transactions are reduced by reasonably placing the transactions, and the expandability of a piece system is further improved; (2) performing time performance analysis on the fragments to estimate the time spent on putting the transaction into the fragments; (3) and abstracting the transactions in the block chain network into a transaction flow diagram, abstracting the transactions into vertexes in the diagram, and abstracting the relationship between the transactions into edges. And forming a transaction flow graph in sequence according to the transaction time sequence so as to analyze the relationship between the transactions. (4) And (3) putting the fragment fitness as an index for measuring the transaction placement, wherein the index considers the transaction placement by combining two angles of time and cross-fragment transaction so as to place the transaction into a proper fragment.
The purpose of the experiment is to evaluate the influence of the transaction placement optimization method on the performance of the blockchain slicing system. And running a transaction placement optimization method on the basis of OmniLedger and RapidCHain fragmentation schemes. And verifying the effectiveness of the transaction placement optimization method on the improvement of the fragment performance through a comparison experiment. Firstly, the specific configuration and indexes of the experiment are described in detail, then the content of the detailed design of the experiment is described, and finally the experiment result is analyzed.
Experimental setup
Experimental Environment and parameter settings
The experiment adopts a Windows 10 sixty-four-bit operating system, an Intel Core i7 processor, a CPU2.40GHz and an 8G memory. And an Omnet + +5.4.1 simulator is adopted, and an OverSim simulation module is used for simulating the block chain fragmentation network. Wherein Omnet + +5.4.1 is a simulator for constructing a network, and plays an important role in the field of network simulation; OverSim is an open source simulation module based on Omnet + +5.4.1 and used for simulating P2P network. The overlarm has the greatest characteristic of strong expandability, and network simulation of 10000 nodes or even 100000 nodes can be realized on one PC.
In the simulation experiment, the nodes randomly select 8 peers to form P2P coverage, the bandwidth of each node is set to 20Mbps, and the communication link delay is set to 100ms, which is the same as the experimental setting in omnilegger and rapidchannel. Since the block size in the current bitcoin is 1MB and the average size of one transaction is about 500 bytes, it is assumed that the number of transactions contained in the block is 2000. The one-way latency between two random nodes in the emulated network is about 90-140ms, which is consistent with the measurements of bitcoin and ether houses. Setting of transaction rates were set from 2000tps to 6000tps with reference to the VISA system throughput of 4000 transactions per second. All experiments were tested 5 times and the measurements were counted at a stable time for each run. Table 1 summarizes all parameters and configurations of the experiment:
table 1 experimental configuration table
Data set
The data set used in the experiment was collected by the Massachusetts institute of technology, and the content of the data set was 10000000 bit transactions in the bitcoin network. The information contained in the data set is complete and the literature also uses the data set. By using the data set and respectively based on OmniLedger and RapidCHain fragmentation schemes, transaction placement optimization methods are implemented for comparison.
Index of experiment
Verifying whether the transaction placement optimization method is effective mainly comprises two performance indexes: transaction throughput and transaction latency.
Transaction throughput (denoted T)p) Representing the number of transactions processed per unit of time,
TP=N/T (12)
where N is the number of transaction processes whose validation was completed within period T.
Transaction latency (denoted Ω), represents the time in the blockchain from transaction generation to final verification completion:
Ω=T1–T0 (13)
wherein T is1And T0Respectively representing the completion time of the block verification and the transaction generation time. They are stored in block transactions.
The effectiveness of the transaction placement optimization method on the promotion of the blockchain fragmentation system is detected through two indexes of transaction throughput and transaction delay.
Design of experiments
Compared with the OmniLedger and RapidCHain fragmentation schemes, the transaction placement optimization method has the problem of large cross-fragment transaction quantity because the transactions in the OmniLedger and RapidCHain fragmentation schemes are randomly distributed. The Proposed transaction placement optimization method (deployed) changes the random placement mode of transactions, places related transactions in the same segment as much as possible, and realizes the placement targets of less cross-segment transactions and short transaction waiting time by considering the time performance of each segment.
Because the experimental configuration in the OmniLedger and RapidCarin slicing schemes is different, the number of nodes in the slicing is different when the optimal performance is included, the cross-slice verification mode is different, and the like, in order to meet different conditions of the two schemes, the transaction placement optimization method and the two schemes are respectively set with experiments for comparison. The effectiveness of the transaction placement optimization method on the performance improvement of the blockchain slicing system is observed through two indexes of transaction throughput and transaction delay.
Results and analysis of the experiments
Transaction throughput
We first tested the impact of the number of splits on transaction throughput. When a transaction is validated, all its parents need to be validated. As the number of slices increases, the number of related slices also changes. It may result in an increase in cross-slice transactions, directly affecting transaction throughput, as shown in fig. 3 and 4.
Fig. 3 shows that when the slice count in the blockchain system is small (e.g., 4 or 6 slices), there are fewer cross-slice transactions. This approach has no significant impact on transaction throughput. As it increases, transaction throughput increases significantly and becomes larger and larger. The superiority of the method over the Omnilededge and RapidCHain methods is demonstrated.
In fig. 3, a black line segment with a square represents the omnilegger slicing scheme, and a black line segment with a circle represents the omnilegger-based transaction placement optimization method (deployed). In fig. 4, the black line segment with squares represents the RapidChain scheme, and the black line segment with circles represents the RapidChain-based transaction placement optimization method (deployed). The deployed methods in fig. 4 and fig. 5 are both transaction placement optimization methods, and the difference between the two methods is caused by different fragmentation schemes, and similar representations also exist in the following.
Both fig. 3 and fig. 4 show that the three transaction placement approaches achieve the highest throughput at 16 slices, and that transaction throughput increases with the number of slices. Moreover, when the number of the fragments in the system is small (for example, 4 fragments or 6 fragments), the cross-fragment transactions in the system are few, and the effect of all the transaction placement optimization methods on improving the throughput is not obvious. In fig. 3, when the disposition method is used to place the transaction, the transaction throughput is increased by 280tx/s on average every time a segment is added; and the transaction throughput is averagely increased by 112tx/s every time the Omnilededge fragmentation scheme is increased by one fragmentation. The difference between the two is that the Omnilededge transaction adopts a random placement mode, which causes the number of cross-chip transactions to increase with the increase of the number of the chips, so the difference of the number of cross-chip transactions in the two systems causes the difference of the throughput of the two systems. In fig. 4, when the deployed method is adopted, the system throughput is also greatly improved.
Another factor affecting transaction throughput may be the number of parent transactions, since verifying a transaction requires verifying all parent transactions of the transaction, if the parent transaction involves more segments, the transaction verification speed will be lower, and network congestion may occur. To confirm the guess, experiments were conducted on the impact of parent transaction number on throughput. For the convenience of observation, 6 slices are measured, and the number of parent transactions is set to 1, 2.. and 10 respectively, so as to compare the transaction throughput variation when the random placement mode and the deployed mode are adopted. The results of the experiment are shown in fig. 5 and 6.
Fig. 5 and 6 show that the transaction throughput decreases as the number of parent transactions increases, because in the omnilegger and RapidChain fragmentation schemes, as the number of parent transactions increases, the random placement will result in a larger number of cross-fragment transactions, and thus a decrease in transaction throughput; when the deployed method is used for placing transactions, the relationship among the transactions is considered, and the waiting time in the fragments is combined, so that when the deployed method is adopted, the cross-fragment transactions do not exist completely, the number of the cross-fragment transactions is reduced, and compared with Omnilededge and RapidCHain fragmentation schemes, the reduction range of the transaction throughput is not large. It can also be seen from the figure that when the number of parent transactions reaches 6, the transaction throughput of the three transaction placement modes tends to be smooth. This is because the parent transaction may already involve all segments to the extent that the number of parent transactions continues to increase without further reduction in transaction throughput.
To make an overall comparison, the impact of transaction rate on transaction throughput is considered. Setting 600 nodes for nodes in an Omnilridge fragmentation scheme, setting 200 nodes for nodes in a RapidCarin fragmentation scheme, setting the fragmentation number as 16, and sequentially setting the transaction rate as 2000,.
Figures 7 and 8 show that increasing the transaction rate to some extent can increase transaction throughput. In the omniridge scheme of fig. 7, when the transaction speed reaches 4000, the transaction throughput is 3363tx/s, and the transaction throughput is lower than the transaction arrival rate, which indicates that the scheme cannot process under the setting because the system has a large transaction backlog. When the transaction is placed by the method of Proposed, when the transaction speed is 6000, the throughput is 5220tx/s, and the problem of transaction backlog is generated at this time, so that the transaction throughput is further improved by the method of Proposed. Similarly, in fig. 8, the RapidChain scheme can only operate normally at the transaction rate of 4000, but when the deployed method is adopted to place the transaction, the transaction throughput is 6050tx/s at the transaction speed of 6000, and the transaction backlog does not occur in the system, thereby further proving the effectiveness of the transaction placement optimization method.
In order to further observe the transaction backlog conditions of different placement modes, the related condition of the change of the size of the block chain queue along with time is researched, and the experimental result is represented by the ratio between the maximum queue and the minimum queue in the block chain blocks under different placement methods. Let the maximum number of transaction in the block chain fragmentation system be L0The minimum number of the transaction in the partitioned queue is L1The ratio R between the maximum queue and the minimum queue is then calculated as follows:
in order to avoid the situation that the minimum queue length in each fragmentation method is 0 initially, counting the operation results only after the experiment operation is stable. The 16 slices were measured with the transaction rate set to 6000tx/s and the run times set to 400s,600 s.., 1600s, respectively, with the experimental results shown in fig. 9 and 10:
as can be understood from fig. 9 and 10, except that when the transaction is placed by the rapid method based on rapid command, the size of the fragmentation queue in the system is stable, no backlog of transactions occurs in the system, and in the worst case, the size of the fragmentation queue in the system reaches the maximum value of 8072 after 600s of operation. While none of the other three placement modes can operate at a transaction rate of 6000tps, the fragmentation queue size will increase linearly with time and by different amounts due to the respective methods. And then, comparing the influence of different methods on transaction delay to show the effectiveness of the transaction placement optimization method on improvement of the expansibility of the partition block chain.
Transaction latency
Firstly, considering the influence of the number of fragments on transaction delay, assuming that network delay is the same and the computing power of nodes in each fragment is the same, 600 nodes are set for each fragment in the experiment of the omnilegger fragmentation scheme and the omnilegger-based transaction placement optimization method (deployed), 200 nodes are set for each fragment in the experiment of the rapidcha scheme and the rapidcha-based transaction placement optimization method (deployed), and the number of fragments is sequentially set to 4,6,.., 16, and the experiment result is shown in fig. 11 and 12:
fig. 11 and 12 show that the transaction delay decreases with the increase of the number of slices, because in the blockchain slicing system, as the number of slices increases, the parallel capability of the blockchain system increases, so the time of waiting for verification of the transaction in the slices decreases, and further the transaction delay is greatly reduced. In fig. 11, when the number of slices is 16, the transaction delay of the omnilegger slicing scheme is 28.1s, while the transaction delay of the deployed method is reduced to 25.3 s. In the same case of fig. 12, the transaction latency of the rapidchip slicing scheme is 12.1s, and the transaction latency of the deployed is 10.6 s. Through the analysis, the transaction delay of the two fragmentation schemes is further reduced after the optimization method is combined with the transaction placement. Therefore, the transaction delay of the partitioned block chain can be reduced by changing the transaction placement mode. In order to further explore the influence factors of the transaction delay, considering the influence of the fragment size on the transaction delay, the experimental results are shown in fig. 13 and 14:
fig. 13 and fig. 14 both show that as the number of nodes in a segment increases, the transaction delay also increases, and due to the existence of an asynchronous network, the increase of the number of nodes in the segment may cause an increase of communication delay caused by message forwarding between nodes, and further cause a delay of transaction confirmation, resulting in a longer time taken to achieve consensus in the segment. In fig. 13 and fig. 14, the deployed method reduces the transaction delay to some extent on the basis of two slicing schemes, which further confirms the advantage of the deployed method in reducing the cross-slice transaction and transaction verification time. For a more complete comparison, experiments were conducted on the impact between transaction rate and transaction latency, with the results shown in fig. 15 and 16:
fig. 15 and 16 show that the transaction latency increases as the transaction rate increases. In fig. 15, the omnilegger fragmentation scheme can operate normally at transaction rates 2000 and 3000, while the deployed method can operate normally at transaction rates 2000, 3000, 4000, 5000. Because when the transaction rate increases to a certain degree, serious transaction backlog will occur in the system, and as the transaction rate increases, the transaction queuing phenomenon becomes more serious, so the transaction waiting time increases and the transaction delay also increases. In fig. 16, the RapidChain fragmentation scheme can operate normally at transaction rates 2000, 3000 and 4000, and the RapidChain-based deployed method can operate normally at the set transaction speed.
Experimental results show that the change of the transaction placement mode can obviously reduce the number of cross-piece transactions in the slicing system, further improve the transaction throughput and reduce the transaction delay, and the method is specifically shown in the following steps: (1) the transaction placement optimization method is more scalable because the method can achieve higher throughput and lower transaction delay under the condition of the same fragment number. And under the condition of the same fragment size, the method can also generate lower transaction delay; (2) the transaction placement optimization method can actually reduce the number of cross-piece transactions in the system; (3) the trade placement optimization method can handle higher trade rates while ensuring no trade backlogs.
The invention has been described above with reference to the accompanying drawings, it is obvious that the invention is not limited to the specific implementation in the above-described manner, and it is within the scope of the invention to apply the inventive concept and solution to other applications without substantial modification.
Claims (6)
1. A transaction placement method for blockchain fragments is characterized by comprising the following steps:
S2 average waiting time in the slice i based on the transaction uCalculating the fitness of the transaction u in the segment i according to the parent transaction number in the segment i;
and S3, putting the transaction u into the segment corresponding to the maximum fitness value.
2. The transaction placement method for blockchain segments according to claim 1, wherein the method for acquiring the parent transaction amount specifically includes the following steps:
s21, constructing a transaction flow chart G;
s22, acquiring the fragment ID of the parent transaction of the transaction u in the transaction flow chart G;
s23, counting the parent transaction number of the transaction u in each fragment;
where G ═ V, E, V denotes a transaction set, each transaction in the transaction set including a transfer of a transaction initiator to another user and an unspent amount of the transaction initiator, E denotes a relationship between transactions.
3. The method of claim 1, wherein the average latency of the transaction in slice i isThe calculation formula of (a) is specifically as follows:
wherein, tiTo be the average processing time for a transaction,for the total processing time from the arrival of the transaction to the completion of the transaction,the average number of transactions in the waiting queue of slice i, b the number of transactions packed in the block, muiDenotes the block generation rate, λ, in slice iiFor the arrival rate of transactions in the queue, p represents the success probability of block verification, E (H)i(t)) represents the mathematical expectation of the chunk generation time in slice i.
4. The method for transaction placement on blockchain shards of claim 1, wherein the fitness g of the transaction u in the shard iiThe calculation formula of (u) is specifically as follows:
gi(u)=yi(u)-*xi(u)
wherein x isi(u) normalized average latency, y, for transaction u in slice ii(u) represents the normalized parent transaction number of transaction u in slice i.
5. The method of claim 4, wherein the normalized parent transaction number y isiThe calculation formula of (u) is specifically as follows:
wherein K is the number of the fragments, the value of K is more than or equal to 2 and less than or equal to 16, and NuSet of all parent transactions, V, representing transaction ui∩NuI represents the number of its parent transaction in the fragment i, ViRepresenting the transaction set in the ith slice of the transaction flow chart.
6. The method of tile chain slicing transaction placement according to claim 4 wherein normalized average latency xiThe calculation formula of (u) is specifically as follows:
wherein K is the number of the fragments, the value of K is more than or equal to 2 and less than or equal to 16,for the average waiting time of the transaction in slice i,representing the minimum value of the average waiting time of transaction u in all slices,representing the maximum value of the average waiting time of transaction u in all slices.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011091440.4A CN112258321B (en) | 2020-10-13 | 2020-10-13 | Transaction placement method for blockchain slicing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011091440.4A CN112258321B (en) | 2020-10-13 | 2020-10-13 | Transaction placement method for blockchain slicing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112258321A true CN112258321A (en) | 2021-01-22 |
CN112258321B CN112258321B (en) | 2024-03-15 |
Family
ID=74242019
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011091440.4A Active CN112258321B (en) | 2020-10-13 | 2020-10-13 | Transaction placement method for blockchain slicing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112258321B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113810507A (en) * | 2021-11-18 | 2021-12-17 | 南京信息工程大学 | Block chain credible node partitioning method based on IDE |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109544334A (en) * | 2018-10-22 | 2019-03-29 | 绿州蔚来(深圳)控股有限公司 | A kind of network scalability block chain implementation method |
CN110868434A (en) * | 2018-08-27 | 2020-03-06 | 深圳金刚链计算技术有限公司 | Block chain consensus method and system of multilayer fragment architecture |
US20200184469A1 (en) * | 2018-12-07 | 2020-06-11 | 0Chain, LLC | Systems and methods of blockchain for transaction rewards on token locking |
-
2020
- 2020-10-13 CN CN202011091440.4A patent/CN112258321B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110868434A (en) * | 2018-08-27 | 2020-03-06 | 深圳金刚链计算技术有限公司 | Block chain consensus method and system of multilayer fragment architecture |
CN109544334A (en) * | 2018-10-22 | 2019-03-29 | 绿州蔚来(深圳)控股有限公司 | A kind of network scalability block chain implementation method |
US20200184469A1 (en) * | 2018-12-07 | 2020-06-11 | 0Chain, LLC | Systems and methods of blockchain for transaction rewards on token locking |
Non-Patent Citations (3)
Title |
---|
AMIRI, MJ: "On Sharding Permissioned Blockchains", 《 2019 IEEE INTERNATIONAL CONFERENCE ON BLOCKCHAIN》, pages 282 - 285 * |
刘雄文;: "多区块链交易分发和事件处理的系统方案", 计算机科学, no. 2 * |
潘晨;刘志强;刘振;龙宇;: "区块链可扩展性研究:问题与方法", 计算机研究与发展, no. 10 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113810507A (en) * | 2021-11-18 | 2021-12-17 | 南京信息工程大学 | Block chain credible node partitioning method based on IDE |
CN113810507B (en) * | 2021-11-18 | 2022-02-15 | 南京信息工程大学 | Block chain credible node partitioning method based on IDE |
Also Published As
Publication number | Publication date |
---|---|
CN112258321B (en) | 2024-03-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Nguyen et al. | Optchain: optimal transactions placement for scalable blockchain sharding | |
Sukhwani et al. | Performance modeling of hyperledger fabric (permissioned blockchain network) | |
JP7165148B2 (en) | Method and system for consistent distributed memory pool in blockchain network | |
Hines et al. | Comparison of neuronal spike exchange methods on a Blue Gene/P supercomputer | |
CN108011741B (en) | Method and system for simulating and testing blockchains of distributed networks | |
US11531982B2 (en) | Optimal transactions sharding for scalable blockchain | |
CN112449705A (en) | Metastable byzantine protocol | |
CN113037504B (en) | Node excitation method and system under fragment-based unauthorized block chain architecture | |
CN113114496A (en) | Block chain expandability problem solution based on fragmentation technology | |
CN112003660B (en) | Dimension measurement method of resources in network, calculation force scheduling method and storage medium | |
CN116669111A (en) | Mobile edge computing task unloading method based on blockchain | |
CN112258321A (en) | Transaction placement method for block chain fragments | |
de Oliveira Souza et al. | Cbnet: Minimizing adjustments in concurrent demand-aware tree networks | |
Hutton et al. | Design of a scalable distributed ledger | |
Beauprez et al. | A multi-agent negotiation strategy for reducing the flowtime | |
Cordi | Simulating high-throughput cryptocurrency payment channel networks | |
Rizvandi et al. | Network load analysis and provisioning of MapReduce applications | |
Jiang et al. | Understanding and improvement of the selection of replica servers in key–value stores | |
Djari et al. | Simulation study of Sycomore++, a self-adapting graph-based permissionless distributed ledger | |
Wilhelmi et al. | Blockchain-enabled server-less federated learning | |
Nylander et al. | Modeling of request cloning in cloud server systems using processor sharing | |
CN108256694A (en) | Based on Fuzzy time sequence forecasting system, the method and device for repeating genetic algorithm | |
Wang et al. | PoTA: A hybrid consensus protocol to avoid miners’ collusion for BaaS platform | |
CN114980216A (en) | Dependent task unloading system and method based on mobile edge calculation | |
Shabgahi et al. | Modeling Effective Lifespan of Payment Channels |
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 |