CN115102866B - Block chain TPS estimation method and verification method thereof facing consensus algorithm - Google Patents

Block chain TPS estimation method and verification method thereof facing consensus algorithm Download PDF

Info

Publication number
CN115102866B
CN115102866B CN202210634856.9A CN202210634856A CN115102866B CN 115102866 B CN115102866 B CN 115102866B CN 202210634856 A CN202210634856 A CN 202210634856A CN 115102866 B CN115102866 B CN 115102866B
Authority
CN
China
Prior art keywords
blockchain
transaction
tps
node
time
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
CN202210634856.9A
Other languages
Chinese (zh)
Other versions
CN115102866A (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.)
Nanjing University of Posts and Telecommunications
Original Assignee
Nanjing University of Posts and Telecommunications
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 Nanjing University of Posts and Telecommunications filed Critical Nanjing University of Posts and Telecommunications
Priority to CN202210634856.9A priority Critical patent/CN115102866B/en
Publication of CN115102866A publication Critical patent/CN115102866A/en
Application granted granted Critical
Publication of CN115102866B publication Critical patent/CN115102866B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/147Network analysis or design for predicting network behaviour

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a block chain TPS estimation method facing a consensus algorithm and a verification method thereof, wherein the method establishes a mathematical model between block chain TPS and node communication and computing capacity by analyzing a block chain system transaction flow based on a Bayesian fault-tolerant algorithm so as to carry out TPS estimation; the accuracy verification method is used for carrying out TPS test by building block chain networks with different structures, and comparing an actual test result with a predicted result of the mathematical model so as to verify the accuracy of the block chain TPS mathematical model. The invention realizes the prediction of the blockchain network performance before the deployment of the blockchain system, the prediction error is not more than 10 percent, the mathematical model is convenient for hardware purchasing of the blockchain nodes and network construction cost estimation when the blockchain system is actually deployed, and the feasibility of actually deploying the blockchain system under a specific network structure can be verified through the estimation of the blockchain performance.

Description

