CN109639521B - Block chain performance testing method, device, equipment and storage medium - Google Patents

Block chain performance testing method, device, equipment and storage medium Download PDF

Info

Publication number
CN109639521B
CN109639521B CN201811477228.4A CN201811477228A CN109639521B CN 109639521 B CN109639521 B CN 109639521B CN 201811477228 A CN201811477228 A CN 201811477228A CN 109639521 B CN109639521 B CN 109639521B
Authority
CN
China
Prior art keywords
block chain
transaction
uplink
chain system
endorsement
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
CN201811477228.4A
Other languages
Chinese (zh)
Other versions
CN109639521A (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.)
JD Digital Technology Holdings Co Ltd
Jingdong Technology Holding Co Ltd
Original Assignee
JD Digital Technology Holdings Co Ltd
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 JD Digital Technology Holdings Co Ltd filed Critical JD Digital Technology Holdings Co Ltd
Priority to CN201811477228.4A priority Critical patent/CN109639521B/en
Publication of CN109639521A publication Critical patent/CN109639521A/en
Application granted granted Critical
Publication of CN109639521B publication Critical patent/CN109639521B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0888Throughput
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a method, a device, equipment and a storage medium for testing block chain performance, wherein the method comprises the following steps: sending a test query request to a block chain system so that the block chain system completes endorsement and uplink of transaction data according to the test query request; acquiring first test performance data of the block chain system; and optimizing the block chain system according to the first test performance data. The block chain system completes the endorsement and chaining complete process of transaction data by sending a test query request to the block chain system through the simulation service system, obtains first test performance data in the whole process of completing the block chain system, analyzes the performance of the block chain system according to the first test performance data, and can effectively improve the test efficiency of the block chain system.

Description

