WO2021259126A1 - 区块链网络的压力测试方法及装置、系统 - Google Patents

区块链网络的压力测试方法及装置、系统 Download PDF

Info

Publication number
WO2021259126A1
WO2021259126A1 PCT/CN2021/100577 CN2021100577W WO2021259126A1 WO 2021259126 A1 WO2021259126 A1 WO 2021259126A1 CN 2021100577 W CN2021100577 W CN 2021100577W WO 2021259126 A1 WO2021259126 A1 WO 2021259126A1
Authority
WO
WIPO (PCT)
Prior art keywords
blockchain
transaction
block
block chain
network
Prior art date
Application number
PCT/CN2021/100577
Other languages
English (en)
French (fr)
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 WO2021259126A1 publication Critical patent/WO2021259126A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • 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) 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 pressure test system for a blockchain network including: a blockchain client, in response to a processing request from a business system, where the processing request is A first blockchain transaction containing a first type of identification is generated when a stress test request is made, and a second blockchain transaction containing a second type of identification is generated when the processing request is a business request; the first blockchain network receives the The first blockchain transaction submitted by the blockchain client executes the first blockchain transaction and generates a transaction receipt containing the first type of identification; the second blockchain network receives the transaction submitted by the blockchain client The second blockchain transaction, execute the second blockchain transaction and generate a transaction receipt containing the second type of identification; the business system, send the processing request to the blockchain client, and receive the blockchain client The transaction receipt returned by the terminal; the transaction receipt containing the first type identifier is stored in the stress test database, and the transaction receipt containing the second type identifier is stored in the business database.
  • a pressure test system for a blockchain network including: a blockchain client, in response to a processing request from a business system, where the processing request is A first blockchain transaction including a first type of identification is generated when a stress test request is made, and a second blockchain transaction including a second type of identification is generated when the processing request is a business request; the blockchain network receives the zone The first block chain transaction and the second block chain transaction submitted by the block chain client, execute the first block chain transaction and generate a transaction receipt containing the first type of identification, execute the second block chain transaction and generate the second block chain transaction Transaction receipt with the type identification; the business system, sending the processing request to the blockchain client, and receiving the transaction receipt returned by the blockchain client; storing the transaction receipt containing the first type identification to the stress test The database stores the transaction receipts containing the second type identifiers in the business database.
  • 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, When the processing request is a stress test request, a first blockchain transaction including a first type identifier is generated, and when the processing request is a business request, a second blockchain transaction including a second type identifier is generated; respectively acquiring corresponding The first transaction receipt of the first blockchain transaction, the second transaction receipt corresponding to the second blockchain transaction, the first transaction receipt includes the first type identifier, and the second transaction receipt includes the second type identifier; The system returns the obtained transaction receipt.
  • a method for stress testing of a blockchain network is proposed, which is applied to a blockchain node, and the method includes: receiving a blockchain transaction, the blockchain The transaction is generated by the blockchain client in response to a processing request from the business system; wherein, when the processing request is a stress test request, the blockchain transaction includes a first type identifier, and when the processing request is a business The blockchain transaction includes a second type identifier when requested; the transaction receipt corresponding to the blockchain transaction is returned to the blockchain client, and the transaction receipt includes the same type identifier as the blockchain transaction .
  • a pressure test device for a blockchain network which is applied to a blockchain client.
  • the device includes: a transaction generation unit, which responds to a request from a business system Processing a request, generating a first blockchain transaction including a first type identifier when the processing request is a stress test request, and generating a second blockchain transaction including a second type identifier when the processing request is a business request;
  • the receipt obtaining unit respectively obtains the first transaction receipt corresponding to the first blockchain transaction and the second transaction receipt corresponding to the second blockchain transaction.
  • the first transaction receipt includes the first type identifier and the second transaction receipt includes the first transaction receipt.
  • Second type identification a receipt return unit, which returns the acquired transaction receipt to the business system.
  • a pressure test device for a blockchain network is proposed, which is applied to a blockchain node.
  • the device includes: a transaction receiving unit that receives blockchain transactions;
  • the blockchain transaction is generated by the blockchain client in response to a processing request from the business system; wherein, when the processing request is a stress test request, the blockchain transaction includes a first type identifier, and When the processing request is a business request, the blockchain transaction includes a second type identifier; the receipt return unit returns a transaction receipt corresponding to the blockchain transaction to the blockchain client, and the transaction receipt includes the type identifier Same as the blockchain transaction.
  • an electronic device including: a processor; a memory for storing executable instructions of the processor; wherein the processor runs the executable instructions To implement the method described in any of the above embodiments.
  • a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, the method as 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 flowchart of executing blockchain transactions according to an exemplary embodiment.
  • Fig. 6 is a flowchart of another method for stress testing of a blockchain network provided by an exemplary embodiment.
  • Fig. 7 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • Fig. 8 is a block diagram of a pressure test device for a blockchain network provided by an exemplary embodiment.
  • Fig. 9 is a block diagram of another block chain network stress testing device provided by an exemplary embodiment.
  • the steps of the corresponding method are not necessarily 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. 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.
  • the business system 11 can generate a processing request of the stress test request type (including data used for the stress test), and the blockchain client 12 can Create corresponding blockchain transactions in response to these stress test requests, and the blockchain network 13 executes these blockchain transactions to perform a stress test on the blockchain network 13; and, the blockchain client 12 transfers the blockchain network 13
  • the transaction receipt generated by the execution of the blockchain transaction is fed back to the business system 11 so that the business system 11 analyzes the transaction receipt to determine 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 according to an exemplary embodiment.
  • the method is applied to the blockchain client and may include the following steps: Step 202, in response to a processing request from the business system, when the processing request is a stress test request, a first type identifier is generated.
  • Step 202 in response to a processing request from the business system, when the processing request is a stress test request, a first type identifier is generated.
  • a second blockchain transaction including a second type identifier is generated for the first blockchain transaction.
  • 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 network may have multiple structures, which makes it possible for the blockchain client to create blockchain transactions and realize data interaction with the blockchain network due to the blockchain. There are certain differences in the structure of the network.
  • the first blockchain network for responding to the first blockchain transaction and the second blockchain network for responding to the second blockchain transaction can be deployed separately.
  • the blockchain client can submit the first blockchain transaction to the first blockchain network; similarly, the blockchain client is creating the second blockchain transaction Later, the second blockchain transaction can be submitted to the second blockchain network.
  • the first blockchain network may receive the first blockchain transaction submitted by the blockchain client, execute the first blockchain transaction, and generate a transaction receipt (that is, the first transaction receipt) containing the first type identifier;
  • the second blockchain network receives the second blockchain transaction submitted by the blockchain client, executes the second blockchain transaction, and generates a transaction receipt (that is, the second transaction receipt) containing the second type of identification.
  • the blockchain client can obtain the transaction receipt generated by the first blockchain network and the second blockchain network and return it to the business system.
  • the business system can receive the transaction receipt returned by the blockchain client, store the transaction receipt including the first type identifier in the stress test database, and store the transaction receipt including the second type identifier in the business database.
  • the target blockchain network in the production state Take the target blockchain network in the production state as the second blockchain network, and the peer-to-peer blockchain network corresponding to the target blockchain network as the first blockchain network for example.
  • the corresponding peer-to-peer blockchain network 34 can be deployed for the target blockchain network 33 in the production state, so that the target blockchain network 33 is used to realize the production business and the peer-to-peer blockchain network 34.
  • the blockchain client 32 After receiving the processing request initiated by the business system 31, the blockchain client 32 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 32 can create a first blockchain transaction corresponding to the processing request (ie, the stress test request) for the above-mentioned peer-to-peer blockchain network 34 when the received processing request is a stress test request (Including the first type identification, such as a pressure test tag), and send the first blockchain transaction to the peer-to-peer blockchain network 34.
  • the blockchain client 32 can send the first blockchain transaction to a certain blockchain node 34n in the blockchain network 34, and the blockchain node 34n can further transfer the blockchain transaction to Other blockchain nodes in the blockchain network 34 enable all blockchain nodes to perform consensus, execution, and chain operations on the blockchain transaction, and generate corresponding transaction receipts (including the first type of identification, namely The above pressure test label).
  • the blockchain client 32 can create a second blockchain transaction (including the second type Identification, such as a business tag), and send the second blockchain transaction to the target blockchain network 33.
  • the blockchain client 32 can send the second blockchain transaction to a certain blockchain node 33n in the blockchain network 33, and the blockchain node 33n can further transact the second blockchain Pass it to other blockchain nodes in the blockchain network 33, so that all blockchain nodes can perform consensus, execution, and chain operations on the second blockchain transaction, and generate corresponding transaction receipts (including the second Type identification, that is, the above-mentioned service label).
  • the peer-to-peer blockchain network 34 and the target blockchain network 33 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 34 can reflect the target area The true state of the blockchain network 33.
  • the stress test implemented on the peer-to-peer blockchain network 34 can reflect the target area The true state of the blockchain network 33.
  • the stress test implemented by the peer-to-peer blockchain network 34 It is still possible to provide feedback to a certain extent of the true status of the target blockchain network 33.
  • the same blockchain network can respond to the first blockchain transaction and the second blockchain transaction , Then the same blockchain network needs to identify the received blockchain transaction. Therefore, when the blockchain client creates a blockchain transaction, it can add a type identifier (corresponding to the request type of the processing request) to indicate the transaction type in the blockchain transaction. Correspondingly, when the blockchain network generates a transaction receipt, it also adds a corresponding type identifier to the transaction receipt to indicate which processing request the transaction receipt corresponds to.
  • the blockchain client in response to a processing request from a business system, can generate a first blockchain transaction containing a first type identifier when the processing request is a stress test request, and generate a second blockchain transaction containing a first type of identifier when the processing request is a business request.
  • the second blockchain transaction identified by the type.
  • the blockchain client After the blockchain client generates the first blockchain transaction and the second blockchain transaction, it submits the first blockchain transaction and the second blockchain transaction to the blockchain network.
  • the blockchain network receives the first blockchain transaction and the second blockchain transaction submitted by the blockchain client, it can execute the first blockchain transaction and generate a transaction receipt containing the first type of identification (i.e.
  • the first transaction receipt execute the second blockchain transaction and generate a transaction receipt (that is, the second transaction receipt) containing the second type of identification.
  • the blockchain client can obtain the transaction receipt generated by the blockchain network and return it to the business system.
  • the business system can receive the transaction receipt returned by the blockchain client, store the transaction receipt including the first type identifier in the stress test database, and store the transaction receipt including the second type identifier in the business database.
  • the block chain nodes in the target block chain network 43 maintain the first block chain A and the second block chain B at the same time; among them, the block of the first block chain A is used to record the first block chain.
  • a block chain transaction, the block of the second block chain B is used to record the second block chain transaction.
  • the target blockchain network 43 executes the first blockchain transaction
  • the first blockchain transaction is stored in the block contained in the first blockchain
  • the blockchain network 43 is executing the second block
  • the second blockchain transaction is stored in the block contained in the second blockchain.
  • the block header of the block contained in the first blockchain includes the first type identifier
  • the block header of the block contained in the second blockchain includes the second type identifier.
  • the first block chain can be effectively distinguished from the second block chain. For example, after generating the blocks of the first block chain and the block of the second block chain, the block header can be used to identify which block chain these blocks belong to, and then the identified block can be added to the block to which it belongs The end of the chain.
  • the business system 41 does not need to perceive the test environment (that is, does not need to perceive the existence of the first blockchain), and is responsible for marking the processing request (marking the pressure test request or the business request) That is, making the stress test less intrusive to the business.
  • 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 may create a first blockchain transaction (including the first type identification, such as a stress test label) corresponding to the stress test request when the received processing request is a stress test request; and, In the case that the received processing request is a business request, a second blockchain transaction (including a second type identification, such as a stress test tag) corresponding to the business request is created. Then, the blockchain client 42 can submit the first blockchain transaction and the second blockchain transaction to the target blockchain network 43 in the production state, respectively, to receive the first blockchain network 43 returned by the target blockchain network. Transaction receipt and second transaction receipt.
  • the blockchain client 42 can submit the first blockchain transaction and the second blockchain transaction to a certain blockchain node 43n in the target blockchain network 43, and the blockchain node 43n can Further transfer the first block chain transaction and the second block chain transaction to other block chain nodes in the block chain network 43, so that all block chain nodes can target the first block chain transaction and the second block chain
  • the transaction performs operations such as consensus, execution, and chaining, and respectively generates a transaction receipt corresponding to the first blockchain transaction (including the first type identification, that is, the above-mentioned stress test label) and the transaction receipt corresponding to the second blockchain transaction (Contains the second type of identification, that is, the above-mentioned service label).
  • the blockchain node in the target blockchain network 43 can identify the type identification contained in the received blockchain transaction, and determine accordingly Determine whether the blockchain transaction is the first blockchain transaction or the second blockchain transaction. Specifically, when the blockchain transaction contains the first type of identification (indicating that the blockchain transaction belongs to the first blockchain transaction), the blockchain transaction can be stored in the first blockchain. Block; in the case where the block chain transaction contains the second type of identification (indicating that the block chain transaction belongs to the second block chain transaction), the block chain transaction can be stored in the block contained in the second block chain .
  • the type field (or any other field) can be added to the blockchain transaction to mark the blockchain transaction as a production transaction (corresponding to a business request) or a test transaction ( Corresponding to the pressure test request).
  • a type field is also added to the transaction receipt to mark whether the transaction receipt corresponds to a production transaction or a test transaction.
  • the existing fields in the blockchain transaction and transaction receipt can also be reused, and the type identification can be added to the existing fields.
  • the "reserved field" in the blockchain transaction is reused to indicate the transaction type of the blockchain transaction; for example, a business tag can be added to the "reserved field” so that the blockchain node on the blockchain network can Blockchain transactions that contain business tags are identified as production transactions, and blockchain transactions that do not contain business tags are identified as test transactions.
  • a stress test label can be added to the "reserved field” so that the blockchain node can recognize the blockchain transaction that contains the stress test label as a test transaction, and the blockchain transaction that does not contain the stress test label as a production trade.
  • the blockchain node in the target blockchain network has obtained the blockchain transaction containing the first type of identification (i.e. the first blockchain transaction) and the blockchain transaction containing the second type of identification (i.e. the second block) After chain transactions), the above blockchain transactions can be mixed under the same conditions.
  • the blockchain node in the target blockchain network can reuse its own software and hardware resources (such as machine resources, network resources, computing resources, etc.) to execute the first blockchain transaction and the second zone Blockchain transactions, that is, the above-mentioned "same conditions" can include the software resources and hardware resources of the blockchain nodes.
  • the stress test implemented on the first block chain can reflect the true status of the second block chain, and on the other hand,
  • the first blockchain and the second blockchain share software and hardware resources, which can effectively reduce costs.
  • the first block chain transaction can be used to carry out the stress test.
  • it can improve the accuracy of the stress test as much as possible, and on the other hand, it can reduce the impact on the normal execution of the business.
  • the block chain nodes in the target block chain network maintain the first block chain and the second block chain at the same time
  • the block data of the first block chain and the block data of the second block chain are in the target block chain.
  • the block chain node in the block chain network is stored in isolation, that is, the block data of the first block chain and the second block chain are isolated from each other, and each uses independent storage resources, thereby avoiding stress testing to the business production environment Impact, affecting the normal execution of the business.
  • the blockchain nodes in the target blockchain network since the blockchain nodes in the target blockchain network maintain the first blockchain and the second blockchain at the same time, the blockchain nodes in the target blockchain network The first state data corresponding to the first block chain and the second state data corresponding to the second block chain are maintained.
  • the first state data is the world state of the first block chain (the account states of all blockchain accounts on the first block chain)
  • the second state data is the world state of the second block chain (the second block The account status of all blockchain accounts on the chain).
  • the first blockchain after the blockchain node in the target blockchain network executes the first blockchain transaction, it will cause the account status on the first blockchain to change, which in turn will cause the first blockchain to fail.
  • the state of the world changes; in other words, the first blockchain transaction is used to drive the update of the first state data.
  • the second block chain after the block chain node in the target block chain network executes the second block chain transaction, it will cause the account status on the second block chain to change, which will lead to the second zone
  • the world state of the block chain changes; in other words, the second block chain transaction is used to drive the update of the second state data.
  • the first state data and the second state data are in the blockchain of the target blockchain network. Isolate storage on the node, that is, the state data of the first block chain and the second block chain are isolated from each other, and each uses independent storage resources, thereby avoiding the impact of stress testing on the business production environment and affecting the normal execution of the business.
  • the first block chain and the second block chain can be formed into blocks on a periodic basis.
  • the block chain nodes in the target block chain network can keep the block heights of the first block chain and the second block chain consistent (that is, to ensure that the first block chain and the second block chain are synchronized in blocks) , So that the business system does not need to perceive the first blockchain (the first blockchain is the test environment) and the second blockchain (the second blockchain is the production environment) on the target blockchain network, that is, there is no need to perceive the test environment And production environment.
  • the block chain node in the target block chain network can determine the multiple block chain transactions sent by the block chain client for the current cycle ;
  • the block chain transactions all contain the first type of identifier (that is, the multiple block chain transactions only include the first block chain transaction, and do not include the second block chain transaction)
  • the multiple blockchain transactions all contain the second type of identifier (that is, the multiple blockchain transactions only include the second blockchain transaction and do not include the first blockchain transaction), respectively Generate the first blank block that does not contain the blockchain transaction and the second normal block that contains the multiple blockchain transactions, and add the first blank block to the end of the first blockchain, and the second normal block The block is added to the end of the second normal blockchain.
  • the multiple blockchain transactions contain both the first type identification and the second type identification (that is, both the first blockchain transaction and the second blockchain transaction are included) because the first blockchain and the The second block chain is formed into blocks according to the cycle, so it can also ensure that the blocks of the first block chain and the second block chain are kept consistent after the multiple block chain transactions are executed and formed into blocks.
  • the data of the first block chain can be managed to reduce the occupation of the storage resources of the block chain nodes.
  • the administrator of the target blockchain network can submit a data cleaning transaction to the target blockchain network through the client (similarly, a third type identification of the cleaning type can be added to the data cleaning transaction.
  • the three-type identification is used to indicate that the transaction is a data cleaning transaction)
  • the data cleaning transaction is used to instruct the blockchain node of the target blockchain network to update the latest data on the first blockchain after receiving the data cleaning transaction.
  • the state data corresponding to the block is modified to the state data corresponding to the specified block, and the state data corresponding to other blocks different from the specified block on the first blockchain is deleted.
  • the designated block may be a pre-appointed block, and each time a data cleanup transaction is received, the state data will be cleaned up according to the agreed block.
  • the designated block is the genesis block of the first blockchain.
  • the designated block can be a block designated by the administrator of the target blockchain network, and the data cleaning transaction contains the information of the block, so that the blockchain nodes in the target blockchain network follow the instructions of the data cleaning transaction. The block performs state data cleaning.
  • the block data of all blocks located before the latest block on the first blockchain can also be archived.
  • the block data (mainly the transactions contained in the block) of all blocks before the latest block on the first block chain can be archived to other storage devices different from the block chain node, and then the block The block data stored in the chain node is deleted.
  • Step 204 Obtain a first transaction receipt corresponding to the first blockchain transaction and a second transaction receipt corresponding to the second blockchain transaction, respectively.
  • the first transaction receipt includes the first type identifier
  • the second transaction receipt includes the second transaction receipt. Type identification.
  • the blockchain client may establish a connection with a certain blockchain node in the blockchain network to submit a blockchain transaction to the blockchain node.
  • the blockchain node may be a blockchain node 33n or a blockchain node 34n as shown in FIG. 3, or a blockchain node 43n as shown in FIG. 4.
  • the connection established between the block chain client 42 and the block chain node 43n can be a long connection, so that the block chain node 43n executes the block chain transaction (the first block chain transaction Or the second blockchain transaction), after the corresponding transaction receipt is generated, the corresponding transaction receipt generation event can be generated, and the blockchain client 42 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 (first transaction receipt and/or second transaction receipt) based on the aforementioned long connection.
  • the blockchain node 43n can also monitor the transaction receipt generation event through the aforementioned event monitoring mechanism, and feed the transaction receipt back to the blockchain client 42 through the aforementioned long connection, so that the blockchain client 42 can obtain Transaction receipt. Or, if the connection established between the blockchain client 42 and the blockchain node 43n is not a persistent connection or the established persistent connection is disconnected, the blockchain client 42 needs to initiate an additional query transaction to query the corresponding Transaction receipt.
  • the query transaction can be a regular blockchain transaction, so that all blockchain nodes in the blockchain network 43 need to perform operations such as obtaining, consensus, execution, and chaining for the query transaction, while the blockchain customer
  • the terminal 42 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 terminal 42 can only establish a long connection with the blockchain node 43n and send the query transaction, then the query transaction will only be acquired and executed by the blockchain node 43n.
  • the query transaction does not need to participate in consensus and does not need to be chained, or even be
  • the other blockchain nodes obtain it, and then the blockchain client 42 can obtain the transaction receipt based on the event monitoring mechanism as described above.
  • the blockchain client 42 may obtain multiple transaction receipts in batches, and the obtained transaction receipts may include the first transaction receipt and/or the second transaction receipt.
  • Step 206 Return the acquired transaction receipt to the business system.
  • the blockchain client may obtain the first transaction receipt and/or the second transaction receipt from the blockchain node of the target blockchain network, and then return the obtained transaction receipt to the business system.
  • the business system can receive the transaction receipt returned by the blockchain client.
  • the transaction receipt (first transaction receipt) containing the first type identifier is stored in the stress test database
  • the transaction receipt (second transaction receipt) containing the second type identifier is stored in the business database.
  • the follow-up business system can obtain the transaction receipt corresponding to the stress test request from the stress test database, and then analyze the stress test result.
  • the second blockchain is the production chain (for example, a certain business is realized by executing smart contracts)
  • the first blockchain is the shadow chain corresponding to the production chain
  • the first blockchain transaction is the stress test transaction (all
  • the first type of identification included is a pressure test tag
  • the second blockchain transaction is a production transaction (the second type of identification included is a business tag).
  • FIG. 5 is a flowchart of executing blockchain transactions according to an exemplary embodiment.
  • the execution process may include the following steps: Step 502, read a batch of blockchain transactions.
  • the blockchain node in the target blockchain network can make a consensus on multiple blockchain transactions sent by the blockchain client 42, and after the consensus is passed, they can respectively agree on the first type identification and the first type identification.
  • Blockchain transactions with the second type of identification are processed. That is, the blockchain node may first make a consensus on the blockchain transaction sent by the blockchain client 42, and then identify the transaction type of the blockchain transaction passed by the consensus, and then perform differentiated processing.
  • the processing method of adopting consensus first and then identifying the transaction type for blockchain transactions it is possible to perform a consensus operation only once and call the consensus service only once, thereby effectively improving the efficiency of consensus.
  • the blockchain nodes in the target blockchain network can distinguish the type identifications contained in multiple blockchain transactions sent by the blockchain client, and then respectively include the first type identifications Consensus with the blockchain transaction of the second type of identification.
  • the blockchain transactions received by the blockchain nodes in the target blockchain network 43 include stress testing transactions and production transactions, and for the execution process of these different types of blockchain transactions, part of the execution process Can be reused. For example, pre-checking, consensus, post-checking for blockchain transactions, computing services used to execute transactions, block verification, etc. In other words, in the process of performing the above operations, there is no need to differentiate between blockchain transactions for transaction types.
  • the blockchain transaction that has passed the verification is put into the verified queue. Then, in the subsequent consensus scheduling, certain rules can be followed (for example, according to the submitted block Time sequence of chain transactions) Read a batch of blockchain transactions from the verified queue, and then make a consensus on the read blockchain transactions.
  • Step 504 Consensus is made on the read blockchain transaction.
  • the real data generated in the physical world can be constructed into a standard transaction format supported by the blockchain network, and then published to the blockchain network, and the node devices in the blockchain network will respond to the received transactions. Perform consensus processing, and after reaching a consensus, the node device (ie, blockchain node) as the accounting node in the blockchain network will package the transaction into the block and store it persistently in the blockchain network. certificate.
  • the node device ie, blockchain node
  • the accounting node in the blockchain network will package the transaction into the block and store it persistently in the blockchain network. certificate.
  • the consensus algorithms supported in the blockchain network can include: the first type of consensus algorithm, that is, the consensus algorithm that node devices need to compete for the accounting right of each round of accounting cycle; for example, Proof of Work (POW) , Proof of Stake (POS), Delegated Proof of Stake (DPOS) and other consensus algorithms; the second type of consensus algorithm, that is, pre-election of accounting nodes for each round of accounting cycle (no need to compete for accounting (Account rights) consensus algorithms; for example, practical Byzantine Fault Tolerance (PBFT) and other consensus algorithms.
  • the first type of consensus algorithm that is, the consensus algorithm that node devices need to compete for the accounting right of each round of accounting cycle
  • POW Proof of Work
  • POS Proof of Stake
  • DPOS Delegated Proof of Stake
  • PBFT practical Byzantine Fault Tolerance
  • all node devices that compete for the right to bookkeeping can execute the transaction after receiving the transaction.
  • the node devices competing for the right to bookkeeping one of the node devices may win this round of contention for the right to bookkeeping and become the bookkeeping node.
  • the accounting node can package the received transaction with other transactions to generate the latest block, and send the generated latest block or the block header of the latest block to other node devices for consensus.
  • the node device In the blockchain network using the second type of consensus algorithm, the node device with the right to book accounts has been agreed before this round of bookkeeping. Therefore, after receiving the transaction, the node device can send the transaction to the accounting node if it is not the accounting node of the current round. For this round of accounting nodes, the transaction can be executed during or before the process of packaging the transaction with other transactions to generate the latest block. After the accounting node generates the latest block, it can send the latest block or the block header of the latest block to other node devices for consensus.
  • the accounting node in this round can package the received transaction to generate the latest block, and the generated latest block or the latest area
  • the block header of the block is sent to other node devices for consensus verification. If other node devices receive the latest block or the block header of the latest block, and there is no problem after verification, the latest block can be appended to the end of the original blockchain network to complete the accounting of the blockchain network process. In the process of verifying the new block or block header sent by the accounting node, other nodes can also execute the transactions contained in the block.
  • the blockchain transactions passed by the consensus are placed in the pending execution list, and then the blockchain transactions in the pending execution list are post-checked.
  • Step 506 Identify the transaction type of the blockchain transaction in the to-be-executed list.
  • the blockchain transaction is a stress test transaction, proceed to step 508A; when the blockchain transaction is a production transaction, proceed to step 508B.
  • the anti-replay check can also be performed on the blockchain transactions in the list to be executed to prevent the same transaction from being executed multiple times.
  • the anti-replay check can be performed separately for each transaction type.
  • Anti-replay check, and the means of anti-replay check can be the same.
  • blockchain accounts can include external accounts and contract accounts.
  • External accounts are usually owned by users (individuals or institutions), while contract accounts correspond to smart contracts deployed in the blockchain.
  • the structure of all types of accounts is similar and can include fields such as Balance, Nonce, Code, and Storage. in:
  • the Balance field is used to maintain the current account balance of the account; the Nonce field is used to maintain the number of transactions in the account; it is a counter used to ensure that each transaction can be processed and can only be processed once, effectively avoiding replay attacks; Code field ,
  • the contract code used to maintain the account (therefore the Code field of the external account is usually empty); in actual applications, the Code field usually only maintains the hash value of the contract code; therefore, the Code field is usually also called the Codehash field.
  • the Storage field is used to maintain the storage content of the account (the default field value is empty); for contract accounts, an independent storage space is usually allocated to store the storage content of the contract account; the independent storage space is usually Call it the account storage of the contract account.
  • the storage content of the contract account is usually constructed as an MPT (Merkle Patricia Trie) tree and the data structure is stored in the above independent storage space; among them, the MPT tree constructed based on the storage content of the contract account is usually also called the Storage tree .
  • the Storage field usually only maintains the root node of the Storage tree; therefore, the Storage field is usually also called the StorageRoot field.
  • Step 508A execute a stress test transaction.
  • Step 508B execute the production transaction.
  • the transaction type can be identified based on the tags included in the blockchain transaction.
  • a block chain transaction includes a stress test label, it is determined that the block chain transaction is a stress test transaction; when a block chain transaction includes a business label, it is determined that the block chain transaction is a production transaction.
  • the to-be-executed list can be further divided into a stress test transaction list and a production transaction list, and then the computing service interface is called (for example, executed by calling a smart contract), respectively Perform block chain transactions in the stress test transaction list and the production transaction list.
  • Step 510A generate a pressure test block.
  • step 510B a production block is generated.
  • Ethereum uses MPT tree (a variant of Merkle tree) as a form of data organization to organize and manage important data such as account status and transaction information.
  • MPT tree a variant of Merkle tree
  • Ethereum has designed three MPT trees for the data that needs to be stored and maintained in the blockchain, namely the MPT state tree, the MPT transaction tree and the MPT receipt tree.
  • the MPT state tree is an MPT tree organized by the account state data of all accounts in the blockchain;
  • the MPT transaction tree is an MPT tree organized by the transaction data in the blockchain;
  • MPT receipt tree Is the MPT tree organized by the transaction receipt (receipt) corresponding to each transaction generated after the transaction in the block is executed.
  • the hash values of the root nodes of the MPT state tree, MPT transaction tree, and MPT receipt tree shown above will all be added to the block header of the corresponding block eventually.
  • the MPT transaction tree and MPT receipt tree correspond to blocks, that is, each block has its own MPT transaction tree and MPT receipt tree.
  • the MPT state tree is a global MPT tree, which does not correspond to a specific block, but covers the account state data (ie world state) of all accounts in the blockchain.
  • the organized MPT transaction tree, MPT receipt tree, and MPT state tree will eventually be stored in a Key-Value database (for example, LevelDB) that uses a multi-level data storage structure.
  • LevelDB Key-Value database
  • the account status of the relevant account (which can be an external account or a contract account) of the executed transaction in the blockchain, usually Changes will follow, and the state of the world will also change accordingly.
  • the balances of the transferor account and transferee account related to the "transfer transaction” (that is, the field value of the Balance field of these accounts) are usually also Will change accordingly.
  • the node device After the transaction of the node device in the latest block generated by the blockchain is completed, because the account status in the current blockchain has changed, the node device needs to use the current account status data of all accounts in the blockchain to Construct the MPT state tree to maintain the latest state of all accounts in the blockchain. That is, whenever a newest block is generated in the blockchain, and the transaction in the latest block is executed, the account status in the blockchain changes, and the node device needs to be based on all accounts in the blockchain With the latest account status data, rebuild an MPT status tree. In other words, each block in the blockchain has a corresponding MPT state tree; the MPT state tree maintains the latest account of all accounts in the blockchain after the transactions in the block are executed. state.
  • the first transaction receipt obtained from performing stress test transactions contains the stress test label
  • the second transaction receipt obtained from executing production transactions includes production. Label.
  • the blockchain nodes in the target blockchain network can construct the stress test of the shadow chain based on the transactions in the stress test transaction list, the world state obtained after the stress test transaction is executed, and the transaction receipt. Block; Among them, a pressure test label can be added to the block header of the pressure test block.
  • the block chain node in the target block chain network has completed the execution of the production transaction, the transaction in the production transaction list, the world state obtained after the execution of the production transaction, and the transaction receipt construct the production block of the production chain; among them, Add a production tag to the block header of the production block.
  • Step 512 Put the generated block into the block queue to be written.
  • Step 514 Read the block from the block queue to be written.
  • Step 516 Identify the block type. When the block is a pressure test block, go to step 518A; when the block is a production block, go to step 518B.
  • the block header based on the block contains a label indicating the block type.
  • the block can be identified as a pressure test area based on the label contained in the block header of the block Blocks are also production blocks.
  • Step 518A generate block height information of the test chain.
  • Step 518B generate block height information of the production chain.
  • Step 520A write the pressure test block.
  • Step 520B write into the production block.
  • any block After reading any block in the block queue to be written and identifying the block type of any block, any block can be written in the corresponding block database (that is, the process of block formation), And generate block height information (ie, block number) of the blockchain to which any block belongs.
  • block height information ie, block number
  • write the pressure test block into the pressure test database used to store the shadow chain block data (logically add the pressure test block to the end of the shadow chain, that is, the process of building blocks on the shadow chain); , To generate the current block height information of the shadow chain.
  • write the production block into the production database used to store the block data of the production chain (logically add the production block to the end of the production chain, that is, the process of building blocks on the production chain); at the same time, generate Current block height information of the production chain.
  • the generated block height information can be stored locally in the blockchain node, or stored in other devices different from the blockchain node.
  • the block chain node can be based on the stored block height Information and corresponding block data quickly reconstruct the shadow chain and the production chain, that is, realize the rapid recovery of the shadow chain and the production chain.
  • the blockchain nodes in the target blockchain network maintain the shadow chain and the production chain
  • the shadow chain and the production chain form blocks in cycles.
  • the blockchain nodes in the target blockchain network can keep the shadow chain and the production chain block highly consistent (that is, ensure that the shadow chain and the production chain are synchronized in blocks), so that the business system does not need to perceive the target blockchain network.
  • the logic control for the blockchain is "pull block".
  • the block information of the shadow chain and the production chain needs to be obtained by pulling the block
  • the blocks of the chain are highly consistent, the logic of the business system to pull the production block and the pressure test block is the same, then a code for pulling the block can be configured for the business system, and the code can be used to obtain at the same time Blocks of shadow chain and production chain.
  • the shadow chain and the production chain block are highly inconsistent, the logic of the business system to pull the production block and the pressure test block is not the same, then the business system needs to be configured to obtain the pressure test block on the shadow chain. Code, and also need to configure the business system to obtain the code for the production block on the production chain.
  • the above "pulling block” is only an illustrative example, and it can actually be other logic control for blocks.
  • the blockchain node in the target blockchain network can determine the multiple blockchain transactions sent by the blockchain client for the current cycle.
  • the multiple blockchain transactions all contain stress test tags (that is, the blockchain transactions in the current cycle are used for stress testing)
  • the first normal block and the first normal block containing the multiple blockchain transactions are generated respectively.
  • the second blank block that does not contain the blockchain transaction, and the first normal block is added to the end of the shadow chain, and the second blank block is added to the end of the production chain.
  • the multiple blockchain transactions all contain business tags (that is, the blockchain transactions in the current cycle are all used to perform actual business in the production environment), respectively generate the first blank area that does not contain the blockchain transaction Block and the second normal block containing the multiple blockchain transactions, and the first blank block is added to the end of the shadow chain, and the second normal block is added to the end of the production chain.
  • the multiple blockchain transactions contain both stress test tags and business tags (that is, both stress test transactions and production transactions are included at the same time)
  • since the shadow chain and the production chain are cycled into blocks it can also be guaranteed to be executed After completing the multiple blockchain transactions and forming blocks, keep the blocks of the shadow chain and the production chain highly consistent.
  • Step 522 Put the block into the queue to be verified.
  • Step 524 verify the correctness of the block.
  • the block chain node in the target block chain network can read the block from the queue to be verified, verify the correctness of the block, and then, if the block is verified to be correct, send The blockchain client issues a block notification so that the blockchain client can obtain the transaction receipt.
  • the data on the shadow chain is all test data, it can be deleted after the test is over, and the data of the shadow chain can be managed In order to reduce the occupation of storage resources of blockchain nodes.
  • the administrator of the target blockchain network can submit a data cleaning transaction to the target blockchain network through the client.
  • the data cleaning transaction is used to instruct the blockchain node of the target blockchain network to receive the data cleaning transaction.
  • modify the state data corresponding to the latest block on the shadow chain to the state data corresponding to the specified block and delete the state data corresponding to other blocks on the shadow chain that are different from the specified block.
  • the designated block may be a pre-appointed block, and each time a data cleaning transaction is received, the state data is cleaned according to the agreed block.
  • the designated block is the genesis block of the shadow chain.
  • the designated block can be a block designated by the administrator of the target blockchain network, and the data cleaning transaction contains the information of the block, so that the blockchain nodes in the target blockchain network follow the instructions of the data cleaning transaction. The block performs state data cleaning.
  • the block data of all blocks located before the latest block on the shadow chain can also be archived.
  • the block data (mainly the transactions contained in the block) of all blocks located before the latest block on the shadow chain can be archived to other storage devices that are different from the blockchain node, and then the blockchain node
  • the stored block data is deleted, for example, the block header and block body are deleted, and the block is empty after deletion.
  • the blockchain node of the target blockchain network can upload the shadow chain
  • the account status of block 10 is modified to the account status corresponding to block 1, namely account X100 yuan, account Y0 yuan, and then the account status corresponding to blocks 1-9 is deleted, thereby saving the storage space of the blockchain node.
  • the stress test can still be performed again based on the account status corresponding to block 10, and the shadow chain account status is cleared after the completion At the same time, it is ensured that the blocks of the shadow chain and the production chain are highly consistent.
  • the block data of blocks 1-9 can also be archived.
  • the present disclosure also proposes an embodiment on the node side of the blockchain, and the description involved in the embodiment on the client side of the blockchain can also be applied.
  • the embodiment on the side of the blockchain node will not be described in detail below.
  • FIG. 6 is a flowchart of another method for stress testing of a blockchain network according to an exemplary embodiment.
  • the method is applied to a blockchain node and may include the following steps: Step 602, receiving a blockchain transaction, the blockchain transaction being processed by the blockchain client in response to a processing request from the business system Generate; wherein, when the processing request is a stress test request, the blockchain transaction includes a first type identifier, and when the processing request is a business request, the blockchain transaction includes a second type identifier; step 604 Return a transaction receipt corresponding to the blockchain transaction to the blockchain client, and the transaction receipt includes the same type identifier as the blockchain transaction.
  • the blockchain node receives the first type identifier that contains the first type.
  • Block chain transaction in the case that the block chain node belongs to the target block chain network, the block chain node receives a second block chain transaction containing a second type of identification.
  • the peer-to-peer blockchain network and the target blockchain network have the same network structure and network configuration.
  • the blockchain node maintains a first blockchain and a second blockchain; the blockchain node recognizes the type identification contained in the blockchain transaction; in the blockchain In the case where the transaction includes the first type of identification, the blockchain transaction is stored in a block included in the first blockchain; in the case that the blockchain transaction includes the second type of identification, the block is stored Blockchain transactions are stored in the blocks included in the second blockchain.
  • the block data of the first block chain and the block data of the second block chain are stored separately on the block chain nodes in the target block chain network.
  • the blockchain nodes in the target blockchain network maintain the first state data corresponding to the first blockchain and the second state data corresponding to the second blockchain; where the first The blockchain transaction is used to drive the update of the first state data, and the second blockchain transaction is used to drive the update of the second state data.
  • the first state data and the second state data are stored separately on the blockchain nodes in the target blockchain network.
  • the blockchain transaction containing the first type identifier and the blockchain transaction containing the second type identifier are mixed and executed by the blockchain node under the same conditions.
  • the blockchain node agrees on the multiple blockchain transactions sent by the blockchain client, and after the consensus is passed, the blocks containing the first type identifier and the second type identifier are respectively determined.
  • the block header of the block contained in the first blockchain contains the first type identifier
  • the block header of the block contained in the second blockchain contains the second type identifier
  • the blockchain node when the blockchain node receives the data cleaning transaction, it will modify the state data corresponding to the latest block on the first block chain to the state data corresponding to the specified block, and delete the first block The state data corresponding to other blocks on the block chain that are different from the specified block.
  • the designated block includes the genesis block of the first blockchain.
  • the blockchain node archives the block data of all blocks before the latest block.
  • the first block chain and the second block chain form blocks according to the cycle; the block chain node determines the multiple block chain transactions sent by the block chain client for the current cycle;
  • a first normal block containing the multiple blockchain transactions and a second blank block not containing the blockchain transaction are generated respectively, And add the first normal block to the end of the first block chain, and add the second blank block to the end of the second block chain;
  • the multiple blockchain transactions all include the second type identifier
  • the present disclosure also provides an embodiment of a pressure test device for a blockchain network.
  • Fig. 7 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 7.
  • the device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710.
  • the processor 702 reads the corresponding computer program from the non-volatile memory 710 to the memory 708 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 subject of the following processing flow is not limited to each
  • the logic unit can also be a hardware or a logic device.
  • the pressure test device of the blockchain network is applied to the blockchain client, which may include: a transaction generating unit 802, in response to a processing request from the business system, in the processing When the request is a stress test request, a first blockchain transaction including a first type identifier is generated, and when the processing request is a business request, a second blockchain transaction including a second type identifier is generated; the receipt obtaining unit 804 obtains respectively The first transaction receipt corresponding to the first blockchain transaction, the second transaction receipt corresponding to the second blockchain transaction, the first transaction receipt includes the first type identifier, and the second transaction receipt includes the second type identifier; the return receipt returns Unit 806 returns the acquired transaction receipt to the business system.
  • a transaction generating unit 802 in response to a processing request from the business system, in the processing When the request is a stress test request, a first blockchain transaction including a first type identifier is generated, and when the processing request is a business request, a second blockchain transaction including a second type identifier is generated; the receipt obtaining unit
  • the receipt obtaining unit 804 is specifically configured to: submit the first blockchain transaction to the peer-to-peer blockchain network corresponding to the target blockchain network in the production state, and receive the peer-to-peer blockchain The first transaction receipt returned by the network; and submitting the second blockchain transaction to the target blockchain network, and receiving the second transaction receipt returned by the target blockchain network.
  • the peer-to-peer blockchain network and the target blockchain network have the same network structure and network configuration.
  • the receipt obtaining unit 804 is specifically configured to: submit the first block chain transaction and the second block chain transaction to the target block chain network in the production state respectively, and receive the target block chain network The first transaction receipt and the second transaction receipt are returned respectively.
  • the block chain node in the target block chain network maintains a first block chain and a second block chain; wherein, the first block chain transaction is stored in the first block chain included Block, the second blockchain transaction is stored in the block contained in the second blockchain.
  • the block data of the first block chain and the block data of the second block chain are stored separately on the block chain nodes in the target block chain network.
  • the block chain node in the target block chain network maintains first state data corresponding to the first block chain and second state data corresponding to the second block chain; wherein, the first area The block chain transaction is used to drive the update of the first state data, and the second block chain transaction is used to drive the update of the second state data.
  • the first state data and the second state data are stored separately on the blockchain nodes in the target blockchain network.
  • the first blockchain transaction and the second blockchain transaction are mixed and executed by blockchain nodes in the target blockchain network under the same conditions.
  • the pressure test device of the blockchain network is applied to the blockchain node, and may include: a transaction receiving unit 902, which receives a blockchain transaction.
  • the blockchain client is generated in response to a processing request from the business system; wherein, when the processing request is a stress test request, the blockchain transaction includes a first type identifier, and when the processing request is a business request
  • the blockchain transaction includes a second type identifier; the receipt return unit 904 returns a transaction receipt corresponding to the blockchain transaction to the blockchain client, and the transaction receipt includes the type identifier and the block Chain transactions are the same.
  • the transaction receiving unit 902 is specifically configured to: receive the identifier containing the first type
  • the receiving blockchain transaction includes: receiving a second blockchain transaction containing a second type of identifier .
  • the peer-to-peer blockchain network and the target blockchain network have the same network structure and network configuration.
  • the block chain node maintains a first block chain and a second block chain;
  • the device further includes: a transaction execution unit 906, which recognizes the type identification contained in the block chain transaction;
  • the blockchain transaction includes the first type of identification
  • the blockchain transaction is stored in a block included in the first blockchain; in the case that the blockchain transaction includes the second type of identification, Store the blockchain transaction in a block included in the second blockchain.
  • the block data of the first block chain and the block data of the second block chain are stored separately on the block chain nodes in the target block chain network.
  • the block chain node in the target block chain network maintains first state data corresponding to the first block chain and second state data corresponding to the second block chain; wherein, the first area The block chain transaction is used to drive the update of the first state data, and the second block chain transaction is used to drive the update of the second state data.
  • the first state data and the second state data are stored separately on the blockchain nodes in the target blockchain network.
  • the blockchain transaction containing the first type identifier and the blockchain transaction containing the second type identifier are mixed and executed by the blockchain node under the same conditions.
  • a transaction consensus unit 908 which performs a consensus on multiple blockchain transactions sent by the blockchain client, and after the consensus is passed, the districts containing the first type identification and the second type identification are respectively determined. Block chain transactions are processed; or, after distinguishing the type identifications contained in multiple blockchain transactions sent by the blockchain client, block chain transactions that contain the first type identification and the second type identification are respectively distinguished Have a consensus.
  • the block header of the block contained in the first blockchain includes the first type identifier
  • the block header of the block contained in the second blockchain includes the second type identifier
  • a cleaning unit 910 in the case of receiving the data cleaning transaction, modify the state data corresponding to the latest block on the first block chain to the state data corresponding to the specified block, and delete the first block The state data corresponding to other blocks on the block chain that are different from the specified block.
  • the designated block includes the genesis block of the first blockchain.
  • the cleaning unit 910 is further configured to: archive block data of all blocks before the latest block.
  • the first block chain and the second block chain are formed into blocks in cycles;
  • the transaction execution unit 908 is further configured to: determine multiple block chains sent by the block chain client for the current cycle Transaction; in the case where the multiple blockchain transactions all contain the first type of identification, respectively generate a first normal block containing the multiple blockchain transactions and a second blank area that does not contain the blockchain transaction Block, and add the first normal block to the end of the first block chain, and add the second blank block to the end of the second block chain;
  • the multiple blockchain transactions all include the second type identifier
  • 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.
  • 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, magnetic 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.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • CD-ROM compact disc
  • DVD digital versatile disc
  • Magnetic cassettes magnetic disk storage, quantum
  • 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)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Computing Systems (AREA)
  • Development Economics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

本公开一个或多个实施例提供一种区块链网络的压力测试方法及装置、系统,该方法可以包括:响应于来自业务系统的处理请求,在所述处理请求为压测请求时生成包含第一类型标识的第一区块链交易,在所述处理请求为业务请求时生成包含第二类型标识的第二区块链交易;分别获取对应于第一区块链交易的第一交易回执、对应于第二区块链交易的第二交易回执,第一交易回执包含第一类型标识、第二交易回执包含第二类型标识;向所述业务系统返回获取到的交易回执。

Description

区块链网络的压力测试方法及装置、系统 技术领域
本公开一个或多个实施例涉及区块链技术领域,尤其涉及一种区块链网络的压力测试方法及装置、系统。
背景技术
区块链技术(也被称之为,分布式账本技术)是一种去中性化的分布式数据库技术,具有去中心化、公开透明、不可篡改、可信任等多种特点,适用于诸多对数据可靠性具有高需求的应用场景中。通过向区块链网络导入压力测试流量,可以获知区块链网络的负载能力、数据吞吐量上限等各项性能指标,从而据此维护区块链网络的正常运行,或者针对区块链网络进行优化。
发明内容
本公开一个或多个实施例提供一种区块链网络的压力测试方法及装置、系统。
根据本公开一个或多个实施例的第一方面,提出了一种区块链网络的压力测试系统,包括:区块链客户端,响应于来自业务系统的处理请求,在所述处理请求为压测请求时生成包含第一类型标识的第一区块链交易,在所述处理请求为业务请求时生成包含第二类型标识的第二区块链交易;第一区块链网络,接收所述区块链客户端提交的第一区块链交易,执行第一区块链交易并生成包含第一类型标识的交易回执;第二区块链网络,接收所述区块链客户端提交的第二区块链交易,执行第二区块链交易并生成包含第二类型标识的交易回执;业务系统,向所述区块链客户端发送所述处理请求,并接收所述区块链客户端返回的交易回执;将包含第一类型标识的交易回执存储至压测数据库,将包含第二类型标识的交易回执存储至业务数据库。
根据本公开一个或多个实施例的第二方面,提出了一种区块链网络的压力测试系统,包括:区块链客户端,响应于来自业务系统的处理请求,在所述处理请求为压测请求时生成包含第一类型标识的第一区块链交易,在所述处理请求为业务请求时生成包含第二类型标识的第二区块链交易;区块链网络,接收所述区块链客户端提交的第一区块链交易和第二区块链交易,执行第一区块链交易并生成包含第一类型标识的交易回执,执行第二区块链交易并生成包含第二类型标识的交易回执;业务系统,向所述区块链客户端发送所述处理请求,并接收所述区块链客户端返回的交易回执;将包含第一类型标识的交易回执存储至压测数据库,将包含第二类型标识的交易回执存储至业务数据库。
根据本公开一个或多个实施例的第三方面,提出了一种区块链网络的压力测试方法,应用于区块链客户端,所述方法包括:响应于来自业务系统的处理请求,在所述处理请求为压测请求时生成包含第一类型标识的第一区块链交易,在所述处理请求为业务请求时生成包含第二类型标识的第二区块链交易;分别获取对应于第一区块链交易的第一交易回执、对应于第二区块链交易的第二交易回执,第一交易回执包含第一类型标识、第二交易回执包含第二类型标识;向所述业务系统返回获取到的交易回执。
根据本公开一个或多个实施例的第四方面,提出了一种区块链网络的压力测试方法,应用于区块链节点,所述方法包括:接收区块链交易,所述区块链交易由区块链客户端响应于来自业务系统的处理请求而生成;其中,在所述处理请求为压测请求时所述区块链交易中包含第一类型标识,在所述处理请求为业务请求时所述区块链交易包含第二类型标识;向所述区块链客户端返回所述区块链交易对应的交易回执,所述交易回执包含的类型标识与所述区块链交易相同。
根据本公开一个或多个实施例的第五方面,提出了一种区块链网络的压力测试装置,应用于区块链客户端,所述装置包括:交易生成单元,响应于来自业务系统的处理请求,在所述处理请求为压测请求时生成包含第一类型标识的第一区块链交易,在所述处理请求为业务请求时生成包含第二类型标识的第二区块链交易;回执获取单元,分别获取对应于第一区块链交易的第一交易回执、对应于第二区块链交易的第二交易回执,第一交易回执包含第一类型标识、第二交易回执包含第二类型标识;回执返回单元,向所述业务系统返回获取到的交易回执。
根据本公开一个或多个实施例的第六方面,提出了一种区块链网络的压力测试装置,应用于区块链节点,所述装置包括:交易接收单元,接收区块链交易,所述区块链交易由区块链客户端响应于来自业务系统的处理请求而生成;其中,在所述处理请求为压测请求时所述区块链交易中包含第一类型标识,在所述处理请求为业务请求时所述区块链交易包含第二类型标识;回执返回单元,向所述区块链客户端返回所述区块链交易对应的交易回执,所述交易回执包含的类型标识与所述区块链交易相同。
根据本公开一个或多个实施例的第七方面,提出了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器通过运行所述可执行指令以实现如上述实施例中任一所述的方法。
根据本公开一个或多个实施例的第八方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如上述实施例中任一所述方法的步骤。
附图说明
图1是一示例性实施例提供的一种网络架构的示意图。
图2是一示例性实施例提供的一种区块链网络的压力测试方法的流程图。
图3是一示例性实施例提供的一种区块链网络的压力测试系统的示意图。
图4是一示例性实施例提供的另一种区块链网络的压力测试系统的示意图。
图5是一示例性实施例提供的一种执行区块链交易的流程图。
图6是一示例性实施例提供的另一种区块链网络的压力测试方法的流程图。
图7是一示例性实施例提供的一种设备的结构示意图。
图8是一示例性实施例提供的一种区块链网络的压力测试装置的框图。
图9是一示例性实施例提供的另一种区块链网络的压力测试装置的框图。
具体实施方式
在其他实施例中并不一定按照本公开示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本公开所描述的更多或更少。此外,本公开中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本公开中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。
图1是一示例性实施例提供的一种网络架构的示意图。如图1所示,业务系统11产生处理请求后,将该处理请求发送至区块链客户端12,由区块链客户端12针对该处理请求创建区块链交易,并将区块链交易提交至区块链网络13,使得区块链网络13上的区块链节点执行该区块链交易。当针对区块链网络13存在压力测试(简称“压测”)需求时,业务系统11可以生成压测请求类型的处理请求(包含用于压力测试的数据),而区块链客户端12可以针对这些压测请求创建相应的区块链交易,并由区块链网络13执行这些区块链交易以对区块链网络13进行压力测试;以及,区块链客户端12将区块链网络13执行区块链交易而产生的交易回执反馈至业务系统11,以由业务系统11对交易回执进行分析后,确定区块链网络13的压测结果。而在生产环境下,业务系统11、区块链客户端12和区块链网络13之间的交互过程,与上述的压测过程类似:业务系统11生成业务请求类型的处理请求,区块链客户端12针对这些业务请求创建相应的区块链交易,并由区块链网络13执行这些区块链交易;以及,区块链客户端12将区块链网络13执行区块链交易而产生的交易回执反馈至业务系统11。
在全链路压测场景下,涉及到生产环境中的压力测试。为了避免上述的压测请求与业务请求之间产生相互干扰,业务系统11可以在业务请求中添加压测标签以区分于业务请求;当然,也可以在业务请求中添加业务标签以区分于压测请求。但是,区块链客户端12在创建区块链交易时,由于需要遵守现有的交易格式等相关规定,因而无法针对不同处理请求对应的区块链交易予以区分,即无法将上述的压测标签或业务标签等特征标签带入到区块链网络13中,造成区块链网络13产生的交易回执同样无法携带上述的特征标签,使得业务系统11无法有效区分交易回执的来源,无法据此准确获知区块链网络13的压测结果。
下面结合实施例对本公开的压力测试方案进行描述。
请参见图2,图2是一示例性实施例提供的一种区块链网络的压力测试方法的流程图。如图2所示,该方法应用于区块链客户端,可以包括以下步骤:步骤202,响应于来自业务系统的处理请求,在所述处理请求为压测请求时生成包含第一类型标识的第一区块链交易,在所述处理请求为业务请求时生成包含第二类型标识的第二区块链交易。
区块链客户端用于配合业务系统与区块链网络,以实现业务系统与区块链网络之间的数据交互。其中,区块链客户端可以包括任意能够实现数据交互的电子设备,比如为区块链网关;当然,本公开并不对此进行限制。在业务系统向区块链网络传递数据的过程中,区块链客户端接收业务系统发起的处理请求,并创建对应于处理请求的区块链交易,然后将该区块链交易提交至区块链网络,使得区块链网络中的所有区块链节点对该区块链交易进行共识、执行、上链等操作;以及,在区块链网络向业务系统传递数据的过程中,区块链客户端获取区块链网络通过执行上述区块链交易所产生的交易回执 (receipt),并将该交易回执反馈至业务系统。
而在本公开提供的压力测试方案中,区块链网络可能存在多种结构,这使得区块链客户端在创建区块链交易、与区块链网络实现数据交互等操作可能由于区块链网络的结构差异而存在一定不同。
在一实施例中,为了避免压力测试与生产业务之间相互干扰,可分别部署用于响应第一区块链交易的第一区块链网络,以及用于响应第二区块链交易的第二区块链网络。那么,区块链客户端在创建第一区块链交易后,可向第一区块链网络提交该第一区块链交易;类似的,区块链客户端在创建第二区块链交易后,可向第二区块链网络提交该第二区块链交易。进一步的,第一区块链网络可接收区块链客户端提交的第一区块链交易,执行第一区块链交易并生成包含第一类型标识的交易回执(即第一交易回执);类似的,第二区块链网络接收区块链客户端提交的第二区块链交易,执行第二区块链交易并生成包含第二类型标识的交易回执(即第二交易回执)。而区块链客户端可获取第一区块链网络和第二区块链网络生成的交易回执,并返回至业务系统。相应的,业务系统可接收区块链客户端返回的交易回执,将包含第一类型标识的交易回执存储至压测数据库,以及将包含第二类型标识的交易回执存储至业务数据库。
以处于生产状态的目标区块链网络为第二区块链网络,与目标区块链网络对应的对等区块链网络为第一区块链网络进行举例说明。如图3所示,可以针对处于生产状态的目标区块链网络33部署对应的对等区块链网络34,使得目标区块链网络33用于实现生产业务、对等区块链网络34用于实现压力测试。相应地,区块链客户端32在收到业务系统31发起的处理请求后,需要对该处理请求的类型予以识别,以确定该处理请求为业务请求还是压测请求。区块链客户端32可以在接收到的处理请求为压测请求的情况下,针对上述的对等区块链网络34创建对应于该处理请求(即压测请求)的第一区块链交易(包含第一类型标识,比如为压测标签),并将该第一区块链交易发送至对等区块链网络34。比如,区块链客户端32可以将第一区块链交易发送至区块链网络34中的某一区块链节点34n,而该区块链节点34n可以进一步将该区块链交易传递至区块链网络34中的其他区块链节点,使得所有区块链节点可以针对该区块链交易进行共识、执行、上链等操作,并生成相应的交易回执(包含第一类型标识,即上述压测标签)。类似的,区块链客户端32可以在接收到的处理请求为业务请求的情况下,针对上述的目标区块链网络33创建对应于该业务请求的第二区块链交易(包含第二类型标识,比如为业务标签),并将第二区块链交易发送至目标区块链网络33。比如,区块链客户端32可以将第二区块链交易发送至区块链网络33中的某一区块链节点33n,而该区块链节点33n可以进一步将该第二区块链交易传递至区块链网络33中的其他区块链节点,使得所有区块链节点可以针对该第二区块链交易进行共识、执行、上链等操作,并生成相应的交易回执(包含第二类型标识,即上述业务标签)。
对等区块链网络34与目标区块链网络33可以具有相同的网络结构和网络配置(包括硬件和软件配置),使得针对对等区块链网络34所实施的压力测试能够体现出目标区块链网络33的真实状况。当然,对等区块链网络34可以与目标区块链网络33之间存在一定差异,这种差异可能由于各种因素所导致,但针对该对等区块链网络34所实施的压力测试,仍然能够在一定程度上反馈出目标区块链网络33的真实状况。
为了避免重复部署和配置区块链网络,即不需要基于额外资源来部署专用于压力测试的区块链网络,可由同一区块链网络来响应第一区块链交易和第二区块链交易,那么该同一区块链网络需要对接收到的区块链交易进行识别。因此,区块链客户端在创建区块链交易时,可在区块链交易中添加用于表明交易类型的类型标识(与处理请求的请求类型相对应)。相应的,区块链网络在生成交易回执时,同样在交易回执中添加相应的类型标识来表明该交易回执与哪种处理请求相对应。比如,区块链客户端可响应于来自业务系统的处理请求,在处理请求为压测请求时生成包含第一类型标识的第一区块链交易,在处理请求为业务请求时生成包含第二类型标识的第二区块链交易。进一步的,区块链客户端在生成第一区块链交易和第二区块链交易后,向该区块链网络提交第一区块链交易和第二区块链交易。而区块链网络在接收到区块链客户端提交的第一区块链交易和第二区块链交易后,可执行第一区块链交易并生成包含第一类型标识的交易回执(即第一交易回执),执行第二区块链交易并生成包含第二类型标识的交易回执(即第二交易回执)。然后,区块链客户端可获取区块链网络生成的交易回执,并返回至业务系统。相应的,业务系统可接收区块链客户端返回的交易回执,将包含第一类型标识的交易回执存储至压测数据库,以及将包含第二类型标识的交易回执存储至业务数据库。
以处于生产状态的目标区块链网络分别响应第一区块链交易和第二区块链交易为例进行举例说明。如图4所示,目标区块链网络43中的区块链节点同时维护有第一区块链A和第二区块链B;其中,第一区块链A的区块用于记录第一区块链交易,第二区块链B的区块用于记录第二区块链交易。换言之,目标区块链网络43在执行第一区块链交易后,第一区块链交易被存储至第一区块链所含的区块中;区块链网络43在执行第二区块链交易后,第二区块链交易被存储至第二区块链所含的区块中。相应的,第一区块链所含区块的区块头中包含第一类型标识,第二区块链所含区块的区块头中包含第二类型标识。基于区块头中包含类型标识,那么可有效将第一区块链和第二区块链区分。比如,在生成第一区块链的区块和第二区块链的区块后,可通过区块头识别出这些区块属于哪个区块链,进而将识别出的区块添加至所属区块链的末端。
可见,通过上述部署目标区块链网络的方式,业务系统41可无需感知测试环境(即无需感知第一区块链的存在),负责对处理请求进行打标(标记压测请求或业务请求)即可,使得压力测试对业务的侵入较低。
区块链客户端42在收到业务系统41发起的处理请求后,需要对该处理请求的类型予以识别,以确定该处理请求为业务请求还是压测请求。区块链客户端42可以在接收到的处理请求为压测请求的情况下,创建对应于压测请求的第一区块链交易(包含第一类型标识,比如为压测标签);以及,在接收到的处理请求为业务请求的情况下,创建对应于业务请求的第二区块链交易(包含第二类型标识,比如为压测标签)。然后,区块链客户端42可将第一区块链交易和第二区块链交易分别提交至处于生产状态的目标区块链网络43,以接收目标区块链网络43分别返回的第一交易回执和第二交易回执。比如,区块链客户端42可以将第一区块链交易和第二区块链交易分别提交至目标区块链网络43中的某一区块链节点43n,而该区块链节点43n可以进一步将第一区块链交易和第二区块链交易传递至区块链网络43中的其他区块链节点,使得所有区块链节点可以针对第一区块链交易和第二区块链交易进行共识、执行、上链等操作,并分别生成对 应于第一区块链交易的交易回执(包含第一类型标识,即上述压测标签)和对应于第二区块链交易的交易回执(包含第二类型标识,即上述业务标签)。其中,目标区块链网络43中的区块链节点在接收到区块链客户端42提交的区块链交易后,可识别接收到的区块链交易所含的类型标识,从而据此确定出该区块链交易为第一区块链交易还是第二区块链交易。具体而言,在区块链交易包含第一类型标识的情况下(表明该区块链交易属于第一区块链交易),可将该区块链交易存储至第一区块链所含的区块;在区块链交易包含第二类型标识的情况下(表明该区块链交易属于第二区块链交易),可将区块链交易存储至第二区块链所含的区块。
对于添加类型标识的方式,在一种情况下,可在区块链交易中添加type字段(或者其他任意字段),用于标记区块链交易为生产交易(与业务请求对应)或测试交易(与压测请求对应)。比如,当任一区块链交易type字段的取值为第一取值时,表明该区块链交易属于生产交易,当任一区块链交易type字段的取值为第二取值(区别于第一取值)时,表明该区块链交易属于测试交易。相应地,在交易回执中也添加type字段,用于标记该交易回执对应于生产交易还是对应于测试交易。在另一种情况下,还可复用区块链交易和交易回执中的已有字段,在已有字段中添加类型标识。比如,复用区块链交易中的“reserved字段”来表明区块链交易的交易类型;例如,可在“reserved字段”中添加业务标签,使得区块链网络上的区块链节点可以将包含业务标签的区块链交易识别为生产交易,而将未包含业务标签的区块链交易识别为测试交易。或者,可在“reserved字段”中添加压测标签,使得区块链节点可将包含压测标签的区块链交易识别为测试交易,而将未包含压测标签的区块链交易识别为生产交易。或者,还可同时在“reserved字段”中添加业务标签和压测标签,使得区块链节点可将包含业务标签的区块链交易识别为生产交易,将包含压测标签的区块链交易识别为测试交易。需要说明的是,针对在交易回执中添加类型标识的方式与上述类似,在此不再赘述。
目标区块链网络中的区块链节点在获取到包含第一类型标识的区块链交易(即第一区块链交易)和包含第二类型标识的区块链交易(即第二区块链交易)后,可在相同的条件下混合执行上述区块链交易。作为一示例性实施例,目标区块链网络中的区块链节点可复用自身的软硬件资源(比如机器资源、网络资源、计算资源等)来执行第一区块链交易和第二区块链交易,即上述“相同的条件”可包括区块链节点的软件资源和硬件资源。通过在相同的条件下混合执行第一区块链交易和第二区块链交易,一方面可使得针对第一区块链所实施的压力测试能够体现出第二区块链的真实状况,另一方面第一区块链和第二区块链共享软硬件资源,可有效降低成本。需要说明的是,可避开在第二区块链交易的流量高峰期(比如,大量通过提交第二区块链交易来实现业务的时间段)通过第一区块链交易来进行压力测试,一方面可尽可能提高压力测试的准确度,另一方面可减少对业务正常执行的影响。
针对上述目标区块链网络中的区块链节点同时维护第一区块链和第二区块链的方式,第一区块链的区块数据和第二区块链的区块数据在目标区块链网络中的区块链节点上隔离存储,即第一区块链和第二区块链的区块数据互相隔离,各自使用独立的存储资源,从而避免压力测试给业务的生产环境造成影响,影响业务的正常执行。
以目标区块链网络采用账户模型为例,由于目标区块链网络中的区块链节点同时维 护第一区块链和第二区块链,则目标区块链网络中的区块链节点维护有对应于第一区块链的第一状态数据、对应于第二区块链的第二状态数据。其中,第一状态数据为第一区块链的世界状态(第一区块链上所有区块链账户的账户状态),第二状态数据为第二区块链的世界状态(第二区块链上所有区块链账户的账户状态)。针对第一区块链,目标区块链网络中的区块链节点在执行第一区块链交易后,将导致第一区块链上的账户状态发生变化,进而导致第一区块链的世界状态发生变化;换言之,第一区块链交易被用于驱动第一状态数据的更新。同理,针对第二区块链,目标区块链网络中的区块链节点在执行第二区块链交易后,将导致第二区块链上的账户状态发生变化,进而导致第二区块链的世界状态发生变化;换言之,第二区块链交易被用于驱动第二状态数据的更新。
类似的,针对上述目标区块链网络中的区块链节点同时维护第一状态数据和第二状态数据的方式,第一状态数据和第二状态数据在目标区块链网络中的区块链节点上隔离存储,即第一区块链和第二区块链的状态数据互相隔离,各自使用独立的存储资源,从而避免压力测试给业务的生产环境造成影响,影响业务的正常执行。
承接于上述区块链节点维护有第一区块链和第二区块链的实施例,第一区块链和第二区块链可按周期成块。那么,目标区块链网络中的区块链节点可保持第一区块链和第二区块链的区块高度一致(即保证第一区块链和第二区块链成块同步进行),使得业务系统无需感知目标区块链网络上的第一区块链(第一区块链为测试环境)和第二区块链(第二区块链为生产环境),即无需感知测试环境和生产环境。那么,便无需针对业务系统开发相应的环境控制代码以分别适配于测试环境和生产环境,而是针对测试环境和生产环境能够采用统一的区块链数据管理方式。
为了保证第一区块链和第二区块链的区块高度一致,目标区块链网络中的区块链节点可确定区块链客户端发送的用于当前周期的多笔区块链交易;在该笔区块链交易均包含第一类型标识的情况(即该多笔区块链交易中仅包含第一区块链交易,不包含第二区块链交易)下,分别生成包含该多笔区块链交易的第一正常区块和未包含区块链交易的第二空白区块,并将第一正常区块添加至第一区块链的末端、将第二空白区块添加至第二区块链的末端。同理,在该多笔区块链交易均包含第二类型标识的情况(即该多笔区块链交易中仅包含第二区块链交易,不包含第一区块链交易)下,分别生成未包含区块链交易的第一空白区块和包含该多笔区块链交易的第二正常区块,并将第一空白区块添加至第一区块链的末端、将第二正常区块添加至第二正常区块链的末端。而针对该多笔区块链交易中既包含第一类型标识又包含第二类型标识的情况(即同时包含第一区块链交易和第二区块链交易),由于第一区块链和第二区块链按周期成块,那么也能保证在执行完该多笔区块链交易并成块之后,保持第一区块链和第二区块链的区块高度一致。
在上述为了保持第一区块链和第二区块链的区块高度一致的前提下,可对第一区块链的数据进行管理以减少对区块链节点存储资源的占用。作为一示例性实施例,目标区块链网络的管理员可通过客户端向目标区块链网络提交数据清理交易(类似的,可在数据清理交易中添加清理类型的第三类型标识,该第三类型标识用于表明所属交易为数据清理交易),该数据清理交易用于指示目标区块链网络的区块链节点在接收到该数据清理交易的情况下,将第一区块链上最新区块对应的状态数据修改为指定区块对应的状态数据,并删除第一区块链上区别于指定区块的其他区块对应的状态数据。那么,在执行 完数据清理交易后,即使后续又存在与该指定区块的状态数据对应的压力测试需求,由于最新区块的状态数据被修改为该指定区块的状态数据,也依然可以重新基于最新区块的状态数据进行压力测试,并且在完成清理第一区块链状态数据的同时保证第一区块链和第二区块链的区块高度一致。
进一步,指定区块可是预先约定好的区块,每次接收到数据清理交易均按照该约定好的区块进行状态数据清理。比如,指定区块为第一区块链的创世块。或者,指定区块可以是目标区块链网络的管理员指定的区块,数据清理交易中包含该区块的信息,进而使得目标区块链网络中的区块链节点按照数据清理交易指示的区块进行状态数据清理。
为了进一步减少第一区块链的数据对区块链节点存储资源的占用,还可将第一区块链上位于最新区块之前的所有区块的区块数据归档。比如,可将第一区块链上位于最新区块之前的所有区块的区块数据(主要为区块中包含的交易)归档至区别于区块链节点的其他存储设备,进而将区块链节点中存储的区块数据删除。
步骤204,分别获取对应于第一区块链交易的第一交易回执、对应于第二区块链交易的第二交易回执,第一交易回执包含第一类型标识、第二交易回执包含第二类型标识。
在一实施例中,区块链客户端可以通过与区块链网络中的某一区块链节点之间建立连接,从而向该区块链节点提交区块链交易。比如,该区块链节点可以为如图3所示的区块链节点33n或区块链节点34n,也可以为如图4所示的区块链节点43n。以区块链节点43n为例,区块链客户端42与该区块链节点43n之间建立的连接可以为长连接,使得区块链节点43n执行区块链交易(第一区块链交易或者第二区块链交易),生成相应的交易回执之后,可以产生相应的交易回执生成事件,而区块链客户端42可以通过监听该交易回执生成事件获知交易回执已生成(即事件监听机制),并基于上述的长连接获取该交易回执(第一交易回执和/或第二交易回执)。当然,也可以由区块链节点43n自身通过上述的事件监听机制来监听交易回执生成事件,并通过上述的长连接将交易回执反馈至区块链客户端42,使得区块链客户端42获得交易回执。或者,如果区块链客户端42与区块链节点43n之间建立的连接并非长连接或者所建立的长连接断开,区块链客户端42需要额外通过发起一笔查询交易,以查询相应的交易回执。其中,该查询交易可以为常规的区块链交易,使得区块链网络43中的所有区块链节点均需针对该查询交易进行获取、共识、执行、上链等操作,而区块链客户端42可以通过上述方式与某一区块链节点建立长连接,并基于上述的事件监听机制从该区块链节点处获取交易回执;或者,该查询交易可以为特殊交易,譬如区块链客户端42可以仅与区块链节点43n建立长连接并发送该查询交易,那么该查询交易仅会被区块链节点43n获取并执行,该查询交易无需参与共识且不需要上链,甚至无需被其他区块链节点获取,然后区块链客户端42可以基于如前所述的事件监听机制获取交易回执。当然,区块链客户端42可批量获取多个交易回执,那么获取到的交易回执中可包括第一交易回执和/或第二交易回执。
步骤206,向所述业务系统返回获取到的交易回执。
在一实施例中,区块链客户端可从目标区块链网络的区块链节点处获取到第一交易回执和/或第二交易回执,进而向业务系统返回获取到的交易回执。业务系统可接收区块 链客户端返回的交易回执。其中,将包含第一类型标识的交易回执(第一交易回执)存储至压测数据库,将包含第二类型标识的交易回执(第二交易回执)存储至业务数据库。那么,后续业务系统可以从压测数据库获取对应于压测请求的交易回执,进而分析压测结果。
以下以第二区块链为生产链(比如,通过执行智能合约来实现某项业务)、第一区块链为对应于生产链的影子链、第一区块链交易为压测交易(所含的第一类型标识为压测标签)、第二区块链交易为生产交易(所含的第二类型标识为业务标签)为例,结合图5对图4中目标区块链网络执行区块链交易的过程进行详细说明。
请参见图5,图5是一示例性实施例提供的一种执行区块链交易的流程图。如图5所示,该执行过程可以包括以下步骤:步骤502,读取一批区块链交易。
在一种情况下,目标区块链网络中的区块链节点可对区块链客户端42发送的多笔区块链交易进行共识,并在共识通过后分别对包含第一类型标识和第二类型标识的区块链交易进行处理。也即,区块链节点可先对区块链客户端42发送的区块链交易进行共识,再识别共识通过的区块链交易的交易类型,进而进行差异化处理。通过上述针对区块链交易采用先共识再识别交易类型的处理方式,可以仅执行一次共识操作,仅调用一次共识服务,从而有效提高了共识的效率。
在另一种情况下,目标区块链网络中的区块链节点可对区块链客户端发送的多笔区块链交易所含的类型标识进行区分后,再分别对包含第一类型标识和第二类型标识的区块链交易进行共识。
在本实施例中,目标区块链网络43中的区块链节点接收到的区块链交易包括压测交易和生产交易,而针对这些不同类型的区块链交易的执行过程,部分执行流程可进行复用。比如,针对区块链交易的前置校验、共识、后置校验、执行交易采用的计算服务、区块验证等。换言之,在执行上述操作的过程中,可不必针对交易类型对区块链交易进行差异化处理。
在对接收到的区块链交易进行前置校验后,将校验通过的区块链交易放入已验证队列,那么后续在进行共识调度时,可按照一定规则(比如,按照提交区块链交易的时间先后顺序)从已验证队列中读取一批区块链交易,进而对读取到的区块链交易进行共识。
步骤504,对读取到的区块链交易进行共识。
对于物理世界产生的真实数据,可以将其构建成区块链网络所支持的标准的交易(transaction)格式,然后发布至区块链网络,由区块链网络中的节点设备对收到的交易进行共识处理,并在达成共识后,由区块链网络中作为记账节点的节点设备(即区块链节点),将这笔交易打包进区块,在区块链网络中进行持久化存证。
区块链网络中支持的共识算法可以包括:第一类共识算法,即节点设备需要争夺每一轮的记账周期的记账权的共识算法;例如,工作量证明(Proof of Work,POW)、股权证明(Proof of Stake,POS)、委任权益证明(Delegated Proof of Stake,DPOS)等共识算法;第二类共识算法,即预先为每一轮记账周期选举记账节点(不需要争夺记账权)的共识算法;例如,实用拜占庭容错(Practical Byzantine Fault Tolerance,PBFT)等共 识算法。
在采用第一类共识算法的区块链网络中,争夺记账权的节点设备,都可以在接收到交易后执行该笔交易。争夺记账权的节点设备中可能有一个节点设备在本轮争夺记账权的过程中胜出,成为记账节点。记账节点可以将收到的交易与其它交易一起打包以生成最新区块,并将生成的最新区块或者该最新区块的区块头发送至其它节点设备进行共识。
在采用第二类共识算法的区块链网络中,具有记账权的节点设备在本轮记账前已经商定好。因此,节点设备在接收到交易后,如果自身不是本轮的记账节点,则可以将该交易发送至记账节点。对于本轮的记账节点,在将该交易与其它交易一起打包以生成最新区块的过程中或者之前,可以执行该交易。记账节点在生成最新区块后,可以将该最新区块或者该最新区块的区块头发送至其它节点设备进行共识。
如上所述,无论区块链网络采用以上示出的哪种共识算法,本轮的记账节点都可以将接收到的交易打包以生成最新区块,并将生成的最新区块或者该最新区块的区块头发送至其它节点设备进行共识验证。如果其它节点设备接收到最新区块或者该最新区块的区块头后,经验证没有问题,可以将该最新区块追加到原有的区块链网络末尾,从而完成区块链网络的记账过程。其它节点验证记账节点发来的新的区块或区块头的过程中,也可以执行该区块中的包含的交易。
在完成共识后,将共识通过的区块链交易放入待执行列表中,进而对待执行列表中的区块链交易进行后置校验。
步骤506,识别待执行列表中区块链交易的交易类型,当区块链交易为压测交易时转入步骤508A;当区块链交易为生产交易时转入步骤508B。
在一实施例中,还可对待执行列表中的区块链交易进行防重放检查,防止同一笔交易执行多次。其中,由于在生成区块阶段会根据不同的交易类型生成不同的区块,并且不同的区块中的交易访问不同的数据存储,在进行防重放检查时,可分别针对每种交易类型进行防重放检查,而进行防重放检查的手段可以相同。
以账户模型(以太坊)为例,区块链账户可以包括外部账户和合约账户等。外部账户通常为用户(个人或机构)所有,而合约账户则对应于部署在区块链中的智能合约。各类账户的结构都类似,可以包括Balance,Nonce,Code和Storage等字段。其中:
Balance字段,用于维护账户目前的账户余额;Nonce字段,用于维护该账户的交易次数;它是用于保障每笔交易能且只能被处理一次的计数器,有效避免重放攻击;Code字段,用于维护该账户的合约代码(因而外部账户的Code字段通常为空);在实际应用中,Code字段中通常仅维护合约代码的hash值;因而,Code字段通常也称之为Codehash字段。
Storage字段,用于维护该账户的存储内容(默认字段值为空);对于合约账户而言,通常会分配一个独立的存储空间,用以存储该合约账户的存储内容;该独立的存储空间通常称之为该合约账户的账户存储。合约账户的存储内容通常会构建成MPT(Merkle Patricia Trie)树的数据结构存储在上述独立的存储空间之中;其中,基于合约账户的存储内容构建成的MPT树,通常也称之为Storage树。而Storage字段通常仅维护该Storage 树的根节点;因此,Storage字段通常也称之为StorageRoot字段。
步骤508A,执行压测交易。
步骤508B,执行生产交易。
在一实施例中,可根据区块链交易中包含的标签来识别交易类型。当区块链交易中包含压测标签时,确定该区块链交易为压测交易;当区块链交易中包含业务标签时,确定该区块链交易为生产交易。在识别出待执行列表中区块链交易的交易类型后,可将待执行列表进一步划分为压测交易列表和生产交易列表,进而调用计算服务接口(比如,通过调用智能合约来执行),分别执行压测交易列表和生产交易列表中的区块链交易。
步骤510A,生成压测区块。
步骤510B,生成生产区块。
以以太坊为例,以太坊使用了MPT树(一种Merkle树变种),作为数据组织形式,用来组织和管理账户状态、交易信息等重要数据。以太坊针对区块链中需要存储和维护的数据,设计了三棵MPT树,分别是MPT状态树、MPT交易树和MPT收据树。
MPT状态树,是由区块链中所有账户的账户状态(state)数据组织成的MPT树;MPT交易树,是由区块链中的交易(transaction)数据组织成的MPT树;MPT收据树,是区块中的交易在执行完毕后生成的与每笔交易对应的交易收据(receipt)组织成的MPT树。以上示出的MPT状态树、MPT交易树和MPT收据树的根节点的hash值,最终都会被添加至对应区块的区块头中。其中,MPT交易树和MPT收据树均与区块相对应,即每一个区块都有自己的MPT交易树和MPT收据树。而MPT状态树是一个全局的MPT树,并不与某一个特定的区块相对应,而是涵盖了区块链中所有账户的账户状态数据(即世界状态)。对于组织成的MPT交易树、MPT收据树和MPT状态树,最终都会在采用多级数据存储结构的Key-Value型数据库(比如,LevelDB)中进行存储。
区块链每产生一个最新区块,则在该最新区块中的交易被执行之后,区块链中这些被执行交易的相关账户(可以是外部账户也可以是合约账户)的账户状态,通常也会随之发生变化,那么世界状态也随之发生变化。例如,当区块中的一笔“转账交易”执行完毕后,与该“转账交易”相关的转出方账户和转入方账户的余额(即这些账户的Balance字段的字段值),通常也会随之发生变化。而节点设备在区块链产生的最新区块中的交易执行完毕后,由于当前区块链中的账户状态发生了变化,因此节点设备需要根据区块链中所有账户当前的账户状态数据,来构建MPT状态树,用于维护区块链中所有账户的最新状态。也即,每当区块链中产生一个最新区块,并且该最新区块中的交易执行完毕后,导致区块链中的账户状态发生了变化,节点设备都需要基于区块链中所有账户最新的账户状态数据,重新构建一棵MPT状态树。换言之,区块链中每一个区块,都有一个与之对应的MPT状态树;该MPT状态树,维护了在该区块中的交易在执行完毕后,区块链中所有账户最新的账户状态。
在执行压测交易和生产交易时,在得到的交易回执中添加相应的标签,即执行压测交易得到的第一交易回执中包含压测标签,执行生产交易得到的第二交易回执中包含生产标签。
相应的,目标区块链网络中的区块链节点在压测交易执行完毕后,可基于压测交易列表中的交易、执行压测交易后得到的世界状态和交易回执构建影子链的压测区块;其中,可在压测区块的区块头中添加压测标签。类似的,目标区块链网络中的区块链节点在生产交易执行完毕后,生产交易列表中的交易、执行生产交易后得到的世界状态和交易回执构建生产链的生产区块;其中,可在生产区块的区块头中添加生产标签。
步骤512,将生成的区块放入待写块队列。
步骤514,从待写块队列读取区块。
步骤516,识别区块类型,当区块为压测区块时转入步骤518A;当区块为生产区块时转入步骤518B。
基于区块的区块头中包含表明区块类型的标签,针对从待写块队列中读取到的区块,可根据该区块的区块头中包含的标签来识别该区块属于压测区块还是生产区块。
步骤518A,生成测试链的区块高度信息。
步骤518B,生成生产链的区块高度信息。
步骤520A,写入压测区块。
步骤520B,写入生产区块。
在读取待写块队列中的任一区块并识别出该任一区块的区块类型后,可在相应的区块数据库中写入该任一区块(即成块的过程),并生成该任一区块所属区块链的区块高度信息(即区块号)。比如,将压测区块写入用于存储影子链区块数据的压测数据库中(逻辑上将该压测区块添加至影子链的末端,即在影子链上成块的过程);同时,生成影子链当前的区块高度信息。又如,将生产区块写入用于存储生产链区块数据的生产数据库中(逻辑上将该生产区块添加至生产链的末端,即在生产链上成块的过程);同时,生成生产链当前的区块高度信息。其中,生成的区块高度信息,可存储在区块链节点本地,或者存储至区别于该区块链节点的其他设备中。通过生成影子链和生产链的区块高度信息,在区块链节点因各种原因(比如断电、宕机、关闭等)导致设备重启时,该区块链节点可依据存储的区块高度信息和相应的区块数据快速重新构建出影子链和生产链,即实现影子链和生产链的快速恢复。
目标区块链网络中的区块链节点在维护影子链和生产链时,影子链和生产链按周期成块。那么,目标区块链网络中的区块链节点可保持影子链和生产链的区块高度一致(即保证影子链和生产链成块同步进行),使得业务系统无需感知目标区块链网络上的影子链(影子链为测试环境)和生产链(生产链为生产环境),即无需感知测试环境和生产环境。那么,便无需针对业务系统开发相应的环境控制代码以分别适配于测试环境和生产环境,而是针对测试环境和生产环境能够采用统一的区块链数据管理方式。以针对区块链的逻辑控制代码为例,假定针对区块链的逻辑控制为“拉块”,当需要通过拉块来获取影子链和生产链的区块信息时,在保持影子链和生产链的区块高度一致的情况下,业务系统拉取生产区块和压测区块的逻辑相同,那么可为业务系统配置一种拉取区块的代码即可,该代码可同时用于获取影子链和生产链的区块。而在影子链和生产链的区块高度不一致的情况下,业务系统拉取生产区块和压测区块的逻辑不相同,那么需要为业务 系统配置用于获取影子链上压测区块的代码,以及还需要为业务系统配置用于获取生产链上生产区块的代码。当然,上述“拉块”仅为一示例性举例,实际还可为其他针对区块的逻辑控制。
具体而言,目标区块链网络中的区块链节点可确定区块链客户端发送的用于当前周期的多笔区块链交易。在该多笔区块链交易均包含压测标签的情况(即当前周期内的区块链交易均用于压力测试)下,分别生成包含该多笔区块链交易的第一正常区块和未包含区块链交易的第二空白区块,并将第一正常区块添加至影子链的末端、将第二空白区块添加至生产链的末端。在该多笔区块链交易均包含业务标签的情况(即当前周期内的区块链交易均用于执行生产环境下的实际业务)下,分别生成未包含区块链交易的第一空白区块和包含该多笔区块链交易的第二正常区块,并将第一空白区块添加至影子链的末端、将第二正常区块添加至生产链的末端。而针对该多笔区块链交易中既包含压测标签又包含业务标签的情况(即同时包含压测交易和生产交易),由于影子链和生产链按周期成块,那么也能保证在执行完该多笔区块链交易并成块之后,保持影子链和生产链的区块高度一致。
步骤522,将区块放入待验证队列。
步骤524,验证区块正确性。
在一实施例中,目标区块链网络中的区块链节点可从待验证队列中读取区块,验证该区块的正确性,进而在验证得出该区块正确的情况下,向区块链客户端下发成块通知,以使区块链客户端获取交易回执。
在一实施例中,在上述为了保持影子链和生产链的区块高度一致的前提下,由于影子链上的数据均为测试数据,在测试结束后可删除,可对影子链的数据进行管理以减少对区块链节点存储资源的占用。比如,目标区块链网络的管理员可通过客户端向目标区块链网络提交数据清理交易,该数据清理交易用于指示目标区块链网络的区块链节点在接收到该数据清理交易的情况下,将影子链上最新区块对应的状态数据修改为指定区块对应的状态数据,并删除影子链上区别于指定区块的其他区块对应的状态数据。那么,在执行完数据清理交易后,即使后续又存在与该指定区块的状态数据对应的压力测试需求,由于最新区块的状态数据被修改为该指定区块的状态数据,也依然可以重新基于最新区块的状态数据进行压力测试,并且在完成清理影子链状态数据的同时保证影子链和生产链的区块高度一致。
进一步的,指定区块可以是预先约定好的区块,每次接收到数据清理交易均按照该约定好的区块进行状态数据清理。比如,指定区块为影子链的创世块。或者,指定区块可以是目标区块链网络的管理员指定的区块,数据清理交易中包含该区块的信息,进而使得目标区块链网络中的区块链节点按照数据清理交易指示的区块进行状态数据清理。
为了进一步减少影子链的数据对区块链节点存储资源的占用,还可将影子链上位于最新区块之前的所有区块的区块数据归档。比如,可将影子链上位于最新区块之前的所有区块的区块数据(主要为区块中包含的交易)归档至区别于区块链节点的其他存储设备,进而将区块链节点中存储的区块数据删除,比如将区块的区块头和区块体均删除,删除后该区块为空块。
以测试转账过程中账户X向账户Y转账导致的账户状态变化为例。假设在完成测试后,影子链上当前存在区块1-10,区块1(即创世块)对应的账户状态为账户X100元,账户Y0元,区块10(最新区块)对应的账户状态为账户X0元,账户Y100元。此时,若目标区块链网络的管理员通过客户端向目标区块链网络提交数据清理交易以清理影子链上的压测数据,目标区块链网络的区块链节点可将影子链上区块10的账户状态修改为区块1对应的账户状态,即账户X100元,账户Y0元,然后将区块1-9对应的账户状态删除,从而节省了区块链节点的存储空间。而即使后续需要重新进行转账的压力测试(比如,换个时间段,但是测试的账户状态不变),也依然可以重新基于区块10对应的账户状态进行压力测试,并且在完成清理影子链账户状态的同时保证影子链和生产链的区块高度一致。当然,为了进一步减少影子链的数据对区块链节点存储资源的占用,还可将区块1-9的区块数据归档。
在本公开中,对应于上述区块链客户端侧的实施例,本公开还提出了区块链节点侧的实施例,在区块链客户端侧的实施例中所涉及的描述同样可以适用于区块链节点侧的实施例,下文中不再对此进行赘述。
请参见图6,图6是一示例性实施例提供的另一种区块链网络的压力测试方法的流程图。如图6所示,该方法应用于区块链节点,可包括以下步骤:步骤602,接收区块链交易,所述区块链交易由区块链客户端响应于来自业务系统的处理请求而生成;其中,在所述处理请求为压测请求时所述区块链交易中包含第一类型标识,在所述处理请求为业务请求时所述区块链交易包含第二类型标识;步骤604,向所述区块链客户端返回所述区块链交易对应的交易回执,所述交易回执包含的类型标识与所述区块链交易相同。
如前所述,在所述区块链节点属于与处于生产状态的目标区块链网络对应的对等区块链网络的情况下,所述区块链节点接收包含第一类型标识的第一区块链交易;在所述区块链节点属于所述目标区块链网络的情况下,所述区块链节点接收包含第二类型标识的第二区块链交易。
如前所述,所述对等区块链网络与所述目标区块链网络具有相同的网络结构和网络配置。
如前所述,所述区块链节点维护有第一区块链和第二区块链;所述区块链节点识别所述区块链交易所含的类型标识;在所述区块链交易包含第一类型标识的情况下,将所述区块链交易存储至第一区块链所含的区块;在所述区块链交易包含第二类型标识的情况下,将所述区块链交易存储至第二区块链所含的区块。
如前所述,第一区块链的区块数据和第二区块链的区块数据在所述目标区块链网络中的区块链节点上隔离存储。
如前所述,所述目标区块链网络中的区块链节点维护有对应于第一区块链的第一状态数据、对应于第二区块链的第二状态数据;其中,第一区块链交易被用于驱动第一状态数据的更新、第二区块链交易被用于驱动第二状态数据的更新。
如前所述,第一状态数据和第二状态数据在所述目标区块链网络中的区块链节点上隔离存储。
如前所述,包含第一类型标识的区块链交易和包含第二类型标识的区块链交易由所述区块链节点在相同的条件下混合执行。
如前所述,所述区块链节点对所述区块链客户端发送的多笔区块链交易进行共识,并在共识通过后分别对包含第一类型标识和第二类型标识的区块链交易进行处理;或者,对所述区块链客户端发送的多笔区块链交易所含的类型标识进行区分后,分别对包含第一类型标识和第二类型标识的区块链交易进行共识。
如前所述,第一区块链所含区块的区块头中包含第一类型标识,第二区块链所含区块的区块头中包含第二类型标识。
如前所述,所述区块链节点在接收到数据清理交易的情况下,将第一区块链上最新区块对应的状态数据修改为指定区块对应的状态数据,并删除第一区块链上区别于指定区块的其他区块对应的状态数据。
如前所述,所述指定区块包括第一区块链的创世块。
如前所述,所述区块链节点将位于所述最新区块之前的所有区块的区块数据归档。
如前所述,第一区块链和第二区块链按周期成块;所述区块链节点确定所述区块链客户端发送的用于当前周期的多笔区块链交易;
在所述多笔区块链交易均包含第一类型标识的情况下,分别生成包含所述多笔区块链交易的第一正常区块和未包含区块链交易的第二空白区块,并将第一正常区块添加至第一区块链的末端、将第二空白区块添加至第二区块链的末端;
在所述多笔区块链交易均包含第二类型标识的情况下,分别生成未包含区块链交易的第一空白区块和包含所述多笔区块链交易的第二正常区块,并将第一空白区块添加至第一区块链的末端、将第二正常区块添加至第二正常区块链的末端。
本公开还提供了一种区块链网络的压力测试装置的实施例。
图7是一示例性实施例提供的一种设备的示意结构图。请参考图7,在硬件层面,该设备包括处理器702、内部总线704、网络接口706、内存708以及非易失性存储器710,当然还可能包括其他业务所需要的硬件。处理器702从非易失性存储器710中读取对应的计算机程序到内存708中然后运行,在逻辑层面上形成区块链网络的压力测试装置。当然,除了软件实现方式之外,本公开一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。
请参考图8,在一软件实施方式中,该区块链网络的压力测试装置应用于区块链客户端,可以包括:交易生成单元802,响应于来自业务系统的处理请求,在所述处理请求为压测请求时生成包含第一类型标识的第一区块链交易,在所述处理请求为业务请求时生成包含第二类型标识的第二区块链交易;回执获取单元804,分别获取对应于第一区块链交易的第一交易回执、对应于第二区块链交易的第二交易回执,第一交易回执包含第一类型标识、第二交易回执包含第二类型标识;回执返回单元806,向所述业务 系统返回获取到的交易回执。
可选的,所述回执获取单元804具体用于:将第一区块链交易提交至处于生产状态的目标区块链网络对应的对等区块链网络,并接收所述对等区块链网络返回的第一交易回执;以及将第二区块链交易提交至所述目标区块链网络,并接收所述目标区块链网络返回的第二交易回执。
可选的,所述对等区块链网络与所述目标区块链网络具有相同的网络结构和网络配置。
可选的,所述回执获取单元804具体用于:将第一区块链交易和第二区块链交易分别提交至处于生产状态的目标区块链网络,并接收所述目标区块链网络分别返回的第一交易回执和第二交易回执。
可选的,所述目标区块链网络中的区块链节点维护有第一区块链和第二区块链;其中,第一区块链交易被存储至第一区块链所含的区块,第二区块链交易被存储至第二区块链所含的区块。
可选的,第一区块链的区块数据和第二区块链的区块数据在所述目标区块链网络中的区块链节点上隔离存储。
可选的,所述目标区块链网络中的区块链节点维护有对应于第一区块链的第一状态数据、对应于第二区块链的第二状态数据;其中,第一区块链交易被用于驱动第一状态数据的更新、第二区块链交易被用于驱动第二状态数据的更新。
可选的,第一状态数据和第二状态数据在所述目标区块链网络中的区块链节点上隔离存储。
可选的,所述第一区块链交易和所述第二区块链交易由所述目标区块链网络中的区块链节点在相同的条件下混合执行。
请参考图9,在另一软件实施方式中,该区块链网络的压力测试装置应用于区块链节点,可以包括:交易接收单元902,接收区块链交易,所述区块链交易由区块链客户端响应于来自业务系统的处理请求而生成;其中,在所述处理请求为压测请求时所述区块链交易中包含第一类型标识,在所述处理请求为业务请求时所述区块链交易包含第二类型标识;回执返回单元904,向所述区块链客户端返回所述区块链交易对应的交易回执,所述交易回执包含的类型标识与所述区块链交易相同。
可选的,在所述区块链节点属于与处于生产状态的目标区块链网络对应的对等区块链网络的情况下,所述交易接收单元902具体用于:接收包含第一类型标识的第一区块链交易;在所述区块链节点属于所述目标区块链网络的情况下,所述接收区块链交易,包括:接收包含第二类型标识的第二区块链交易。
可选的,所述对等区块链网络与所述目标区块链网络具有相同的网络结构和网络配置。
可选的,所述区块链节点维护有第一区块链和第二区块链;所述装置还包括:交易执行单元906,识别所述区块链交易所含的类型标识;在所述区块链交易包含第一 类型标识的情况下,将所述区块链交易存储至第一区块链所含的区块;在所述区块链交易包含第二类型标识的情况下,将所述区块链交易存储至第二区块链所含的区块。
可选的,第一区块链的区块数据和第二区块链的区块数据在所述目标区块链网络中的区块链节点上隔离存储。
可选的,所述目标区块链网络中的区块链节点维护有对应于第一区块链的第一状态数据、对应于第二区块链的第二状态数据;其中,第一区块链交易被用于驱动第一状态数据的更新、第二区块链交易被用于驱动第二状态数据的更新。
可选的,第一状态数据和第二状态数据在所述目标区块链网络中的区块链节点上隔离存储。
可选的,包含第一类型标识的区块链交易和包含第二类型标识的区块链交易由所述区块链节点在相同的条件下混合执行。
可选的,还包括:交易共识单元908,对所述区块链客户端发送的多笔区块链交易进行共识,并在共识通过后分别对包含第一类型标识和第二类型标识的区块链交易进行处理;或者,对所述区块链客户端发送的多笔区块链交易所含的类型标识进行区分后,分别对包含第一类型标识和第二类型标识的区块链交易进行共识。
可选的,第一区块链所含区块的区块头中包含第一类型标识,第二区块链所含区块的区块头中包含第二类型标识。
可选的,还包括:清理单元910,在接收到数据清理交易的情况下,将第一区块链上最新区块对应的状态数据修改为指定区块对应的状态数据,并删除第一区块链上区别于指定区块的其他区块对应的状态数据。
可选的,所述指定区块包括第一区块链的创世块。
可选的,清理单元910还用于:将位于所述最新区块之前的所有区块的区块数据归档。
可选的,第一区块链和第二区块链按周期成块;所述交易执行单元908还用于:确定所述区块链客户端发送的用于当前周期的多笔区块链交易;在所述多笔区块链交易均包含第一类型标识的情况下,分别生成包含所述多笔区块链交易的第一正常区块和未包含区块链交易的第二空白区块,并将第一正常区块添加至第一区块链的末端、将第二空白区块添加至第二区块链的末端;
在所述多笔区块链交易均包含第二类型标识的情况下,分别生成未包含区块链交易的第一空白区块和包含所述多笔区块链交易的第二正常区块,并将第一空白区块添加至第一区块链的末端、将第二正常区块添加至第二正常区块链的末端。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
上述对本公开特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
在本公开一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开一个或多个实施例。在本公开一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本公开一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开一个或多个实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
以上所述仅为本公开一个或多个实施例的较佳实施例而已,并不用以限制本公开一个或多个实施例,凡在本公开一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本公开一个或多个实施例保护的范围之内。

Claims (26)

  1. 一种区块链网络的压力测试系统,包括:
    区块链客户端,响应于来自业务系统的处理请求,在所述处理请求为压测请求时生成包含第一类型标识的第一区块链交易,在所述处理请求为业务请求时生成包含第二类型标识的第二区块链交易;
    第一区块链网络,接收所述区块链客户端提交的第一区块链交易,执行第一区块链交易并生成包含第一类型标识的交易回执;
    第二区块链网络,接收所述区块链客户端提交的第二区块链交易,执行第二区块链交易并生成包含第二类型标识的交易回执;
    业务系统,向所述区块链客户端发送所述处理请求,并接收所述区块链客户端返回的交易回执;将包含第一类型标识的交易回执存储至压测数据库,将包含第二类型标识的交易回执存储至业务数据库。
  2. 一种区块链网络的压力测试系统,包括:
    区块链客户端,响应于来自业务系统的处理请求,在所述处理请求为压测请求时生成包含第一类型标识的第一区块链交易,在所述处理请求为业务请求时生成包含第二类型标识的第二区块链交易;
    区块链网络,接收所述区块链客户端提交的第一区块链交易和第二区块链交易,执行第一区块链交易并生成包含第一类型标识的交易回执,执行第二区块链交易并生成包含第二类型标识的交易回执;
    业务系统,向所述区块链客户端发送所述处理请求,并接收所述区块链客户端返回的交易回执;将包含第一类型标识的交易回执存储至压测数据库,将包含第二类型标识的交易回执存储至业务数据库。
  3. 一种区块链网络的压力测试方法,应用于区块链客户端,所述方法包括:
    响应于来自业务系统的处理请求,在所述处理请求为压测请求时生成包含第一类型标识的第一区块链交易,在所述处理请求为业务请求时生成包含第二类型标识的第二区块链交易;
    分别获取对应于第一区块链交易的第一交易回执、对应于第二区块链交易的第二交易回执,第一交易回执包含第一类型标识、第二交易回执包含第二类型标识;
    向所述业务系统返回获取到的交易回执。
  4. 根据权利要求3所述的方法,所述分别获取对应于第一区块链交易的第一交易回执、对应于第二区块链交易的第二交易回执,包括:
    将第一区块链交易提交至处于生产状态的目标区块链网络对应的对等区块链网络,并接收所述对等区块链网络返回的第一交易回执;以及
    将第二区块链交易提交至所述目标区块链网络,并接收所述目标区块链网络返回的第二交易回执。
  5. 根据权利要求4所述的方法,所述对等区块链网络与所述目标区块链网络具有相同的网络结构和网络配置。
  6. 根据权利要求3所述的方法,所述分别获取对应于第一区块链交易的第一交易回执、对应于第二区块链交易的第二交易回执,包括:
    将第一区块链交易和第二区块链交易分别提交至处于生产状态的目标区块链网络, 并接收所述目标区块链网络分别返回的第一交易回执和第二交易回执。
  7. 根据权利要求6所述的方法,所述目标区块链网络中的区块链节点维护有第一区块链和第二区块链;其中,第一区块链交易被存储至第一区块链所含的区块,第二区块链交易被存储至第二区块链所含的区块。
  8. 根据权利要求7所述的方法,第一区块链的区块数据和第二区块链的区块数据在所述目标区块链网络中的区块链节点上隔离存储。
  9. 根据权利要求7所述的方法,所述目标区块链网络中的区块链节点维护有对应于第一区块链的第一状态数据、对应于第二区块链的第二状态数据;其中,第一区块链交易被用于驱动第一状态数据的更新、第二区块链交易被用于驱动第二状态数据的更新。
  10. 根据权利要求9所述的方法,第一状态数据和第二状态数据在所述目标区块链网络中的区块链节点上隔离存储。
  11. 根据权利要求6所述的方法,所述第一区块链交易和所述第二区块链交易由所述目标区块链网络中的区块链节点在相同的条件下混合执行。
  12. 一种区块链网络的压力测试方法,应用于区块链节点,所述方法包括:
    接收区块链交易,所述区块链交易由区块链客户端响应于来自业务系统的处理请求而生成;其中,在所述处理请求为压测请求时所述区块链交易中包含第一类型标识,在所述处理请求为业务请求时所述区块链交易包含第二类型标识;
    向所述区块链客户端返回所述区块链交易对应的交易回执,所述交易回执包含的类型标识与所述区块链交易相同。
  13. 根据权利要求12所述的方法,
    在所述区块链节点属于与处于生产状态的目标区块链网络对应的对等区块链网络的情况下,所述接收区块链交易,包括:接收包含第一类型标识的第一区块链交易;
    在所述区块链节点属于所述目标区块链网络的情况下,所述接收区块链交易,包括:接收包含第二类型标识的第二区块链交易。
  14. 根据权利要求13所述的方法,所述对等区块链网络与所述目标区块链网络具有相同的网络结构和网络配置。
  15. 根据权利要求12所述的方法,所述区块链节点维护有第一区块链和第二区块链;所述方法还包括:
    识别所述区块链交易所含的类型标识;
    在所述区块链交易包含第一类型标识的情况下,将所述区块链交易存储至第一区块链所含的区块;
    在所述区块链交易包含第二类型标识的情况下,将所述区块链交易存储至第二区块链所含的区块。
  16. 根据权利要求15所述的方法,第一区块链的区块数据和第二区块链的区块数据在所述目标区块链网络中的区块链节点上隔离存储。
  17. 根据权利要求15所述的方法,所述目标区块链网络中的区块链节点维护有对应于第一区块链的第一状态数据、对应于第二区块链的第二状态数据;其中,第一区块链交易被用于驱动第一状态数据的更新、第二区块链交易被用于驱动第二状态数据的更新。
  18. 根据权利要求17所述的方法,第一状态数据和第二状态数据在所述目标区块 链网络中的区块链节点上隔离存储。
  19. 根据权利要求15所述的方法,包含第一类型标识的区块链交易和包含第二类型标识的区块链交易由所述区块链节点在相同的条件下混合执行。
  20. 根据权利要求15所述的方法,还包括:
    对所述区块链客户端发送的多笔区块链交易进行共识,并在共识通过后分别对包含第一类型标识和第二类型标识的区块链交易进行处理;或者,
    对所述区块链客户端发送的多笔区块链交易所含的类型标识进行区分后,分别对包含第一类型标识和第二类型标识的区块链交易进行共识。
  21. 根据权利要求15所述的方法,第一区块链所含区块的区块头中包含第一类型标识,第二区块链所含区块的区块头中包含第二类型标识。
  22. 根据权利要求15所述的方法,第一区块链和第二区块链按周期成块;所述方法还包括:
    确定所述区块链客户端发送的用于当前周期的多笔区块链交易;
    在所述多笔区块链交易均包含第一类型标识的情况下,分别生成包含所述多笔区块链交易的第一正常区块和未包含区块链交易的第二空白区块,并将第一正常区块添加至第一区块链的末端、将第二空白区块添加至第二区块链的末端;
    在所述多笔区块链交易均包含第二类型标识的情况下,分别生成未包含区块链交易的第一空白区块和包含所述多笔区块链交易的第二正常区块,并将第一空白区块添加至第一区块链的末端、将第二正常区块添加至第二正常区块链的末端。
  23. 一种区块链网络的压力测试装置,应用于区块链客户端,所述装置包括:
    交易生成单元,响应于来自业务系统的处理请求,在所述处理请求为压测请求时生成包含第一类型标识的第一区块链交易,在所述处理请求为业务请求时生成包含第二类型标识的第二区块链交易;
    回执获取单元,分别获取对应于第一区块链交易的第一交易回执、对应于第二区块链交易的第二交易回执,第一交易回执包含第一类型标识、第二交易回执包含第二类型标识;
    回执返回单元,向所述业务系统返回获取到的交易回执。
  24. 一种区块链网络的压力测试装置,应用于区块链节点,所述装置包括:
    交易接收单元,接收区块链交易,所述区块链交易由区块链客户端响应于来自业务系统的处理请求而生成;其中,在所述处理请求为压测请求时所述区块链交易中包含第一类型标识,在所述处理请求为业务请求时所述区块链交易包含第二类型标识;
    回执返回单元,向所述区块链客户端返回所述区块链交易对应的交易回执,所述交易回执包含的类型标识与所述区块链交易相同。
  25. 一种电子设备,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求3-22中任一项所述的方法。
  26. 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求3-22中任一项所述方法的步骤。
PCT/CN2021/100577 2020-06-24 2021-06-17 区块链网络的压力测试方法及装置、系统 WO2021259126A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010585468.7A CN111478828B (zh) 2020-06-24 2020-06-24 区块链网络的压力测试方法及装置、系统
CN202010585468.7 2020-06-24

Publications (1)

Publication Number Publication Date
WO2021259126A1 true WO2021259126A1 (zh) 2021-12-30

Family

ID=71763999

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/100577 WO2021259126A1 (zh) 2020-06-24 2021-06-17 区块链网络的压力测试方法及装置、系统

Country Status (2)

Country Link
CN (1) CN111478828B (zh)
WO (1) WO2021259126A1 (zh)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111478827B (zh) * 2020-06-24 2020-12-04 支付宝(杭州)信息技术有限公司 区块链网络的压力测试方法及装置、系统
CN111478828B (zh) * 2020-06-24 2020-10-20 支付宝(杭州)信息技术有限公司 区块链网络的压力测试方法及装置、系统
CN114143236A (zh) * 2020-08-13 2022-03-04 网联清算有限公司 一种业务系统测试方法、装置、电子设备和可读存储介质
CN112102082A (zh) * 2020-08-24 2020-12-18 深圳区块大陆科技有限公司 一种判定区块链交易执行结果的方法
CN112199239B (zh) * 2020-10-23 2023-10-27 中国工商银行股份有限公司 区块链节点的重启方法、装置及系统
CN112269915B (zh) * 2020-10-30 2023-08-25 成都质数斯达克科技有限公司 业务处理方法、装置、设备及存储介质
CN112732720B (zh) * 2021-01-11 2022-05-24 杭州复杂美科技有限公司 数据存储方法、数据查询方法、计算机设备和存储介质

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6859758B1 (en) * 2002-11-12 2005-02-22 Cisco Technology, Inc. Stress testing database storage
CN102143523A (zh) * 2010-11-18 2011-08-03 华为技术有限公司 基于业务递送平台的应用测试方法和业务递送平台
CN109871320A (zh) * 2019-01-21 2019-06-11 上海德启信息科技有限公司 一种数据处理方法、装置、应用服务器及存储介质
CN110489471A (zh) * 2019-07-25 2019-11-22 北京文渊佳科技有限公司 一种数据请求处理方法、装置、存储介质及服务器
CN110598446A (zh) * 2019-09-16 2019-12-20 腾讯科技(深圳)有限公司 基于区块链的测试方法、装置、存储介质和计算机设备
CN110750584A (zh) * 2019-09-18 2020-02-04 苏宁云计算有限公司 数据管理方法和系统
CN111478828A (zh) * 2020-06-24 2020-07-31 支付宝(杭州)信息技术有限公司 区块链网络的压力测试方法及装置、系统
CN111478827A (zh) * 2020-06-24 2020-07-31 支付宝(杭州)信息技术有限公司 区块链网络的压力测试方法及装置、系统
CN111475501A (zh) * 2020-06-24 2020-07-31 支付宝(杭州)信息技术有限公司 区块链网络的数据清理方法及装置
CN111478829A (zh) * 2020-06-24 2020-07-31 支付宝(杭州)信息技术有限公司 区块链网络的压力测试方法及装置、系统
CN111488291A (zh) * 2020-06-24 2020-08-04 支付宝(杭州)信息技术有限公司 区块链网络的压力测试方法及装置、系统

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106411774A (zh) * 2016-09-06 2017-02-15 联动优势科技有限公司 一种控制交易数据量的方法和装置
WO2018118990A1 (en) * 2016-12-19 2018-06-28 Iannazzo Vincent Paul Digital platform for creating instantaneous income generating private equity portfolios.
CN108763058A (zh) * 2018-04-24 2018-11-06 苏州同济区块链研究院有限公司 一种区块链测评系统
CN109753418B (zh) * 2018-12-28 2022-07-12 金蝶软件(中国)有限公司 性能测试方法、装置、计算机设备和存储介质

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6859758B1 (en) * 2002-11-12 2005-02-22 Cisco Technology, Inc. Stress testing database storage
CN102143523A (zh) * 2010-11-18 2011-08-03 华为技术有限公司 基于业务递送平台的应用测试方法和业务递送平台
CN109871320A (zh) * 2019-01-21 2019-06-11 上海德启信息科技有限公司 一种数据处理方法、装置、应用服务器及存储介质
CN110489471A (zh) * 2019-07-25 2019-11-22 北京文渊佳科技有限公司 一种数据请求处理方法、装置、存储介质及服务器
CN110598446A (zh) * 2019-09-16 2019-12-20 腾讯科技(深圳)有限公司 基于区块链的测试方法、装置、存储介质和计算机设备
CN110750584A (zh) * 2019-09-18 2020-02-04 苏宁云计算有限公司 数据管理方法和系统
CN111478828A (zh) * 2020-06-24 2020-07-31 支付宝(杭州)信息技术有限公司 区块链网络的压力测试方法及装置、系统
CN111478827A (zh) * 2020-06-24 2020-07-31 支付宝(杭州)信息技术有限公司 区块链网络的压力测试方法及装置、系统
CN111475501A (zh) * 2020-06-24 2020-07-31 支付宝(杭州)信息技术有限公司 区块链网络的数据清理方法及装置
CN111478829A (zh) * 2020-06-24 2020-07-31 支付宝(杭州)信息技术有限公司 区块链网络的压力测试方法及装置、系统
CN111488291A (zh) * 2020-06-24 2020-08-04 支付宝(杭州)信息技术有限公司 区块链网络的压力测试方法及装置、系统
CN112486830A (zh) * 2020-06-24 2021-03-12 支付宝(杭州)信息技术有限公司 区块链网络的压力测试方法及装置、系统
CN112910724A (zh) * 2020-06-24 2021-06-04 支付宝(杭州)信息技术有限公司 区块链网络的压力测试方法及装置、系统

Also Published As

Publication number Publication date
CN111478828A (zh) 2020-07-31
CN111478828B (zh) 2020-10-20

Similar Documents

Publication Publication Date Title
WO2021259126A1 (zh) 区块链网络的压力测试方法及装置、系统
WO2021259125A1 (zh) 区块链网络的数据清理方法及装置
WO2021259127A1 (zh) 区块链网络的压力测试方法及装置、系统
US11195231B2 (en) Transaction processing in a service blockchain
US11190342B2 (en) Transaction processing in a service blockchain
US10785168B2 (en) Allocating virtual resource based on block chain
US20220051238A1 (en) Method and apparatus for verifying commodities in batches based on blockchain, and electronic device
CN112073269B (zh) 区块链网络测试方法、装置、服务器及存储介质
WO2021259149A1 (zh) 区块链网络的压力测试方法及装置、系统
JP2021533502A (ja) 取引検証方法、装置、記憶媒体及び電子機器
WO2021259131A1 (zh) 区块链网络的压力测试方法及装置、系统
WO2020052125A1 (zh) 基于区块链的能源交互装置、能源互联网系统和交互方法
CN111049904A (zh) 多公有云资源监控的方法与设备
WO2023231335A1 (zh) 在区块链中执行交易的方法及区块链的主节点
WO2023231337A1 (zh) 在区块链中执行交易的方法、区块链的主节点和从节点
WO2021073096A1 (zh) 资源数据的转移方法、装置和区块链系统
CN114491662B (zh) 一种基于区块链的数据资产审计方法、系统及设备
CN113095824B (zh) 基于区块链的资产管理方法、装置及电子设备
CN110765193B (zh) 一种区块链数据导出的方法及装置
Zou et al. Blockchain-Based Cross-Border Supply Chain Model
Zou et al. Check for updates Blockchain-Based Cross-Border Supply Chain Model
WO2012050562A1 (en) Transaction processing system and method
CN112699002A (zh) 多云资源报警管控的方法与设备
WO2023144244A1 (en) System and method for writing and retrieval of data in blockchain
CN114911510A (zh) 一种请求响应方法、装置及电子设备和存储介质

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: 21828266

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: 21828266

Country of ref document: EP

Kind code of ref document: A1