WO2021259131A1 - 区块链网络的压力测试方法及装置、系统 - Google Patents
区块链网络的压力测试方法及装置、系统 Download PDFInfo
- Publication number
- WO2021259131A1 WO2021259131A1 PCT/CN2021/100605 CN2021100605W WO2021259131A1 WO 2021259131 A1 WO2021259131 A1 WO 2021259131A1 CN 2021100605 W CN2021100605 W CN 2021100605W WO 2021259131 A1 WO2021259131 A1 WO 2021259131A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- business
- blockchain
- transaction
- stress test
- network
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Definitions
- One or more embodiments of this specification relate to the field of blockchain technology, and in particular to a method, device, and system for stress testing of a blockchain network.
- Blockchain technology also known as distributed ledger technology
- distributed ledger technology is a de-neutralized distributed database technology. It has the characteristics of decentralization, openness and transparency, non-tampering, trustworthiness, etc., and is suitable for many In application scenarios that have high requirements for data reliability.
- various performance indicators such as the load capacity of the blockchain network and the upper limit of data throughput can be obtained, so as to maintain the normal operation of the blockchain network, or carry out the performance of the blockchain network. optimization.
- one or more embodiments of this specification provide a method, device, and system for stress testing of a blockchain network.
- a pressure test system for a blockchain network including: a business end, which initiates a blockchain transaction to a business blockchain network in production; business area A block chain network, where the business block chain node in the business block chain network transfers to a pressure test block chain equivalent to the business block chain network when the block chain transaction is a pressure test transaction
- the network forwards the stress test transaction, and if the blockchain transaction is a business transaction, execute the business transaction; stress test the blockchain network, the stress test blockchain in the stress test blockchain network
- the node executes the stress test transaction.
- a method for stress testing of a blockchain network is proposed, which is applied to a business blockchain node in a business blockchain network in a production state, and the method includes : Identify the transaction type of the blockchain transaction initiated by the business end; if the blockchain transaction is a stress test transaction, forward the transaction to a stress test blockchain network equivalent to the business blockchain network Stress testing transaction; in the case that the blockchain transaction is a business transaction, execute the business transaction.
- a method for stress testing of a blockchain network is proposed, which is applied to a stress testing blockchain network that is equivalent to a business blockchain network in production.
- a pressure test block chain node the method includes: receiving a pressure test transaction forwarded by a business block chain node in the business block chain network, the pressure test transaction initiated by the business block chain node at the business end When the blockchain transaction is a stress test transaction, forward; execute the stress test transaction; wherein, when the blockchain transaction is a business transaction, the business transaction is executed by the business blockchain node .
- a pressure test device for a blockchain network which is applied to a business blockchain node in a business blockchain network in a production state, and the device includes : Identification unit, which identifies the transaction type of the blockchain transaction initiated by the business end; the forwarding unit, when the blockchain transaction is a stress test transaction, to the stress test area equivalent to the business blockchain network The block chain network forwards the stress test transaction; the execution unit executes the business transaction when the block chain transaction is a business transaction.
- a pressure test device for a blockchain network is proposed, which is applied to a pressure test blockchain network that is equivalent to a business blockchain network in production.
- a stress test blockchain node the device includes: a receiving unit that receives a stress test transaction forwarded by a business blockchain node in the business blockchain network, the stress test transaction being sent by the business blockchain node When the blockchain transaction initiated by the business end is a stress test transaction, it is forwarded; the execution unit executes the stress test transaction; wherein, when the blockchain transaction is a business transaction, the business transaction is Business blockchain node execution.
- an electronic device including: a processor; and a memory for storing executable instructions of the processor.
- the processor executes the executable instruction to implement the method described in any of the foregoing embodiments.
- a computer-readable storage medium which stores computer instructions, which when executed by a processor, implements the method described in any of the above-mentioned embodiments. step.
- Fig. 1 is a schematic diagram of a network architecture provided by an exemplary embodiment.
- Fig. 2 is a flowchart of a method for stress testing of a blockchain network provided by an exemplary embodiment.
- Fig. 3 is a schematic diagram of a pressure test system for a blockchain network provided by an exemplary embodiment.
- Fig. 4 is a schematic diagram of another block chain network stress testing system provided by an exemplary embodiment.
- Fig. 5 is a schematic structural diagram of a device provided by an exemplary embodiment.
- Fig. 6 is a block diagram of a pressure test device for a blockchain network provided by an exemplary embodiment.
- Fig. 7 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 this specification.
- the method may include more or fewer steps than described in this specification.
- a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification 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 end 11 generates a processing request, it sends the processing request to the blockchain gateway 12, and the blockchain gateway 12 creates a blockchain transaction for the processing request, and submits the blockchain transaction to The blockchain network 13 enables the blockchain nodes on the blockchain network 13 to execute the blockchain transaction.
- the business end 11 can generate a processing request of the stress test request type (including the data used for the stress test), and the blockchain gateway 12 can target These stress test requests create corresponding blockchain transactions, and the blockchain network 13 executes these blockchain transactions to perform a stress test on the blockchain network 13; and, the blockchain gateway 12 executes the blockchain network 13
- the transaction receipt generated by the blockchain transaction is fed back to the business terminal 11, so that the business terminal 11 analyzes the transaction receipt to determine the pressure test result of the blockchain network 13.
- the interaction process between the business end 11, the blockchain gateway 12, and the blockchain network 13 is similar to the above-mentioned stress test process: the business end 11 generates a processing request of the business request type, and the blockchain gateway 12 Create corresponding blockchain transactions for these business requests, and the blockchain network 13 will execute these blockchain transactions; and, the blockchain gateway 12 will execute the blockchain transaction on the blockchain network 13 and generate transaction receipts Feedback to the business side 11.
- the service terminal 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 gateway 12 creates a blockchain transaction, due to the need to comply with the existing transaction format and other relevant regulations, it cannot distinguish the blockchain transactions corresponding to different processing requests, that is, the above-mentioned pressure test label cannot be distinguished.
- the pressure test system of the blockchain network in this manual includes the business end, the business blockchain network and the pressure test blockchain network.
- the business end initiates a blockchain transaction to the business blockchain network in the production state;
- the business blockchain node in the business blockchain network when the blockchain transaction is a stress test transaction, will contact the business area
- the peer-to-peer pressure test block chain network of the block chain network forwards the pressure test transaction, and executes the business transaction when the block chain transaction is a business transaction;
- the pressure test block chain node in the pressure test block chain network executes Stress test transactions forwarded by business blockchain nodes.
- 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 a business blockchain node in a business blockchain network in a production state, and may include the following steps: Step 202, identifying the transaction type of the blockchain transaction initiated by the business end.
- the blockchain client is used to create a blockchain transaction and submit the created blockchain transaction to the business blockchain network. Therefore, the business end can initiate a blockchain transaction to the business blockchain network through the blockchain client.
- the blockchain client can be deployed on the business end, and the business end directly interacts with the business blockchain network through the blockchain client to create the corresponding blockchain transaction and submit it to the business blockchain Network to meet actual needs.
- the business end can create a stress testing type of blockchain transaction (ie, stress testing transaction, including data used for stress testing) through the blockchain client.
- stress testing transaction including data used for stress testing
- the business end can create a business-type blockchain transaction (that is, a business transaction, which contains data used to implement the business) through the blockchain client.
- the stress test transaction and the business transaction can be distinguished by adding a type identification to the blockchain transaction.
- the first type of identification can be added to the stress test transaction
- the second type of identification can be added to the business transaction.
- the business blockchain node in the business blockchain network receives the blockchain transaction submitted by the business end, it can read the type identification contained in the received blockchain transaction.
- the type identifier is the first type identifier
- the received blockchain transaction is determined as a stress test transaction
- the type identifier is the second type identifier
- the received blockchain transaction is determined as Business transactions.
- the first type identifier can be added to the first transaction receipt to indicate that the first transaction receipt corresponds to the stress test transaction.
- the second type identifier can be added to the second transaction receipt to indicate that the second transaction receipt corresponds to the business transaction. That is, the first transaction receipt corresponding to the stress test transaction includes the first type identifier, and the second transaction receipt corresponding to the business transaction includes the second type identifier. Then, after obtaining the returned transaction receipt, the business end can identify the type of the transaction receipt according to the type identifier in the transaction receipt, and then store the first transaction receipt in the stress test database and the second transaction receipt in the business database. Facilitate subsequent analysis. It can be seen that through the above improvements to create blockchain transactions, characteristic tags such as stress test tags and business tags can be brought into the blockchain network, so as to realize the transfer of stress test attributes in the blockchain network.
- a type field (or any other field) can be added to the blockchain transaction to mark the blockchain transaction as a business transaction or a stress test transaction. For example, when the value of the type field of any blockchain transaction is the first value, it indicates that the blockchain transaction is a business transaction, and when the value of the type field of any blockchain transaction is the second value (the difference is In the first value), it indicates that the blockchain transaction is a stress test transaction.
- the type field can also be added to the transaction receipt to mark whether the transaction receipt is generated by the execution of the business transaction or the execution of the stress test transaction, then the business end can identify the type field according to the above after obtaining the transaction receipt
- the method of value is used to identify the type of transaction receipt, and then perform differentiated processing.
- 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 include business tags are recognized as business transactions, and blockchain transactions that do not include business tags are recognized as stress test transactions.
- a stress test label can be added to the "reserved field", so that the blockchain node can recognize a blockchain transaction that contains a stress test label as a stress test transaction, and a blockchain transaction that does not contain a stress test label as Business transactions.
- the blockchain client is deployed on the business blockchain node in the business blockchain network.
- the first set of logic codes corresponds to the blockchain client, and the node device runs the first set of logic codes so that the business end of the chain can interact with the business blockchain network through the blockchain client.
- the second set of logic codes corresponds to the business blockchain network (ie, the chain code of the business blockchain network), and the node device operates as the business blockchain node in the business blockchain network by running the second set of logic codes.
- the business end may send a processing request to the node device in the business blockchain network to realize the interaction with the business blockchain network.
- the processing request may include a stress test request used to call a stress test blockchain network to perform a stress test, a business request used to call a business blockchain network to perform a production business, and so on.
- the node device After receiving the processing request from the business end, the node device recognizes the request type of the processing request through the blockchain client, then creates a blockchain transaction corresponding to the request type, and submits the blockchain to the business blockchain network trade.
- the node device as a business blockchain node in the business blockchain network, obtains the blockchain transaction submitted by the blockchain client and identifies the transaction type of the blockchain transaction.
- the processing request of the business end may include a type identifier
- the blockchain client can identify the request type of the processing request based on this.
- the blockchain client when it creates a blockchain transaction corresponding to the processing request, it can also add a type identifier to the blockchain transaction to mark the transaction type of the blockchain transaction. Therefore, the transaction type of the blockchain transaction can be determined according to the type identifier contained in the acquired blockchain transaction. Taking the processing request divided into stress test request and business request as an example, the stress test request contains the first type identifier, and the service request contains the second type identifier. Then, the blockchain client recognizes the received signal according to the first type identifier.
- a corresponding stress test transaction can be created, and the first type identification can be added to the stress test transaction.
- the blockchain client After the processing request is a stress test request, a corresponding stress test transaction can be created, and the first type identification can be added to the stress test transaction.
- the blockchain client After the blockchain client recognizes that the received processing request is a business request according to the second type of identification, it can create a corresponding business transaction and add the second type of identification to the business transaction.
- Step 204 If the blockchain transaction is a stress test transaction, forward the stress test transaction to a stress test blockchain network equivalent to the business blockchain network.
- a stress testing blockchain network for responding to stress testing transactions and a business blockchain network for responding to business transactions can be deployed separately.
- the pressure test blockchain network is a blockchain network equivalent to the business blockchain network.
- the blockchain nodes in the business blockchain network cooperate with the business end and the blockchain network to realize the data interaction between the business end and the business blockchain network and the pressure test blockchain network.
- the business blockchain node in the business blockchain network in the production state receives the blockchain transaction as a stress test transaction
- the stress test transaction is forwarded to the stress test blockchain network to be
- the stress test blockchain node in the stress test blockchain network responds to the stress test transaction.
- the business transaction received by the business blockchain node is a business transaction
- the business transaction is directly executed to realize the corresponding business. It can be seen that in the stress testing scheme in this manual, the business blockchain node in the business blockchain network directly obtains the blockchain transaction initiated by the business end and identifies the transaction type of the blockchain transaction.
- the business end needs to interact with the business blockchain network (that is, the business end needs to call the business blockchain network to realize the production business)
- the business end is independent of the business end and the district
- the block chain gateway of the block chain network (including the business block chain network and the pressure test block chain network) to receive the block chain transaction created by the business end, and to identify the transaction type and then distribute the block chain to the corresponding block chain network Transaction, or the blockchain gateway creates the corresponding blockchain transaction in response to the processing request sent by the business end, and then distributes the created blockchain transaction to the corresponding blockchain network, then the business end and the business blockchain
- One more hop between the networks will cause a certain delay due to the distribution of the blockchain gateway, and the business blockchain network will not be able to obtain business transactions in time to respond, thereby reducing the efficiency of business implementation.
- the stress testing solution in this manual cancels the above-mentioned blockchain gateway used to cooperate with the business end and the blockchain network for data interaction, and the business blockchain node in the business blockchain network performs the above-mentioned distribution operation on its behalf.
- the business end needs to interact with the business blockchain network for data, there is one less jump between the business blockchain node in the business blockchain network and the business end, and the business transaction initiated by the business end can be directly obtained. Thereby, delays can be reduced, the speed of responding to business transactions can be improved, and the efficiency of business realization can be improved.
- the business end can initiate stress testing transactions within a specified time period.
- the specified time period can be to avoid peak business periods, such as late night and other time periods when business data traffic is at a low point. Then, even if the business blockchain node in the business blockchain network executes the operation of distributing blockchain transactions, it will not cause a processing burden on the business blockchain network.
- Step 206 If the blockchain transaction is a business transaction, execute the business transaction.
- a peer-to-peer pressure test blockchain network 33 can be deployed for the business blockchain network 32 in the production state, so that the business blockchain network 33 is used to implement production services, and the pressure test blockchain network 33 Used to implement stress testing.
- the pressure test blockchain network 33 is completely equivalent to the business blockchain network 32, and has the same network structure and network configuration (including hardware and software configuration), making the pressure test implemented for the pressure test blockchain network 33 It can reflect the true status of the business blockchain network 32.
- the machine resources, network resources, computing resources, and storage resources of the pressure test blockchain network 33 and the business blockchain network 32 are the same.
- the block chain network 32 can be used to deploy the pressure test block chain network 33, which is relatively simple in technical implementation and avoids the problem of increasing deployment costs due to complex technical implementation.
- the service end 31 may create a stress test transaction, which includes a first type of identification (for example, a stress test label) and data used for performing the stress test.
- a first type of identification for example, a stress test label
- the business end 31 can create a business transaction, which includes a second type of identification (for example, a business tag) and data used to implement the production business. Then, the business end 31 can submit the created blockchain transaction to the business blockchain network 32.
- the business end 31 directly interacts with the business blockchain network 32, that is, the business end 31 only perceives the business blockchain network 32, and does not need to perceive pressure.
- Test the blockchain network 33 for example, the service end 31 only needs to sense the IP address of the service blockchain node in the service blockchain network 32 to communicate with it, and does not need to sense the IP address of the stress test blockchain node in the stress test blockchain network.
- the business blockchain node in the business blockchain network 32 After the business blockchain node in the business blockchain network 32 receives a blockchain transaction, it needs to read the type identifier contained in the blockchain transaction to identify its transaction type, so as to identify the areas of different transaction types. Differentiated processing of blockchain transactions.
- the business blockchain node in the business blockchain network 32 When the received blockchain transaction is a business transaction, the business blockchain node in the business blockchain network 32 performs operations such as consensus, execution, and chaining for the business transaction, and generates a corresponding transaction receipt.
- the business end 31 can send the created blockchain transaction to a certain business blockchain node 32n in the business blockchain network 32, and the business blockchain node 32n needs to process the received blockchain transaction.
- the transaction type is identified to determine whether the blockchain transaction is a business transaction or a stress test transaction.
- the blockchain node 32n can further transfer the business transaction to other blockchain nodes in the business blockchain network 32, so that all the blockchain nodes in the business blockchain network 32
- the business blockchain node can perform operations such as consensus, execution, and chaining for the business transaction, and generate a corresponding transaction receipt (including the second type of identification, that is, the above-mentioned business tag).
- the pressure test block chain network 33 uses the pressure test block chain node in the pressure test block chain network 33 to perform consensus, execution, and chain operations on the pressure test transaction, and generate a corresponding transaction receipt (including the first Type identification, that is, the above-mentioned pressure test label).
- the real data generated in the physical world it 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.
- the node device ie, blockchain node
- the business blockchain network 32 performs consensus processing on the received business transaction by all business blockchain nodes in the business blockchain network 32, so that the business transaction can be executed and the business transaction will be executed after the consensus is passed.
- the business transaction is packaged into a block.
- 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), appointment Consensus algorithms such as Delegated Proof of Stake (DPOS);
- POW Proof of Work
- POS Proof of Stake
- DPOS Delegated Proof of Stake
- the second type of consensus algorithm is a consensus algorithm that pre-selects accounting nodes for each round of accounting cycles (without competing for accounting rights); for example, practical Byzantine Fault Tolerance (PBFT) and other consensus algorithms.
- PBFT 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.
- other nodes verify the new block or block header sent by the accounting node, they can also execute the transaction contained in the block.
- the pressure test blockchain network 33 is a blockchain network equivalent to the business blockchain network 32
- the number of pressure test blockchain nodes and business blocks in the pressure test blockchain network 33 The number of business blockchain nodes in the chain network 32 is the same, that is, there is a one-to-one correspondence between the pressure test blockchain nodes and the business blockchain nodes. Therefore, the business blockchain node in the business blockchain network 32 can send a pressure test transaction to the pressure test blockchain node corresponding to itself in the pressure test blockchain network 33, so as to realize that each business blockchain node sends the corresponding The stress test blockchain node forwards stress test transactions peer-to-peer.
- the business blockchain node A forwards the stress test transaction to the stress test blockchain node a
- the business blockchain node B forwards the stress test transaction to the stress test blockchain node b
- the business blockchain node C forwards the stress test transaction to the stress test blockchain node b.
- the stress test blockchain node c forwards the stress test transaction
- the business blockchain node D forwards the stress test transaction to the stress test blockchain node d.
- the business blockchain node in the business blockchain network 32 sends pressure to all pressure test blockchain nodes in the pressure test blockchain network 33.
- Test transactions For example, following the example in Table 1 above, business blockchain node A forwards stress test transactions to stress test blockchain nodes a to d, and business blockchain node B sends stress test blockchain node a to stress test blockchain node a.
- business blockchain node C forwards stress test transactions to stress test blockchain nodes a to d
- business blockchain node D forwards stress test transactions to stress test blockchain nodes a to d, respectively Test transactions.
- the business end 31 submits stress test transactions to the business blockchain nodes in the business blockchain network 32, and the service end 31 (there may be multiple) can submit multiple stress test transactions to different The business blockchain node submits a stress test transaction. Therefore, there are two situations for the forwarded stress test transaction. In one case, any business blockchain node in the business blockchain network 32 can forward the pressure test transaction received by the business blockchain node from the business end 31 to the pressure test blockchain network 33.
- the business blockchain node A can forward the business blockchain node A to the pressure test blockchain node a from the business end 31
- the business blockchain node B can forward the 40 stress test transactions received by the service blockchain node B from the service end 31 to the stress test blockchain node b.
- the service blockchain Node C can forward the 30 pressure test transactions received by the business blockchain node C from the business end 31 to the pressure test blockchain node c
- the business blockchain node D can forward the business area to the pressure test blockchain node d
- the block chain node D received 20 pressure test transactions from the business end 31.
- each pressure test blockchain node After each pressure test blockchain node receives the pressure test transaction, it can broadcast the pressure test transaction received by itself in the pressure test blockchain network, so that all the pressure test blockchain nodes can obtain the same pressure test transaction , And then all pressure test blockchain nodes can perform consensus, execution, and chain operations for these same pressure test transactions.
- the stress test blockchain node a can broadcast the 50 stress test transactions it has received in the stress test blockchain network, that is, the stress test blockchain nodes b, c, and d can obtain these 50 stress test transactions.
- the stress test blockchain node b can broadcast the 40 stress test transactions it has received in the stress test blockchain network, that is, the stress test blockchain nodes a, c, and d can obtain these 40 stress tests. trade.
- the stress test blockchain node c can broadcast the 30 stress test transactions it has received in the stress test blockchain network, that is, the stress test blockchain nodes a, b, and d can obtain these 30 stress test transactions.
- the stress test blockchain node d can broadcast the 20 stress test transactions it has received in the stress test blockchain network, that is, the stress test blockchain nodes a, b, and c can obtain these 20 stress test transactions.
- the pressure test blockchain nodes a to d can obtain 140 identical pressure test transactions, and then perform consensus, execution, and chain operations for these 140 pressure test transactions.
- any business block chain node in the business block chain network 32 can forward all business block chain nodes in the business block chain network 32 from the business end 31 to the pressure test block chain network 33 Stress test transactions received.
- each business blockchain node in the business blockchain network 32 receives the stress test transaction from the business end 31, it can broadcast the stress test transaction it receives in the business blockchain network 32, so that the business The pressure test transactions that can be received synchronously between all business blockchain nodes in the blockchain network 32, that is, each business blockchain node can obtain the data received by all business blockchain nodes from the business end Stress test transactions, and then forward these stress test transactions to the business blockchain network.
- a forwarding node for forwarding stress test transactions can be configured in the business blockchain network 32, so if a certain business blockchain node in the business blockchain network 32 is a forwarding node, the business area The block chain node forwards the pressure test transaction to the pressure test block chain network 33.
- Each business blockchain node in the business blockchain network 32 can send the stress test transaction received from the business end to the forwarding node, and the forwarding node will uniformly measure the stress received by all business blockchain nodes from the business end. The transaction is forwarded to the pressure test blockchain network 33.
- the forwarding node can establish a connection with a certain stress test blockchain node in the stress test blockchain network 33, so as to forward all stress test transactions to the stress test blockchain node, so that the stress test blockchain can be used by the stress test blockchain node.
- the node broadcasts the stress test transaction from the forwarding node in the stress test blockchain network 33, so that all the stress test blockchain nodes in the stress test blockchain network 33 can obtain the stress test transaction from the forwarding node, and then carry out consensus, Execution, winding and other operations.
- the forwarding node can establish a connection with each pressure test blockchain node in the pressure test blockchain network 33, thereby forwarding all pressure test transactions to each pressure test blockchain node, so that the pressure test blockchain All stress test blockchain nodes in the network 33 can obtain stress test transactions from the forwarding node, and then perform operations such as consensus, execution, and chaining.
- the forwarding node can be selected through negotiation among various business blockchain nodes in the business blockchain network 32.
- the forwarding node is selected at the stage of deploying the business blockchain network 32, so that the node information of the forwarding node is written into the chain code, so that each business blockchain node will assign the business area corresponding to the node information recorded in the chain code
- the block chain node is confirmed as a forwarding node.
- the business end 31 can submit the created blockchain transaction to the business blockchain node by establishing a connection with a certain business blockchain node in the business blockchain network 32, and the business blockchain node can be The business blockchain node 32n is shown in FIG. 3.
- the connection established between the business end 31 and the business blockchain node 32n can be a long connection, so that the business blockchain node 32n executes the business transaction to generate the second transaction receipt, and from the pressure test
- the blockchain network 33 After the blockchain network 33 obtains the first transaction receipt, it can generate a corresponding transaction receipt generation event, and the business end 31 can learn that the transaction receipt has been generated by monitoring the transaction receipt generation event (that is, the event monitoring mechanism), and based on the aforementioned long-term Connect to get the corresponding transaction receipt (first transaction receipt or second transaction receipt).
- the business blockchain node 32n can also monitor the transaction receipt generation event through the aforementioned event monitoring mechanism, and feed back the corresponding transaction receipt to the service end 31 through the aforementioned long connection, so that the service end 31 can obtain the transaction receipt. Or, if the connection established between the business end 31 and the business blockchain node 32n is not a persistent connection or the established persistent connection is disconnected, the business end 31 needs to initiate an additional query transaction to query the submitted blockchain The transaction receipt corresponding to the transaction.
- the query transaction can be a regular blockchain transaction, so that all blockchain nodes in the business blockchain network 32 need to perform operations such as obtaining, consensus, execution, and chaining for the query transaction, and the business end 31 You can establish a long connection with a business blockchain node in the above manner, and obtain the corresponding transaction receipt from the business blockchain node based on the above event monitoring mechanism; or, the query transaction can be a special transaction, such as a business terminal 31 can only establish a long connection with the business blockchain node 32n and send the query transaction, then the query transaction will only be acquired and executed by the business blockchain node 32n.
- the query transaction does not need to participate in consensus and does not need to be chained, or even Obtained by other blockchain nodes, then the business end 31 can obtain the corresponding transaction receipt based on the event monitoring mechanism as described above.
- the business blockchain node in the service blockchain network 32 can also be based on the aforementioned The event monitoring mechanism obtains the second transaction receipt, which will not be repeated here.
- a connection can be established between the business blockchain node 32n and the pressure test blockchain node 33n, so as to obtain the second transaction receipt based on the event monitoring mechanism as described above.
- the service terminal 31 can identify whether the obtained transaction receipt corresponds to a stress test transaction or a business transaction according to the type identifier included in the transaction receipt.
- the acquired transaction receipt contains the first type identification
- the acquired transaction receipt contains the second type identification
- the transaction receipt is determined It is the second transaction receipt (that is, corresponding to the business transaction).
- the business end 31 can store the first transaction receipt in the stress test database, and store the second transaction receipt in the business database, and subsequently can obtain the first transaction receipt from the stress test database to analyze and determine the stress test for the business blockchain network 32 result.
- this specification also proposes an embodiment of the pressure test on the blockchain node side in the blockchain network, and the implementation on the node side of the business blockchain
- the description involved in the example can also be applied to the embodiment of the pressure test on the node side of the blockchain, which will not be repeated in the following.
- FIG. 4 is a flowchart of another method for stress testing of a blockchain network according to an exemplary embodiment. As shown in Fig. 4, the method is applied to the pressure test blockchain node in the pressure test blockchain network equivalent to the business blockchain network in the production state, and may include the following steps:
- Step 402 Receive a stress test transaction forwarded by a business blockchain node in the business blockchain network.
- the stress test transaction initiated by the business blockchain node on the business side is a stress test transaction. Forward in case of;
- Step 404 Execute the stress test transaction; wherein, when the blockchain transaction is a business transaction, the business transaction is executed by the business blockchain node.
- the stress test blockchain node can receive the stress test transaction forwarded by the business blockchain node corresponding to the stress test blockchain node in the business blockchain network.
- the stress test blockchain node can receive the stress test transaction forwarded by the business blockchain node as the forwarding node in the business blockchain network.
- the stress test block chain node can receive the stress test transaction received from the business end forwarded by the business block chain node in the business block chain network; or, receive the business block The stress test transactions received from the business end by all business blockchain nodes in the business blockchain network forwarded by the business blockchain node in the chain network.
- the stress test transaction includes a first type identifier
- the business transaction includes a second type identifier
- the first transaction receipt corresponding to the stress test transaction includes the first type identifier
- the second transaction receipt corresponding to the business transaction includes the second type identifier
- the first transaction receipt is stored in the stress test database
- the second transaction receipt is stored in the business database.
- the pressure test blockchain network and the business blockchain network have the same network structure and network configuration.
- the blockchain transaction is initiated by the business end to the business blockchain network through the blockchain client.
- the blockchain client is deployed on the business end; or, the blockchain client is deployed on the business blockchain node in the business blockchain network.
- Fig. 5 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to FIG. 5.
- the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510.
- the processor 502 reads the corresponding computer program from the non-volatile memory 510 to the memory 508 and then runs it to form a stress test device for the blockchain network on a logical level.
- one or more embodiments of this specification 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 business blockchain node in the business blockchain network in the production state, and may include: an identification unit 602, which identifies the business end The transaction type of the initiated blockchain transaction; the forwarding unit 604, in the case that the blockchain transaction is a stress test transaction, forwards the transaction to a stress test blockchain network equivalent to the business blockchain network Stress testing transaction; the execution unit 606 executes the business transaction when the blockchain transaction is a business transaction.
- the forwarding unit 604 is specifically configured to: send the stress test transaction to a stress test blockchain node corresponding to the business blockchain node in the stress test blockchain network; or, All the stress test blockchain nodes in the stress test blockchain network respectively send the stress test transaction.
- the forwarding unit 604 is specifically configured to: if the business blockchain node is a forwarding node in the business blockchain network, forward the pressure to the stress test blockchain network. Test transactions.
- the forwarding unit 604 is specifically configured to: forward the stress test transaction received by the service blockchain node from the service end to the stress test blockchain network; or, to the stress test The blockchain network forwards the stress test transactions received from the business end by all business blockchain nodes in the business blockchain network.
- the identification unit 602 is specifically configured to: read the type identifier included in the blockchain transaction; if the type identifier is the first type identifier, determine that the blockchain transaction is In the stress test transaction, if the type identifier is a second type identifier, the blockchain transaction is determined to be the business transaction.
- the first transaction receipt corresponding to the stress test transaction includes the first type identifier
- the second transaction receipt corresponding to the business transaction includes the second type identifier
- the first transaction receipt is stored in a stress test database
- the second transaction receipt is stored in a business database.
- the pressure test blockchain network and the business blockchain network have the same network structure and network configuration.
- the blockchain transaction is initiated by the business end to the business blockchain network through a blockchain client.
- the blockchain client is deployed on the business end; or, the blockchain client is deployed on a business blockchain node in the business blockchain network.
- the pressure test device of the blockchain network is applied to the pressure test blockchain in the pressure test blockchain network that is equivalent to the business blockchain network in production.
- Nodes can include:
- the receiving unit 702 receives a stress test transaction forwarded by a business blockchain node in the business blockchain network, where the stress test transaction initiated by the business blockchain node at the business end is a stress test Forwarding in the case of a transaction; the execution unit 704 executes the stress test transaction; wherein, when the blockchain transaction is a business transaction, the business transaction is executed by the business blockchain node.
- the receiving unit 702 is specifically configured to receive a stress test transaction forwarded by a business blockchain node corresponding to the stress test blockchain node in the business blockchain network.
- the receiving unit 702 is specifically configured to receive a stress test transaction forwarded by a business blockchain node as a forwarding node in the business blockchain network.
- the receiving unit 702 is specifically configured to: receive a stress test transaction received from the business end forwarded by a business blockchain node in the business blockchain network; or, receive the business area
- the business blockchain node in the blockchain network forwards the stress test transaction received by all the business blockchain nodes in the business blockchain network from the business end.
- the stress test transaction includes a first type identifier
- the business transaction includes a second type identifier
- the first transaction receipt corresponding to the stress test transaction includes the first type identifier
- the second transaction receipt corresponding to the business transaction includes the second type identifier
- the first transaction receipt is stored in a stress test database
- the second transaction receipt is stored in a business database.
- the pressure test blockchain network and the business blockchain network have the same network structure and network configuration.
- the blockchain transaction is initiated by the business end to the business blockchain network through a blockchain client.
- the blockchain client is deployed on the business end; or, the blockchain client is deployed on a business blockchain node in the business blockchain network.
- a typical implementation device is a computer.
- the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
- the computer includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
- processors CPU
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- the memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM).
- RAM random access memory
- ROM read-only memory
- flash RAM flash memory
- Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
- the information can be computer-readable instructions, data structures, program modules, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, 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.
- first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, 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)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- General Engineering & Computer Science (AREA)
- Finance (AREA)
- Databases & Information Systems (AREA)
- Computing Systems (AREA)
- Computer Hardware Design (AREA)
- Data Mining & Analysis (AREA)
- Quality & Reliability (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- General Business, Economics & Management (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
本说明书一个或多个实施例提供一种区块链网络的压力测试方法及装置、系统;该方法应用于处于生产状态的业务区块链网络中的业务区块链节点,可以包括:识别业务端发起的区块链交易的交易类型;在所述区块链交易为压测交易的情况下,向与所述业务区块链网络对等的压测区块链网络转发所述压测交易;在所述区块链交易为业务交易的情况下,执行所述业务交易。
Description
本说明书一个或多个实施例涉及区块链技术领域,尤其涉及一种区块链网络的压力测试方法及装置、系统。
区块链技术(也被称之为,分布式账本技术)是一种去中性化的分布式数据库技术,具有去中心化、公开透明、不可篡改、可信任等多种特点,适用于诸多对数据可靠性具有高需求的应用场景中。
通过向区块链网络导入压力测试流量,可以获知区块链网络的负载能力、数据吞吐量上限等各项性能指标,从而据此维护区块链网络的正常运行,或者针对区块链网络进行优化。
发明内容
有鉴于此,本说明书一个或多个实施例提供一种区块链网络的压力测试方法及装置、系统。
根据本说明书一个或多个实施例的第一方面,提出了一种区块链网络的压力测试系统,包括:业务端,向处于生产状态的业务区块链网络发起区块链交易;业务区块链网络,所述业务区块链网络中的业务区块链节点在所述区块链交易为压测交易的情况下,向与所述业务区块链网络对等的压测区块链网络转发所述压测交易,在所述区块链交易为业务交易的情况下,执行所述业务交易;压测区块链网络,所述压测区块链网络中的压测区块链节点执行所述压测交易。
根据本说明书一个或多个实施例的第二方面,提出了一种区块链网络的压力测试方法,应用于处于生产状态的业务区块链网络中的业务区块链节点,所述方法包括:识别业务端发起的区块链交易的交易类型;在所述区块链交易为压测交易的情况下,向与所述业务区块链网络对等的压测区块链网络转发所述压测交易;在所述区块链交易为业务交易的情况下,执行所述业务交易。
根据本说明书一个或多个实施例的第三方面,提出了一种区块链网络的压力测试方 法,应用于与处于生产状态的业务区块链网络对等的压测区块链网络中的压测区块链节点,所述方法包括:接收所述业务区块链网络中的业务区块链节点转发的压测交易,所述压测交易由所述业务区块链节点在业务端发起的区块链交易为压测交易的情况下转发;执行所述压测交易;其中,在所述区块链交易为业务交易的情况下,所述业务交易被所述业务区块链节点执行。
根据本说明书一个或多个实施例的第四方面,提出了一种区块链网络的压力测试装置,应用于处于生产状态的业务区块链网络中的业务区块链节点,所述装置包括:识别单元,识别业务端发起的区块链交易的交易类型;转发单元,在所述区块链交易为压测交易的情况下,向与所述业务区块链网络对等的压测区块链网络转发所述压测交易;执行单元,在所述区块链交易为业务交易的情况下,执行所述业务交易。
根据本说明书一个或多个实施例的第五方面,提出了一种区块链网络的压力测试装置,应用于与处于生产状态的业务区块链网络对等的压测区块链网络中的压测区块链节点,所述装置包括:接收单元,接收所述业务区块链网络中的业务区块链节点转发的压测交易,所述压测交易由所述业务区块链节点在业务端发起的区块链交易为压测交易的情况下转发;执行单元,执行所述压测交易;其中,在所述区块链交易为业务交易的情况下,所述业务交易被所述业务区块链节点执行。
根据本说明书一个或多个实施例的第六方面,提出了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器。其中,所述处理器通过运行所述可执行指令以实现如上述实施例中任一所述的方法。
根据本说明书一个或多个实施例的第七方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如上述实施例中任一所述方法的步骤。
图1是一示例性实施例提供的一种网络架构的示意图。
图2是一示例性实施例提供的一种区块链网络的压力测试方法的流程图。
图3是一示例性实施例提供的一种区块链网络的压力测试系统的示意图。
图4是一示例性实施例提供的另一种区块链网络的压力测试系统的示意图。
图5是一示例性实施例提供的一种设备的结构示意图。
图6是一示例性实施例提供的一种区块链网络的压力测试装置的框图。
图7是一示例性实施例提供的另一种区块链网络的压力测试装置的框图。
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本说明书一个或多个实施例相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本说明书一个或多个实施例的一些方面相一致的装置和方法的例子。
需要说明的是:在其他实施例中并不一定按照本说明书示出和描述的顺序来执行相应方法的步骤。在一些其他实施例中,其方法所包括的步骤可以比本说明书所描述的更多或更少。此外,本说明书中所描述的单个步骤,在其他实施例中可能被分解为多个步骤进行描述;而本说明书中所描述的多个步骤,在其他实施例中也可能被合并为单个步骤进行描述。
图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,识别业务端发起的区块链交易的交易类型。
在本实施例中,区块链客户端用于创建区块链交易,并向业务区块链网络提交创建的区块链交易。因此,业务端可通过区块链客户端向业务区块链网络发起区块链交易。
在一种情况下,区块链客户端可部署于业务端上,由业务端通过区块链客户端直接与业务区块链网络进行交互,创建相应的区块链交易提交至业务区块链网络来满足实际需求。当针对业务区块链网络存在压测需求时,业务端可通过区块链客户端创建压测类型的区块链交易(即压测交易,包含用于压力测试的数据),当针对业务区块链网络存在业务需求时,业务端可通过区块链客户端创建业务类型的区块链交易(即业务交易,包含用于实现业务的数据)。
作为一示例性实施例,可通过在区块链交易中添加类型标识的方式来对压测交易和业务交易进行区分。比如,可在压测交易中添加第一类型标识,在业务交易中添加第二类型标识。那么,业务区块链网络中的业务区块链节点在接收到业务端提交的区块链交易后,可读取接收到的区块链交易包含的类型标识。在该类型标识为第一类型标识的情况下,将接收到的区块链交易判定为压测交易,在该类型标识为第二类型标识的情况下,将接收到的区块链交易判定为业务交易。
相应的,在执行压测交易生成第一交易回执时,可在第一交易回执中添加第一类型标识,以用于表明第一交易回执与压测交易相对应。类似的,在执行业务交易生成第二交易回执时,可在第二交易回执中添加第二类型标识,以用于表明第二交易回执与业务交易相对应。也即,对应于压测交易的第一交易回执中包含第一类型标识,对应于业务交易的第二交易回执中包含第二类型标识。那么,业务端在获取到返回的交易回执后,可根据交易回执中的类型标识来识别交易回执的类型,进而将第一交易回执存储至压测数据库,将第二交易回执存储至业务数据库,便于后续进行分析。可见,通过上述改进创建区块链交易的方式,使得压测标签和业务标签等特征标签可带入到区块链网络中,从而实现压测属性在区块链网络中的传递。
而对于添加类型标识的方式,在一种情况下,可在区块链交易中添加type字段(或者其他任意字段),用于标记区块链交易为业务交易或压测交易。比如,当任一区块链交易type字段的取值为第一取值时,表明该区块链交易属于业务交易,当任一区块链交易type字段的取值为第二取值(区别于第一取值)时,表明该区块链交易属于压测交易。相应地,可在交易回执中也添加type字段,用于标记该交易回执由执行业务交易而生成还是由执行压测交易而生成,那么业务端便可在获取交易回执后,按照上述识别type字段取值的方式来识别交易回执的类型,进而进行差异化处理。在另一种情况下,还可复用区块链交易和交易回执中的已有字段,在已有字段中添加类型标识。比如,复用区块链交易中的“reserved字段”来表明区块链交易的交易类型;例如,可在“reserved字段”中添加业务标签,使得区块链网络上的区块链节点可以将包含业务标签的区块链交易识别为业务交易,而将未包含业务标签的区块链交易识别为压测交易。或者,可在“reserved字段”中添加压测标签,使得区块链节点可将包含压测标签的区块链交易识别为压测交易,而将未包含压测标签的区块链交易识别为业务交易。或者,还可同时在“reserved字段”中添加业务标签和压测标签,使得区块链节点可将包含业务标签的区块链交易识别为业务交易,将包含压测标签的区块链交易识别为压测交易。需要说明的是,针对在交易回执中添加类型标识的方式与上述类似,在此不再赘述。
在另一种情况下,区块链客户端部署于业务区块链网络中的业务区块链节点上。比如,业务区块链网络中的节点设备上部署有两套逻辑代码。其中,第一套逻辑代码对应于区块链客户端,节点设备通过运行第一套逻辑代码以使得链下的业务端可通过该区块链客户端与业务区块链网络进行数据交互。第二套逻辑代码对应于业务区块链网络(即业务区块链网络的链代码),节点设备通过运行第二套逻辑代码来作为业务区块链网络中的业务区块链节点。
举例而言,业务端可向业务区块链网络中的节点设备发送处理请求来实现与业务区块链网络的交互。其中,处理请求可包含用于调用压测区块链网络执行压力测试的压测请求、用于调用业务区块链网络执行生产业务的业务请求等。而节点设备在接收到业务端的处理请求后,通过区块链客户端识别该处理请求的请求类型,进而创建与请求类型对应的区块链交易,并向业务区块链网络提交该区块链交易。同时,节点设备作为业务区块链网络中的业务区块链节点,获取区块链客户端提交的区块链交易,并识别该区块链交易的交易类型。
其中,业务端的处理请求中可包含类型标识,区块链客户端可据此识别处理请求的请求类型。进一步的,区块链客户端在创建与处理请求对应的区块链交易时,同样可在区块链交易中添加类型标识以用于标记该区块链交易的交易类型。因此,可根据获取到的区块链交易包含的类型标识来确定该区块链交易的交易类型。以处理请求分为压测请求和业务请求为例,压测请求中包含第一类型标识,业务请求中包含第二类型标识,那么,区块链客户端在根据第一类型标识识别出接收到的处理请求为压测请求后,可创建与之对应的压测交易,并在压测交易中添加第一类型标识。类似的,区块链客户端在根据第二类型标识识别出接收到的处理请求为业务请求后,可创建与之对应的业务交易,并在业务交易中添加第二类型标识。
步骤204,在所述区块链交易为压测交易的情况下,向与所述业务区块链网络对等的压测区块链网络转发所述压测交易。
在本实施例中,为了避免压力测试与生产业务之间相互干扰,可分别部署用于响应压测交易的压测区块链网络,以及用于响应业务交易的业务区块链网络。其中,压测区块链网络为与业务区块链网络对等的区块链网络。
进一步的,由业务区块链网络中的区块链节点配合业务端与区块链网络,以实现业务端与业务区块链网络以及压测区块链网络之间的数据交互。具体而言,处于生产状态的业务区块链网络中的业务区块链节点在接收到的区块链交易为压测交易时,将该压测交易转发至压测区块链网络,以由压测区块链网络中的压测区块链节点对该压测交易进行响应。而在业务区块链节点在接收到的区块链交易为业务交易时,直接执行该业务交易以实现相应的业务。可见,在本说明书中的压测方案中,由业务区块链网络中的业务区块链节点直接来获取业务端发起的区块链交易以及识别区块链交易的交易类型。本领域技术人员应当理解的是:在业务端需要与业务区块链网络进行数据交互的情况下(即业务端需要调用业务区块链网络来实现生产业务),若由独立于业务端和区块链网络(包 括业务区块链网络和压测区块链网络)的区块链网关来接收业务端创建的区块链交易,以及识别出交易类型进而向相应区块链网络分发区块链交易,或者由该区块链网关来响应于业务端发送的处理请求而创建相应的区块链交易,进而向相应区块链网络分发创建的区块链交易,则业务端与业务区块链网络之间多了一跳,将因区块链网关的分发造成一定的延迟,业务区块链网络无法及时获取到业务交易以进行响应,从而降低了业务实现的效率。
而本说明书中的压测方案取消了上述用于配合业务端和区块链网络进行数据交互的区块链网关,由业务区块链网络中的业务区块链节点来代为执行上述分发操作。在业务端需要与业务区块链网络进行数据交互的情况下,业务区块链网络中的业务区块链节点与业务端之间少了一跳,可直接获取到业务端发起的业务交易,从而可降低延迟,提高响应业务交易的速度,进而提升业务实现的效率。同时,业务端可在指定时间段内发起压测交易,比如该指定时间段可以是避开业务高峰期,譬如深夜等业务数据流量处于低谷的时间段。那么,即便是由业务区块链网络中的业务区块链节点来执行分发区块链交易的操作,也不会对业务区块链网络造成处理负担。
步骤206,在所述区块链交易为业务交易的情况下,执行所述业务交易。
为了便于理解,下面结合图3,以区块链客户端部署于业务端上(即由业务端来创建区块链交易)为例进行说明,而区块链客户端部署于业务区块链节点上的方案与此类似。
如图3所示,可以针对处于生产状态的业务区块链网络32部署对等的压测区块链网络33,使得业务区块链网络33用于实现生产业务,压测区块链网络33用于实现压力测试。其中,压测区块链网络33与业务区块链网络32完全对等,具有相同的网络结构和网络配置(包括硬件和软件配置),使得针对压测区块链网络33所实施的压力测试能够体现出业务区块链网络32的真实状况。比如,压测区块链网络33与业务区块链网络32的机器资源、网络资源、计算资源、存储资源均相同。同时,由于压测区块链网络33与业务区块链网络32完全对等,那么在配置压测区块链网络33时无需对现有的区块链网络进行改造,比如直接按照部署业务区块链网络32的方式部署压测区块链网络33即可,在技术实现上较为简单,避免因技术实现较为复杂导致提高部署成本的问题。
当针对业务区块链网络32存在压测需求时,业务端31可创建压测交易,该压测交易中包含第一类型标识(比如为压测标签)和用于进行压力测试的数据。当针对业务区块链网络32存在业务需求时,业务端31可创建业务交易,该业务交易中包含第二类型 标识(比如为业务标签)和用于实现生产业务的数据。然后,业务端31可将创建好的区块链交易提交至业务区块链网络32。实际上,无论业务端31创建的是业务交易还是压测交易,业务端31都是直接与业务区块链网络32进行交互,也即业务端31仅感知业务区块链网络32,无需感知压测区块链网络33。比如,业务端31感知业务区块链网络32中业务区块链节点的IP地址以与其进行通讯即可,而无需感知压测区块链网络中的压测区块链节点的IP地址。
业务区块链网络32中的业务区块链节点在接收到区块链交易后,需要读取该区块链交易中包含的类型标识以对其交易类型进行识别,从而对不同交易类型的区块链交易进行差异化处理。当接收到的区块链交易为业务交易时,业务区块链网络32中的业务区块链节点则针对该业务交易进行共识、执行、上链等操作,并生成相应的交易回执。比如,业务端31可以将创建好的区块链交易发送至业务区块链网络32中的某一业务区块链节点32n,而业务区块链节点32n需要对接收到的区块链交易的交易类型予以识别,以确定该区块链交易为业务交易还是压测交易。当确定出该区块链交易为业务交易时,区块链节点32n可以进一步将该业务交易传递至业务区块链网络32中的其他区块链节点,使得业务区块链网络32中的所有业务区块链节点可以针对该业务交易进行共识、执行、上链等操作,并生成相应的交易回执(包含第二类型标识,即上述业务标签)。
当业务区块链网络32中的业务区块链节点识别出接收到的区块链交易为压测交易时,业务区块链网络32中的业务区块链节点则将该压测交易转发至压测区块链网络33,以由压测区块链网络33中的压测区块链节点针对该压测交易进行共识、执行、上链等操作,并生成相应的交易回执(包含第一类型标识,即上述压测标签)。
对于物理世界产生的真实数据,可以将其构建成区块链网络所支持的标准的交易(transaction)格式,然后发布至区块链网络,由区块链网络中的节点设备对收到的交易进行共识处理,并在达成共识后,由区块链网络中作为记账节点的节点设备(即区块链节点),将这笔交易打包进区块,在区块链网络中进行持久化存证。具体而言,业务区块链网络32针对接收到的业务交易,由业务区块链网络32中的所有业务区块链节点对其进行共识处理,从而在共识通过后再执行该业务交易以及将该业务交易打包进区块。类似的,压测区块链网络33针对接收到的压测交易,由压测区块链网络33中的所有压测区块链节点对其进行共识处理,从而在共识通过后再执行该压测交易以及将该压测交易打包进区块。
其中,区块链网络中支持的共识算法可以包括:
第一类共识算法,即节点设备需要争夺每一轮的记账周期的记账权的共识算法;例如,工作量证明(Proof of Work,POW)、股权证明(Proof of Stake,POS)、委任权益证明(Delegated Proof of Stake,DPOS)等共识算法;
第二类共识算法,即预先为每一轮记账周期选举记账节点(不需要争夺记账权)的共识算法;例如,实用拜占庭容错(Practical Byzantine Fault Tolerance,PBFT)等共识算法。
在采用第一类共识算法的区块链网络中,争夺记账权的节点设备,都可以在接收到交易后执行该笔交易。争夺记账权的节点设备中可能有一个节点设备在本轮争夺记账权的过程中胜出,成为记账节点。记账节点可以将收到的交易与其它交易一起打包以生成最新区块,并将生成的最新区块或者该最新区块的区块头发送至其它节点设备进行共识。
在采用第二类共识算法的区块链网络中,具有记账权的节点设备在本轮记账前已经商定好。因此,节点设备在接收到交易后,如果自身不是本轮的记账节点,则可以将该交易发送至记账节点。对于本轮的记账节点,在将该交易与其它交易一起打包以生成最新区块的过程中或者之前,可以执行该交易。记账节点在生成最新区块后,可以将该最新区块或者该最新区块的区块头发送至其它节点设备进行共识。
如上所述,无论区块链网络采用以上示出的哪种共识算法,本轮的记账节点都可以将接收到的交易打包以生成最新区块,并将生成的最新区块或者该最新区块的区块头发送至其它节点设备进行共识验证。如果其它节点设备接收到最新区块或者该最新区块的区块头后,经验证没有问题,可以将该最新区块追加到原有的区块链网络末尾,从而完成区块链网络的记账过程。其它节点验证记账节点发来的新的区块或区块头的过程中,也可以执行该区块中包含的交易。
而针对业务区块链网络32中的业务区块链节点向压测区块链网络33转发压测交易的方式,根据配置业务区块链节点和压测区块链节点的方式而存在一定不同。
一方面,针对向压测区块链网络转发压测交易的方式,存在两种情况。在一种情况下,由于压测区块链网络33是与业务区块链网络32对等的区块链网络,压测区块链网络33中压测区块链节点的数量与业务区块链网络32中业务区块链节点的数量相同,即压测区块链节点与业务区块链节点为一一对应的关系。因此,业务区块链网络32中的业务区块链节点可向压测区块链网络33中与自身对应的压测区块链节点发送压测交易,从而实现各个业务区块链节点向相应的压测区块链节点对等地转发压测交易。
举例而言,假定业务区块链网络32中业务区块链节点和压测区块链网络33中压测区块链节点之间的对应关系如表1所示。
业务区块链节点 | 压测区块链节点 |
A | a |
B | b |
C | c |
D | d |
表1
那么,由业务区块链节点A向压测区块链节点a转发压测交易,由业务区块链节点B向压测区块链节点b转发压测交易,由业务区块链节点C向压测区块链节点c转发压测交易,由业务区块链节点D向压测区块链节点d转发压测交易。
在另一种情况下,区别于上述对等转发的方式,由业务区块链网络32中的业务区块链节点向压测区块链网络33中的所有压测区块链节点分别发送压测交易。比如,承接于上述表1中的举例,由业务区块链节点A分别向压测区块链节点a~d转发压测交易,由业务区块链节点B分别向压测区块链节点a~d转发压测交易,由业务区块链节点C分别向压测区块链节点a~d转发压测交易,由业务区块链节点D分别向压测区块链节点a~d转发压测交易。
另一方面,业务端31向业务区块链网络32中的业务区块链节点提交压测交易,而业务端31(可能存在多个)在提交多笔压测交易时,可以分别向不同的业务区块链节点提交压测交易。因此,针对转发的压测交易,存在两种情况。在一种情况下,业务区块链网络32中的任一业务区块链节点可向压测区块链网络33转发该业务区块链节点从业务端31处接收到的压测交易。以上述压测区块链节点与业务区块链节点“一一对应”的情况为例,业务区块链节点A可向压测区块链节点a转发业务区块链节点A从业务端31处接收到的50笔压测交易,业务区块链节点B可向压测区块链节点b转发业务区块链节点B从业务端31处接收到的40笔压测交易,业务区块链节点C可向压测区块链节点c转发业务区块链节点C从业务端31处接收到的30笔压测交易,业务区块链节点D可向压测区块链节点d转发业务区块链节点D从业务端31处接收到的20笔压测交易。而各个压测区块链节点在接收到压测交易后,可在压测区块链网络中广播自身接收到的压测交易,使得所有压测区块链节点可获取到相同的压测交易,进而所有压测区 块链节点可针对这些相同的压测交易进行共识、执行、上链等操作。比如,压测区块链节点a可在压测区块链网络中广播自身接收到的50笔压测交易,即压测区块链节点b、c、d可获取到这50笔压测交易。类似的,压测区块链节点b可在压测区块链网络中广播自身接收到的40笔压测交易,即压测区块链节点a、c、d可获取到这40笔压测交易。压测区块链节点c可在压测区块链网络中广播自身接收到的30笔压测交易,即压测区块链节点a、b、d可获取到这30笔压测交易。压测区块链节点d可在压测区块链网络中广播自身接收到的20笔压测交易,即压测区块链节点a、b、c可获取到这20笔压测交易。通过上述广播过程,压测区块链节点a~d均可获取到140笔相同的压测交易,进而针对这140笔压测交易进行共识、执行、上链等操作。
在另一种情况下,业务区块链网络32中的任一业务区块链节点可向压测区块链网络33转发业务区块链网络32中所有业务区块链节点从业务端31处接收到的压测交易。其中,业务区块链网络32中的每个业务区块链节点在从业务端31处接收到压测交易后,可在业务区块链网络32中广播自身接收到的压测交易,使得业务区块链网络32中的所有业务区块链节点之间可同步接收到的压测交易,也即每个业务区块链节点均可获取到所有业务区块链节点从业务端处接收到的压测交易,进而将这些压测交易转发至业务区块链网络。
或者,可在业务区块链网络32中配置用于转发压测交易的转发节点,那么在业务区块链网络32中的某一业务区块链节点为转发节点的情况下,由该业务区块链节点向压测区块链网络33转发压测交易。业务区块链网络32中各个业务区块链节点可将从业务端处接收到的压测交易发送至转发节点,由转发节点统一将所有业务区块链节点从业务端处接收到的压测交易转发至压测区块链网络33。比如,转发节点可与压测区块链网络33中的某一压测区块链节点建立连接,从而将所有压测交易转发至该压测区块链节点,以由该压测区块链节点在压测区块链网络33中广播来自转发节点的压测交易,使得压测区块链网络33中的所有压测区块链节点可获取来自转发节点的压测交易,进而进行共识、执行、上链等操作。又如,转发节点可与压测区块链网络33中的每个压测区块链节点建立连接,从而将所有压测交易转发至每个压测区块链节点,使得压测区块链网络33中的所有压测区块链节点可获取来自转发节点的压测交易,进而进行共识、执行、上链等操作。
其中,可由业务区块链网络32中各个业务区块链节点之间进行协商选取出转发节点。或者,在部署业务区块链网络32的阶段选取出转发节点,从而将该转发节点的节点信 息写入链代码中,使得各个业务区块链节点将链代码中记录的节点信息对应的业务区块链节点确认为转发节点。
业务端31可以通过与业务区块链网络32中的某一业务区块链节点之间建立连接,从而向该业务区块链节点提交创建的区块链交易,该业务区块链节点可以为如图3所示的业务区块链节点32n。以业务区块链节点32n为例,业务端31与业务区块链节点32n之间建立的连接可以为长连接,使得业务区块链节点32n执行业务交易生成第二交易回执,以及从压测区块链网络33获得第一交易回执之后,可以产生相应的交易回执生成事件,而业务端31可以通过监听该交易回执生成事件获知交易回执已生成(即事件监听机制),并基于上述的长连接获取相应的交易回执(第一交易回执或第二交易回执)。当然,也可以由业务区块链节点32n自身通过上述的事件监听机制来监听交易回执生成事件,并通过上述的长连接将相应的交易回执反馈至业务端31,使得业务端31获得交易回执。或者,如果业务端31与业务区块链节点32n之间建立的连接并非长连接或者所建立的长连接断开,业务端31需要额外通过发起一笔查询交易,以查询所提交的区块链交易对应的交易回执。其中,该查询交易可以为常规的区块链交易,使得业务区块链网络32中的所有区块链节点均需针对该查询交易进行获取、共识、执行、上链等操作,而业务端31可以通过上述方式与某一业务区块链节点建立长连接,并基于上述的事件监听机制从该业务区块链节点处获取相应的交易回执;或者,该查询交易可以为特殊交易,譬如业务端31可以仅与业务区块链节点32n建立长连接并发送该查询交易,那么该查询交易仅会被业务区块链节点32n获取并执行,该查询交易无需参与共识且不需要上链,甚至无需被其他区块链节点获取,然后业务端31可以基于如前所述的事件监听机制获取相应的交易回执。
而对于压测区块链网络33中的压测区块链节点执行压测交易后生成的第一交易回执,业务区块链网络32中的业务区块链节点同样可基于如前所述的事件监听机制获取该第二交易回执,在此不再赘述。例如,可由业务区块链节点32n与压测区块链节点33n之间建立连接,从而基于如前所述的事件监听机制获取第二交易回执。
相应地,业务端31在获取交易回执后,可根据交易回执中包含的类型标识来识别获取到的交易回执对应于压测交易还是对应于业务交易。当获取到的交易回执中包含第一类型标识时,判定该交易回执为第一交易回执(即对应于压测交易);当获取到的交易回执中包含第二类型标识时,判定该交易回执为第二交易回执(即对应于业务交易)。进一步的。业务端31可以将第一交易回执存储至压测数据库,将第二交易回执存储至 业务数据库,后续可以从压测数据库获取第一交易回执,以分析确定针对业务区块链网络32的压测结果。
在本说明书中,对应于上述业务区块链节点侧的实施例,本说明书还提出了压测区块链网络中压测区块链节点侧的实施例,在业务区块链节点侧的实施例中所涉及的描述同样可以适用于压测区块链节点侧的实施例,下文中不再对此进行赘述。
请参见图4,图4是一示例性实施例提供的另一种区块链网络的压力测试方法的流程图。如图4所示,该方法应用于与处于生产状态的业务区块链网络对等的压测区块链网络中的压测区块链节点,可以包括以下步骤:
步骤402,接收所述业务区块链网络中的业务区块链节点转发的压测交易,所述压测交易由所述业务区块链节点在业务端发起的区块链交易为压测交易的情况下转发;
步骤404,执行所述压测交易;其中,在所述区块链交易为业务交易的情况下,所述业务交易被所述业务区块链节点执行。
如前所述,压测区块链节点可接收所述业务区块链网络中与所述压测区块链节点对应的业务区块链节点转发的压测交易。
如前所述,压测区块链节点可接收所述业务区块链网络中作为转发节点的业务区块链节点转发的压测交易。
如前所述,压测区块链节点可接收所述业务区块链网络中的业务区块链节点转发的从所述业务端处接收到的压测交易;或者,接收所述业务区块链网络中的业务区块链节点转发的所述业务区块链网络中所有业务区块链节点从所述业务端处接收到的压测交易。
如前所述,所述压测交易中包含第一类型标识,所述业务交易中包含第二类型标识。
如前所述,对应于所述压测交易的第一交易回执中包含所述第一类型标识,对应于所述业务交易的第二交易回执中包含所述第二类型标识。
如前所述,所述第一交易回执被存储至压测数据库,所述第二交易回执被存储至业务数据库。
如前所述,所述压测区块链网络与所述业务区块链网络具有相同的网络结构和网络配置。
如前所述,所述区块链交易由所述业务端通过区块链客户端向所述业务区块链网络 发起。
如前所述,所述区块链客户端部署于所述业务端上;或者,所述区块链客户端部署于所述业务区块链网络中的业务区块链节点上。
图5是一示例性实施例提供的一种设备的示意结构图。请参考图5,在硬件层面,该设备包括处理器502、内部总线504、网络接口506、内存508以及非易失性存储器510,当然还可能包括其他业务所需要的硬件。处理器502从非易失性存储器510中读取对应的计算机程序到内存508中然后运行,在逻辑层面上形成区块链网络的压力测试装置。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。
请参考图6,在一软件实施方式中,该区块链网络的压力测试装置应用于处于生产状态的业务区块链网络中的业务区块链节点,可以包括:识别单元602,识别业务端发起的区块链交易的交易类型;转发单元604,在所述区块链交易为压测交易的情况下,向与所述业务区块链网络对等的压测区块链网络转发所述压测交易;执行单元606,在所述区块链交易为业务交易的情况下,执行所述业务交易。
可选的,所述转发单元604具体用于:向所述压测区块链网络中与所述业务区块链节点对应的压测区块链节点发送所述压测交易;或者,向所述压测区块链网络中的所有压测区块链节点分别发送所述压测交易。
可选的,所述转发单元604具体用于:在所述业务区块链节点为所述业务区块链网络中的转发节点的情况下,向所述压测区块链网络转发所述压测交易。
可选的,所述转发单元604具体用于:向所述压测区块链网络转发所述业务区块链节点从所述业务端处接收到的压测交易;或者,向所述压测区块链网络转发所述业务区块链网络中所有业务区块链节点从所述业务端处接收到的压测交易。
可选的,所述识别单元602具体用于:读取所述区块链交易包含的类型标识;在所述类型标识为第一类型标识的情况下,将所述区块链交易判定为所述压测交易,在所述类型标识为第二类型标识的情况下,将所述区块链交易判定为所述业务交易。
可选的,对应于所述压测交易的第一交易回执中包含所述第一类型标识,对应于所述业务交易的第二交易回执中包含所述第二类型标识。
可选的,所述第一交易回执被存储至压测数据库,所述第二交易回执被存储至业务 数据库。
可选的,所述压测区块链网络与所述业务区块链网络具有相同的网络结构和网络配置。
可选的,所述区块链交易由所述业务端通过区块链客户端向所述业务区块链网络发起。
可选的,所述区块链客户端部署于所述业务端上;或者,所述区块链客户端部署于所述业务区块链网络中的业务区块链节点上。
请参考图7,在另一软件实施方式中,该区块链网络的压力测试装置应用于与处于生产状态的业务区块链网络对等的压测区块链网络中的压测区块链节点,可以包括:
接收单元702,接收所述业务区块链网络中的业务区块链节点转发的压测交易,所述压测交易由所述业务区块链节点在业务端发起的区块链交易为压测交易的情况下转发;执行单元704,执行所述压测交易;其中,在所述区块链交易为业务交易的情况下,所述业务交易被所述业务区块链节点执行。
可选的,所述接收单元702具体用于:接收所述业务区块链网络中与所述压测区块链节点对应的业务区块链节点转发的压测交易。
可选的,所述接收单元702具体用于:接收所述业务区块链网络中作为转发节点的业务区块链节点转发的压测交易。
可选的,所述接收单元702具体用于:接收所述业务区块链网络中的业务区块链节点转发的从所述业务端处接收到的压测交易;或者,接收所述业务区块链网络中的业务区块链节点转发的所述业务区块链网络中所有业务区块链节点从所述业务端处接收到的压测交易。
可选的,所述压测交易中包含第一类型标识,所述业务交易中包含第二类型标识。
可选的,对应于所述压测交易的第一交易回执中包含所述第一类型标识,对应于所述业务交易的第二交易回执中包含所述第二类型标识。
可选的,所述第一交易回执被存储至压测数据库,所述第二交易回执被存储至业务数据库。
可选的,所述压测区块链网络与所述业务区块链网络具有相同的网络结构和网络配置。
可选的,所述区块链交易由所述业务端通过区块链客户端向所述业务区块链网络发起。
可选的,所述区块链客户端部署于所述业务端上;或者,所述区块链客户端部署于所述业务区块链网络中的业务区块链节点上。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围 内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
在本说明书一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本说明书一个或多个实施例。在本说明书一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本说明书一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书一个或多个实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书一个或多个实施例,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例保护的范围之内。
Claims (27)
- 一种区块链网络的压力测试系统,包括:业务端,向处于生产状态的业务区块链网络发起区块链交易;业务区块链网络,所述业务区块链网络中的业务区块链节点在所述区块链交易为压测交易的情况下,向与所述业务区块链网络对等的压测区块链网络转发所述压测交易,在所述区块链交易为业务交易的情况下,执行所述业务交易;压测区块链网络,所述压测区块链网络中的压测区块链节点执行所述压测交易。
- 根据权利要求1所述的系统,所述业务端通过区块链客户端向所述业务区块链网络发起区块链交易。
- 根据权利要求2所述的系统,所述区块链客户端部署于所述业务端上;或者,所述区块链客户端部署于所述业务区块链网络中的业务区块链节点上。
- 一种区块链网络的压力测试方法,应用于处于生产状态的业务区块链网络中的业务区块链节点,所述方法包括:识别业务端发起的区块链交易的交易类型;在所述区块链交易为压测交易的情况下,向与所述业务区块链网络对等的压测区块链网络转发所述压测交易;在所述区块链交易为业务交易的情况下,执行所述业务交易。
- 根据权利要求4所述的方法,所述向与所述业务区块链网络对等的压测区块链网络转发所述压测交易,包括:向所述压测区块链网络中与所述业务区块链节点对应的压测区块链节点发送所述压测交易;或者,向所述压测区块链网络中的所有压测区块链节点分别发送所述压测交易。
- 根据权利要求4所述的方法,所述向与所述业务区块链网络对等的压测区块链网络转发所述压测交易,包括:在所述业务区块链节点为所述业务区块链网络中的转发节点的情况下,向所述压测区块链网络转发所述压测交易。
- 根据权利要求4所述的方法,所述向与所述业务区块链网络对等的压测区块链网络转发所述压测交易,包括:向所述压测区块链网络转发所述业务区块链节点从所述业务端处接收到的压测交易;或者,向所述压测区块链网络转发所述业务区块链网络中所有业务区块链节点从所述业 务端处接收到的压测交易。
- 根据权利要求4所述的方法,所述识别业务端提交的区块链交易的交易类型,包括:读取所述区块链交易包含的类型标识;在所述类型标识为第一类型标识的情况下,将所述区块链交易判定为所述压测交易,在所述类型标识为第二类型标识的情况下,将所述区块链交易判定为所述业务交易。
- 根据权利要求8所述的方法,对应于所述压测交易的第一交易回执中包含所述第一类型标识,对应于所述业务交易的第二交易回执中包含所述第二类型标识。
- 根据权利要求9所述的方法,所述第一交易回执被存储至压测数据库,所述第二交易回执被存储至业务数据库。
- 根据权利要求4所述的方法,所述压测区块链网络与所述业务区块链网络具有相同的网络结构和网络配置。
- 根据权利要求4所述的方法,所述区块链交易由所述业务端通过区块链客户端向所述业务区块链网络发起。
- 根据权利要求12所述的方法,所述区块链客户端部署于所述业务端上;或者,所述区块链客户端部署于所述业务区块链网络中的业务区块链节点上。
- 一种区块链网络的压力测试方法,应用于与处于生产状态的业务区块链网络对等的压测区块链网络中的压测区块链节点,所述方法包括:接收所述业务区块链网络中的业务区块链节点转发的压测交易,所述压测交易由所述业务区块链节点在业务端发起的区块链交易为压测交易的情况下转发;执行所述压测交易;其中,在所述区块链交易为业务交易的情况下,所述业务交易被所述业务区块链节点执行。
- 根据权利要求14所述的方法,所述接收所述业务区块链网络中的业务区块链节点转发的压测交易,包括:接收所述业务区块链网络中与所述压测区块链节点对应的业务区块链节点转发的压测交易。
- 根据权利要求14所述的方法,所述接收所述业务区块链网络中的业务区块链节点转发的压测交易,包括:接收所述业务区块链网络中作为转发节点的业务区块链节点转发的压测交易。
- 根据权利要求14所述的方法,所述接收所述业务区块链网络中的业务区块链节点转发的压测交易,包括:接收所述业务区块链网络中的业务区块链节点转发的从所述业务端处接收到的压测交易;或者,接收所述业务区块链网络中的业务区块链节点转发的所述业务区块链网络中所有业务区块链节点从所述业务端处接收到的压测交易。
- 根据权利要求14所述的方法,所述压测交易中包含第一类型标识,所述业务交易中包含第二类型标识。
- 根据权利要求18所述的方法,对应于所述压测交易的第一交易回执中包含所述第一类型标识,对应于所述业务交易的第二交易回执中包含所述第二类型标识。
- 根据权利要求19所述的方法,所述第一交易回执被存储至压测数据库,所述第二交易回执被存储至业务数据库。
- 根据权利要求14所述的方法,所述压测区块链网络与所述业务区块链网络具有相同的网络结构和网络配置。
- 根据权利要求14所述的方法,所述区块链交易由所述业务端通过区块链客户端向所述业务区块链网络发起。
- 根据权利要求22所述的方法,所述区块链客户端部署于所述业务端上;或者,所述区块链客户端部署于所述业务区块链网络中的业务区块链节点上。
- 一种区块链网络的压力测试装置,应用于处于生产状态的业务区块链网络中的业务区块链节点,所述装置包括:识别单元,识别业务端发起的区块链交易的交易类型;转发单元,在所述区块链交易为压测交易的情况下,向与所述业务区块链网络对等的压测区块链网络转发所述压测交易;执行单元,在所述区块链交易为业务交易的情况下,执行所述业务交易。
- 一种区块链网络的压力测试装置,应用于与处于生产状态的业务区块链网络对等的压测区块链网络中的压测区块链节点,所述装置包括:接收单元,接收所述业务区块链网络中的业务区块链节点转发的压测交易,所述压测交易由所述业务区块链节点在业务端发起的区块链交易为压测交易的情况下转发;执行单元,执行所述压测交易;其中,在所述区块链交易为业务交易的情况下,所述业务交易被所述业务区块链节点执行。
- 一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器通过运行所述可执行指令以实现如权利要求4-23中任一项所述的方法。
- 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求4-23中任一项所述方法的步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010586356.3 | 2020-06-24 | ||
CN202010586356.3A CN111478829B (zh) | 2020-06-24 | 2020-06-24 | 区块链网络的压力测试方法及装置、系统 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021259131A1 true WO2021259131A1 (zh) | 2021-12-30 |
Family
ID=71765371
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/100605 WO2021259131A1 (zh) | 2020-06-24 | 2021-06-17 | 区块链网络的压力测试方法及装置、系统 |
Country Status (2)
Country | Link |
---|---|
CN (2) | CN111478829B (zh) |
WO (1) | WO2021259131A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114448839A (zh) * | 2022-01-29 | 2022-05-06 | 中国工商银行股份有限公司 | 自适应分布式系统压测方法、装置及系统 |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111478828B (zh) * | 2020-06-24 | 2020-10-20 | 支付宝(杭州)信息技术有限公司 | 区块链网络的压力测试方法及装置、系统 |
CN111478829B (zh) * | 2020-06-24 | 2020-10-30 | 支付宝(杭州)信息技术有限公司 | 区块链网络的压力测试方法及装置、系统 |
CN112910724B (zh) * | 2020-06-24 | 2022-08-09 | 支付宝(杭州)信息技术有限公司 | 区块链网络的压力测试方法及装置、系统 |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108805704A (zh) * | 2018-05-16 | 2018-11-13 | 深圳市网心科技有限公司 | 区块链业务实现方法、监听设备、存储介质及系统 |
CN108848156A (zh) * | 2018-06-08 | 2018-11-20 | 中国联合网络通信集团有限公司 | 接入网关处理方法、装置及存储介质 |
CN109034809A (zh) * | 2018-08-16 | 2018-12-18 | 北京京东尚科信息技术有限公司 | 区块链的生成方法、装置、区块链节点及存储介质 |
CN109165168A (zh) * | 2018-09-14 | 2019-01-08 | 杭州云创共享网络科技有限公司 | 一种压力测试方法、装置、设备及介质 |
CN110291506A (zh) * | 2018-11-30 | 2019-09-27 | 阿里巴巴集团控股有限公司 | 区块链网络测试平台 |
CN110519388A (zh) * | 2019-08-30 | 2019-11-29 | 北京东软望海科技有限公司 | 区块链请求的处理方法、装置、电子设备及可读存储介质 |
US20190377660A1 (en) * | 2018-06-07 | 2019-12-12 | Blocktest Global | Methods and systems for blockchain testing |
CN110598446A (zh) * | 2019-09-16 | 2019-12-20 | 腾讯科技(深圳)有限公司 | 基于区块链的测试方法、装置、存储介质和计算机设备 |
CN111290907A (zh) * | 2020-01-14 | 2020-06-16 | 深圳市网心科技有限公司 | 分布式存储网络压测方法及装置、计算机装置及存储介质 |
CN111478827A (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 (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101001183A (zh) * | 2007-01-10 | 2007-07-18 | 网之易信息技术(北京)有限公司 | 一种网络应用软件的测试方法和系统 |
CN101621414B (zh) * | 2009-08-21 | 2012-01-04 | 杭州华三通信技术有限公司 | 一种网络资源及拓扑的发现方法及装置 |
CN108075911B (zh) * | 2016-11-14 | 2020-12-08 | 中国移动通信集团甘肃有限公司 | 一种业务测试方法和装置 |
CN106598824B (zh) * | 2016-11-25 | 2018-11-20 | 深圳前海微众银行股份有限公司 | 区块链的性能分析方法及装置 |
US9934138B1 (en) * | 2016-12-07 | 2018-04-03 | International Business Machines Corporation | Application testing on a blockchain |
EP3388994A1 (de) * | 2017-04-12 | 2018-10-17 | Siemens Aktiengesellschaft | Verfahren und vorrichtung zum rechnergestützten testen einer blockkette |
CN108389104B (zh) * | 2018-01-31 | 2021-06-25 | 口碑(上海)信息技术有限公司 | 一种网络活动的仿真验证方法以及装置 |
CN108763058A (zh) * | 2018-04-24 | 2018-11-06 | 苏州同济区块链研究院有限公司 | 一种区块链测评系统 |
WO2020003131A1 (en) * | 2018-06-25 | 2020-01-02 | Blocktest Global | Systems and methods to automatically evaluate blockchain-based solution performance |
CN111176970A (zh) * | 2018-11-09 | 2020-05-19 | 北京天德科技有限公司 | 一种区块链测试架构及系统 |
CN109639521B (zh) * | 2018-12-05 | 2020-09-29 | 京东数字科技控股有限公司 | 区块链性能的测试方法、装置、设备及存储介质 |
CN110046091B (zh) * | 2019-03-12 | 2023-10-20 | 创新先进技术有限公司 | 一种自动测试方法和装置 |
CN110061889A (zh) * | 2019-04-01 | 2019-07-26 | 北京众享比特科技有限公司 | 区块链性能测试方法、装置、设备和存储介质 |
CN110580206B (zh) * | 2019-09-16 | 2023-04-28 | 上海保险交易所股份有限公司 | 用于区块链系统的压力测试的方法、介质和控制装置 |
CN111327490B (zh) * | 2020-01-20 | 2021-01-29 | 腾讯科技(深圳)有限公司 | 区块链的拜占庭容错检测方法及相关装置 |
-
2020
- 2020-06-24 CN CN202010586356.3A patent/CN111478829B/zh active Active
- 2020-06-24 CN CN202011416443.0A patent/CN112486830B/zh active Active
-
2021
- 2021-06-17 WO PCT/CN2021/100605 patent/WO2021259131A1/zh active Application Filing
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108805704A (zh) * | 2018-05-16 | 2018-11-13 | 深圳市网心科技有限公司 | 区块链业务实现方法、监听设备、存储介质及系统 |
US20190377660A1 (en) * | 2018-06-07 | 2019-12-12 | Blocktest Global | Methods and systems for blockchain testing |
CN108848156A (zh) * | 2018-06-08 | 2018-11-20 | 中国联合网络通信集团有限公司 | 接入网关处理方法、装置及存储介质 |
CN109034809A (zh) * | 2018-08-16 | 2018-12-18 | 北京京东尚科信息技术有限公司 | 区块链的生成方法、装置、区块链节点及存储介质 |
CN109165168A (zh) * | 2018-09-14 | 2019-01-08 | 杭州云创共享网络科技有限公司 | 一种压力测试方法、装置、设备及介质 |
CN110291506A (zh) * | 2018-11-30 | 2019-09-27 | 阿里巴巴集团控股有限公司 | 区块链网络测试平台 |
CN110519388A (zh) * | 2019-08-30 | 2019-11-29 | 北京东软望海科技有限公司 | 区块链请求的处理方法、装置、电子设备及可读存储介质 |
CN110598446A (zh) * | 2019-09-16 | 2019-12-20 | 腾讯科技(深圳)有限公司 | 基于区块链的测试方法、装置、存储介质和计算机设备 |
CN111290907A (zh) * | 2020-01-14 | 2020-06-16 | 深圳市网心科技有限公司 | 分布式存储网络压测方法及装置、计算机装置及存储介质 |
CN111478827A (zh) * | 2020-06-24 | 2020-07-31 | 支付宝(杭州)信息技术有限公司 | 区块链网络的压力测试方法及装置、系统 |
CN111478829A (zh) * | 2020-06-24 | 2020-07-31 | 支付宝(杭州)信息技术有限公司 | 区块链网络的压力测试方法及装置、系统 |
CN111488291A (zh) * | 2020-06-24 | 2020-08-04 | 支付宝(杭州)信息技术有限公司 | 区块链网络的压力测试方法及装置、系统 |
CN112910724A (zh) * | 2020-06-24 | 2021-06-04 | 支付宝(杭州)信息技术有限公司 | 区块链网络的压力测试方法及装置、系统 |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114448839A (zh) * | 2022-01-29 | 2022-05-06 | 中国工商银行股份有限公司 | 自适应分布式系统压测方法、装置及系统 |
CN114448839B (zh) * | 2022-01-29 | 2024-04-12 | 中国工商银行股份有限公司 | 自适应分布式系统压测方法、装置及系统 |
Also Published As
Publication number | Publication date |
---|---|
CN112486830B (zh) | 2023-04-18 |
CN111478829B (zh) | 2020-10-30 |
CN111478829A (zh) | 2020-07-31 |
CN112486830A (zh) | 2021-03-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021259131A1 (zh) | 区块链网络的压力测试方法及装置、系统 | |
CN108415784B (zh) | 跨区块链的交互方法及装置、系统、电子设备 | |
TWI710979B (zh) | 跨區塊鏈的互動方法及裝置、系統、電子設備 | |
WO2021259149A1 (zh) | 区块链网络的压力测试方法及装置、系统 | |
US10929198B2 (en) | Blockchain-based resource allocation method and apparatus | |
CN110471984B (zh) | 基于区块链的业务处理方法及装置、电子设备 | |
WO2021259126A1 (zh) | 区块链网络的压力测试方法及装置、系统 | |
CN112953821B (zh) | 消息传输方法及装置 | |
CN111144883B (zh) | 一种区块链网络的处理性能分析方法及装置 | |
JP2021533502A (ja) | 取引検証方法、装置、記憶媒体及び電子機器 | |
WO2021259125A1 (zh) | 区块链网络的数据清理方法及装置 | |
WO2021259127A1 (zh) | 区块链网络的压力测试方法及装置、系统 | |
CN113347164B (zh) | 基于区块链的分布式共识系统及方法、设备、存储介质 | |
CN111612614A (zh) | 一种基于公链的子链业务系统 | |
CN115174472B (zh) | 一种消息转发处理方法及相关装置 | |
CN110175074A (zh) | 负载均衡方法和服务器、负载单元、服务处理设备及介质 | |
CN111506932A (zh) | 一种区块链算力上链实现方法 | |
CN113095936A (zh) | 委托订单处理方法、装置、计算机设备和存储介质 | |
US10735415B2 (en) | Method for accumulating and co-assembling consistent data | |
CN116185630A (zh) | 系统集群的业务处理方法、装置、电子设备及介质 | |
WO2022201445A1 (ja) | 情報処理装置、情報処理システム、情報処理方法及びプログラム | |
CN111339089B (zh) | 一种应用于区块链的数据存储与获取方法及装置 | |
CN111510484B (zh) | 区块链处理方法、系统、装置、计算机设备和存储介质 | |
TWI705405B (zh) | 資源開銷的輸出方法及裝置、電子設備 | |
CN103491079B (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: 21828815 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: 21828815 Country of ref document: EP Kind code of ref document: A1 |