Block chain performance testing method, device, equipment and storage medium
Technical Field
The present application relates to the field of block chain technologies, and in particular, to a method, an apparatus, a device, and a storage medium for testing block chain performance.
Background
Blockchains are considered as a cornerstone to push the internet from untrusted to trusted, from information to value transfer. Blockchains are typically managed collectively by multiple blockchain nodes in a blockchain network, which is a fully decentralized, distributed network that may span multiple subnets, multiple data centers, multiple operators, and even multiple countries, with fuzzy boundaries. The blockchain test is very different from the conventional software test.
In the prior art, manual testing is usually required, and the testing efficiency is low. Particularly, for block chain testing of a federation chain, at present, there is no mature performance testing method suitable for the federation chain, and therefore, how to effectively test a block chain system based on the federation chain becomes a technical problem to be solved urgently.
Disclosure of Invention
The application provides a method, a device, equipment and a storage medium for testing block chain performance, which are used for solving the defects that the prior art cannot effectively test the block chain system performance and the like.
The first aspect of the present application provides a method for testing performance of a blockchain, including:
sending a test query request to a block chain system so that the block chain system completes endorsement and uplink of transaction data according to the test query request;
acquiring first test performance data of the block chain system, wherein the first test performance data at least comprises one of uplink time consumption, uplink Throughput (TPS), endorsement success rate, file growth rate and synchronization success rate;
and determining the performance of the block chain system according to the first test performance data.
A second aspect of the present application provides a device for testing performance of a block chain, comprising:
the system comprises a sending module, a searching module and a processing module, wherein the sending module is used for sending a test query request to a block chain system so that the block chain system completes endorsement and chaining of transaction data according to the test query request;
an obtaining module, configured to obtain first test performance data of the block chain system, where the first test performance data at least includes one of uplink time consumption, uplink throughput TPS, endorsement success rate, file growth rate, and synchronization success rate;
and the processing module is used for determining the performance of the block chain system according to the first test performance data.
A third aspect of the present application provides a computer device comprising: at least one processor and memory;
the memory stores a computer program; the at least one processor executes the computer program stored by the memory to implement the method provided by the first aspect.
A fourth aspect of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed, implements the method provided by the first aspect.
According to the block chain performance testing method, device, equipment and storage medium, the block chain system sends the test query request to the block chain system through the simulation service system, so that the block chain system completes the endorsement and chaining integrity process of transaction data, obtains the first test performance data of the block chain system in the whole process, analyzes the performance of the block chain system according to the first test performance data, performs optimization processing, and can effectively improve the block chain system testing efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a schematic structural diagram of a test system suitable for use in the embodiments of the present application;
fig. 2 is a flowchart illustrating a method for testing performance of a blockchain according to an embodiment of the present disclosure;
fig. 3 is a flowchart illustrating a method for testing performance of a blockchain according to another embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating an overall architecture and operation of a test system according to an embodiment of the present invention;
FIG. 5 is a block chain architecture of an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a device for testing performance of a blockchain according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms referred to in this application are explained first:
block chains: in a narrow sense, the blockchain is a distributed account book which is a chain data structure formed by combining data blocks in a sequential connection mode according to a time sequence and is guaranteed in a cryptographic mode and cannot be tampered and forged. Broadly speaking, the blockchain technique is a completely new distributed infrastructure and computing paradigm that utilizes blockchain data structures to verify and store data, utilizes distributed node consensus algorithms to generate and update data, cryptographically secure data transmission and access, and utilizes intelligent contracts composed of automated script code to program and manipulate data.
Federation chain: it is directed to members of a particular group and limited third parties who internally designate a plurality of preselected nodes as billers, and the generation of each block is determined by all of the preselected nodes.
Block chain network: the method is characterized in that a blockchain is constructed in an existing communication network, a blockchain network is formed by a plurality of blockchain link points, and information broadcasted in the blockchain network can be shared among each blockchain node in the network. The link points of each block belong to an equal relation.
Block: refers to a list of blocks in a block chain with records that are growing and aligned. Each tile contains a timestamp and a link to the previous tile.
Carrying out a book: the method refers to a process of signing an endorsement application by other block link points, and the endorsement application means applying the other block link points to achieve consensus on the proposal request and allow the generation of a new block.
Intelligent contract: business rules executed in a consensus manner are preset into the block chain.
The generation of each block is determined by all the preselected nodes together by the biller.
The method for testing the performance of the block chain provided by the embodiment of the application is suitable for the following scenes: fig. 1 is a schematic structural diagram of a test system applicable to the embodiment of the present application. The execution main body of the block chain performance testing method is a block chain performance testing device, the device can simulate a service system A (server) to send an inquiry request (namely a test inquiry request) to a block chain system by calling a BS system A (BS interface), the BS system A forwards the inquiry request to a BS system B of the service system B, the BS system B sends the inquiry request to the service system B, the service system responds to the inquiry request and returns a response result, the BS system B forwards the response result to the BS system A and sends transaction data to the block chain network for endorsement and uplink, and the block chain network returns the uplink result to the BS system A and the BS system B, so that all parties and the block chain perform data synchronization. Where a and B represent two participants in a federation chain, this is illustratively described herein as two participants, and in practice, more participants may be included.
Furthermore, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following examples, "plurality" means two or more unless specifically limited otherwise.
The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Example one
The present embodiment provides a method for testing performance of a blockchain, which is used to perform a performance test on a blockchain system based on a federation chain. The execution subject of the embodiment is a device for testing the performance of the blockchain, and the device may be disposed in a computer device, such as a server, a desktop computer, a notebook computer, and so on.
As shown in fig. 2, a flow chart of the method for testing the performance of the block chain provided in this embodiment is shown, and the method includes:
step 101, sending a test query request to the blockchain system, so that the blockchain system completes endorsement and uplink of the transaction data according to the test query request.
Specifically, referring to fig. 1, the device for testing the performance of the blockchain may simulate that a service system a (server) sends an inquiry request (i.e., a test inquiry request) to a blockchain system by invoking a BS system a (BS interface), the BS system a forwards the inquiry request to a BS system B of the service system B, the BS system B sends the inquiry request to the service system B, the service system responds to the inquiry request and returns a response result, the BS system B forwards the response result to the BS system a and sends transaction data to the blockchain network for endorsement and uplink, and the blockchain network returns the uplink result to the BS system a and the BS system B, so that each party and the blockchain perform data synchronization, thereby completing an entire process of endorsement of the transaction data and successful uplink. Where a and B represent two participants in a federation chain, this is illustratively described herein as two participants, and in practice, more participants may be included.
Since the blockchain node (order node) generates the block, the data test is not directly sent from the inside of the fabric (super book), and the data chain and the block can only package the transaction through the fabric-SDK (also called SDK) and send to the order node. Therefore, the simulation service system calls a forward interface of the BS system or a BS billing query request interface and sends the forward interface or the BS billing query request interface to the fabric-sdk for data encapsulation, so that the aim of sending data to order nodes in batches and generating blocks is fulfilled, and indirect testing is performed. And counting data such as block generation condition of the order node and file use growth condition in the node when the data is uplink.
The block chain system comprises a block chain network, a BS system of each participant and a service system.
Step 102, obtaining first test performance data of the block chain system, wherein the first test performance data at least comprises one of uplink time consumption, uplink Throughput (TPS), endorsement success rate, file growth rate and synchronization success rate.
Specifically, during the whole operation process of the blockchain system, logs are recorded, such as the time when the transaction data starts to upload an endorsement, the endorsement return state, the successful time of the first transaction endorsement, the generation time of the last block, the size of a file before uplink, the size of a file when uplink is completed, the requested transaction amount, the successful uplink transaction amount, and the like, and the log data can be obtained from the blockchain system, and the first test performance data of the blockchain system can be obtained according to the log data.
For example, the uplink time consumption may be a difference between the generation time of the last block (i.e. the successful uplink time of the last transaction) and the successful endorsement time of the first transaction.
Where the transaction data for each submission may include one or more transactions, the blockchain network may be blocked by transaction data submission time or transaction data size, among other ways, i.e., determining which transactions to record in a block. The specific block-out uplink process is the prior art and is not described herein again.
Step 103, determining the performance of the block chain system according to the first test performance data.
Specifically, after the first test performance data of the blockchain system is obtained, analysis may be performed according to the first test performance data to determine the performance of the blockchain system.
Optionally, after determining the performance of the blockchain system, if the performance is poor, the blockchain system may be further optimized.
For example, if the uplink TPS is too low, the system performance may be improved by increasing the number of concurrencies and invoking SDKs in a separate role to send to a different endorsement node (peer node), and so on.
Optionally, multiple groups of first test performance data may be obtained by sending the test query request for multiple times, and the comprehensive judgment is performed.
Optionally, the number of transactions in each transaction data may be controlled to test the block generation rate, the transaction number or uplink request rate, the response time of single or multiple pieces of data, the number of concurrent queries, and the like for different transaction numbers. The specific test content may be set according to actual requirements, and this embodiment is not limited.
In the method for testing the performance of the blockchain provided by this embodiment, the simulated service system sends the test query request to the blockchain system, so that the blockchain system completes the endorsement and chaining of the transaction data in a complete process, obtains the first test performance data of the blockchain system in the complete process, and analyzes the performance of the blockchain system according to the first test performance data, thereby effectively improving the efficiency of testing the blockchain system.
Example two
The present embodiment further supplements the method provided in the first embodiment.
Fig. 3 is a schematic flow chart of the method for testing the performance of the blockchain according to the present embodiment.
As a practical manner, on the basis of the first embodiment, optionally, the step 102 may specifically include:
step 1021, obtaining the log data recorded by the blockchain system.
Step 1022, obtain the first test performance data of the blockchain system according to the log data.
Specifically, during the whole operation process of the blockchain system, logs are recorded, such as the time when the transaction data starts to upload an endorsement, the endorsement return state, the successful time of the first transaction endorsement, the generation time of the last block, the size of a file before uplink, the size of a file when uplink is completed, the requested transaction amount, the successful uplink transaction amount, and the like, and the log data can be obtained from the blockchain system, and the first test performance data of the blockchain system can be obtained according to the log data.
For example, the uplink time consumption may be a difference between the generation time of the last block (i.e. the successful uplink time of the last transaction) and the successful endorsement time of the first transaction.
Optionally, the log data includes time when the transaction data starts to be uploaded to the endorsement, endorsement return state, successful time of the first transaction endorsement, generation time of the last block, size of a file before uplink, size of a file when uplink is completed, requested transaction amount and successful uplink transaction amount; step 1022 specifically includes:
determining the uplink time consumption of the block chain system according to the successful time of the first transaction endorsement and the generation time of the last block;
determining uplink TPS of the block chain system according to the requested transaction quantity and uplink time consumption;
determining the successful endorsement quantity according to the endorsement return state, and determining the endorsement success rate of the block chain system according to the successful endorsement quantity and the requested transaction quantity;
determining the file growth rate of the block chain system according to the size of the file before the uplink and the size of the file when the uplink is finished, namely the uplink time consumption;
and determining the synchronization success rate of the block chain system according to the successful uplink transaction quantity and the requested transaction quantity.
Specifically, the uplink time is the time difference between the generation time of the last block (i.e. the last transaction uplink success time) and the first transaction endorsement success time (i.e. the initial uplink time).
The uplink TPS is the number of transactions requested (i.e., the total number of transactions sent)/uplink elapsed time.
The success rate of endorsement is: number of transactions that endorsed successfully/number of transactions requested.
The file growth rate is: (size of file at the time of completion of uplink-size of previous uplink file)/time consumed for uplink.
The synchronization success rate is: number of successful transactions/requested transactions on the uplink.
For example, a performance test scenario of sharing blacklist data is taken as an example, as shown in fig. 4, which is a schematic diagram of an overall architecture and an operation process of the test system provided in this embodiment.
1. Performance index definition:
and (3) winding time consumption: the difference between the successful time of the last transaction and the successful time of the first transaction.
And (3) winding the TPS: total number of transactions sent (i.e. number of transactions requested)/uplink time consumed.
The success rate of endorsement: endorsement success count/total sent transaction count (i.e., requested transaction count).
File growth rate: (size of file at the time of completion of uplink-size of previous uplink file)/time consumed for uplink.
2. And (3) testing the overall performance of the system:
1.1 query request. Namely, the testing apparatus simulating the performance of the block chain sends an inquiry request (i.e. a test inquiry request) to the BS system a to request to inquire the blacklist data.
1.2 query requests are put in storage. That is, the BS system a stores the query request in the local database Mongodb.
1.3 service request number message queue. The steps are not in sequence with 1.2. Specifically, the BS system a sends the query request to Kafka for splitting and queuing. The splitting means that the query request may include multiple types of information to be queried, for example, multiple organizations are involved, and the query request is split into multiple requests to be queued. Kafka is a high throughput distributed publish-subscribe messaging system that enables high concurrency of query requests.
1.4 returns acceptance success. That is, the BS system a returns a message that the query request has been successfully accepted to the device for testing the blockchain performance.
2.1 consuming the query request message. That is, after splitting, BS system a obtains the query requests item by item from Kafka and forwards them.
2.2 query request forwarding. That is, BS system a acquires query requests item by item from Kafka and forwards them to BS system B. Optionally, the query request may also be encrypted before being sent to BS system B.
2.3 query request. That is, after receiving the query request forwarded by the BS system a, the BS system B forwards the query request to the service system B, where the service system B is a real service system of the participant B, and may be specifically a server. Optionally, if the query request is encrypted, decryption is required before sending to the service system B.
2.4 return response results. Namely, after receiving the query request, the service system B responds to the query request and returns a response result. Specifically, the blacklist data requested by the query request may be returned. Turns 2.5 and 2.6.
And 2.5, warehousing the request response result. That is, after receiving the response result returned by the service system B, the BS system B stores the response result in the local database Mongodb.
2.6outTradeNo messaging queue. I.e., BS system B sends the response results to Kafka for queuing.
2.7 consume the response result message. That is, the BS system B reads the response results from Kafka one by one. Turn 2.8 and 3.1
And 2.8 responding to the result and forwarding. That is, BS system B forwards the individual read response results from Kafka to BS system a.
2.9 response results messaging queue. That is, the BS system a receives the response result sent by the BS system B, and sends the response result to Kafka for queuing. The block chain performance testing apparatus obtains the response results from Kafka.
3.1 integrate clearing UpLink. That is, BS system B sends the Kafka read response results to the blockchain network for endorsement and uplink. The points are referred to as transaction data.
3.2 return the integrated clearing result. That is, the blockchain network returns the uplink result to the BS system a and the BS system B, so that each participant and the blockchain network perform data synchronization.
As another implementable manner, on the basis of the first embodiment, optionally, the method may further include:
step 2011, a chain code function is called according to a preset rule to trigger an intelligent contract;
step 2012, obtaining second test performance data of the block chain, the second test performance data at least including one of a transaction success rate, a transaction throughput, a transaction delay, and resource consumption;
and 2013, determining the performance of the block chain according to the second test performance data.
Optionally, determining the performance of the blockchain according to the second test performance data includes:
if the resource consumption is higher than a first threshold, determining that the resource consumption is too high;
if the transaction throughput is lower than the second threshold, determining that the transaction throughput is too low;
if the transaction success rate is lower than a third threshold value, determining that the transaction success rate is too low;
if the transaction delay is above a fourth threshold, it is determined that the transaction delay is too high.
Optionally, the method may further include:
and 104, optimizing the block chain system according to the performance of the block chain.
Illustratively, if the resource consumption is too high, the hardware configuration is promoted, if the transaction throughput is too low, the processing logic of the smart contract is modified and deployed in a distributed manner, and so on.
Specifically, the overall performance test by the blockchain system is inherently effective, but if the performance bottleneck of the blockchain itself needs to be analyzed, the data inside the blockchain needs to be accurately obtained. The effectiveness of the distributed account book can be better measured by packaging the fabricSDK in the testing device of the blockchain performance, installing an intelligent contract, writing a script to call a chain code function to trigger the contract, or inquiring the state of various distributed account books. The test content index comprises: transaction success rate, transaction throughput TPS, transaction delay, resource consumption. After the chain code function is called to trigger the intelligent contract, corresponding data can be recorded in the execution process, second test performance data of the block chain can be obtained, the system processing capacity is estimated according to the second test performance data of the block chain, the performance bottleneck is analyzed, and the original system is improved. If the resource consumption is too high, the hardware configuration is improved; transaction throughput is too low, intelligent contract processing logic is modified and deployed in a distributed manner, and so on.
Fig. 5 is a block chain bottom structure diagram provided in the present embodiment. Wherein, the peer node also belongs to the node in the block chain network. Fabric refers to super ledger, and Fabric SDK refers to super ledger software development kit. Except for the configuration of the device for testing the performance of the blockchain and the packaging of the fabric SDK therein, other architectures are the prior art and are not described herein again.
It should be noted that the respective implementable modes in the present embodiment may be implemented individually, or may be implemented in combination in any combination without conflict, and the present application is not limited thereto.
In the method for testing the performance of the blockchain provided by this embodiment, the simulated service system sends the test query request to the blockchain system, so that the blockchain system completes the endorsement and chaining of the transaction data in a complete process, obtains the first test performance data of the blockchain system in the complete process, and analyzes the performance of the blockchain system according to the first test performance data, thereby effectively improving the efficiency of testing the blockchain system. And the fabric SDK can be packaged in the testing device of the performance of the block chain, so that the performance of the bottom layer of the block chain can be tested, and optimization is performed based on the test result, so that the testing efficiency is further improved, and the system performance is improved.
EXAMPLE III
The present embodiment provides a device for testing performance of a block chain, which is used to perform the method of the first embodiment.
Fig. 6 is a schematic structural diagram of the device for testing block chain performance according to the present embodiment. The device 30 for testing the performance of the block chain includes a sending module 31, an obtaining module 32 and a processing module 33.
The sending module 31 is configured to send a test query request to the blockchain system, so that the blockchain system completes endorsement and uplink of the transaction data according to the test query request; the obtaining module 32 is configured to obtain first test performance data of the block chain system, where the first test performance data at least includes one of uplink time consumption, uplink throughput TPS, endorsement success rate, file growth rate, and synchronization success rate; the processing module 33 is configured to determine the performance of the blockchain system according to the first test performance data.
The specific manner in which the respective modules perform operations has been described in detail in relation to the apparatus in this embodiment, and will not be elaborated upon here.
According to the device for testing the performance of the blockchain, provided by the embodiment, the test query request is sent to the blockchain system through the simulation service system, so that the blockchain system completes the endorsement and chaining integrity process of the transaction data, the first test performance data in the whole process of completing the blockchain system is obtained, the performance of the blockchain system is analyzed according to the first test performance data, and the test efficiency of the blockchain system can be effectively improved.
Example four
The present embodiment further supplements the apparatus provided in the third embodiment to perform the method provided in the second embodiment.
As an implementable manner, on the basis of the third embodiment, optionally, the obtaining module is specifically configured to:
acquiring log data recorded by a block chain system;
and acquiring first test performance data of the block chain system according to the log data.
Optionally, the log data includes time when the transaction data starts to be uploaded to the endorsement, endorsement return state, successful time of the first transaction endorsement, generation time of the last block, size of a file before uplink, size of a file when uplink is completed, requested transaction amount and successful uplink transaction amount;
an acquisition module specifically configured to:
determining the uplink time consumption of the block chain system according to the successful time of the first transaction endorsement and the generation time of the last block;
determining uplink TPS of the block chain system according to the requested transaction quantity and uplink time consumption;
determining the successful endorsement quantity according to the endorsement return state, and determining the endorsement success rate of the block chain system according to the successful endorsement quantity and the requested transaction quantity;
determining the file growth rate of the block chain system according to the size of the file before the uplink and the size of the file when the uplink is finished, namely the uplink time consumption;
and determining the synchronization success rate of the block chain system according to the successful uplink transaction quantity and the requested transaction quantity.
As another implementable manner, on the basis of the third embodiment, optionally, the processing module is further configured to invoke a chain code function to trigger an intelligent contract according to a preset rule;
the acquisition module is further used for acquiring second test performance data of the block chain, wherein the second test performance data at least comprises one of transaction success rate, transaction throughput, transaction delay and resource consumption;
and the processing module is also used for determining the performance of the block chain according to the second test performance data.
Optionally, the processing module is specifically configured to:
if the resource consumption is higher than a first threshold, determining that the resource consumption is too high;
if the transaction throughput is lower than the second threshold, determining that the transaction throughput is too low;
if the transaction success rate is lower than a third threshold value, determining that the transaction success rate is too low;
if the transaction delay is above a fourth threshold, it is determined that the transaction delay is too high.
As another implementable manner, on the basis of the third embodiment, optionally, the processing module is further configured to:
and optimizing the block chain system according to the performance of the block chain system.
The specific manner in which the respective modules perform operations has been described in detail in relation to the apparatus in this embodiment, and will not be elaborated upon here.
It should be noted that the respective implementable modes in the present embodiment may be implemented individually, or may be implemented in combination in any combination without conflict, and the present application is not limited thereto.
According to the device for testing the performance of the blockchain, the test inquiry request is sent to the blockchain system through the simulation service system, so that the blockchain system completes the endorsement and chaining complete process of the transaction data, the first test performance data in the whole process of completing the blockchain system is obtained, the performance of the blockchain system is analyzed according to the first test performance data, and the test efficiency of the blockchain system can be effectively improved. And the fabric SDK can be packaged in the testing device of the performance of the block chain, so that the performance of the bottom layer of the block chain can be tested, and optimization is performed based on the test result, so that the testing efficiency is further improved, and the system performance is improved.
EXAMPLE five
The embodiment provides a computer device for executing the method provided by the embodiment. The computer device may be a server, a desktop computer, a notebook computer, etc.
Fig. 7 is a schematic structural diagram of the computer device according to this embodiment. The computer device 50 includes: at least one processor 51 and memory 52;
the memory stores a computer program; at least one processor executes the computer program stored in the memory to implement the methods provided by the above-described embodiments.
According to the computer equipment of the embodiment, the block chain system completes the endorsement and chaining complete process of transaction data by sending the test query request to the block chain system through the simulation service system, obtains the first test performance data in the whole process of completing the block chain system, and analyzes the performance of the block chain system according to the first test performance data, so that the test efficiency of the block chain system can be effectively improved. And the test of the performance of the bottom layer of the block chain can be realized by packaging the fabric SDK in the test device of the performance of the block chain, and the optimization is carried out based on the test result, so that the test efficiency is further improved, and the system performance is improved.
EXAMPLE six
The present embodiment provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed, the method provided by any one of the above embodiments is implemented.
According to the computer-readable storage medium of this embodiment, the block chain system completes the endorsement and chaining of the transaction data by sending the test query request to the block chain system through the simulation service system, obtains the first test performance data in the whole process of completing the block chain system, analyzes the performance of the block chain system according to the first test performance data, and performs optimization processing, so that the efficiency of testing the block chain system can be effectively improved. And the test of the performance of the bottom layer of the block chain can be realized by packaging the fabric SDK in the test device of the performance of the block chain, and the optimization is carried out based on the test result, so that the test efficiency is further improved, and the system performance is improved.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A method for testing performance of a block chain, comprising:
sending a test query request to a block chain system so that the block chain system completes endorsement and uplink of transaction data according to the test query request;
acquiring test performance data of the block chain system, wherein the test performance data of the block chain system at least comprises one of uplink time consumption, uplink Throughput (TPS), endorsement success rate, file growth rate and synchronization success rate;
determining the system performance of the blockchain system according to the test performance data of the blockchain system;
calling a chain code function to trigger an intelligent contract according to a preset rule;
acquiring test performance data of a block chain, wherein the test performance data of the block chain at least comprises one of transaction success rate, transaction throughput, transaction delay and resource consumption;
determining the performance of the block chain according to the test performance data of the block chain;
acquiring test performance data of the block chain system, including:
acquiring log data recorded by the block chain system;
and acquiring the test performance data of the block chain system according to the log data.
2. The method of claim 1, wherein the log data comprises a time when the transaction data starts to upload an endorsement, an endorsement return status, a first transaction endorsement success time, a last block generation time, a pre-uplink file size, a file size when uplink is completed, a requested transaction amount, and a successful uplink transaction amount;
the obtaining of the test performance data of the block chain system according to the log data includes:
determining the uplink time consumption of the block chain system according to the successful endorsement time of the first transaction and the generation time of the last block;
determining uplink TPS of the block chain system according to the requested transaction quantity and the uplink time consumption;
determining the successful endorsement quantity according to the endorsement return state, and determining the endorsement success rate of the block chain system according to the successful endorsement quantity and the requested transaction quantity;
determining a file growth rate of the block chain system according to the size of the file before the uplink and the size of the file when the uplink is finished, namely the uplink time consumption;
and determining the synchronization success rate of the block chain system according to the successful uplink transaction quantity and the requested transaction quantity.
3. The method of claim 1, wherein determining the performance of the blockchain based on the test performance data of the blockchain comprises:
if the resource consumption is higher than a first threshold, determining that the resource consumption is too high;
if the transaction throughput is lower than the second threshold, determining that the transaction throughput is too low;
if the transaction success rate is lower than a third threshold value, determining that the transaction success rate is too low;
if the transaction delay is above a fourth threshold, it is determined that the transaction delay is too high.
4. The method according to any of claims 1-3, wherein after determining the performance of the blockchain system from the test performance data of the blockchain system, the method further comprises:
and optimizing the block chain system according to the performance of the block chain system.
5. An apparatus for testing performance of a blockchain, comprising:
the system comprises a sending module, a searching module and a processing module, wherein the sending module is used for sending a test query request to a block chain system so that the block chain system completes endorsement and chaining of transaction data according to the test query request;
an obtaining module, configured to obtain test performance data of the block chain system, where the test performance data of the block chain system at least includes one of uplink time consumption, uplink throughput TPS, endorsement success rate, file growth rate, and synchronization success rate;
the processing module is used for determining the performance of the block chain system according to the test performance data of the block chain system;
the processing module is also used for calling a chain code function to trigger an intelligent contract according to a preset rule;
the obtaining module is further configured to obtain test performance data of the blockchain, where the test performance data of the blockchain at least includes one of a transaction success rate, a transaction throughput, a transaction delay, and resource consumption;
the processing module is further configured to determine the performance of the blockchain according to the test performance data of the blockchain;
the acquisition module is specifically configured to:
acquiring log data recorded by the block chain system;
and acquiring the test performance data of the block chain system according to the log data.
6. The apparatus of claim 5, wherein the log data comprises a time when the transaction data starts to upload an endorsement, an endorsement return status, a first transaction endorsement success time, a last block generation time, a pre-uplink file size, a file size when uplink is completed, a requested transaction amount, and a successful uplink transaction amount;
the acquisition module is specifically configured to:
determining the uplink time consumption of the block chain system according to the successful endorsement time of the first transaction and the generation time of the last block;
determining uplink TPS of the block chain system according to the requested transaction quantity and the uplink time consumption;
determining the successful endorsement quantity according to the endorsement return state, and determining the endorsement success rate of the block chain system according to the successful endorsement quantity and the requested transaction quantity;
determining a file growth rate of the block chain system according to the size of the file before the uplink and the size of the file when the uplink is finished, namely the uplink time consumption;
and determining the synchronization success rate of the block chain system according to the successful uplink transaction quantity and the requested transaction quantity.
7. The apparatus of claim 5, wherein the processing module is specifically configured to:
if the resource consumption is higher than a first threshold, determining that the resource consumption is too high;
if the transaction throughput is lower than the second threshold, determining that the transaction throughput is too low;
if the transaction success rate is lower than a third threshold value, determining that the transaction success rate is too low;
if the transaction delay is above a fourth threshold, it is determined that the transaction delay is too high.
8. The apparatus of any of claims 5-7, wherein the processing module is further configured to:
and optimizing the block chain system according to the performance of the block chain system.
9. A computer device, comprising: at least one processor and memory;
the memory stores a computer program; the at least one processor executes the memory-stored computer program to implement the method of any of claims 1-4.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when executed, implements the method of any of claims 1-4.
CN201811477228.4A 2018-12-05 2018-12-05 Block chain performance testing method, device, equipment and storage medium Active CN109639521B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811477228.4A CN109639521B (en) 2018-12-05 2018-12-05 Block chain performance testing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811477228.4A CN109639521B (en) 2018-12-05 2018-12-05 Block chain performance testing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109639521A CN109639521A (en) 2019-04-16
CN109639521B true CN109639521B (en) 2020-09-29