Block chain TPS estimation method and verification method thereof facing consensus algorithm
Technical Field
The invention belongs to the field of communication networks, and particularly relates to a block chain TPS estimation method and a verification method thereof for a consensus algorithm.
Background
Through years of development, the application of the Internet of things has been developed. However, the large-scale development of the internet of things still faces some key challenges, especially how to balance construction/operation costs with service capability/efficiency issues. The blockchain technology is beneficial to solving the problems of the internet of things in aspects of resource sharing, data security transmission, credit system construction and the like of cross-industry, department and cross-network service systems. Meanwhile, the large-scale Internet user group is not only a user of various application services, but also a contributor of network space big data and application services, and forms a crowd-sourced resource for supporting a large number of successful applications.
Researchers from the fields of artificial intelligence, big data, computer collaborative work, man-machine interaction and the like research the data from different academic perspectives, and research directions of crowdsourcing, people computing, group intelligence, social computing and the like are provided, and meanwhile, a large number of platforms and applications for supporting data collaboration are also provided in the industry. The data collaborative computing provides great convenience for the development of artificial intelligence new technologies such as big data, statistical machine learning and the like, and is characterized in that the intelligent resource of the group in the open network environment is effectively managed and cooperatively utilized to realize the maximization of the group intelligence, and if a alliance chain data collaborative framework is constructed based on technologies such as intelligent contracts, safe multi-party computing and the like, the data interaction can be reliably and safely performed by utilizing the blockchain technology, and the transparency and traceability of all records are ensured.
However, with the rapid development of services such as smart cities and shared economies, the unknown performance of the actual deployment of the blockchain system is one of the reasons why the blockchain system is not widely used, so a prediction method for the performance of the blockchain system before the actual deployment of the blockchain system is urgently needed.
Disclosure of Invention
In order to solve the technical problems mentioned in the background art, the invention provides a block chain TPS estimation method and a verification method thereof for a consensus algorithm.
In order to achieve the technical purpose, the technical scheme of the invention is as follows:
a block chain TPS estimation method facing to a consensus algorithm comprises the following steps:
s1, calculating the actual transaction size S sent by a blockchain system according to the transaction format of the blockchain and an intelligent contract used for testing TPS tx The adopted test transaction content and format are the same;
s2, according to the actual deployment condition of the network nodes, acquiring the time T generated at the client side of each transaction txbuild Calculating a time T for each transaction generated by a client and sent to a blockchain node to which the client is connected txsend
S3, acquiring signature verification time T of transaction txcheck The signature verification time of each transaction is the same, and the signature verification time is only considered once in the total processing time of the transaction;
s4, obtaining the packing time T of the block blockpk Size S of block header blockhead And the number of transactions n contained in each block, calculating the total time T of the transaction packaging block and transmitting the transaction packaging block to other block chain nodes blocksend
S5, obtaining block verificationTime T blockcheck And time T for each transaction to execute tx Calculating a time T for each block to verify and execute on the node blockdone
S6, obtaining the time T of transaction landing blocksave
S7, T is obtained according to the steps S2-S6 txbuild 、T txsend 、T blockpk 、T blocksend 、T blockcheck 、T blockdone 、T blocksave Calculating total time T for completing one block tot The method comprises the steps of carrying out a first treatment on the surface of the Will T tot Divided into communication times T comm And calculate time T comp The method comprises the steps of carrying out a first treatment on the surface of the Obtaining the average time T of each transaction processing by carrying out a plurality of single-node transaction processing txcomp
And S8, establishing a blockchain TPS mathematical model, and drawing a TPS estimation curve of the blockchain system by taking the communication capacity of the nodes as an independent variable import model.
Preferably, the step S2 specifically refers to: the maximum uplink and downlink rate upper limit of each block chain node is marked as C, and the time for each transaction to be transmitted between two block chain nodes isAcquiring a time T generated at a blockchain node for each transaction txbuild Then each transaction is generated by the client and sent to the blockchain node for a time of +.>
Preferably, the total time of the transaction package block and the transmission to other blockchain nodes in the step S4
T blocksend The calculation formula of (2) is as follows:
where C is the maximum uplink and downlink rate upper limit for each blockchain node.
Preferably, each block in step S5 verifies and executes on the node for a time T blockdone Is of the meter(s)
The calculation formula is as follows:
T blockdone =T blockcheck +nT tx
preferably, the total time T for completing one block in the step S7 tot The calculation formula of (2) is as follows:
T tot =n(T txbuild +T txsend +T txcheck )+T blockpk +T blocksend +T blockdone +T consensus +T blocksave
wherein T is consensus The consensus time of the block is ignored when the communication time is calculated;
communication time T comm The calculation formula of (2) is as follows:
wherein N is the number of the block chain nodes, and C is the maximum uplink and downlink rate upper limit of each block chain node;
calculate time T comp The calculation formula of (2) is as follows:
T comp =n(T txbuild +T txcheck )+T blockpk +T blockcheck +nT tx +T blocksave
preferably, in the step S8, the calculation formula of the block chain TPS mathematical model is expressed as follows:
wherein N is the number of block chain nodes, C is the maximum uplink and downlink rate upper limit of each block chain node, S tx For each transaction size.
A method for verifying accuracy of a block chain TPS estimation method facing a consensus algorithm comprises the following steps:
step one, constructing a blockchain network with the same network structure as that used in the analysis of a blockchain TPS mathematical model, and deploying a test intelligent contract on the blockchain network;
deploying a Caliper blockchain performance test software on a Linux host outside the blockchain network;
installing system bandwidth limiting software on each blockchain node, modifying the maximum uplink and downlink bandwidth of each node, and verifying errors between the result of blockchain TPS mathematical model prediction and actual TPS under different rates;
step four, after the maximum uplink and downlink bandwidths of the nodes are modified, initiating multi-round TPS tests on the deployed blockchain network by using a client blockchain performance test software through a Linux host outside the blockchain network, recording the actual TPS results of the tests, and averaging a plurality of groups of data at the same rate; and fifthly, drawing a graph of the actual result, comparing the graph with a TPS theoretical value predicted by a blockchain TPS mathematical model, respectively calculating errors between the result predicted by the mathematical model under different node communication capacities and the actual test, and judging the accuracy of the blockchain TPS estimation method.
Preferably, in the first step, a blockchain network with the same structure as that of the blockchain TPS mathematical model is built, and the method specifically includes the following steps:
s101, providing a plurality of physical machines, accessing the physical machines through a router, configuring static IP addresses of the physical machines, and detecting communication conditions among link points of each block by using Ping commands in a command line;
s102, configuring an environment required by the operation of a block chain node on a physical machine;
s103, downloading a link establishment script, modifying an ipconf configuration file according to the actual condition of the blockchain network, and correspondingly configuring the ip address of the blockchain node and the affiliated mechanism in the ipconf configuration file;
s104, executing a chain building script, automatically generating a node certificate required for building a blockchain network according to configuration in an ipconf configuration file, and sending the generated certificate to each blockchain node in an SCP mode;
s105, compiling a script, accessing the blockchain nodes one by one, and executing a blockchain link point starting program on each Linux host in the blockchain network, wherein the starting program runs a docker container under the blockchain nodes, and maps a preset docker container port onto a physical machine port to realize communication with other docker containers;
s106, prohibiting mutual access between two nodes through TC instructions, and waiting for other nodes in the blockchain network to receive broadcasting after transaction when the prohibited nodes acquire the transaction or the block sent by the other party;
and S107, after all the block chain link points are started, selecting any block chain node, executing a checking command, and observing whether all the nodes in the block chain network can be mutually discovered in a direct or multi-bar mode.
Preferably, the modifying the maximum uplink and downlink rate of each node in the third step specifically includes the following steps: s301, downloading Wndershiper bandwidth limiting software on each physical machine;
s302, compiling an automatic script speed control. Sh, and taking uplink and downlink bandwidths needing to be limited as two input values of a script respectively;
s303, installing the Ipfs 3 bandwidth test software on all the blockchain nodes;
s304, executing the speedcontrol. Sh, and limiting the node bandwidth to a set value;
and S305, starting the iperf3 bandwidth test software, and testing the communication bandwidth between any two nodes to verify whether the bandwidth limitation is effective.
Preferably, the fourth step specifically includes the following steps:
s401, downloading a Caliper open source code from a Github website;
s402, configuring a dependent environment of a client on a Linux host outside a blockchain network;
s403, deploying a Caliper in the Linux system, and combining the Caliper software with an actual blockchain platform
Binding;
s404, modifying configuration file config.yaml required by the Caliper test, and configuring the file config.yaml
The intelligent contract testing method is changed into an intelligent contract method which is actually deployed;
s405, starting the Caliper software to perform TPS test.
The beneficial effects brought by adopting the technical scheme are that:
(1) The method establishes a mathematical model between communication capacity and calculation capacity of the blockchain network TPS and the blockchain nodes based on transaction flow analysis, and realizes the prediction of blockchain network performance before the blockchain system is deployed.
(2) The TPS performance test is carried out based on the established actual blockchain platform, the test result is compared with the mathematical model, the accuracy of the established mathematical model is verified, and the maximum prediction error of the verification result is not more than 10%.
Drawings
FIG. 1 is a schematic diagram of the identity and function of a blockchain system node in accordance with an embodiment of the present invention;
FIG. 2 is a flow diagram of a PBFT-based blockchain in accordance with an embodiment of the invention;
FIG. 3 is a block chain system transaction architecture diagram of an embodiment of the present invention;
FIG. 4 is a schematic flow diagram of a PBFT blockchain based transaction verification according to an embodiment of the invention;
FIG. 5 is a flow diagram of a blockchain consensus node packaging transaction in accordance with an embodiment of the present invention;
FIG. 6 is a flow chart of a blockchain full network node executing a blockhouse transaction according to an embodiment of the present invention;
FIG. 7 is a graph of average time to transaction number for single-node transaction processing according to an embodiment of the invention;
FIG. 8 is a diagram of a PBFT-based blockchain system TPS mathematical model in accordance with an embodiment of the invention;
FIG. 9 is a practical block diagram of an embodiment of the present invention for validating a blockchain system TPS mathematical model;
FIG. 10 is a graph comparing actual test TPS with TPS values predicted by a mathematical model in accordance with an embodiment of the invention.
Detailed Description
The technical scheme of the present invention will be described in detail below with reference to the accompanying drawings.
The architecture of a PBFT-based blockchain network analyzed in accordance with the present invention is shown in fig. 1. The block chain network node based on PBFT mainly has several roles of an access node, a consensus node and a whole network node, and each role is responsible for different responsibilities.
Referring to fig. 2, the invention provides a TPS prediction method for a PBFT consensus blockchain network, which analyzes a transaction flow of a blockchain system based on a bayer fault-tolerant algorithm, wherein the transaction processing flow comprises: the invention provides a TPS prediction method for a PBFT consensus blockchain network, which comprises the following steps of:
s1, calculating the actual transaction size sent by a blockchain system according to the transaction format of the blockchain and according to the intelligent contract used by the test TPS, and marking as S tx The analysis is convenient, and the adopted test transaction content and format are the same;
referring to fig. 3, the blockchain transaction format includes the contents of the diagram, such as transaction type, nonce, recipient address, and other transaction related information.
S2, according to the actual network node situation, the maximum uplink and downlink rate upper limit of each node is marked as C, and then the transmission time of each transaction between two nodes isAt the same time, assume that each transaction is generated at a node for a time T txbuild So each transaction is generated by the client and sent to the blockchain node for a time of +.>
S3, assuming that the time for verifying the signature of the transaction is T txcheck Because the adopted test transaction content and format are the same, the signature verification time of each transaction is T txcheck The signature verification time is only considered once in the total processing time of the transaction;
referring to fig. 4, the blockchain transaction verification process includes verifying whether the transaction is legal or repeated, and if not, directly discarding the transaction; if the transaction is legal and there is no duplication, the transaction is stored in a local transaction pool of the node.
S4, assume that the packing time of the block is T blockpk The size of the block head is S blockhead Each block contains n transactions, and the total time for the transactions to be packed into blocks and sent to other nodes is:
referring to fig. 5, the above-mentioned blockchain transaction packing process includes taking out the transactions from the head of the transaction pool, using several transactions as the main body of the block by the Sealer, attaching the information of the current node to the block head, packing the above information into one block, and transmitting the block to the rest of the blockchain nodes.
S5, assume that the block verification time is T blockcheck Each transaction is executed for a time T tx Then each block verifies and executes on the node for a time T blockcheck +nT tx
S6, the node broadcasts the execution result of the block to other blocks after the execution of one block is completed, the data size of the block execution result is negligible compared with the size of the block, and the time for the transaction to drop is assumed to be T blocksave
Referring to fig. 6, the rest of blockchain nodes receive the blockinformation sent by other nodes, firstly, the basic information of the block is verified by a blockverifier, including verifying whether the identity information and signature of the sending node are legal, if the block passes the validity detection, the execution engine will take out the transaction from the block one by one, search the relevant intelligent contract codes from the local intelligent contract library according to the specific content of the transaction and execute one by one, and after execution is completed, the current node will broadcast the execution result in the whole network.
S7, executing a block for a total time of
T tot =n(T txbuild +T txsend +T txcheck )+T blockpk +T blocksend +T blockdone +T consensus +T blocksave
S8, dividing the time for processing the transaction into two parts, and communicating the time T comm And calculate time T comp . Wherein the time of the calculation section is T comp =n(T txbuild +T txcheck )+T blockpk +T blockcheck +nT tx +T blocksave The size of the block header can be ignored when calculating the communication time, so the communication time can be expressed as
S9, the calculation time of the block chain processing transaction is influenced by a plurality of factors, and is difficult to precisely quantify, so that the average time T of each transaction processing is obtained by performing a plurality of single-node transaction processing modes txcomp And recording test results under different transaction amounts, and drawing a relation diagram between the execution time and the transaction amount of each transaction.
Referring to fig. 7, this step builds a single node on a single machine for testing, in order to measure the total time of relatively accurate transaction creation, transaction execution and transaction placement, fig. 7 shows the relationship between the number of transactions sent to the blockchain and the time of each transaction execution, and it can be seen that the total time of each transaction generated, verified, executed and placed in the blockchain has no obvious relationship with the number of transactions input per test, the average time of all transactions in the figure is 0.7397ms, and the value is taken as the average time of each transaction processed by the blockchain to be fitted into a mathematical model.
S10, so the established blockchain TPS mathematical model isTPS curves of the blockchain system can be drawn by using Matlab programs with the communication capacity of the nodes as an argument.
Referring to fig. 8, it can be seen that when the communication capability of the blockchain node is poor, the TPS value of the blockchain is mainly affected by the blockchain link point communication capability, so that the maximum uplink and downlink rate of the lifting node can effectively lift the TPS of the blockchain network, but when the communication capability of the node is raised to a certain size, the effect on the blockchain TPS is gradually reduced.
S11, building an actual blockchain network with the same structure as the mathematical model network, performing TPS test on the actual blockchain network, and comparing the TPS test with the theoretical analysis value.
S1101, providing a plurality of physical machines, accessing the physical machines through a router, configuring static IP addresses of the physical machines, and detecting communication conditions among all the blockchain nodes in a command line by using Ping commands.
Referring to fig. 9, an actual blockchain network is built.
For example: the mutual access among 10 physical machines is realized by using 1 router, and the structure of the blockchain network is shown in fig. 2. And starting a Linux operating system on the physical machine, and configuring the static IP addresses of 10 physical machines to be 192.168.1.200-209.
S1102, configuring an environment required by the operation of the block chain node on the physical machine. For example: software such as openssl, curl, java 14.0.2 and docker is installed.
S1103, downloading a build-up_chain.sh of the build-up script, modifying the ipconf configuration file according to the actual situation of the blockchain network, and configuring the ip address of the blockchain node and the affiliated mechanism (the affiliated mechanism in the alliance chain is composed of a plurality of mechanisms) in the ipconf configuration file in a one-to-one correspondence manner.
S1104, executing a building chain script build_chain.sh, automatically generating a node certificate required for building a block chain network according to the configuration in the ipconf configuration file, and sending the generated certificate to each block chain node in an SCP mode.
S1105, writing a script, accessing the blockchain nodes one by one, executing a blockchain link point starting program under a specified directory, running a docker container under the current blockchain node by the starting program, and mapping a preset docker container port onto a physical machine port to realize communication with other docker containers.
S1106, if two nodes in the blockchain network cannot communicate directly, the access between the two points needs to be forbidden through TC instructions, and the forbidden nodes want to acquire the transaction or the block sent by the other party and can only wait for other nodes in the blockchain network to receive the broadcast after the transaction;
s1107, after all block chain link points are started, selecting any block chain node, executing a checking command, and observing whether all nodes in the block chain network can be mutually discovered in a direct or multi-bar mode;
s1108, configuring a client blockchain TPS test software on a Linux host outside the blockchain network, and transmitting a transaction to any node of the blockchain network through the node to perform TPS test;
s1109, modifying the maximum uplink and downlink rates of each node, and respectively performing multiple tests to compare the maximum uplink and downlink rates with TPS predicted values of different rates of the mathematical model;
s1110, drawing and comparing the test result of the actual network and the prediction curve of the mathematical model through Matlab software, and calculating the maximum error.
Referring to fig. 10, it can be seen that the established mathematical model and the actually built 10-node fully-connected blockchain system have higher precision in the case of lower communication rate, and larger errors occur in the case of maximum communication rate of the nodes greater than 10 mbytes/s. The error is mainly caused by the influence of a test environment, the maximum allowable flow of a gigabit router used in an actually-built blockchain system is 100Mbyte/s, and if the uplink and downlink rates of one node are higher than 10Mbyte/s, queuing transmission phenomenon is generated in the router, so that the communication efficiency is reduced, and the final TPS value of an experiment is influenced. From the actual tested TPS curve, it can also be seen that the improvement of the communication capability of the node has little effect on the actual network TPS after the network bandwidth reaches 10 Mbyte/s. The data with the highest communication rate of 50 KByte/s-10 Mbyte/s of the nodes in the upper graph is taken as effective data, and the maximum error of the mathematical model in the global coupling network is 6.74%.
The invention proposes an electronic device comprising a memory storing a computer program and a processor implementing the steps of any of the methods described above when the processor executes the computer program.
The present invention proposes a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of any of the methods described above.
It should be appreciated that the integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The embodiments are only for illustrating the technical idea of the present invention, and the protection scope of the present invention is not limited by the embodiments, and any modification made on the basis of the technical scheme according to the technical idea of the present invention falls within the protection scope of the present invention.

