WO2021259149A1 - Pressure testing method, apparatus and system for blockchain network - Google Patents

Pressure testing method, apparatus and system for blockchain network Download PDF

Info

Publication number
WO2021259149A1
WO2021259149A1 PCT/CN2021/100779 CN2021100779W WO2021259149A1 WO 2021259149 A1 WO2021259149 A1 WO 2021259149A1 CN 2021100779 W CN2021100779 W CN 2021100779W WO 2021259149 A1 WO2021259149 A1 WO 2021259149A1
Authority
WO
WIPO (PCT)
Prior art keywords
blockchain
transaction
request
stress test
processing request
Prior art date
Application number
PCT/CN2021/100779
Other languages
French (fr)
Chinese (zh)
Inventor
王吉元
程双杰
郑艺林
刘勇
Original Assignee
支付宝(杭州)信息技术有限公司
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 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021259149A1 publication Critical patent/WO2021259149A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • One or more embodiments of the present disclosure relate to the field of blockchain technology, and in particular to a method, device, and system for stress testing of a blockchain network.
  • Blockchain technology also known as distributed ledger technology
  • distributed ledger technology is a de-neutralized distributed database technology. It has the characteristics of decentralization, openness and transparency, non-tampering, trustworthiness, etc., and is suitable for many In application scenarios that have high requirements for data reliability.
  • various performance indicators such as the load capacity of the blockchain network and the upper limit of data throughput can be obtained, so as to maintain the normal operation of the blockchain network, or carry out the performance of the blockchain network. optimization.
  • one or more embodiments of the present disclosure provide a method, device, and system for stress testing of a blockchain network.
  • a stress testing system for a blockchain network including: a blockchain client, in response to a processing request from a business system, creates a system corresponding to the processing The requested blockchain transaction; in the case that the processing request is a stress test request, generate a stress test record for the blockchain transaction corresponding to the stress test request; and, based on the stress test record and obtained If the information of the blockchain transaction corresponding to the transaction receipt determines that the processing request corresponding to the transaction receipt is a stress test request, add a feature identifier to the transaction receipt; the blockchain network receives and executes the blockchain The blockchain transaction submitted by the client, and a transaction receipt corresponding to the blockchain transaction is generated; the business system sends the processing request to the blockchain client, and receives the return from the blockchain client The transaction receipt; in the case that the transaction receipt is determined to correspond to the stress test request according to the feature identifier, the transaction receipt is stored in the stress test database, and the processing request corresponding to the transaction receipt is
  • a stress testing system for a blockchain network including: a blockchain client, in response to a processing request from a business system, creates a system corresponding to the processing The requested blockchain transaction; in the case that the processing request is a stress test request, generate a stress test record for the blockchain transaction corresponding to the stress test request; and, based on the stress test record and obtained If the information of the blockchain transaction corresponding to the transaction receipt determines that the processing request corresponding to the transaction receipt is a stress test request, add a feature identifier to the transaction receipt; the first blockchain network receives the blockchain The first blockchain transaction submitted by the client corresponding to the stress test request executes and generates a transaction receipt corresponding to the first blockchain transaction; the second blockchain network receives the first blockchain transaction submitted by the blockchain client Two blockchain transactions, the processing request corresponding to the second blockchain transaction is a business request that is different from the stress test request; execute and generate a transaction receipt corresponding to the second blockchain transaction; the business system sends
  • a method for stress testing of a blockchain network is proposed, which is applied to a blockchain client.
  • the method includes: in response to a processing request from a business system, creating The blockchain transaction corresponding to the processing request; in the case that the processing request is a pressure test request, generate a pressure test record for the blockchain transaction corresponding to the pressure test request; and obtain a pressure test record according to the pressure test record
  • the block chain transaction information corresponding to the received transaction receipt determines whether the processing request corresponding to the transaction receipt is a stress test request.
  • a pressure test device for a blockchain network which is applied to a blockchain client.
  • the device includes: a transaction creation unit, which responds to a request from a business system Processing a request, creating a blockchain transaction corresponding to the processing request; a relationship recording unit, in a case where the processing request is a stress testing request, generating a stress testing record for the blockchain transaction corresponding to the stress testing request; The type determining unit determines whether the processing request corresponding to the transaction receipt is a stress test request according to the pressure test record and the acquired transaction receipt information corresponding to the blockchain transaction.
  • an electronic device including: a processor; and a memory for storing executable instructions of the processor.
  • the processor executes the executable instruction to implement the method described in any of the foregoing embodiments.
  • a computer-readable storage medium on which computer instructions are stored.
  • the instructions are executed by a processor, the method described in any of the above-mentioned embodiments is implemented. step.
  • Fig. 1 is a schematic diagram of a network architecture provided by an exemplary embodiment.
  • Fig. 2 is a flowchart of a method for stress testing of a blockchain network provided by an exemplary embodiment.
  • Fig. 3 is a schematic diagram of a pressure test system for a blockchain network provided by an exemplary embodiment.
  • Fig. 4 is a schematic diagram of another block chain network stress testing system provided by an exemplary embodiment.
  • Fig. 5 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • Fig. 6 is a block diagram of a pressure test device for a blockchain network provided by an exemplary embodiment.
  • the steps of the corresponding method may not be executed in the order shown and described in the present disclosure.
  • the method may include more or fewer steps than described in this disclosure.
  • a single step described in this disclosure may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this disclosure may also be combined into a single step in other embodiments. describe.
  • Fig. 1 is a schematic diagram of a network architecture provided by an exemplary embodiment.
  • the business system 11 After the business system 11 generates a processing request, it sends the processing request to the blockchain client 12, and the blockchain client 12 creates a blockchain transaction for the processing request, and performs the blockchain transaction Submit to the blockchain network 13 so that the blockchain nodes on the blockchain network 13 execute the blockchain transaction.
  • the business system 11 can generate a processing request of the stress test request type, and the blockchain client 12 can create a corresponding zone for these stress test requests.
  • Blockchain transactions, and the blockchain network 13 executes these blockchain transactions; and, the blockchain client 12 feeds back the transaction receipt generated by the blockchain network 13 to the business system 11
  • the business system 11 analyzes the transaction receipt, it determines the pressure test result of the blockchain network 13.
  • the interaction process between the business system 11, the blockchain client 12, and the blockchain network 13 is similar to the aforementioned stress testing process: the business system 11 generates a processing request of the business request type, and the blockchain The client 12 creates corresponding blockchain transactions for these business requests, and the blockchain network 13 executes these blockchain transactions; and the blockchain client 12 executes the blockchain transactions on the blockchain network 13 The transaction receipt is fed back to the business system 11.
  • the service system 11 can add a stress test label to the service request to distinguish it from the service request; of course, it can also add a service label to the service request to distinguish it from the stress test. ask.
  • the blockchain client 12 creates a blockchain transaction, due to the need to comply with the existing transaction format and other relevant regulations, it cannot distinguish between the blockchain transactions corresponding to different processing requests, that is, the above-mentioned stress test cannot be distinguished.
  • Feature tags such as tags or business tags are brought into the blockchain network 13, causing the transaction receipt generated by the blockchain network 13 to also fail to carry the aforementioned feature tags, so that the business system 11 cannot effectively distinguish the source of the transaction receipt, and cannot be based on this. Accurately know the pressure test results of the blockchain network 13.
  • Fig. 2 is a flowchart of a method for stress testing of a blockchain network provided by an exemplary embodiment. As shown in Fig. 2, the method is applied to a blockchain client. The method includes: step 202, in response to a processing request from a business system, creating a blockchain transaction corresponding to the processing request.
  • the blockchain client is used to cooperate with the business system and the blockchain network to realize the data interaction between the business system and the blockchain network.
  • the blockchain client can include any electronic device that can realize data interaction, such as a blockchain gateway; of course, the present disclosure does not limit this.
  • the blockchain client receives the processing request initiated by the business system, creates a blockchain transaction corresponding to the processing request, and then submits the blockchain transaction to the block
  • the blockchain network enables all blockchain nodes in the blockchain network to perform operations such as consensus, execution, and chaining on the blockchain transaction; and, in the process of transmitting data from the blockchain network to the business system, the blockchain The client obtains the transaction receipt (receipt) generated by the blockchain network by executing the above-mentioned blockchain transaction, and feeds the transaction receipt to the business system.
  • the blockchain client can create a blockchain transaction corresponding to the above processing request for the target blockchain network in the production state, and the blockchain transaction is sent to the target blockchain network.
  • the blockchain client 32 interacts with the blockchain network 33, which is the aforementioned target blockchain network deployed in the production environment and in the production state.
  • the blockchain network 33 is the aforementioned target blockchain network deployed in the production environment and in the production state.
  • a stress test can be performed on the blockchain network 33 in a production state, without the need to deploy a blockchain network dedicated for stress testing based on additional resources.
  • the blockchain client 32 can create a blockchain transaction corresponding to the above processing request for the blockchain network 33, and send the blockchain transaction to the
  • the blockchain network 33 for example, the blockchain client 32 can send a blockchain transaction to a certain blockchain node 33n in the blockchain network 33, and the blockchain node 33n can further the blockchain
  • the transaction is transmitted to other blockchain nodes in the blockchain network 33, so that all blockchain nodes can perform consensus, execution, and chain operations on the blockchain transaction, and generate corresponding transaction receipts.
  • a corresponding peer-to-peer blockchain network in order to avoid mutual interference between stress testing and production services, can be deployed for the target blockchain network in the production state, so that the target blockchain network is used to realize the production service , Peer-to-peer blockchain network is used to achieve stress testing.
  • the blockchain client can create the first blockchain transaction corresponding to the processing request (ie, the stress test request) for the above-mentioned peer-to-peer blockchain network when the processing request is a stress test request, and Send the first blockchain transaction to the peer-to-peer blockchain network, and in the case that the processing request is a business request different from the above-mentioned stress test request, create a processing request corresponding to the target blockchain network (that is, the business Request) the second blockchain transaction, and send the second blockchain transaction to the target blockchain network.
  • the processing request ie, the stress test request
  • the target blockchain network that is, the business Request
  • the peer-to-peer blockchain network and the target blockchain network can have the same network structure and network configuration (including hardware and software configuration), so that the stress test implemented on the peer-to-peer blockchain network can reflect the target area The true state of the blockchain network.
  • the peer-to-peer blockchain network and the target blockchain network there may be a certain difference between the peer-to-peer blockchain network and the target blockchain network. This difference may be caused by various factors, but the stress test implemented on the peer-to-peer blockchain network can still be To a certain extent, feedback the true status of the target blockchain network.
  • the blockchain client 42 can interact with the blockchain network 43 and the blockchain network 44 respectively, where the blockchain network 43 is the above-mentioned target block deployed in the production environment and in the production state.
  • the blockchain network 44 is a corresponding peer-to-peer blockchain network.
  • the blockchain client 42 After receiving the processing request initiated by the business system 41, the blockchain client 42 needs to identify the type of the processing request to determine whether the processing request is a business request or a stress test request.
  • the blockchain client 42 creates a blockchain transaction corresponding to the business request for the above-mentioned blockchain network 43, and sends the blockchain transaction to the blockchain network 43
  • the blockchain client 42 can send the blockchain transaction to a certain blockchain node 43n in the blockchain network 43, and the blockchain node 43n can further transfer the blockchain transaction to the block
  • Other blockchain nodes in the chain network 43 enable all blockchain nodes to perform operations such as consensus, execution, and chaining for the blockchain transaction, and generate corresponding transaction receipts.
  • the blockchain client 42 creates a blockchain transaction corresponding to the stress test request for the aforementioned blockchain network 44, and sends the blockchain transaction to the blockchain
  • the network 44 for example, the blockchain client 42 can send the blockchain transaction to a certain blockchain node 44n in the blockchain network 44, and the blockchain node 44n can further transfer the blockchain transaction to Other blockchain nodes in the blockchain network 44 enable all blockchain nodes to perform consensus, execution, and chain operations on the blockchain transaction, and generate corresponding transaction receipts.
  • Step 204 When the processing request is a stress test request, generate a stress test record for the blockchain transaction corresponding to the stress test request.
  • the processing request can be a business request or a stress test request.
  • the business system can add a business tag to the business request, so that the blockchain client can recognize a processing request containing the business tag as a business request, and a processing request that does not contain a business tag as a stress test request.
  • the business system can add a stress test label to the stress test request, so that the blockchain client can recognize a processing request containing a stress test label as a stress test request, and a processing request that does not include a stress test request as a business request .
  • the business system can add a business tag to the business request and a pressure test tag to the pressure test request at the same time, so that the blockchain client can recognize the processing request containing the business tag as a business request, and process the processing that contains the pressure test label.
  • the request is identified as a stress test request.
  • the business system can also mark the type of processing request in other ways, and the blockchain client can also use other corresponding methods to accurately identify the type of processing request, which is not limited in the present disclosure.
  • the stress test record By generating a stress test record for the blockchain transaction corresponding to the stress test request, the stress test record can be used to indicate that the corresponding blockchain transaction corresponds to the stress test request instead of corresponding to the business request.
  • a business record can also be generated for the blockchain transaction corresponding to the business request, so that the business record can be used to indicate that the corresponding blockchain transaction corresponds to the business request instead of the stress test request.
  • the pressure test record can have a variety of characterization forms.
  • the stress test record may be the mapping relationship between the information of the stress test request and the information of the blockchain transaction.
  • the information of the stress test request may be the request ID of the stress test request
  • the information of the blockchain transaction may be the This disclosure does not limit the transaction hash or transaction serial number of blockchain transactions.
  • the stress test record may be a block chain transaction list, and the block chain transaction list is dedicated to recording the block chain transaction corresponding to the stress test request.
  • Step 206 Determine whether the processing request corresponding to the transaction receipt is a stress test request according to the pressure test record and the acquired transaction receipt information corresponding to the blockchain transaction.
  • Blockchains are generally divided into three types: Public Blockchain, Private Blockchain and Consortium Blockchain.
  • the public chain is represented by Bitcoin and Ethereum. Participants who join the public chain can read the data records on the chain, participate in transactions, and compete for the accounting rights of new blocks. Moreover, each participant (ie, node) can freely join and exit the network, and perform related operations.
  • the private chain is the opposite.
  • the write permission of the network is controlled by an organization or institution, and the data read permission is regulated by the organization.
  • the private chain can be a weakly centralized system with strict restrictions and few participating nodes.
  • the consortium chain is a block chain between the public chain and the private chain, which can realize "partial decentralization".
  • Each node in the alliance chain usually has a corresponding entity or organization; participants are authorized to join the network and form a stakeholder alliance to jointly maintain the operation of the blockchain.
  • a blockchain client When a blockchain client generates a blockchain transaction, it can process it in the same way as in related technologies, without the need to implement special processing different from related technologies, so that there is no need to implement any hardware architecture or software functional improvements for the blockchain network Therefore, whether it is the above-mentioned public chain, private chain or consortium chain, it can be applied to the technical solution of the present disclosure.
  • the blockchain client can determine the corresponding blockchain transaction based on the transaction receipt, and then combine the above Pressure test records are used to accurately identify whether the transaction receipt or blockchain transaction corresponds to a pressure test request or a business request.
  • the blockchain client can determine the corresponding blockchain transaction after receiving the transaction receipt.
  • the query is based on the transaction hash of the blockchain transaction and the above-mentioned mapping relationship: if a matching mapping relationship is queried, it can be determined that the received transaction receipt corresponds to the stress test request.
  • the corresponding request ID can also be determined based on the matching mapping relationship, and the corresponding processing request can be obtained based on the request ID, and then the processing request can be further determined by reading whether the processing request contains a stress test request or a business request Whether it is really a pressure test request.
  • the block chain client can determine the corresponding block chain transaction after receiving the transaction receipt, and query the above based on the transaction hash of the block chain transaction Block chain transaction list, so that when the transaction hash of the block chain transaction is queried, it is confirmed that the block chain transaction or its transaction receipt corresponds to the stress test request.
  • the blockchain client can establish a connection with a certain blockchain node in the target blockchain network to submit a blockchain transaction to the blockchain node.
  • the blockchain node can be as shown in Figure 3.
  • the illustrated blockchain node 33n may also be the blockchain node 43n or the blockchain node 44n as shown in FIG. 4.
  • the connection established between the block chain client 32 and the block chain node 33n may be a long connection, so that the block chain node 33n executes the above-mentioned block chain transaction and generates a corresponding transaction receipt After that, the corresponding transaction receipt generation event can be generated, and the blockchain client 32 can learn that the transaction receipt has been generated by monitoring the transaction receipt generation event (that is, the event monitoring mechanism), and obtain the transaction receipt based on the aforementioned long connection; of course; , It is also possible for the blockchain node 33n to monitor the transaction receipt generation event through the aforementioned event monitoring mechanism, and feed the transaction receipt to the blockchain client 32 through the aforementioned long connection, so that the blockchain client 32 obtains Transaction receipt.
  • the transaction receipt generation event that is, the event monitoring mechanism
  • the blockchain client 32 needs to initiate an additional query transaction to query the above The transaction receipt corresponding to the blockchain transaction.
  • the query transaction can be a regular blockchain transaction, so that all blockchain nodes in the blockchain network 33 need to perform operations such as obtaining, consensus, execution, and chaining for the query transaction, while the blockchain client
  • the terminal 32 can establish a long connection with a certain blockchain node through the above-mentioned method, and obtain a transaction receipt from the blockchain node based on the above-mentioned event monitoring mechanism; or, the query transaction can be a special transaction, such as a blockchain client
  • the end 32 can only establish a long connection with the blockchain node 33n and send the query transaction, then the query transaction will only be acquired and executed by the blockchain node 33n.
  • the query transaction does not need to participate in consensus and does not need to be chained, or even be Other blockchain nodes obtain it, and then the blockchain client 32
  • the blockchain client can take differentiated processing for the transaction receipt. For example, in the case that the processing request corresponding to the transaction receipt is a stress test request, the blockchain client can add a feature identifier to the transaction receipt and feed it back to the business system, and in the case that the processing request corresponding to the transaction receipt is a business request , The blockchain client can directly feed back the transaction receipt to the business system; accordingly, the business system can determine whether the corresponding transaction receipt corresponds to the stress test request based on the feature identifier, thereby storing the transaction receipt in a different database. For example, as shown in FIG.
  • the blockchain client 32 determines that the transaction receipt corresponds to the stress test request, it generates a stress test response based on the transaction receipt, and the stress test response may include the transaction receipt and the above-mentioned feature identifier, and When the blockchain client 32 determines that the transaction receipt corresponds to the business request, it generates a business response based on the transaction receipt.
  • the business response may only include the transaction receipt without the feature identifier; accordingly, the business system 31 receives After the stress test response or business response returned by the blockchain client 32, the stress test response can be stored in the stress test database, the business response can be stored in the business database, and the transaction receipt corresponding to the stress test request can be subsequently obtained from the stress test database.
  • the blockchain client 42 determines that the transaction receipt corresponds to the stress test request, it generates a stress test response based on the transaction receipt, and the stress test response may include the transaction receipt and the above-mentioned feature identifier. And when the blockchain client 42 determines that the transaction receipt corresponds to the business request, it generates a business response based on the transaction receipt.
  • the business response may only include the transaction receipt without the feature identifier; accordingly, the business system 41 is receiving
  • the stress test response can be stored in the stress test database
  • the business response can be stored in the business database
  • the transaction corresponding to the stress test request can be subsequently obtained from the stress test database. Receipt to analyze and determine the pressure test results for the blockchain network 44.
  • Fig. 5 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 5.
  • the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510.
  • the processor 502 reads the corresponding computer program from the non-volatile memory 510 to the memory 508 and then runs it to form a stress test device for the blockchain network on a logical level.
  • one or more embodiments of the present disclosure do not exclude other implementations, such as logic devices or a combination of software and hardware, etc. That is to say, the execution body of the following processing flow is not limited to each
  • the logic unit can also be a hardware or a logic device.
  • the stress testing device of the blockchain network may include: a transaction creation unit 61, which creates a blockchain transaction corresponding to the processing request in response to a processing request from the business system;
  • the relationship recording unit 62 when the processing request is a stress test request, generates a stress test record for the blockchain transaction corresponding to the stress test request;
  • the type determination unit 63 based on the stress test record and the obtained
  • the blockchain transaction information corresponding to the transaction receipt determines whether the processing request corresponding to the transaction receipt is a stress test request.
  • the transaction creation unit 61 is specifically configured to: when the processing request is the stress test request, create a peer-to-peer blockchain network corresponding to the target blockchain network in a production state corresponding to The first blockchain transaction of the processing request, and the first blockchain transaction is sent to the peer-to-peer blockchain network; in the case where the processing request is a business request different from the stress test request , A second blockchain transaction corresponding to the processing request is created for the target blockchain network, and the second blockchain transaction is sent to the target blockchain network.
  • the peer-to-peer blockchain network and the target blockchain network have the same network structure and network configuration.
  • the transaction creation unit 61 is specifically configured to: create a blockchain transaction corresponding to the processing request for the target blockchain network in a production state, and the blockchain transaction is sent to the target Blockchain network.
  • the pressure test record includes block chain transaction information; the block chain transaction information includes: the transaction hash of the block chain transaction.
  • the processing request is a stress test request or a service request; wherein the stress test request includes a stress test label, and/or the service request includes a service label.
  • a receipt feedback unit 64 when the processing request corresponding to the transaction receipt is a stress test request, add a feature identifier to the transaction receipt and feed it back to the business system; in the transaction receipt When the corresponding processing request is a business request different from the stress test request, the transaction receipt is directly fed back to the business system.
  • a typical implementation device is a computer.
  • the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
  • the computer includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
  • processors CPU
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM).
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission media, can be used to store information that can be accessed by computing devices.
  • computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • first, second, third, etc. may be used to describe various information in one or more embodiments of the present disclosure, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
  • word “if” as used herein can be interpreted as "when” or “when” or “in response to a certainty”.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Databases & Information Systems (AREA)
  • Development Economics (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

Provided are a pressure testing method, apparatus and system for a blockchain network. The method may comprise: in response to a processing request from a service system, creating a blockchain transaction corresponding to the processing request; if the processing request is a pressure testing request, generating a pressure testing record for the blockchain transaction corresponding to the pressure testing request; and according to the pressure testing record and acquired information of a blockchain transaction corresponding to a transaction receipt, determining whether a processing request corresponding to the transaction receipt is a pressure testing request.

Description

区块链网络的压力测试方法及装置、系统Method, device and system for stress testing of blockchain network 技术领域Technical field
本公开一个或多个实施例涉及区块链技术领域,尤其涉及一种区块链网络的压力测试方法及装置、系统。One or more embodiments of the present disclosure relate to the field of blockchain technology, and in particular to a method, device, and system for stress testing of a blockchain network.
背景技术Background technique
区块链技术(也被称之为,分布式账本技术)是一种去中性化的分布式数据库技术,具有去中心化、公开透明、不可篡改、可信任等多种特点,适用于诸多对数据可靠性具有高需求的应用场景中。Blockchain technology (also known as distributed ledger technology) is a de-neutralized distributed database technology. It has the characteristics of decentralization, openness and transparency, non-tampering, trustworthiness, etc., and is suitable for many In application scenarios that have high requirements for data reliability.
通过向区块链网络导入压力测试流量,可以获知区块链网络的负载能力、数据吞吐量上限等各项性能指标,从而据此维护区块链网络的正常运行,或者针对区块链网络进行优化。By importing the pressure test traffic to the blockchain network, various performance indicators such as the load capacity of the blockchain network and the upper limit of data throughput can be obtained, so as to maintain the normal operation of the blockchain network, or carry out the performance of the blockchain network. optimization.
发明内容Summary of the invention
有鉴于此,本公开一个或多个实施例提供一种区块链网络的压力测试方法及装置、系统。In view of this, one or more embodiments of the present disclosure provide a method, device, and system for stress testing of a blockchain network.
根据本公开一个或多个实施例的第一方面,提出了一种区块链网络的压力测试系统,包括:区块链客户端,响应于来自业务系统的处理请求,创建对应于所述处理请求的区块链交易;在所述处理请求为压测请求的情况下,为所述压测请求对应的区块链交易生成压测记录;以及,在根据所述压测记录和获取到的交易回执对应的区块链交易的信息确定出所述交易回执对应的处理请求为压测请求的情况下,针对所述交易回执添加特征标识;区块链网络,接收并执行所述区块链客户端提交的区块链交易,并生成对应于所述区块链交易的交易回执;业务系统,向所述区块链客户端发送所述处理请求,并接收所述区块链客户端返回的交易回执;在根据所述特征标识确定所述交易回执对应于压测请求的情况下,将所述交易回执存储至压测数据库,在所述交易回执对应的处理请求为区别于所述压测请求的业务请求的情况下,将所述交易回执存储至业务数据库。According to the first aspect of one or more embodiments of the present disclosure, a stress testing system for a blockchain network is proposed, including: a blockchain client, in response to a processing request from a business system, creates a system corresponding to the processing The requested blockchain transaction; in the case that the processing request is a stress test request, generate a stress test record for the blockchain transaction corresponding to the stress test request; and, based on the stress test record and obtained If the information of the blockchain transaction corresponding to the transaction receipt determines that the processing request corresponding to the transaction receipt is a stress test request, add a feature identifier to the transaction receipt; the blockchain network receives and executes the blockchain The blockchain transaction submitted by the client, and a transaction receipt corresponding to the blockchain transaction is generated; the business system sends the processing request to the blockchain client, and receives the return from the blockchain client The transaction receipt; in the case that the transaction receipt is determined to correspond to the stress test request according to the feature identifier, the transaction receipt is stored in the stress test database, and the processing request corresponding to the transaction receipt is different from the stress test request In the case of the business request of the test request, the transaction receipt is stored in the business database.
根据本公开一个或多个实施例的第二方面,提出了一种区块链网络的压力测试系统,包括:区块链客户端,响应于来自业务系统的处理请求,创建对应于所述处理请求的区 块链交易;在所述处理请求为压测请求的情况下,为所述压测请求对应的区块链交易生成压测记录;以及,在根据所述压测记录和获取到的交易回执对应的区块链交易的信息确定出所述交易回执对应的处理请求为压测请求的情况下,针对所述交易回执添加特征标识;第一区块链网络,接收所述区块链客户端提交的对应于压测请求的第一区块链交易,执行并生成对应于第一区块链交易的交易回执;第二区块链网络,接收所述区块链客户端提交的第二区块链交易,第二区块链交易对应的处理请求为区别于所述压测请求的业务请求;执行并生成对应于第二区块链交易的交易回执;业务系统,向所述区块链客户端发送所述处理请求,并接收所述区块链客户端返回的交易回执;在根据所述特征标识确定所述交易回执对应于压测请求的情况下,将所述交易回执存储至压测数据库,在所述交易回执对应于业务请求的情况下,将所述交易回执存储至业务数据库。According to a second aspect of one or more embodiments of the present disclosure, a stress testing system for a blockchain network is proposed, including: a blockchain client, in response to a processing request from a business system, creates a system corresponding to the processing The requested blockchain transaction; in the case that the processing request is a stress test request, generate a stress test record for the blockchain transaction corresponding to the stress test request; and, based on the stress test record and obtained If the information of the blockchain transaction corresponding to the transaction receipt determines that the processing request corresponding to the transaction receipt is a stress test request, add a feature identifier to the transaction receipt; the first blockchain network receives the blockchain The first blockchain transaction submitted by the client corresponding to the stress test request executes and generates a transaction receipt corresponding to the first blockchain transaction; the second blockchain network receives the first blockchain transaction submitted by the blockchain client Two blockchain transactions, the processing request corresponding to the second blockchain transaction is a business request that is different from the stress test request; execute and generate a transaction receipt corresponding to the second blockchain transaction; the business system sends to the district The blockchain client sends the processing request and receives the transaction receipt returned by the blockchain client; in the case where it is determined that the transaction receipt corresponds to the stress test request according to the feature identifier, the transaction receipt is stored To the stress test database, in the case that the transaction receipt corresponds to a business request, the transaction receipt is stored in the business database.
根据本公开一个或多个实施例的第三方面,提出了一种区块链网络的压力测试方法,应用于区块链客户端,所述方法包括:响应于来自业务系统的处理请求,创建对应于所述处理请求的区块链交易;在所述处理请求为压测请求的情况下,为所述压测请求对应的区块链交易生成压测记录;根据所述压测记录和获取到的交易回执对应的区块链交易的信息,确定所述交易回执对应的处理请求是否为压测请求。According to a third aspect of one or more embodiments of the present disclosure, a method for stress testing of a blockchain network is proposed, which is applied to a blockchain client. The method includes: in response to a processing request from a business system, creating The blockchain transaction corresponding to the processing request; in the case that the processing request is a pressure test request, generate a pressure test record for the blockchain transaction corresponding to the pressure test request; and obtain a pressure test record according to the pressure test record The block chain transaction information corresponding to the received transaction receipt determines whether the processing request corresponding to the transaction receipt is a stress test request.
根据本公开一个或多个实施例的第四方面,提出了一种区块链网络的压力测试装置,应用于区块链客户端,所述装置包括:交易创建单元,响应于来自业务系统的处理请求,创建对应于所述处理请求的区块链交易;关系记录单元,在所述处理请求为压测请求的情况下,为所述压测请求对应的区块链交易生成压测记录;类型确定单元,根据所述压测记录和获取到的交易回执对应的区块链交易的信息,确定所述交易回执对应的处理请求是否为压测请求。According to a fourth aspect of one or more embodiments of the present disclosure, a pressure test device for a blockchain network is proposed, which is applied to a blockchain client. The device includes: a transaction creation unit, which responds to a request from a business system Processing a request, creating a blockchain transaction corresponding to the processing request; a relationship recording unit, in a case where the processing request is a stress testing request, generating a stress testing record for the blockchain transaction corresponding to the stress testing request; The type determining unit determines whether the processing request corresponding to the transaction receipt is a stress test request according to the pressure test record and the acquired transaction receipt information corresponding to the blockchain transaction.
根据本公开一个或多个实施例的第五方面,提出了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器。其中,所述处理器通过运行所述可执行指令以实现如上述实施例中任一所述的方法。According to a fifth aspect of one or more embodiments of the present disclosure, an electronic device is proposed, including: a processor; and a memory for storing executable instructions of the processor. Wherein, the processor executes the executable instruction to implement the method described in any of the foregoing embodiments.
根据本公开一个或多个实施例的第六方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如上述实施例中任一所述方法的步骤。According to a sixth aspect of one or more embodiments of the present disclosure, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the method described in any of the above-mentioned embodiments is implemented. step.
附图说明Description of the drawings
图1是一示例性实施例提供的一种网络架构的示意图。Fig. 1 is a schematic diagram of a network architecture provided by an exemplary embodiment.
图2是一示例性实施例提供的一种区块链网络的压力测试方法的流程图。Fig. 2 is a flowchart of a method for stress testing of a blockchain network provided by an exemplary embodiment.
图3是一示例性实施例提供的一种区块链网络的压力测试系统的示意图。Fig. 3 is a schematic diagram of a pressure test system for a blockchain network provided by an exemplary embodiment.
图4是一示例性实施例提供的另一种区块链网络的压力测试系统的示意图。Fig. 4 is a schematic diagram of another block chain network stress testing system provided by an exemplary embodiment.
图5是一示例性实施例提供的一种设备的结构示意图。Fig. 5 is a schematic structural diagram of a device provided by an exemplary embodiment.
图6是一示例性实施例提供的一种区块链网络的压力测试装置的框图。Fig. 6 is a block diagram of a pressure test device for a blockchain network provided by an exemplary embodiment.
具体实施方式detailed description
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开一个或多个实施例的一些方面相一致的装置和方法的例子。Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with one or more embodiments of the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of the present disclosure as detailed in the appended claims.
需要说明的是:在其他实施例中并不一定按照本公开示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本公开所描述的更多或更少。此外,本公开中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本公开中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。It should be noted that in other embodiments, the steps of the corresponding method may not be executed in the order shown and described in the present disclosure. In some other embodiments, the method may include more or fewer steps than described in this disclosure. In addition, a single step described in this disclosure may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this disclosure may also be combined into a single step in other embodiments. describe.
图1是一示例性实施例提供的一种网络架构的示意图。如图1所示,业务系统11产生处理请求后,将该处理请求发送至区块链客户端12,由区块链客户端12针对该处理请求创建区块链交易,并将区块链交易提交至区块链网络13,使得区块链网络13上的区块链节点执行该区块链交易。当针对区块链网络13存在压力测试(简称“压测”)需求时,业务系统11可以生成压测请求类型的处理请求,而区块链客户端12可以针对这些压测请求创建相应的区块链交易,并由区块链网络13执行这些区块链交易;以及,区块链客户端12将区块链网络13执行区块链交易而产生的交易回执反馈至业务系统11,以由业务系统11对交易回执进行分析后,确定区块链网络13的压测结果。而在生产环境下,业务系统11、区块链客户端12和区块链网络13之间的交互过程,与上述的压测过程类似:业务系统11生成业务请求类型的处理请求,区块链客户端12针对这些业务请求创建相应的区块链交易,并由区块链网络13执行这些区块链交易;以及,区块链客户端12将区块链网络13执行区块链交易而产生的交易回执反馈至业务系统11。Fig. 1 is a schematic diagram of a network architecture provided by an exemplary embodiment. As shown in Figure 1, after the business system 11 generates a processing request, it sends the processing request to the blockchain client 12, and the blockchain client 12 creates a blockchain transaction for the processing request, and performs the blockchain transaction Submit to the blockchain network 13 so that the blockchain nodes on the blockchain network 13 execute the blockchain transaction. When there is a stress test ("stress test" for short) demand for the blockchain network 13, the business system 11 can generate a processing request of the stress test request type, and the blockchain client 12 can create a corresponding zone for these stress test requests. Blockchain transactions, and the blockchain network 13 executes these blockchain transactions; and, the blockchain client 12 feeds back the transaction receipt generated by the blockchain network 13 to the business system 11 After the business system 11 analyzes the transaction receipt, it determines the pressure test result of the blockchain network 13. In a production environment, the interaction process between the business system 11, the blockchain client 12, and the blockchain network 13 is similar to the aforementioned stress testing process: the business system 11 generates a processing request of the business request type, and the blockchain The client 12 creates corresponding blockchain transactions for these business requests, and the blockchain network 13 executes these blockchain transactions; and the blockchain client 12 executes the blockchain transactions on the blockchain network 13 The transaction receipt is fed back to the business system 11.
在全链路压测场景下,涉及到生产环境中的压力测试。为了避免上述的压测请求与业务请求之间产生相互干扰,业务系统11可以在业务请求中添加压测标签以区分于业务请求;当然,也可以在业务请求中添加业务标签以区分于压测请求。但是,区块链客户端12在创建区块链交易时,由于需要遵守现有的交易格式等相关规定,因而无法针对不同处理请求对应的区块链交易予以区分,即无法将上述的压测标签或业务标签等特征标签带入到区块链网络13中,造成区块链网络13产生的交易回执同样无法携带上述的特征标签,使得业务系统11无法有效区分交易回执的来源,无法据此准确获知区块链网络13的压测结果。In the full-link stress test scenario, it involves stress test in the production environment. In order to avoid the mutual interference between the aforementioned stress test request and the service request, the service system 11 can add a stress test label to the service request to distinguish it from the service request; of course, it can also add a service label to the service request to distinguish it from the stress test. ask. However, when the blockchain client 12 creates a blockchain transaction, due to the need to comply with the existing transaction format and other relevant regulations, it cannot distinguish between the blockchain transactions corresponding to different processing requests, that is, the above-mentioned stress test cannot be distinguished. Feature tags such as tags or business tags are brought into the blockchain network 13, causing the transaction receipt generated by the blockchain network 13 to also fail to carry the aforementioned feature tags, so that the business system 11 cannot effectively distinguish the source of the transaction receipt, and cannot be based on this. Accurately know the pressure test results of the blockchain network 13.
下面结合实施例对本公开的压力测试方案进行描述。The stress test scheme of the present disclosure will be described below in conjunction with examples.
图2是一示例性实施例提供的一种区块链网络的压力测试方法的流程图。如图2所示,该方法应用于区块链客户端,所述方法包括:步骤202,响应于来自业务系统的处理请求,创建对应于所述处理请求的区块链交易。Fig. 2 is a flowchart of a method for stress testing of a blockchain network provided by an exemplary embodiment. As shown in Fig. 2, the method is applied to a blockchain client. The method includes: step 202, in response to a processing request from a business system, creating a blockchain transaction corresponding to the processing request.
区块链客户端用于配合业务系统与区块链网络,以实现业务系统与区块链网络之间的数据交互。区块链客户端可以包括任意能够实现数据交互的电子设备,比如为区块链网关;当然,本公开并不对此进行限制。在业务系统向区块链网络传递数据的过程中,区块链客户端接收业务系统发起的处理请求,并创建对应于处理请求的区块链交易,然后将该区块链交易提交至区块链网络,使得区块链网络中的所有区块链节点对该区块链交易进行共识、执行、上链等操作;以及,在区块链网络向业务系统传递数据的过程中,区块链客户端获取区块链网络通过执行上述区块链交易所产生的交易回执(receipt),并将该交易回执反馈至业务系统。The blockchain client is used to cooperate with the business system and the blockchain network to realize the data interaction between the business system and the blockchain network. The blockchain client can include any electronic device that can realize data interaction, such as a blockchain gateway; of course, the present disclosure does not limit this. In the process of transferring data from the business system to the blockchain network, the blockchain client receives the processing request initiated by the business system, creates a blockchain transaction corresponding to the processing request, and then submits the blockchain transaction to the block The blockchain network enables all blockchain nodes in the blockchain network to perform operations such as consensus, execution, and chaining on the blockchain transaction; and, in the process of transmitting data from the blockchain network to the business system, the blockchain The client obtains the transaction receipt (receipt) generated by the blockchain network by executing the above-mentioned blockchain transaction, and feeds the transaction receipt to the business system.
区块链网络可能存在多种结构,这使得区块链客户端在创建区块链交易、与区块链网络实现数据交互等操作可能由于区块链网络的结构差异而存在一定不同。There may be multiple structures in the blockchain network. This makes the operations of the blockchain client to create blockchain transactions and realize data interaction with the blockchain network may be different due to the structural differences of the blockchain network.
在一实施例中,区块链客户端可以针对处于生产状态的目标区块链网络创建对应于上述处理请求的区块链交易,且该区块链交易被发送至该目标区块链网络。例如图3所示,区块链客户端32与区块链网络33进行交互,该区块链网络33为上述的部署于生产环境、处于生产状态的目标区块链网络。本实施例中仅涉及上述的区块链网络33,可以针对该处于生产状态的区块链网络33实施压力测试,而不需要基于额外资源来部署专用于压力测试的区块链网络。因此,区块链客户端32在收到业务系统31发起的处理请求后,可以针对该区块链网络33创建对应于上述处理请求的区块链交易,并将该区块链交易发送至该区块链网络33,比如区块链客户端32可以将区块链交易发送至区块 链网络33中的某一区块链节点33n,而该区块链节点33n可以进一步将该区块链交易传递至区块链网络33中的其他区块链节点,使得所有区块链节点可以针对该区块链交易进行共识、执行、上链等操作,并生成相应的交易回执。In an embodiment, the blockchain client can create a blockchain transaction corresponding to the above processing request for the target blockchain network in the production state, and the blockchain transaction is sent to the target blockchain network. For example, as shown in FIG. 3, the blockchain client 32 interacts with the blockchain network 33, which is the aforementioned target blockchain network deployed in the production environment and in the production state. In this embodiment, only the aforementioned blockchain network 33 is involved, and a stress test can be performed on the blockchain network 33 in a production state, without the need to deploy a blockchain network dedicated for stress testing based on additional resources. Therefore, after receiving the processing request initiated by the business system 31, the blockchain client 32 can create a blockchain transaction corresponding to the above processing request for the blockchain network 33, and send the blockchain transaction to the The blockchain network 33, for example, the blockchain client 32 can send a blockchain transaction to a certain blockchain node 33n in the blockchain network 33, and the blockchain node 33n can further the blockchain The transaction is transmitted to other blockchain nodes in the blockchain network 33, so that all blockchain nodes can perform consensus, execution, and chain operations on the blockchain transaction, and generate corresponding transaction receipts.
在一实施例中,为了避免压力测试与生产业务之间相互干扰,可以针对处于生产状态的目标区块链网络部署对应的对等区块链网络,使得目标区块链网络用于实现生产业务、对等区块链网络用于实现压力测试。相应地,区块链客户端可以在处理请求为压测请求的情况下,针对上述的对等区块链网络创建对应于该处理请求(即压测请求)的第一区块链交易,并将该第一区块链交易发送至对等区块链网络,以及在处理请求为区别于上述压测请求的业务请求的情况下,针对目标区块链网络创建对应于该处理请求(即业务请求)的第二区块链交易,并将该第二区块链交易发送至目标区块链网络。其中,对等区块链网络与目标区块链网络可以具有相同的网络结构和网络配置(包括硬件和软件配置),使得针对该对等区块链网络所实施的压力测试能够体现出目标区块链网络的真实状况。当然,对等区块链网络可以与目标区块链网络之间存在一定差异,这种差异可能由于各种因素所导致,但针对该对等区块链网络所实施的压力测试,仍然能够在一定程度上反馈出目标区块链网络的真实状况。例如图4所示,区块链客户端42可以分别与区块链网络43和区块链网络44进行交互,其中区块链网络43为上述的部署于生产环境、处于生产状态的目标区块链网络,而区块链网络44为相应的对等区块链网络。区块链客户端42在收到业务系统41发起的处理请求后,需要对该处理请求的类型予以识别,以确定该处理请求为业务请求还是压测请求。如果收到的处理请求为业务请求,区块链客户端42针对上述的区块链网络43创建对应于该业务请求的区块链交易,并将该区块链交易发送至区块链网络43,比如区块链客户端42可以将区块链交易发送至区块链网络43中的某一区块链节点43n,而该区块链节点43n可以进一步将该区块链交易传递至区块链网络43中的其他区块链节点,使得所有区块链节点可以针对该区块链交易进行共识、执行、上链等操作,并生成相应的交易回执。如果收到的处理请求为压测请求,区块链客户端42针对上述的区块链网络44创建对应于该压测请求的区块链交易,并将该区块链交易发送至区块链网络44,比如区块链客户端42可以将区块链交易发送至区块链网络44中的某一区块链节点44n,而该区块链节点44n可以进一步将该区块链交易传递至区块链网络44中的其他区块链节点,使得所有区块链节点可以针对该区块链交易进行共识、执行、上链等操作,并生成相应的交易回执。In one embodiment, in order to avoid mutual interference between stress testing and production services, a corresponding peer-to-peer blockchain network can be deployed for the target blockchain network in the production state, so that the target blockchain network is used to realize the production service , Peer-to-peer blockchain network is used to achieve stress testing. Correspondingly, the blockchain client can create the first blockchain transaction corresponding to the processing request (ie, the stress test request) for the above-mentioned peer-to-peer blockchain network when the processing request is a stress test request, and Send the first blockchain transaction to the peer-to-peer blockchain network, and in the case that the processing request is a business request different from the above-mentioned stress test request, create a processing request corresponding to the target blockchain network (that is, the business Request) the second blockchain transaction, and send the second blockchain transaction to the target blockchain network. Among them, the peer-to-peer blockchain network and the target blockchain network can have the same network structure and network configuration (including hardware and software configuration), so that the stress test implemented on the peer-to-peer blockchain network can reflect the target area The true state of the blockchain network. Of course, there may be a certain difference between the peer-to-peer blockchain network and the target blockchain network. This difference may be caused by various factors, but the stress test implemented on the peer-to-peer blockchain network can still be To a certain extent, feedback the true status of the target blockchain network. For example, as shown in Figure 4, the blockchain client 42 can interact with the blockchain network 43 and the blockchain network 44 respectively, where the blockchain network 43 is the above-mentioned target block deployed in the production environment and in the production state. Chain network, and the blockchain network 44 is a corresponding peer-to-peer blockchain network. After receiving the processing request initiated by the business system 41, the blockchain client 42 needs to identify the type of the processing request to determine whether the processing request is a business request or a stress test request. If the received processing request is a business request, the blockchain client 42 creates a blockchain transaction corresponding to the business request for the above-mentioned blockchain network 43, and sends the blockchain transaction to the blockchain network 43 For example, the blockchain client 42 can send the blockchain transaction to a certain blockchain node 43n in the blockchain network 43, and the blockchain node 43n can further transfer the blockchain transaction to the block Other blockchain nodes in the chain network 43 enable all blockchain nodes to perform operations such as consensus, execution, and chaining for the blockchain transaction, and generate corresponding transaction receipts. If the received processing request is a stress test request, the blockchain client 42 creates a blockchain transaction corresponding to the stress test request for the aforementioned blockchain network 44, and sends the blockchain transaction to the blockchain The network 44, for example, the blockchain client 42 can send the blockchain transaction to a certain blockchain node 44n in the blockchain network 44, and the blockchain node 44n can further transfer the blockchain transaction to Other blockchain nodes in the blockchain network 44 enable all blockchain nodes to perform consensus, execution, and chain operations on the blockchain transaction, and generate corresponding transaction receipts.
步骤204,在所述处理请求为压测请求的情况下,为所述压测请求对应的区块链交易生成压测记录。Step 204: When the processing request is a stress test request, generate a stress test record for the blockchain transaction corresponding to the stress test request.
如前所述,处理请求可以为业务请求或压测请求。业务系统可以在业务请求中添加业务标签,使得区块链客户端可以将包含业务标签的处理请求识别为业务请求,而将未包含业务标签的处理请求识别为压测请求。或者,业务系统可以在压测请求中添加压测标签,使得区块链客户端可以将包含压测标签的处理请求识别为压测请求,而将未包含压测请求的处理请求识别为业务请求。或者,业务系统可以同时在业务请求中添加业务标签、在压测请求中添加压测标签,使得区块链客户端可以将包含业务标签的处理请求识别为业务请求、将包含压测标签的处理请求识别为压测请求。当然,业务系统还可以通过其他方式对处理请求的类型进行标记,而区块链客户端也可以采用相应的其他方式对处理请求的类型进行准确识别,本公开并不对此进行限制。As mentioned earlier, the processing request can be a business request or a stress test request. The business system can add a business tag to the business request, so that the blockchain client can recognize a processing request containing the business tag as a business request, and a processing request that does not contain a business tag as a stress test request. Alternatively, the business system can add a stress test label to the stress test request, so that the blockchain client can recognize a processing request containing a stress test label as a stress test request, and a processing request that does not include a stress test request as a business request . Or, the business system can add a business tag to the business request and a pressure test tag to the pressure test request at the same time, so that the blockchain client can recognize the processing request containing the business tag as a business request, and process the processing that contains the pressure test label. The request is identified as a stress test request. Of course, the business system can also mark the type of processing request in other ways, and the blockchain client can also use other corresponding methods to accurately identify the type of processing request, which is not limited in the present disclosure.
通过为压测请求对应的区块链交易生成压测记录,使得该压测记录可以用于表明相应的区块链交易对应于压测请求、而非对应于业务请求。类似地,也可以为业务请求对应的区块链交易生成业务记录,使得该业务记录可以用于表明相应的区块链交易对应于业务请求、而非对应于压测请求。By generating a stress test record for the blockchain transaction corresponding to the stress test request, the stress test record can be used to indicate that the corresponding blockchain transaction corresponds to the stress test request instead of corresponding to the business request. Similarly, a business record can also be generated for the blockchain transaction corresponding to the business request, so that the business record can be used to indicate that the corresponding blockchain transaction corresponds to the business request instead of the stress test request.
以压测记录为例。压测记录可以存在多种表征形式。例如,压测记录可以为压测请求的信息与区块链交易的信息之间的映射关系,比如压测请求的信息可以为该压测请求的请求ID、区块链交易的信息可以为该区块链交易的交易哈希或交易流水号等,本公开并不对此进行限制。再例如,压测记录可以为区块链交易列表,该区块链交易列表专用于记录压测请求对应的区块链交易。Take the pressure measurement record as an example. The pressure test record can have a variety of characterization forms. For example, the stress test record may be the mapping relationship between the information of the stress test request and the information of the blockchain transaction. For example, the information of the stress test request may be the request ID of the stress test request, and the information of the blockchain transaction may be the This disclosure does not limit the transaction hash or transaction serial number of blockchain transactions. For another example, the stress test record may be a block chain transaction list, and the block chain transaction list is dedicated to recording the block chain transaction corresponding to the stress test request.
步骤206,根据所述压测记录和获取到的交易回执对应的区块链交易的信息,确定所述交易回执对应的处理请求是否为压测请求。Step 206: Determine whether the processing request corresponding to the transaction receipt is a stress test request according to the pressure test record and the acquired transaction receipt information corresponding to the blockchain transaction.
区块链一般被划分为三种类型:公有链(Public Blockchain),私有链(Private Blockchain)和联盟链(Consortium Blockchain)。此外,还有多种类型的结合,比如私有链+联盟链、联盟链+公有链等不同组合形式。其中去中心化程度最高的是公有链。公有链以比特币、以太坊为代表,加入公有链的参与者可以读取链上的数据记录、参与交易以及竞争新区块的记账权等。而且,各参与者(即节点)可自由加入以及退出网络,并进行相关操作。私有链则相反,该网络的写入权限由某个组织或者机构控制,数据读取权限受组织规定。简单来说,私有链可以为一个弱中心化系统,参与节点具有严格限制且少。这种类型的区块链更适合于特定机构内部使用。联盟链则是介于公有链以及私有链之间的区块链,可实现“部分去中心化”。联盟链中各个节点通常有与之相对应的实体机构或者组织;参与者通过授权加入网络并组成利益相关联盟,共同维护区块链运 行。区块链客户端在生成区块链交易时,可以按照相关技术中的方式进行处理,无需实施区别于相关技术的特殊处理,使得无需针对区块链网络实施任何硬件架构或软件功能方面的改进,因而无论是上述的公有链、私有链或联盟链,均可以适用于本公开的技术方案。Blockchains are generally divided into three types: Public Blockchain, Private Blockchain and Consortium Blockchain. In addition, there are many types of combinations, such as private chain + alliance chain, alliance chain + public chain and other different combinations. Among them, the most decentralized one is the public chain. The public chain is represented by Bitcoin and Ethereum. Participants who join the public chain can read the data records on the chain, participate in transactions, and compete for the accounting rights of new blocks. Moreover, each participant (ie, node) can freely join and exit the network, and perform related operations. The private chain is the opposite. The write permission of the network is controlled by an organization or institution, and the data read permission is regulated by the organization. In simple terms, the private chain can be a weakly centralized system with strict restrictions and few participating nodes. This type of blockchain is more suitable for internal use by specific institutions. The consortium chain is a block chain between the public chain and the private chain, which can realize "partial decentralization". Each node in the alliance chain usually has a corresponding entity or organization; participants are authorized to join the network and form a stakeholder alliance to jointly maintain the operation of the blockchain. When a blockchain client generates a blockchain transaction, it can process it in the same way as in related technologies, without the need to implement special processing different from related technologies, so that there is no need to implement any hardware architecture or software functional improvements for the blockchain network Therefore, whether it is the above-mentioned public chain, private chain or consortium chain, it can be applied to the technical solution of the present disclosure.
虽然区块链交易和交易回执中均未携带类似于上文所述的压测标签或业务标签,但是区块链客户端可以根据交易回执确定其对应的区块链交易,并进而结合上述的压测记录,从而准确识别出该交易回执或区块链交易对应于压测请求还是业务请求。Although neither the blockchain transaction nor the transaction receipt carries a pressure test label or a business label similar to the above, the blockchain client can determine the corresponding blockchain transaction based on the transaction receipt, and then combine the above Pressure test records are used to accurately identify whether the transaction receipt or blockchain transaction corresponds to a pressure test request or a business request.
例如,当压测记录为压测请求的请求ID与区块链交易的交易哈希之间的映射关系时,区块链客户端在收到交易回执后可以确定出相应的区块链交易,并基于该区块链交易的交易哈希和上述的映射关系进行查询:如果查询到某一相匹配的映射关系,即可确定收到的交易回执对应于压测请求。当然,还可以基于相匹配的映射关系确定相应的请求ID,并基于该请求ID获取相应的处理请求,进而通过读取该处理请求中是否包含压测请求或业务请求,从而进一步确定该处理请求是否确实为压测请求。再例如,当压测记录为区块链交易列表时,区块链客户端在收到交易回执后可以确定出相应的区块链交易,并基于该区块链交易的交易哈希查询上述的区块链交易列表,从而在查询到该区块链交易的交易哈希的情况下,确认该区块链交易或其交易回执对应于压测请求。For example, when the stress test record is the mapping relationship between the request ID of the stress test request and the transaction hash of the blockchain transaction, the blockchain client can determine the corresponding blockchain transaction after receiving the transaction receipt. The query is based on the transaction hash of the blockchain transaction and the above-mentioned mapping relationship: if a matching mapping relationship is queried, it can be determined that the received transaction receipt corresponds to the stress test request. Of course, the corresponding request ID can also be determined based on the matching mapping relationship, and the corresponding processing request can be obtained based on the request ID, and then the processing request can be further determined by reading whether the processing request contains a stress test request or a business request Whether it is really a pressure test request. For another example, when the pressure test record is a block chain transaction list, the block chain client can determine the corresponding block chain transaction after receiving the transaction receipt, and query the above based on the transaction hash of the block chain transaction Block chain transaction list, so that when the transaction hash of the block chain transaction is queried, it is confirmed that the block chain transaction or its transaction receipt corresponds to the stress test request.
区块链客户端可以通过与目标区块链网络中的某一区块链节点之间建立连接,从而向该区块链节点提交区块链交易,该区块链节点可以为如图3所示的区块链节点33n,也可以为如图4所示的区块链节点43n或区块链节点44n。以区块链节点33n为例,区块链客户端32与该区块链节点33n之间建立的连接可以为长连接,使得区块链节点33n执行上述区块链交易、生成相应的交易回执之后,可以产生相应的交易回执生成事件,而区块链客户端32可以通过监听该交易回执生成事件获知交易回执已生成(即事件监听机制),并基于上述的长连接获取该交易回执;当然,也可以由区块链节点33n自身通过上述的事件监听机制来监听交易回执生成事件,并通过上述的长连接将交易回执反馈至区块链客户端32,使得该区块链客户端32获得交易回执。或者,如果区块链客户端32与区块链节点33n之间建立的连接并非长连接或者所建立的长连接断开,区块链客户端32需要额外通过发起一笔查询交易,以查询上述区块链交易对应的交易回执。其中,该查询交易可以为常规的区块链交易,使得区块链网络33中的所有区块链节点均需针对该查询交易进行获取、共识、执行、上链等操作,而区块链客户端32可以通过上述方式与某一区块链节点建立长连接,并基于上述的事件监听机制从该区块链节点 处获取交易回执;或者,该查询交易可以为特殊交易,譬如区块链客户端32可以仅与区块链节点33n建立长连接并发送该查询交易,那么该查询交易仅会被区块链节点33n获取并执行,该查询交易无需参与共识且不需要上链,甚至无需被其他区块链节点获取,然后区块链客户端32可以基于如前所述的事件监听机制获取交易回执。The blockchain client can establish a connection with a certain blockchain node in the target blockchain network to submit a blockchain transaction to the blockchain node. The blockchain node can be as shown in Figure 3. The illustrated blockchain node 33n may also be the blockchain node 43n or the blockchain node 44n as shown in FIG. 4. Taking the block chain node 33n as an example, the connection established between the block chain client 32 and the block chain node 33n may be a long connection, so that the block chain node 33n executes the above-mentioned block chain transaction and generates a corresponding transaction receipt After that, the corresponding transaction receipt generation event can be generated, and the blockchain client 32 can learn that the transaction receipt has been generated by monitoring the transaction receipt generation event (that is, the event monitoring mechanism), and obtain the transaction receipt based on the aforementioned long connection; of course; , It is also possible for the blockchain node 33n to monitor the transaction receipt generation event through the aforementioned event monitoring mechanism, and feed the transaction receipt to the blockchain client 32 through the aforementioned long connection, so that the blockchain client 32 obtains Transaction receipt. Or, if the connection established between the blockchain client 32 and the blockchain node 33n is not a persistent connection or the established persistent connection is disconnected, the blockchain client 32 needs to initiate an additional query transaction to query the above The transaction receipt corresponding to the blockchain transaction. Among them, the query transaction can be a regular blockchain transaction, so that all blockchain nodes in the blockchain network 33 need to perform operations such as obtaining, consensus, execution, and chaining for the query transaction, while the blockchain client The terminal 32 can establish a long connection with a certain blockchain node through the above-mentioned method, and obtain a transaction receipt from the blockchain node based on the above-mentioned event monitoring mechanism; or, the query transaction can be a special transaction, such as a blockchain client The end 32 can only establish a long connection with the blockchain node 33n and send the query transaction, then the query transaction will only be acquired and executed by the blockchain node 33n. The query transaction does not need to participate in consensus and does not need to be chained, or even be Other blockchain nodes obtain it, and then the blockchain client 32 can obtain the transaction receipt based on the event monitoring mechanism as described above.
通过识别出交易回执对应的处理请求是否属于压测请求,区块链客户端可以针对交易回执采取差异化的处理。比如,在交易回执对应的处理请求为压测请求的情况下,区块链客户端可以针对该交易回执添加特征标识后反馈至业务系统,而在交易回执对应的处理请求为业务请求的情况下,区块链客户端可以直接将该交易回执反馈至业务系统;相应地,业务系统可以基于该特征标识确定相应的交易回执是否对应于压测请求,从而将交易回执存储至不同的数据库。例如图3所示,区块链客户端32在确定交易回执对应于压测请求的情况下,基于该交易回执生成压测响应,该压测响应可以包含该交易回执和上述的特征标识,以及区块链客户端32在确定交易回执对应于业务请求的情况下,基于该交易回执生成业务响应,该业务响应可以仅包含该交易回执而不包含特征标识;相应地,业务系统31在收到区块链客户端32返回的压测响应或业务响应后,可以将压测响应存储至压测数据库、将业务响应存储至业务数据库,后续可以从压测数据库获取对应于压测请求的交易回执,以分析确定区块链网络33的压测结果。再例如图4所示,区块链客户端42在确定交易回执对应于压测请求的情况下,基于该交易回执生成压测响应,该压测响应可以包含该交易回执和上述的特征标识,以及区块链客户端42在确定交易回执对应于业务请求的情况下,基于该交易回执生成业务响应,该业务响应可以仅包含该交易回执而不包含特征标识;相应地,业务系统41在收到区块链客户端42返回的压测响应或业务响应后,可以将压测响应存储至压测数据库、将业务响应存储至业务数据库,后续可以从压测数据库获取对应于压测请求的交易回执,以分析确定针对区块链网络44的压测结果。By identifying whether the processing request corresponding to the transaction receipt is a stress test request, the blockchain client can take differentiated processing for the transaction receipt. For example, in the case that the processing request corresponding to the transaction receipt is a stress test request, the blockchain client can add a feature identifier to the transaction receipt and feed it back to the business system, and in the case that the processing request corresponding to the transaction receipt is a business request , The blockchain client can directly feed back the transaction receipt to the business system; accordingly, the business system can determine whether the corresponding transaction receipt corresponds to the stress test request based on the feature identifier, thereby storing the transaction receipt in a different database. For example, as shown in FIG. 3, in the case where the blockchain client 32 determines that the transaction receipt corresponds to the stress test request, it generates a stress test response based on the transaction receipt, and the stress test response may include the transaction receipt and the above-mentioned feature identifier, and When the blockchain client 32 determines that the transaction receipt corresponds to the business request, it generates a business response based on the transaction receipt. The business response may only include the transaction receipt without the feature identifier; accordingly, the business system 31 receives After the stress test response or business response returned by the blockchain client 32, the stress test response can be stored in the stress test database, the business response can be stored in the business database, and the transaction receipt corresponding to the stress test request can be subsequently obtained from the stress test database. , To analyze and determine the pressure test results of the blockchain network 33. For another example, as shown in FIG. 4, when the blockchain client 42 determines that the transaction receipt corresponds to the stress test request, it generates a stress test response based on the transaction receipt, and the stress test response may include the transaction receipt and the above-mentioned feature identifier. And when the blockchain client 42 determines that the transaction receipt corresponds to the business request, it generates a business response based on the transaction receipt. The business response may only include the transaction receipt without the feature identifier; accordingly, the business system 41 is receiving After receiving the stress test response or business response returned by the blockchain client 42, the stress test response can be stored in the stress test database, the business response can be stored in the business database, and the transaction corresponding to the stress test request can be subsequently obtained from the stress test database. Receipt to analyze and determine the pressure test results for the blockchain network 44.
图5是一示例性实施例提供的一种设备的示意结构图。请参考图5,在硬件层面,该设备包括处理器502、内部总线504、网络接口506、内存508以及非易失性存储器510,当然还可能包括其他业务所需要的硬件。处理器502从非易失性存储器510中读取对应的计算机程序到内存508中然后运行,在逻辑层面上形成区块链网络的压力测试装置。当然,除了软件实现方式之外,本公开一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。Fig. 5 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 5. At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510. Of course, it may also include hardware required for other services. The processor 502 reads the corresponding computer program from the non-volatile memory 510 to the memory 508 and then runs it to form a stress test device for the blockchain network on a logical level. Of course, in addition to the software implementation, one or more embodiments of the present disclosure do not exclude other implementations, such as logic devices or a combination of software and hardware, etc. That is to say, the execution body of the following processing flow is not limited to each The logic unit can also be a hardware or a logic device.
请参考图6,在软件实施方式中,该区块链网络的压力测试装置可以包括:交易创建单元61,响应于来自业务系统的处理请求,创建对应于所述处理请求的区块链交易;关系记录单元62,在所述处理请求为压测请求的情况下,为所述压测请求对应的区块链交易生成压测记录;类型确定单元63,根据所述压测记录和获取到的交易回执对应的区块链交易的信息,确定所述交易回执对应的处理请求是否为压测请求。Please refer to FIG. 6, in the software implementation, the stress testing device of the blockchain network may include: a transaction creation unit 61, which creates a blockchain transaction corresponding to the processing request in response to a processing request from the business system; The relationship recording unit 62, when the processing request is a stress test request, generates a stress test record for the blockchain transaction corresponding to the stress test request; the type determination unit 63, based on the stress test record and the obtained The blockchain transaction information corresponding to the transaction receipt determines whether the processing request corresponding to the transaction receipt is a stress test request.
可选的,所述交易创建单元61具体用于:在所述处理请求为所述压测请求的情况下,针对处于生产状态的目标区块链网络对应的对等区块链网络创建对应于所述处理请求的第一区块链交易,且第一区块链交易被发送至所述对等区块链网络;在所述处理请求为区别于所述压测请求的业务请求的情况下,针对所述目标区块链网络创建对应于所述处理请求的第二区块链交易,且第二区块链交易被发送至所述目标区块链网络。Optionally, the transaction creation unit 61 is specifically configured to: when the processing request is the stress test request, create a peer-to-peer blockchain network corresponding to the target blockchain network in a production state corresponding to The first blockchain transaction of the processing request, and the first blockchain transaction is sent to the peer-to-peer blockchain network; in the case where the processing request is a business request different from the stress test request , A second blockchain transaction corresponding to the processing request is created for the target blockchain network, and the second blockchain transaction is sent to the target blockchain network.
可选的,所述对等区块链网络与所述目标区块链网络具有相同的网络结构和网络配置。Optionally, the peer-to-peer blockchain network and the target blockchain network have the same network structure and network configuration.
可选的,所述交易创建单元61具体用于:针对处于生产状态的目标区块链网络创建对应于所述处理请求的区块链交易,且所述区块链交易被发送至所述目标区块链网络。Optionally, the transaction creation unit 61 is specifically configured to: create a blockchain transaction corresponding to the processing request for the target blockchain network in a production state, and the blockchain transaction is sent to the target Blockchain network.
可选的,所述压测记录中包含区块链交易的信息;所述区块链交易的信息包括:所述区块链交易的交易哈希。Optionally, the pressure test record includes block chain transaction information; the block chain transaction information includes: the transaction hash of the block chain transaction.
可选的,所述处理请求为压测请求或业务请求;其中,所述压测请求中包含压测标签,和/或所述业务请求中包含业务标签。Optionally, the processing request is a stress test request or a service request; wherein the stress test request includes a stress test label, and/or the service request includes a service label.
可选的,还包括:回执反馈单元64,在所述交易回执对应的处理请求为压测请求的情况下,针对所述交易回执添加特征标识后反馈至所述业务系统;在所述交易回执对应的处理请求为区别于所述压测请求的业务请求的情况下,直接将所述交易回执反馈至所述业务系统。Optionally, it further includes: a receipt feedback unit 64, when the processing request corresponding to the transaction receipt is a stress test request, add a feature identifier to the transaction receipt and feed it back to the business system; in the transaction receipt When the corresponding processing request is a business request different from the stress test request, the transaction receipt is directly fed back to the business system.
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The systems, devices, modules, or units explained in the foregoing embodiments may be specifically implemented by computer chips or entities, or implemented by products with certain functions. A typical implementation device is a computer. The specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, the computer includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission media, can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or equipment including a series of elements includes not only those elements, but also Other elements that are not explicitly listed, or include elements inherent to such processes, methods, commodities, or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, commodity or equipment that includes the element.
上述对本公开特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The specific embodiments of the present disclosure have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than in the embodiments and still achieve desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown in order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
在本公开一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开一个或多个实施例。在本公开一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terms used in one or more embodiments of the present disclosure are only for the purpose of describing specific embodiments, and are not intended to limit the one or more embodiments of the present disclosure. The singular forms "a", "said" and "the" used in one or more embodiments of the present disclosure and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and/or" as used herein refers to and includes any or all possible combinations of one or more associated listed items.
应当理解,尽管在本公开一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开一个或多个实施例范围的情况下,第一信息也可以被称为 第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of the present disclosure, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present disclosure, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information. Depending on the context, the word "if" as used herein can be interpreted as "when" or "when" or "in response to a certainty".
以上所述仅为本公开一个或多个实施例的较佳实施例而已,并不用以限制本公开一个或多个实施例,凡在本公开一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本公开一个或多个实施例保护的范围之内。The foregoing descriptions are only preferred embodiments of one or more embodiments of the present disclosure, and are not intended to limit one or more embodiments of the present disclosure. All within the spirit and principle of the one or more embodiments of the present disclosure, Any modification, equivalent replacement, improvement, etc. made should be included in the protection scope of one or more embodiments of the present disclosure.

Claims (12)

  1. 一种区块链网络的压力测试系统,包括:A pressure test system for a blockchain network, including:
    区块链客户端,响应于来自业务系统的处理请求,创建对应于所述处理请求的区块链交易;在所述处理请求为压测请求的情况下,为所述压测请求对应的区块链交易生成压测记录;以及,在根据所述压测记录和获取到的交易回执对应的区块链交易的信息确定出所述交易回执对应的处理请求为压测请求的情况下,针对所述交易回执添加特征标识;The blockchain client, in response to a processing request from the business system, creates a blockchain transaction corresponding to the processing request; if the processing request is a stress test request, it is the area corresponding to the stress test request Blockchain transactions generate stress test records; and, in the case where it is determined that the processing request corresponding to the transaction receipt is a stress test request based on the stress test record and the information of the blockchain transaction corresponding to the acquired transaction receipt, Add a characteristic identifier to the transaction receipt;
    区块链网络,接收并执行所述区块链客户端提交的区块链交易,并生成对应于所述区块链交易的交易回执;The blockchain network receives and executes the blockchain transaction submitted by the blockchain client, and generates a transaction receipt corresponding to the blockchain transaction;
    业务系统,向所述区块链客户端发送所述处理请求,并接收所述区块链客户端返回的交易回执;在根据所述特征标识确定所述交易回执对应于压测请求的情况下,将所述交易回执存储至压测数据库,在所述交易回执对应的处理请求为区别于所述压测请求的业务请求的情况下,将所述交易回执存储至业务数据库。The business system sends the processing request to the blockchain client and receives the transaction receipt returned by the blockchain client; in the case of determining that the transaction receipt corresponds to the stress test request according to the characteristic identifier Storing the transaction receipt in a stress test database, and storing the transaction receipt in the service database when the processing request corresponding to the transaction receipt is a business request different from the stress test request.
  2. 一种区块链网络的压力测试系统,包括:A pressure test system for a blockchain network, including:
    区块链客户端,响应于来自业务系统的处理请求,创建对应于所述处理请求的区块链交易;在所述处理请求为压测请求的情况下,为所述压测请求对应的区块链交易生成压测记录;以及,在根据所述压测记录和获取到的交易回执对应的区块链交易的信息确定出所述交易回执对应的处理请求为压测请求的情况下,针对所述交易回执添加特征标识;The blockchain client, in response to a processing request from the business system, creates a blockchain transaction corresponding to the processing request; if the processing request is a stress test request, it is the area corresponding to the stress test request Blockchain transactions generate stress test records; and, in the case where it is determined that the processing request corresponding to the transaction receipt is a stress test request based on the stress test record and the information of the blockchain transaction corresponding to the acquired transaction receipt, Add a characteristic identifier to the transaction receipt;
    第一区块链网络,接收所述区块链客户端提交的对应于压测请求的第一区块链交易,执行并生成对应于第一区块链交易的交易回执;The first blockchain network receives the first blockchain transaction corresponding to the stress test request submitted by the blockchain client, executes and generates a transaction receipt corresponding to the first blockchain transaction;
    第二区块链网络,接收所述区块链客户端提交的第二区块链交易,第二区块链交易对应的处理请求为区别于所述压测请求的业务请求;执行并生成对应于第二区块链交易的交易回执;The second blockchain network receives the second blockchain transaction submitted by the blockchain client, and the processing request corresponding to the second blockchain transaction is a business request different from the stress test request; executes and generates the corresponding Transaction receipt for transactions on the second blockchain;
    业务系统,向所述区块链客户端发送所述处理请求,并接收所述区块链客户端返回的交易回执;在根据所述特征标识确定所述交易回执对应于压测请求的情况下,将所述交易回执存储至压测数据库,在所述交易回执对应于业务请求的情况下,将所述交易回执存储至业务数据库。The business system sends the processing request to the blockchain client and receives the transaction receipt returned by the blockchain client; in the case of determining that the transaction receipt corresponds to the stress test request according to the characteristic identifier Storing the transaction receipt in the stress test database, and storing the transaction receipt in the service database in the case that the transaction receipt corresponds to a business request.
  3. 一种区块链网络的压力测试方法,应用于区块链客户端,所述方法包括:A method for stress testing of a blockchain network, which is applied to a blockchain client, and the method includes:
    响应于来自业务系统的处理请求,创建对应于所述处理请求的区块链交易;In response to a processing request from the business system, create a blockchain transaction corresponding to the processing request;
    在所述处理请求为压测请求的情况下,为所述压测请求对应的区块链交易生成压测 记录;In the case that the processing request is a stress test request, generating a stress test record for the blockchain transaction corresponding to the stress test request;
    根据所述压测记录和获取到的交易回执对应的区块链交易的信息,确定所述交易回执对应的处理请求是否为压测请求。Determine whether the processing request corresponding to the transaction receipt is a stress test request according to the stress test record and the acquired transaction receipt corresponding to the blockchain transaction information.
  4. 根据权利要求3所述的方法,所述创建对应于所述处理请求的区块链交易,包括:The method according to claim 3, wherein the creating a blockchain transaction corresponding to the processing request comprises:
    在所述处理请求为所述压测请求的情况下,针对处于生产状态的目标区块链网络对应的对等区块链网络创建对应于所述处理请求的第一区块链交易,且第一区块链交易被发送至所述对等区块链网络;In the case where the processing request is the stress test request, a first blockchain transaction corresponding to the processing request is created for the peer-to-peer blockchain network corresponding to the target blockchain network in the production state, and the first blockchain transaction corresponding to the processing request is created. A blockchain transaction is sent to the peer-to-peer blockchain network;
    在所述处理请求为区别于所述压测请求的业务请求的情况下,针对所述目标区块链网络创建对应于所述处理请求的第二区块链交易,且第二区块链交易被发送至所述目标区块链网络。In the case that the processing request is a business request different from the stress test request, a second blockchain transaction corresponding to the processing request is created for the target blockchain network, and the second blockchain transaction Is sent to the target blockchain network.
  5. 根据权利要求4所述的方法,所述对等区块链网络与所述目标区块链网络具有相同的网络结构和网络配置。According to the method of claim 4, the peer-to-peer blockchain network and the target blockchain network have the same network structure and network configuration.
  6. 根据权利要求3所述的方法,所述创建对应于所述处理请求的区块链交易,包括:The method according to claim 3, wherein the creating a blockchain transaction corresponding to the processing request comprises:
    针对处于生产状态的目标区块链网络创建对应于所述处理请求的区块链交易,且所述区块链交易被发送至所述目标区块链网络。A blockchain transaction corresponding to the processing request is created for the target blockchain network in the production state, and the blockchain transaction is sent to the target blockchain network.
  7. 根据权利要求3所述的方法,所述压测记录中包含区块链交易的信息;所述区块链交易的信息包括:所述区块链交易的交易哈希。The method according to claim 3, wherein the pressure test record contains blockchain transaction information; the blockchain transaction information includes: a transaction hash of the blockchain transaction.
  8. 根据权利要求3所述的方法,所述处理请求为压测请求或业务请求;其中,所述压测请求中包含压测标签,和/或所述业务请求中包含业务标签。The method according to claim 3, wherein the processing request is a stress test request or a service request; wherein the stress test request includes a stress test label, and/or the service request includes a service label.
  9. 根据权利要求3所述的方法,还包括:The method according to claim 3, further comprising:
    在所述交易回执对应的处理请求为压测请求的情况下,针对所述交易回执添加特征标识后反馈至所述业务系统;In the case that the processing request corresponding to the transaction receipt is a stress test request, add a feature identifier to the transaction receipt and feed it back to the business system;
    在所述交易回执对应的处理请求为区别于所述压测请求的业务请求的情况下,直接将所述交易回执反馈至所述业务系统。In the case that the processing request corresponding to the transaction receipt is a business request different from the stress test request, the transaction receipt is directly fed back to the business system.
  10. 一种区块链网络的压力测试装置,应用于区块链客户端,所述装置包括:A pressure test device for a blockchain network, applied to a blockchain client, and the device includes:
    交易创建单元,响应于来自业务系统的处理请求,创建对应于所述处理请求的区块链交易;The transaction creation unit, in response to a processing request from the business system, creates a blockchain transaction corresponding to the processing request;
    关系记录单元,在所述处理请求为压测请求的情况下,为所述压测请求对应的区块链交易生成压测记录;The relationship recording unit generates a stress test record for the blockchain transaction corresponding to the stress test request when the processing request is a stress test request;
    类型确定单元,根据所述压测记录和获取到的交易回执对应的区块链交易的信息,确定所述交易回执对应的处理请求是否为压测请求。The type determining unit determines whether the processing request corresponding to the transaction receipt is a stress test request according to the pressure test record and the acquired transaction receipt information corresponding to the blockchain transaction.
  11. 一种电子设备,包括:An electronic device including:
    处理器;processor;
    用于存储处理器可执行指令的存储器;A memory for storing processor executable instructions;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求3-9中任一项所述的方法。Wherein, the processor implements the method according to any one of claims 3-9 by running the executable instruction.
  12. 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求3-9中任一项所述方法的步骤。A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 3-9.
PCT/CN2021/100779 2020-06-24 2021-06-18 Pressure testing method, apparatus and system for blockchain network WO2021259149A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010585455.X 2020-06-24
CN202010585455.XA CN111488291B (en) 2020-06-24 2020-06-24 Pressure testing method, device and system for block chain network

Publications (1)

Publication Number Publication Date
WO2021259149A1 true WO2021259149A1 (en) 2021-12-30

Family

ID=71813527

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/100779 WO2021259149A1 (en) 2020-06-24 2021-06-18 Pressure testing method, apparatus and system for blockchain network

Country Status (2)

Country Link
CN (1) CN111488291B (en)
WO (1) WO2021259149A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114615171A (en) * 2022-03-16 2022-06-10 网易(杭州)网络有限公司 Pressure measurement processing method, device, medium and program product for cloud game server

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488291B (en) * 2020-06-24 2020-10-30 支付宝(杭州)信息技术有限公司 Pressure testing method, device and system for block chain network
CN111478828B (en) * 2020-06-24 2020-10-20 支付宝(杭州)信息技术有限公司 Pressure testing method, device and system for block chain network
CN111478827B (en) * 2020-06-24 2020-12-04 支付宝(杭州)信息技术有限公司 Pressure testing method, device and system for block chain network
CN112486830B (en) * 2020-06-24 2023-04-18 支付宝(杭州)信息技术有限公司 Pressure testing method, device and system for block chain network
CN114338452A (en) * 2021-12-31 2022-04-12 支付宝(杭州)信息技术有限公司 Pressure testing method, device and system for block chain subnet

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109165168A (en) * 2018-09-14 2019-01-08 杭州云创共享网络科技有限公司 A kind of method for testing pressure, device, equipment and medium
CN110598446A (en) * 2019-09-16 2019-12-20 腾讯科技(深圳)有限公司 Block chain based test method and device, storage medium and computer equipment
US20200167512A1 (en) * 2018-11-13 2020-05-28 Gauntlet Networks, Inc. Simulation-based testing of blockchain and other distributed ledger systems
CN111290907A (en) * 2020-01-14 2020-06-16 深圳市网心科技有限公司 Distributed storage network pressure measurement method and device, computer device and storage medium
CN111488291A (en) * 2020-06-24 2020-08-04 支付宝(杭州)信息技术有限公司 Pressure testing method, device and system for block chain network

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9934138B1 (en) * 2016-12-07 2018-04-03 International Business Machines Corporation Application testing on a blockchain
CN109753434A (en) * 2018-12-26 2019-05-14 中链科技有限公司 Performance test methods, device, electronic equipment and storage medium based on block chain
CN109753418B (en) * 2018-12-28 2022-07-12 金蝶软件(中国)有限公司 Performance test method and device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109165168A (en) * 2018-09-14 2019-01-08 杭州云创共享网络科技有限公司 A kind of method for testing pressure, device, equipment and medium
US20200167512A1 (en) * 2018-11-13 2020-05-28 Gauntlet Networks, Inc. Simulation-based testing of blockchain and other distributed ledger systems
CN110598446A (en) * 2019-09-16 2019-12-20 腾讯科技(深圳)有限公司 Block chain based test method and device, storage medium and computer equipment
CN111290907A (en) * 2020-01-14 2020-06-16 深圳市网心科技有限公司 Distributed storage network pressure measurement method and device, computer device and storage medium
CN111488291A (en) * 2020-06-24 2020-08-04 支付宝(杭州)信息技术有限公司 Pressure testing method, device and system for block chain network

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114615171A (en) * 2022-03-16 2022-06-10 网易(杭州)网络有限公司 Pressure measurement processing method, device, medium and program product for cloud game server
CN114615171B (en) * 2022-03-16 2024-01-30 网易(上海)网络有限公司 Pressure measurement processing method, device, medium and program product of cloud game server

Also Published As

Publication number Publication date
CN111488291A (en) 2020-08-04
CN111488291B (en) 2020-10-30

Similar Documents

Publication Publication Date Title
WO2021259149A1 (en) Pressure testing method, apparatus and system for blockchain network
US10311230B2 (en) Anomaly detection in distributed ledger systems
TWI762818B (en) Blockchain-based invoice creation method and device, electronic device
TWI701617B (en) Cross-block chain interaction method, device, system, and electronic equipment
US11087372B2 (en) Benefit allocation method, apparatus, and electronic device
WO2020155832A1 (en) Cross-chain usage-rights system and method, device, eletronic apparatus and storage medium
WO2020119286A1 (en) Blockchain-based invoice creating method and apparatus, and electronic device
KR101959153B1 (en) System for efficient processing of transaction requests related to an account in a database
TW202004633A (en) Blockchain transaction reconciliation method and apparatus, and electronic device
WO2021259126A1 (en) Method and apparatus for testing pressure of blockchain network, and system
WO2022161181A1 (en) Data processing method and apparatus based on blockchain, and electronic device
US11233660B2 (en) Confidential blockchain transactions
WO2021259131A1 (en) Pressure test method, apparatus, and system for block chain network
TWI714414B (en) Method and device for obtaining block chain data in stages
US20200134625A1 (en) Method, apparatus and electronic device for blockchain transactions
TW202024984A (en) Data reading and writing method and device and electronic equipment
TW202025057A (en) Field updating method and device and electronic equipment
CN111475501B (en) Data cleaning method and device for block chain network
TWI699728B (en) Block publishing method and device, and electronic equipment
WO2021259127A1 (en) Pressure testing method, apparatus and system for blockchain network
WO2021208762A1 (en) Data storage and query
WO2020019791A1 (en) Event prediction method and apparatus and electronic device
CN113220717B (en) Block chain-based data verification method and device and electronic equipment
WO2017118318A1 (en) Data storage and service processing method and device
TWI727642B (en) Method and device for realizing confidential transaction in block chain

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21828442

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21828442

Country of ref document: EP

Kind code of ref document: A1