Family

ID=66071076

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811477228.4A Active CN109639521B (en) 2018-12-05 2018-12-05 Block chain performance testing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109639521B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110113229A (en) * 2019-05-01 2019-08-09 中央财经大学 A kind of block chain reference performance test macro and tool
CN110347733A (en) * 2019-05-21 2019-10-18 江苏中兴华易科技发展有限公司 A kind of method of adjustment based on block chain technical data cochain
CN110245147B (en) * 2019-06-19 2021-08-13 腾讯科技(深圳)有限公司 Block chain data processing method and device, readable storage medium and computer equipment
CN110347607A (en) * 2019-07-16 2019-10-18 北京首汽智行科技有限公司 A kind of data cochain test method
CN110324363B (en) * 2019-08-07 2020-08-14 北京瑞策科技有限公司 Uplink method and device for Internet e-commerce associated data
CN110471827B (en) * 2019-08-09 2023-02-17 中国信息通信研究院 Block chain performance benchmark test method and device
CN110958161B (en) * 2019-12-02 2021-11-19 中国银行股份有限公司 Block chain link point monitoring method and device and storage medium
CN111260349B (en) * 2020-01-10 2023-10-03 中国工商银行股份有限公司 Real-time payment method and system based on block chain
CN111459825B (en) * 2020-04-03 2023-10-31 银清科技有限公司 Block chain application system, method and device for payment service
CN111767211A (en) * 2020-06-15 2020-10-13 北京同邦卓益科技有限公司 Test method and device of alliance chain, storage medium and electronic device
CN112486830B (en) * 2020-06-24 2023-04-18 支付宝(杭州)信息技术有限公司 Pressure testing method, device and system for block chain network
US11782823B2 (en) 2020-07-27 2023-10-10 International Business Machines Corporation Automatically capturing weather data during engineering tests
CN112818055B (en) * 2020-12-29 2023-05-19 杭州趣链科技有限公司 Block chain performance optimization method, device and equipment
CN112910743B (en) * 2021-03-19 2022-06-03 中山大学 Block chain performance detection system
CN113079067A (en) * 2021-03-30 2021-07-06 上海万向区块链股份公司 Union chain performance bottleneck testing system and method based on multidimensional data integration analysis
CN114189524A (en) * 2021-10-19 2022-03-15 中山大学 Method and device for screening reliable peer points of block chain

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106101242A (en) * 2016-06-24 2016-11-09 深圳前海微众银行股份有限公司 The construction method of block chain cloud service platform and device
CN107943580A (en) * 2017-11-13 2018-04-20 上海点融信息科技有限责任公司 For managing the method and equipment of user's intelligence contract at block chain link point
CN108304307A (en) * 2018-01-24 2018-07-20 深圳圣马歌科技有限公司 The method for testing performance of intelligent contract on a kind of block chain
CN108648071A (en) * 2018-05-17 2018-10-12 阿里巴巴集团控股有限公司 Value evaluation of tourism resources method and apparatus based on block chain

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528775B (en) * 2016-10-28 2020-01-03 济南大学 Private block chain operation support system supporting logic multi-chain and working method thereof
CN106598824B (en) * 2016-11-25 2018-11-20 深圳前海微众银行股份有限公司 The method for analyzing performance and device of block chain
CN108170590B (en) * 2017-12-12 2021-08-24 北京大学深圳研究生院 Test system and method of block chain system
CN108763058A (en) * 2018-04-24 2018-11-06 苏州同济区块链研究院有限公司 A kind of block chain evaluation system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106101242A (en) * 2016-06-24 2016-11-09 深圳前海微众银行股份有限公司 The construction method of block chain cloud service platform and device
CN107943580A (en) * 2017-11-13 2018-04-20 上海点融信息科技有限责任公司 For managing the method and equipment of user's intelligence contract at block chain link point
CN108304307A (en) * 2018-01-24 2018-07-20 深圳圣马歌科技有限公司 The method for testing performance of intelligent contract on a kind of block chain
CN108648071A (en) * 2018-05-17 2018-10-12 阿里巴巴集团控股有限公司 Value evaluation of tourism resources method and apparatus based on block chain