Claims (5)

1. The block chain TPS estimation method facing the consensus algorithm is characterized by comprising the following steps of:
s1, calculating the actual transaction size S sent by a blockchain system according to the transaction format of the blockchain and an intelligent contract used for testing TPS tx The adopted test transaction content and format are the same;
s2, according to the actual deployment condition of the network nodes, acquiring the time T generated at the client side of each transaction txbuild Calculating a time T for each transaction generated by a client and sent to a blockchain node to which the client is connected txsend The maximum uplink and downlink rate upper limit of each blockchain node is marked as C, and the time for each transaction to be transmitted between two blockchain nodes isAcquiring a time T generated at a blockchain node for each transaction txbuild Then each transaction is generated by the client and sent to the blockchain node for a time of +.>
S3, acquiring signature verification time T of transaction txcheck The signature verification time of each transaction is the same, and the signature verification time is only considered once in the total processing time of the transaction;
s4, obtaining the packing time T of the block blockpk Size S of block header blockhead And the number of transactions n contained in each block, calculating the total time T of the transaction packaging block and transmitting the transaction packaging block to other block chain nodes blocksend The calculation formula is as follows:
c is the maximum uplink and downlink rate upper limit of each block chain node;
s5, obtaining the time T of block verification blockcheck And time T for each transaction to execute tx Calculate each block verification and at nodeTime T of execution on blockdone The calculation formula is as follows:
T blockdone =T blockcheck +nT tx
s6, obtaining the time T of transaction landing blocksave
S7, T is obtained according to the steps S2-S6 txbuild 、T txsend 、T blockpk 、T blocksend 、T blockcheck 、T blockdone 、T blocksave Calculating total time T for completing one block tot The method comprises the steps of carrying out a first treatment on the surface of the Will T tot Divided into communication times T comm And calculate time T comp The method comprises the steps of carrying out a first treatment on the surface of the Obtaining the average time T of each transaction processing by carrying out a plurality of single-node transaction processing txcomp The calculation formula is as follows:
T tot =n(T txbuild +T txsend +T txcheck )+T blockpk +T blocksend +T blockdone +T consensus +T blocksave
wherein T is consensus The consensus time of the block is ignored when the communication time is calculated;
communication time T comm The calculation formula of (2) is as follows:
wherein N is the number of the block chain nodes, and C is the maximum uplink and downlink rate upper limit of each block chain node;
calculate time T comp The calculation formula of (2) is as follows:
T comp =n(T txbuild +T txcheck )+T blockpk +T blockcheck +nT tx +T blocksave
s8, establishing a blockchain TPS mathematical model, drawing a TPS estimation curve of the blockchain system by taking the communication capacity of the node as an independent variable import model, wherein the computation formula of the blockchain TPS mathematical model is expressed as follows:
wherein N is the number of block chain nodes, C is the maximum uplink and downlink rate upper limit of each block chain node, S tx For each transaction size.
2. The accuracy verification method of a blockchain TPS estimation method based on the consensus algorithm according to claim 1, characterized by comprising the steps of:
step one, constructing a blockchain network with the same network structure as that used in the analysis of a blockchain TPS mathematical model, and deploying a test intelligent contract on the blockchain network;
deploying a Caliper blockchain performance test software on a Linux host outside the blockchain network;
installing system bandwidth limiting software on each blockchain node, modifying the maximum uplink and downlink bandwidth of each node, and verifying errors between the result of blockchain TPS mathematical model prediction and actual TPS under different rates;
step four, after the maximum uplink and downlink bandwidths of the nodes are modified, initiating multi-round TPS tests on the deployed blockchain network by using a client blockchain performance test software through a Linux host outside the blockchain network, recording the actual TPS results of the tests, and averaging a plurality of groups of data at the same rate;
and fifthly, drawing a graph of the actual result, comparing the graph with a TPS theoretical value predicted by a blockchain TPS mathematical model, respectively calculating errors between the result predicted by the mathematical model under different node communication capacities and the actual test, and judging the accuracy of the blockchain TPS estimation method.
3. The accuracy verification method according to claim 2, wherein the constructing a blockchain network having the same structure as the blockchain TPS mathematical model in the first step specifically includes the steps of:
s101, providing a plurality of physical machines, accessing the physical machines through a router, configuring static IP addresses of the physical machines, and detecting communication conditions among link points of each block by using Ping commands in a command line;
s102, configuring an environment required by the operation of a block chain node on a physical machine;
s103, downloading a link establishment script, modifying an ipconf configuration file according to the actual condition of the blockchain network, and correspondingly configuring the ip address of the blockchain node and the affiliated mechanism in the ipconf configuration file;
s104, executing a chain building script, automatically generating a node certificate required for building a blockchain network according to configuration in an ipconf configuration file, and sending the generated certificate to each blockchain node in an SCP mode; s105, compiling a script, accessing the blockchain nodes one by one, and executing a blockchain link point starting program on each Linux host in the blockchain network, wherein the starting program runs a docker container under the blockchain nodes, and maps a preset docker container port onto a physical machine port to realize communication with other docker containers;
s106, prohibiting mutual access between two nodes through TC instructions, and waiting for other nodes in the blockchain network to receive broadcasting after transaction when the prohibited nodes acquire the transaction or the block sent by the other party;
and S107, after all the block chain link points are started, selecting any block chain node, executing a checking command, and observing whether all the nodes in the block chain network can be mutually discovered in a direct or multi-bar mode.
4. The accuracy verification method according to claim 2, wherein the modifying the maximum uplink and downlink rate of each node in the third step specifically includes the steps of:
s301, downloading Wndershiper bandwidth limiting software on each physical machine;
s302, compiling an automatic script speed control. Sh, and taking uplink and downlink bandwidths needing to be limited as two input values of a script respectively;
s303, installing the Ipfs 3 bandwidth test software on all the blockchain nodes;
s304, executing the speedcontrol. Sh, and limiting the node bandwidth to a set value;
and S305, starting the iperf3 bandwidth test software, and testing the communication bandwidth between any two nodes to verify whether the bandwidth limitation is effective.
5. The accuracy verification method according to claim 2, wherein the fourth step specifically comprises the steps of:
s401, downloading a Caliper open source code from a Github website;
s402, configuring a dependent environment of a client on a Linux host outside a blockchain network;
s403, the calipers are deployed in a Linux system, and the calipers software is bound with an actual blockchain platform;
s404, modifying configuration files config.yaml required by the Caliper test, and changing a test intelligent contract method in the file config.yaml into an actually deployed intelligent contract method;
s405, starting the Caliper software to perform TPS test.
CN202210634856.9A 2022-06-06 2022-06-06 Block chain TPS estimation method and verification method thereof facing consensus algorithm Active CN115102866B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210634856.9A CN115102866B (en) 2022-06-06 2022-06-06 Block chain TPS estimation method and verification method thereof facing consensus algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210634856.9A CN115102866B (en) 2022-06-06 2022-06-06 Block chain TPS estimation method and verification method thereof facing consensus algorithm

