A performance testing method and device suitable for a multi-node blockchain system
By setting up multiple nodes in a specific order within the blockchain network, transaction data can be executed simultaneously on multiple nodes, solving the bottleneck problem of single-node pressure processing efficiency and improving the performance testing efficiency and accuracy of the blockchain system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-23
- Publication Date
- 2026-03-31
AI Technical Summary
In existing blockchain performance testing solutions, single-node pressure generation suffers from a single-point pressure bottleneck, preventing further efficiency improvements.
The performance testing method of a multi-node blockchain system is adopted. By setting up N blockchain nodes in a sequential order in the blockchain network, transaction data is transmitted in sequence, enabling the simultaneous execution of transaction data on multiple nodes, thereby improving the efficiency of performance testing.
By horizontally scaling the load capacity, the efficiency of performance testing for blockchain systems is improved, enabling more accurate evaluation of the performance and functionality of multi-node blockchain systems.
Smart Images

Figure CN116319416B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain system testing technology, and in particular to a performance testing method and apparatus suitable for multi-node blockchain systems. Background Technology
[0002] Currently, blockchain performance testing solutions are mainly based on centralized platforms for stress testing. A client sends stress to the blockchain system and calculates the test results. As blockchain technology develops and the performance of blockchain systems continues to improve, single-node stress sending has a single-point pressure bottleneck problem, and the efficiency of single-node stress sending cannot be further improved.
[0003] This application enables horizontal scaling of pressure output capability, allowing pressure to be applied to multiple blockchain nodes simultaneously, thereby improving performance testing efficiency. Summary of the Invention
[0004] This invention provides a performance testing method and apparatus for multi-node blockchain systems. The blockchain system has a blockchain network, which includes N blockchain nodes, where N is a natural number greater than 2. Since the transaction data is transmitted sequentially to each blockchain node in the blockchain network according to the order of arrangement, transaction data sent at different times can be executed simultaneously on multiple blockchain nodes, thereby improving the efficiency of blockchain system performance testing.
[0005] In a first aspect, the present invention provides a performance testing method applicable to a multi-node blockchain system. The blockchain system has a blockchain network comprising N sequentially connected blockchain nodes, where N is a natural number greater than 2. The method includes:
[0006] Generate transaction data based on the data to be tested;
[0007] The transaction data is sent to the first blockchain node, wherein the N blockchain nodes in the blockchain network have an order, and the first blockchain node is the blockchain node with the first order. The transaction data is transmitted to each blockchain node in the blockchain network in the order of the order.
[0008] Receive transaction feedback from the Nth blockchain node;
[0009] Acquire test data during the process from "sending the transaction data to the first blockchain node" to "receiving the transaction feedback returned by the Nth blockchain node";
[0010] Based on the test data, the test results are obtained.
[0011] Optionally, sending the transaction data to the first blockchain node includes:
[0012] Based on the pressure setting parameters, the target transaction data is determined from the transaction data;
[0013] The target transaction data is continuously sent to the first blockchain node until the target transaction data is completely sent or the preset transmission duration is exceeded.
[0014] Optionally, before generating transaction data based on the test data, the following steps are included:
[0015] Test cases are determined based on test setting parameters and test procedures; wherein, the test setting parameters include pressure release time point, simulated concurrency, transaction data quantity, transaction data sending speed, transaction execution logic, transaction data storage volume, and nodes receiving pressure;
[0016] The testing tools are determined based on the test cases and the multi-node blockchain system.
[0017] Connect the testing tool to the multi-node blockchain system.
[0018] Optionally, connecting the testing tool to the multi-node blockchain system includes:
[0019] Multiple blockchain networks are built in the blockchain system, and the number of blockchain nodes in the multiple blockchain networks is different, and the number of blockchain nodes in the multiple blockchain networks decreases or increases in a gradient.
[0020] Connect the testing tool to the blockchain network.
[0021] Optionally, the test data includes a first time point t. send Second time point t recv Number of transaction data per node n recv Total transaction time t for a single node all Total number of transactions n conf and total transaction time T ALL Transaction storage volume n send ;
[0022] Among them, the first time point t send This refers to the time point at which the transaction data is sent to the first blockchain node each time.
[0023] Second time point t recv This refers to the time point at which the transaction feedback is received from the Nth blockchain node.
[0024] Total transaction time t for a single node allThe time taken for a single blockchain node to send the first transaction data to the last transaction data and receive the response;
[0025] Total number of transactions n conf The total number of transactions across all blockchain networks;
[0026] Transaction storage volume n send This refers to the amount of transaction data that can be stored across all blockchain networks after a transaction occurs.
[0027] Optionally, obtaining the test results based on the test data includes:
[0028] Based on the first time point t send Second time point t recv Determine the response time TD, TD1, TD2...TD n The response time for sending the transaction data to the blockchain network n times is identified by TD1, TD2...TD. n Determine the average and maximum time for n transactions;
[0029] Based on the number of transaction data n of a single node recv The total transaction time t of the single node all Determine the number of transactions received by the blockchain node per second;
[0030] Based on the total number of transactions n conf and the total transaction time T ALL Determine the number of transactions confirmed per second by the blockchain system;
[0031] Based on the total number of transactions n conf and transaction storage volume n send Determine the success rate of the transaction;
[0032] The test results are determined based on the average time taken, the maximum time taken, the number of transactions received by the blockchain node per second, the number of transactions confirmed per second, and the transaction success rate.
[0033] Optionally, determining the test result based on the average time consumption, the maximum time consumption, the number of transactions received by the blockchain node per second, the number of transactions confirmed per second, and the transaction success rate includes:
[0034] The average time, the maximum time, the number of transactions received by the blockchain node per second, the number of transactions confirmed per second, and the transaction success rate are used to generate a visual graph to display the test results.
[0035] Secondly, this application provides a performance testing device suitable for multi-node blockchain systems, characterized in that the device comprises:
[0036] A sending unit is used to send the transaction data to a first blockchain node, wherein the N blockchain nodes in the blockchain network have an order of arrangement, and the first blockchain node is the blockchain node with the first order of arrangement;
[0037] A receiving unit is configured to receive transaction feedback returned by the Nth blockchain node; wherein the transaction data is executed in each of the blockchain nodes according to the stated order.
[0038] The acquisition unit is used to acquire test data during the process from "sending the transaction data to the first blockchain node" to "receiving the transaction feedback returned by the Nth blockchain node";
[0039] An analysis unit is used to obtain test results based on the test data;
[0040] The control unit is connected to the transmitting unit, the receiving unit, and the analysis unit, and is used to control the operation of the transmitting unit, the receiving unit, and the analysis unit.
[0041] Optionally, the device further includes:
[0042] The generation unit is used to generate transaction data based on the data to be tested.
[0043] Thirdly, the present invention provides an electronic device, a processor;
[0044] Memory used to store the processor's executable instructions;
[0045] The processor is configured to read the executable instructions from the memory and execute the instructions to implement any of the methods described in the first aspect.
[0046] This invention provides a performance testing method for multi-node blockchain systems. The blockchain system comprises a blockchain network with N sequentially connected blockchain nodes, where N is a natural number greater than 2. The method generates transaction data based on the data to be tested; then, the transaction data is sent to a first blockchain node; next, transaction feedback is received from the Nth blockchain node; then, test data is acquired during the process from sending the transaction data to the first blockchain node to receiving the transaction feedback from the Nth blockchain node; finally, test results are obtained based on the test data. Since the N blockchain nodes in the blockchain network have an ordered sequence, with the first blockchain node being the first in that sequence, the transaction data is transmitted sequentially to each blockchain node according to the ordered sequence. Therefore, transaction data sent at different times can be executed simultaneously on multiple blockchain nodes, thereby improving the efficiency of blockchain system performance testing.
[0047] The further effects of the aforementioned non-conventional preferred method will be explained below in conjunction with specific embodiments. Attached Figure Description
[0048] To more clearly illustrate the embodiments of the present invention or the existing technical solutions, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 A flowchart of a performance testing method for a multi-node blockchain system provided in an embodiment of the present invention. Figure 1 ;
[0050] Figure 2 A flowchart of a performance testing method for a multi-node blockchain system provided in an embodiment of the present invention. Figure 2 ;
[0051] Figure 3 This is a schematic diagram of the structure of a performance testing device for a multi-node blockchain system provided in an embodiment of the present invention;
[0052] Figure 4 This is a schematic diagram of the structure of a performance testing device for a multi-node blockchain system connected to a blockchain system in one embodiment of the present invention;
[0053] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0055] With the development of blockchain technology, the performance of blockchain systems continues to improve. However, single-node pressure generation faces a single-point pressure bottleneck, and its efficiency cannot be further improved.
[0056] In view of this, the present invention provides a performance testing method suitable for multi-node blockchain systems, which can achieve horizontal scaling of stress testing capacity, simultaneously applying stress to multiple blockchain nodes, thereby improving performance testing efficiency. See also Figure 1 The diagram illustrates a specific embodiment of the performance testing method for multi-node blockchain systems provided by the present invention. The method is applied to a blockchain system with a blockchain network comprising N sequentially connected blockchain nodes, where N is a natural number greater than 2. In this embodiment, the method includes steps S01, S02, S03, S04, and S05.
[0057] Step S01: Generate transaction data based on the data to be tested;
[0058] Step S02: Send the transaction data to the first blockchain node;
[0059] Step S03: Receive transaction feedback returned by the Nth blockchain node;
[0060] Step S04: Obtain test data during the process from "sending the transaction data to the first blockchain node" to "receiving the transaction feedback returned by the Nth blockchain node";
[0061] Step S05: Obtain the test results based on the test data.
[0062] The test data refers to the test data required to verify compliance with usage standards before the blockchain system is officially used, or data that can be obtained from the test data to confirm compliance with usage standards. This test data or data will affect the use of the blockchain system. For example, the test data includes the first time point t. send Second time point t recv Number of transaction data per node n recv Total transaction time t for a single node all Total number of transactions nconf and total transaction time T ALL Transaction storage volume n send .
[0063] Since the N blockchain nodes in the blockchain network have an ordered arrangement, and the first blockchain node is the first in that order, the transaction data is transmitted sequentially to each of the blockchain nodes in the blockchain network according to the ordered arrangement. Therefore, transaction data sent at different times can be executed simultaneously on multiple blockchain nodes, thereby improving the efficiency of blockchain system performance testing. For example, after the transaction data is sent to the first blockchain node, the same transaction data will be executed sequentially on the second blockchain node, the third blockchain node, and so on up to the Nth blockchain node. If the transaction data is continuously sent to the blockchain network, then multiple blockchain nodes will be processing the transaction data simultaneously. For example, the first transaction data sent is called the first transaction data, the second transaction data sent is called the second transaction data, and so on up to the Nth transaction data. Then, the first transaction data, the second transaction data, and so on up to the Nth transaction data are sent to the blockchain network sequentially. After the third transaction data is sent to the blockchain network, the first blockchain node executes and / or processes the third transaction data, the second blockchain node executes and / or processes the second transaction data, and the third blockchain node executes and / or processes the first transaction data. The first, second, and third blockchain nodes can simultaneously execute or process transaction data, thus achieving horizontal scaling of the stress-generating capacity. Simultaneously applying stress to multiple blockchain nodes can improve performance testing efficiency.
[0064] In one embodiment, step S02, which involves sending the transaction data to the first blockchain node, includes steps S021 and S022.
[0065] Step S021: Determine the target transaction data from the transaction data according to the voltage setting parameters;
[0066] Step S022: Continuously send the target transaction data to the first blockchain node until the target transaction data is sent completely or the preset transmission duration is exceeded.
[0067] The pressure setting parameters include pressure duration and transaction data volume. Within the transaction data, target transaction data is determined based on the pressure setting parameters. The target transaction data's data volume and sustained pressure duration are identical to the pressure setting parameters. Determining the target transaction data based on the pressure setting parameters ensures a sufficient volume of transaction data and sufficient pressure duration, resulting in more test data and more accurate test results.
[0068] In one embodiment, as shown in the appendix Figure 2 As shown, step S01, before generating transaction data based on the test data, includes:
[0069] Step S1: Determine test cases based on test setting parameters and test process; wherein, the test setting parameters include pressure release time point, simulated concurrency, transaction data quantity, transaction data sending speed, transaction execution logic, transaction data storage volume, and nodes receiving pressure;
[0070] Step S2: Determine the testing tools based on the test cases and the multi-node blockchain system;
[0071] Step S3: Connect the testing tool to the multi-node blockchain system.
[0072] Test cases are the transaction data, parameter settings, and execution flow required during a performance test of a blockchain system. Key data in test cases includes the pressure release time, simulated concurrency, number of transaction data, transaction data transmission speed, transaction execution logic, transaction data storage volume, and the node receiving the pressure. The testing tool is a device used to test a blockchain system using test cases. For example, the testing tool is a performance testing device suitable for multi-node blockchain systems, including a pressure release unit, a receiving unit, an acquisition unit, an analysis unit, and a control unit. The pressure release unit sends the transaction data to the first blockchain node; the receiving unit receives transaction feedback returned by the Nth blockchain node; the acquisition unit acquires test data during the process from "sending the transaction data to the first blockchain node" to "receiving transaction feedback returned by the Nth blockchain node"; the analysis unit obtains test results based on the test data; and the control unit, connected to the sending unit, the receiving unit, and the analysis unit, controls the operation of these units.
[0073] The testing tool is connected to the multi-node blockchain system, and can send transaction data to the multi-node blockchain system, receive information fed back from the blockchain system, and obtain the test data required in the process of sending transaction data to the multi-node blockchain system. It can also analyze the test data to obtain test results, and evaluate the performance, functionality, and transaction efficiency of the multi-node blockchain system based on the test results.
[0074] In one embodiment, step S3, connecting the testing tool to the multi-node blockchain system, includes steps S31 and S32.
[0075] Step S31: Build multiple blockchain networks in the blockchain system. The number of blockchain nodes in the multiple blockchain networks is different, and the number of blockchain nodes in the multiple blockchain networks decreases or increases in a gradient.
[0076] Blockchain systems require building blockchain networks with varying numbers of nodes to meet specific needs. This gradient in the number of nodes allows for the assessment of how the system's performance changes as the number of nodes increases. Examples include networks with 4, 8, or 16 nodes. Alternatively, a blockchain network with a fixed number of nodes can be built, allowing for testing of the overall system performance using different test cases.
[0077] Step S32: Connect the testing tool to the blockchain network.
[0078] The testing tool is connected to the blockchain network through methods such as RPC (Remote Procedure Call), HTTP (Hypertext Transfer Protocol), and SDK (software development kit).
[0079] In one embodiment, the test data includes a first time point t send Second time point t recv Number of transaction data per node n recv Total transaction time t for a single node all Total number of transactions n conf and total transaction time T ALL Transaction storage volume n send ;
[0080] Among them, the first time point t send This refers to the time point at which the transaction data is sent to the first blockchain node each time.
[0081] Second time point t recv This refers to the time point at which the transaction feedback is received from the Nth blockchain node.
[0082] Total transaction time t for a single node all The time taken for a single blockchain node to send the first transaction data to the last transaction data and receive the response;
[0083] Total number of transactions n conf The total number of transactions across all blockchain networks;
[0084] Transaction storage volume n send This refers to the amount of transaction data that can be stored across all blockchain networks after a transaction occurs.
[0085] The aforementioned test data can be recorded by the testing tool during the transaction process and directly obtained from the testing tool's storage medium.
[0086] In one embodiment, test results can be obtained by calculating, analyzing, and creating visualizations from the test data obtained from the test tool's storage medium. Step S05, obtaining test results based on the test data, includes:
[0087] Step S051: Based on the first time point t send Second time point t recv Determine the response time TD (Transaction Delay), TD1, TD2...TD n The response time for sending the transaction data to the blockchain network n times is identified by TD1, TD2...TD. n Determine the average transaction delay (ATD) and maximum transaction delay (MTD) for n transactions;
[0088] The formulas for calculating the average time taken (ATD) and the maximum time taken (MTD) are as follows:
[0089] Average time ATD = avg(TD1, TD2, ... TD) n );
[0090] Maximum execution time MTD = max(TD1, TD2, ... TD) n ).
[0091] Step S0512: Based on the number of transaction data n for a single node recv The total transaction time t of the single node all Determine the number of transactions received per second (RTPS) by the blockchain nodes;
[0092] The formula for calculating the RTPS (Transactions Per Second) of a blockchain node is as follows:
[0093] Number of transactions received by a blockchain node per second
[0094] Step S0513: Based on the total number of transactions n conf and the total transaction time T ALL Determine the number of confirmed transactions per second (CTPS) of the blockchain system;
[0095] The formula for calculating the number of transactions confirmed per second (CTPS) is as follows:
[0096] Number of transactions confirmed per second
[0097] Step S0514: Based on the total number of transactions n conf and transaction storage volume n send Determine the Transaction Success Rate (TSR);
[0098] The formula for calculating the transaction success rate (TSR) is as follows:
[0099] Transaction success rate
[0100] Step S052: Determine the test results based on the average time consumption, the maximum time consumption, the number of transactions received by the blockchain node per second, the number of transactions confirmed per second, and the transaction success rate.
[0101] The order of steps S0511 to S0514 above can be reversed. The performance of the blockchain system is evaluated using data such as the average time consumption, the maximum time consumption, the number of transactions received by the blockchain node per second, the number of transactions confirmed per second, and the transaction success rate, as test results. For example, a comparison value for average time consumption, a comparison value for maximum time consumption, a comparison value for the number of transactions received by the blockchain node per second, a comparison value for the number of transactions confirmed per second, and a comparison value for the transaction success rate can be preset. The average time consumption is compared with the average time consumption comparison value, the maximum time consumption is compared with the maximum time consumption comparison value, the number of transactions received by the blockchain node per second is compared with the number of transactions received by the blockchain node per second, the number of transactions confirmed per second is compared with the number of transactions confirmed per second, and the transaction success rate is compared with the transaction success rate comparison value to obtain comparison results, which are then used as test results.
[0102] The average processing time, the maximum processing time, the number of transactions received by the blockchain node per second, the number of transactions confirmed per second, and the transaction success rate can be visualized into graphs to display the test results. These visualizations can be line charts, bar charts, pie charts, etc.
[0103] As attached Figure 3 The diagram shown is a structural schematic of a performance testing device for a multi-node blockchain system provided in an embodiment of the present invention; as shown in the attached diagram. Figure 4 The diagram shown illustrates the structure of a performance testing device for a multi-node blockchain system connected to the blockchain system in one embodiment of the present invention. The device can be a testing tool, including:
[0104] A pressure-generating unit is used to send the transaction data to a first blockchain node, wherein the N blockchain nodes in the blockchain network have an order, and the first blockchain node is the blockchain node with the first order.
[0105] A receiving unit is configured to receive transaction feedback returned by the Nth blockchain node; wherein the transaction data is executed in each of the blockchain nodes according to the stated order.
[0106] The acquisition unit is used to acquire test data during the process from "sending the transaction data to the first blockchain node" to "receiving the transaction feedback returned by the Nth blockchain node";
[0107] An analysis unit is used to obtain test results based on the test data;
[0108] The control unit is connected to the transmitting unit, the receiving unit, and the analysis unit, and is used to control the operation of the transmitting unit, the receiving unit, and the analysis unit.
[0109] In one embodiment, the performance testing apparatus for multi-node blockchain systems further includes:
[0110] The generation unit is used to generate transaction data based on the data to be tested.
[0111] The device described in this embodiment is used to perform... Figures 1-3 The physical apparatus of the method is essentially the same as that described in the above embodiments, and the corresponding descriptions in the above embodiments are also applicable to this embodiment.
[0112] Optionally, the performance testing device for multi-node blockchain systems further includes:
[0113] The design unit is used to determine test cases based on test setting parameters and test procedures; wherein, the test setting parameters include pressure release time point, simulated concurrency, transaction data quantity, transaction data sending speed, transaction execution logic, transaction data storage capacity, and nodes receiving pressure;
[0114] A test environment setup unit is used to determine the test tools based on the test cases and the multi-node blockchain system; and to connect the test tools to the multi-node blockchain system.
[0115] Optionally, a test environment unit is set up for:
[0116] Multiple blockchain networks are built in the blockchain system, and the number of blockchain nodes in the multiple blockchain networks is different, and the number of blockchain nodes in the multiple blockchain networks decreases or increases in a gradient.
[0117] Connect the testing tool to the blockchain network.
[0118] Optionally, the analysis unit is used for:
[0119] Based on the first time point t send Second time point t recv Determine the response time TD, TD1, TD2...TD n The response time for sending the transaction data to the blockchain network n times is identified by TD1, TD2...TD. n Determine the average and maximum time for n transactions;
[0120] Based on the number of transaction data n of a single node recv The total transaction time t of the single node all Determine the number of transactions received by the blockchain node per second;
[0121] Based on the total number of transactions n conf and the total transaction time T ALL Determine the number of transactions confirmed per second by the blockchain system;
[0122] Based on the total number of transactions n conf and transaction storage volume n send Determine the success rate of the transaction;
[0123] The test results are determined based on the average time taken, the maximum time taken, the number of transactions received by the blockchain node per second, the number of transactions confirmed per second, and the transaction success rate.
[0124] Optionally, the analysis unit is used for:
[0125] The average time, the maximum time, the number of transactions received by the blockchain node per second, the number of transactions confirmed per second, and the transaction success rate are used to generate a visual graph to display the test results.
[0126] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include main memory, such as high-speed random-access memory (RAM), or it may also include non-volatile memory, such as at least one disk storage device. Of course, the electronic device may also include other hardware required for other services.
[0127] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0128] Memory is used to store instructions for execution. Specifically, instructions for execution are computer programs that can be executed. Memory can include main memory and non-volatile memory, and it provides the processor with execution instructions and data.
[0129] In one possible implementation, the processor reads the corresponding execution instructions from non-volatile memory into memory and then executes them. Alternatively, it may obtain the corresponding execution instructions from other devices to form a performance testing device for a multi-node blockchain system at the logical level. The processor executes the execution instructions stored in memory to implement the performance testing method for the multi-node blockchain system provided in any embodiment of the present invention.
[0130] The above is as described in the present invention. Figure 3 , Figure 4The method executed by the performance testing device for the multi-node blockchain system provided in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor.
[0131] The steps of the method disclosed in the embodiments of this invention can be directly manifested as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0132] This invention also proposes a computer-readable storage medium including executable instructions. When the processor of an electronic device executes the executable instructions, the electronic device is able to perform the performance testing method for the multi-node blockchain system provided in any embodiment of this invention, and is specifically used to perform, for example... Figure 1 or Figure 2 The method shown.
[0133] The electronic devices described in the foregoing embodiments may be computers.
[0134] Those skilled in the art will understand that embodiments of the present invention can be provided as methods or computer program products. Therefore, the present invention can be implemented in a completely hardware embodiment, a completely software embodiment, or a combination of software and hardware.
[0135] The various embodiments in this invention are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0136] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0137] The above description is merely an embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A performance testing method suitable for a multi-node blockchain system, applied to a blockchain system, characterized in that, The blockchain system is provided with a blockchain network comprising N blockchain nodes connected in sequence, N being a natural number greater than 2, and the method comprises: generating transaction data according to the data to be tested; sending the transaction data to a first blockchain node; receiving transaction feedback returned by an Nth blockchain node; obtaining test data in the process from "sending the transaction data to a first blockchain node" to "receiving transaction feedback returned by an Nth blockchain node"; obtaining a test result according to the test data; wherein the N blockchain nodes in the blockchain network have an arrangement order, the first blockchain node is the blockchain node with the first arrangement order, and the transaction data is transmitted to each blockchain node in the blockchain network in the arrangement order. 2.The performance testing method for a multi-node blockchain system according to claim 1, wherein, The sending of the transaction data to the first blockchain node comprises: determining target transaction data from the transaction data according to a stress setting parameter; continuously sending the target transaction data to the first blockchain node until the target transaction data is sent completely or a preset stress duration is exceeded. 3.The performance testing method for a multi-node blockchain system according to claim 1, wherein, Before the generation of the transaction data according to the data to be tested, the method comprises: determining a test case according to a test setting parameter and a test flow; wherein the test setting parameter comprises a stress time point, a simulated concurrency, a transaction data quantity, a transaction data sending speed, a transaction execution logic, a transaction data storage quantity, and a node receiving pressure; determining a test tool according to the test case and the multi-node blockchain system; connecting the test tool with the multi-node blockchain system. 4.The performance testing method for a multi-node blockchain system according to claim 3, wherein, The connecting of the test tool with the multi-node blockchain system comprises: building multiple blockchain networks in the blockchain system, the number of blockchain nodes in the multiple blockchain networks being different, and the number of blockchain nodes in the multiple blockchain networks being gradiently decreased or increased; connecting the test tool with the blockchain networks. 5.The performance testing method for a multi-node blockchain system according to claim 4, wherein, The test data includes a first time point t send , a second time point t recv , a single node transaction data quantity n recv , a single node transaction total time consumption t all , a total transaction quantity n conf , and a total transaction time consumption T ALL , a transaction storage quantity n send ; wherein the first time point t send is a time point for each time the transaction data is sent to the first blockchain node; Second time point t recv a time point for each time of receiving the transaction feedback returned by the Nth blockchain node; Total time spent on individual node transactions t all Time spent on sending the first transaction data to the last transaction data received response for the individual blockchain node Total number of transactions n conf is the total number of transactions for all blockchain networks; Transaction preservation amount n send The amount of transaction data that can be preserved after the occurrence of a transaction data in all blockchain networks. 6.The performance testing method for a multi-node blockchain system according to claim 5, wherein, The obtaining of a test result according to the test data comprises: According to the first time point t send , second time point t recv , determine the response time TD, TD1, TD2...TD n identify the response time of n times sending the transaction data to the blockchain network, according to TD1, TD2...TD n determine the average time and the maximum time of n transactions; According to the number of individual node transaction data n recv and the total time t of the individual node transaction all determining the number of transactions received by the blockchain node per second; According to the total number of transactions n conf and the total transaction time consumption T ALL determining the number of transactions confirmed per second by the blockchain system; According to the total transaction quantity n conf And the transaction holding quantity n send Determine the transaction success rate; determining a test result according to the average time consumption, the maximum time consumption, the number of transactions received by each blockchain node per second, the number of transactions confirmed per second, and the transaction success rate.
7. The performance testing method for a multi-node blockchain system according to claim 6, wherein, The determination of a test result according to the average time consumption, the maximum time consumption, the number of transactions received by each blockchain node per second, the number of transactions confirmed per second, and the transaction success rate comprises: generating a visualized graph of the average time consumption, the maximum time consumption, the number of transactions received by each blockchain node per second, the number of transactions confirmed per second, and the transaction success rate to show the test result. 8.A performance testing device suitable for a multi-node blockchain system, characterized in that, The apparatus comprises: a stress unit configured to send transaction data to a first blockchain node, wherein the N blockchain nodes in the blockchain network have an arrangement order, and the first blockchain node is the blockchain node with the first arrangement order; a receiving unit configured to receive transaction feedback returned by an Nth blockchain node, wherein the transaction data is executed in each blockchain node in the arrangement order. An acquisition unit is configured to acquire test data in a process from "sending the transaction data to a first blockchain node" to "receiving transaction feedback returned by an Nth blockchain node"; An analysis unit is configured to obtain a test result according to the test data; A control unit is connected to the sending unit, the receiving unit and the analysis unit, and is configured to control operation of the sending unit, the receiving unit and the analysis unit. 9.The performance testing device for a multi-node blockchain system of claim 8, wherein, The device further comprises: A generation unit is configured to generate transaction data according to to-be-tested data.
10. An electronic device, comprising: The electronic device comprises: A processor; A memory for storing executable instructions of the processor; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the performance test method for the multi-node blockchain system according to any one of claims 1-7.
Citation Information
Patent Citations
Block chain performance test method and device
CN113821426A
Distributed pressure test system and method for block chain network
CN114201403A