Also Published As

Publication number Publication date
CN109639521A (en) 2019-04-16

Similar Documents

Publication Publication Date Title
CN109639521B (en) Block chain performance testing method, device, equipment and storage medium
CN108062672B (en) Flow scheduling method based on block chain intelligent contract
CN110866825B (en) Public link-based block chain information storage method and system
CN109325854B (en) Block chain network, deployment method and storage medium
CN108932348B (en) Block chain merging processing method and device, block chain node and storage medium
CN108777625A (en) Verification method, device and system, storage medium, the electronic device of signature
CN110399373A (en) A kind of block chain account book storage system, storage querying method and delet method
CN113347164B (en) Block chain-based distributed consensus system, method, device and storage medium
CN110839056B (en) Data processing method and device based on block chain and node network
CN111767211A (en) Test method and device of alliance chain, storage medium and electronic device
CN110400140A (en) Layering fragment exchange information processing method and application based on Fabric
CN105786909A (en) Message queue backlog load self-adaptive application triggering method and system
CN110442502A (en) A kind of method, apparatus buried a little, equipment and storage medium
CN111405074B (en) Data center network fault diagnosis and automatic configuration method based on hybrid chain
CN110096511B (en) Data consistency verification method, device, equipment and medium based on private chain
CN113364831A (en) Multi-domain heterogeneous computing network resource credible cooperation method based on block chain
CN105224541B (en) Uniqueness control method, information storage means and the device of data
CN116055052A (en) Block chain-based data processing method, device, equipment and readable storage medium
CN110493323A (en) Fairness document distribution method, system and storage medium based on block chain
CN112732800B (en) Method and apparatus for providing cross-chain messages
CN114022285A (en) Cross-enterprise cloud computing resource metering method and system based on alliance block chain
US20200242702A1 (en) Capital chain information traceability method, system, server and readable storage medium
CN110019043B (en) Block chain data storage method
CN116112507A (en) Hierarchical blockchain-based multitasking asynchronous execution method and device
Nystrøm Network Performance in Hyperledger Fabric-Investigating the network resource consumption of transactions in a Distributed Ledger Technology system

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
CB02 Change of applicant information

Address after: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Daxing District, Beijing Economic and Technological Development Zone, 100195

Applicant after: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

Address before: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone, 100195

Applicant before: BEIJING JINGDONG FINANCIAL TECHNOLOGY HOLDING Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Patentee after: Jingdong Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Patentee before: Jingdong Digital Technology Holding Co.,Ltd.

CP01 Change in the name or title of a patent holder
CP03 Change of name, title or address

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Patentee after: Jingdong Digital Technology Holding Co.,Ltd.

Address before: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Daxing District, Beijing Economic and Technological Development Zone, 100195

Patentee before: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

CP03 Change of name, title or address