Publications (2)

Publication Number Publication Date
CN115102866A CN115102866A (en) 2022-09-23
CN115102866B true CN115102866B (en) 2023-07-25

Family

ID=83289347

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210634856.9A Active CN115102866B (en) 2022-06-06 2022-06-06 Block chain TPS estimation method and verification method thereof facing consensus algorithm

Country Status (1)

Country Link
CN (1) CN115102866B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110971684A (en) * 2019-11-28 2020-04-07 北京工业大学 PBFT-based block chain network node load balancing method
CN111612455A (en) * 2020-04-21 2020-09-01 国网江苏省电力有限公司电力科学研究院 Power consumption information protection-oriented Byzantine fault-tolerant alliance chain consensus method, system and storage medium
CN113569296A (en) * 2021-09-26 2021-10-29 南京中网卫星通信股份有限公司 Sharing facility safe leasing system based on alliance chain and implementation method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2019302940B2 (en) * 2019-10-16 2021-10-21 Alipay (Hangzhou) Information Technology Co., Ltd. Implementing a blockchain-based web service

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110971684A (en) * 2019-11-28 2020-04-07 北京工业大学 PBFT-based block chain network node load balancing method
CN111612455A (en) * 2020-04-21 2020-09-01 国网江苏省电力有限公司电力科学研究院 Power consumption information protection-oriented Byzantine fault-tolerant alliance chain consensus method, system and storage medium
CN113569296A (en) * 2021-09-26 2021-10-29 南京中网卫星通信股份有限公司 Sharing facility safe leasing system based on alliance chain and implementation method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于改进的PBFT算法的性能模型研究;储劲松;鲍可进;夏纯中;;计算机与数字工程(第09期);全文 *

Also Published As

Publication number Publication date
CN115102866A (en) 2022-09-23

Similar Documents

Publication Publication Date Title
CN109472572B (en) Contract system based on block chain main chain and parallel multiple sub-chains
CN107086966A (en) A kind of load balancing of network, control and network interaction method and device
WO2018171578A1 (en) Service graph based serverless cloud platform
CN110650216B (en) Cloud service request method and device
CN111669300B (en) Gateway test method and device based on direct connection test network and computer equipment
CN107493280A (en) Method, intelligent gateway and the certificate server of user authentication
CN108512890B (en) Container cloud platform resource scheduling method and system based on rack sensing
CN112119620B (en) System and method for propagating data packets in a network of nodes
CN110799966A (en) Method and system for hosting a new blockchain using existing blockchain nodes
CN109089298A (en) Bluetooth and the bis- protocol devices method of network entry of wifi and device
CN113542437B (en) Network system, network proxy method and device
US11245709B2 (en) Multi-verifier approach for attestation of nodes in a network
CN106873958A (en) The call method and device of a kind of API
CN115102866B (en) Block chain TPS estimation method and verification method thereof facing consensus algorithm
CN112738181B (en) Method, device and server for cluster external IP access
Fulber-Garcia et al. CUSCO: a customizable solution for NFV composition
CN116703601B (en) Data processing method, device, equipment and storage medium based on block chain network
CN108322454A (en) A kind of network security detection method and device
CN116455576A (en) Block chain consensus method, device, storage medium and equipment based on Internet of things
CN105516134A (en) Authentication method and system for system integration
CN115225299B (en) User authentication method, server and system
CN116244062A (en) Data processing method and device, electronic equipment and storage medium
CN117640184A (en) Safety communication method and safety communication system for internal and external networks in power grid system
Costa et al. Efficient Secure Communication for Distributed Multi-Agent Systems.
CN114143048B (en) Method, device and storage medium for managing safety resources

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