CN114490321A - Block chain stability testing method and system and electronic equipment - Google Patents

Block chain stability testing method and system and electronic equipment Download PDF

Info

Publication number
CN114490321A
CN114490321A CN202111573357.5A CN202111573357A CN114490321A CN 114490321 A CN114490321 A CN 114490321A CN 202111573357 A CN202111573357 A CN 202111573357A CN 114490321 A CN114490321 A CN 114490321A
Authority
CN
China
Prior art keywords
test
stability
transaction
intelligent contract
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111573357.5A
Other languages
Chinese (zh)
Inventor
黄方蕾
胡麦芳
林国鹏
尚璇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Qulian Technology Co Ltd filed Critical Hangzhou Qulian Technology Co Ltd
Priority to CN202111573357.5A priority Critical patent/CN114490321A/en
Publication of CN114490321A publication Critical patent/CN114490321A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

Abstract

The application relates to a block chain stability testing method, a system and electronic equipment, which are applied to the technical field of block chains, wherein the method comprises the following steps: acquiring target user information to be tested and a target intelligent contract example to be tested from a pre-configured testing resource set; calling a target trading interface corresponding to a target intelligent contract instance through target user information from a pre-configured trading interface set so as to trade through the target trading interface; acquiring a transaction result obtained based on a target transaction interface; and determining the stability of the blockchain system according to the transaction result. The problem that a tool for performing stability testing on a block chain is lacked in the prior art is solved.

Description

Block chain stability testing method and system and electronic equipment
Technical Field
The present application relates to the field of block chain technologies, and in particular, to a block chain stability testing method and system, and an electronic device.
Background
The blockchain is a distributed ledger technology maintained by multiple parties, can realize consistent storage of data, and the data stored on the blockchain has the characteristic of being difficult to tamper. At present, many enterprises have entered the development process of the blockchain system, and before the applications are online, the applications are often required to be tested, so as to avoid the online program crash phenomenon under the condition that the application program is under a certain pressure and multiple transactions are executed in parallel for a long time. However, in the related art, there are few tools dedicated to stability testing of the blockchain. Therefore, how to perform stability testing of the block chain is a problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The application provides a block chain stability testing method, a block chain stability testing system and electronic equipment, which are used for solving the problem that a tool for testing the stability of a block chain is lacked in the prior art.
In a first aspect, an embodiment of the present application provides a block chain stability testing method, including:
acquiring target user information to be tested and a target intelligent contract instance to be tested from a pre-configured testing resource set after a current testing system is determined to be capable of executing a stability test;
calling a target trading interface corresponding to the target intelligent contract instance through the target user information from a pre-configured trading interface set so as to trade through the target trading interface;
acquiring a transaction result obtained based on the target transaction interface;
and determining the stability of the blockchain system according to the transaction result.
Optionally, the determining that the current test system can perform the stability test includes:
judging whether the current test environment data meets the pre-configured test conditions;
and if so, determining that the current test system can execute the stability test.
Optionally, the preconfigured test conditions include: stability test duration and test resource execution strategy;
the judging whether the current test environment data meets the pre-configured test conditions includes:
judging whether the test duration in the current test environment data is less than the stability test duration or not;
if the stability test duration is less than the stability test duration, judging whether the test resources in the current test environment data meet the test resource execution strategy or not;
and if so, determining that the stability test can be executed currently.
Optionally, the process of pre-configuring the test resource set includes:
acquiring test configuration data, wherein the test configuration data comprises intelligent contract information and stability test information;
generating an intelligent contract instance set according to the intelligent contract information;
determining a user information set meeting the stability test information;
and determining that the intelligent contract instance set and the user information set are the test resource set.
Optionally, the intelligent contract information includes an intelligent contract name, an intelligent contract maximum concurrency amount, an intelligent contract initialization parameter, and an intelligent contract maximum waiting duration;
the stability test information comprises stability duration, stability maximum concurrency and stability strategy.
Optionally, the obtaining a transaction result obtained based on the target transaction interface includes:
obtaining a calling result for calling the target transaction interface;
if the calling result is failure, determining that the transaction result is transaction failure;
if the calling result is successful, acquiring a transaction execution result within a preset time;
if the transaction execution result is not obtained, determining that the transaction result is transaction failure;
and if the transaction execution result is obtained, determining that the transaction result is successful.
Optionally, after determining the stability of the blockchain system according to the transaction result, the method includes:
counting the transaction result in the test period to obtain a statistical result;
and displaying the statistical result.
In a second aspect, an embodiment of the present application provides a block chain stability testing system, including: an execution unit, an instantiation unit and a contract adaptation unit;
the instantiation unit is used for storing a pre-configured test resource set;
the contract adaptation unit is used for providing a target transaction interface;
the execution unit is used for acquiring target user information to be tested and a target intelligent contract instance to be tested from the testing resource set of the instantiation unit, and calling a target transaction interface corresponding to the target intelligent contract instance from the contract adaptation unit so as to perform transaction through the target transaction interface; acquiring a transaction result obtained based on the target transaction interface; and determining the stability of the blockchain system according to the transaction result.
Optionally, the system further comprises a configuration unit;
the configuration unit is used for acquiring test configuration data, and the test configuration data comprises intelligent contract information and stability test information;
generating an intelligent contract instance set according to the intelligent contract information;
determining a user information set meeting the stability test information;
and storing the intelligent contract instance set and the user information set as the test resource set to the instantiation unit.
In a third aspect, an embodiment of the present application provides an electronic device, including: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory for storing a computer program;
the processor is configured to execute the program stored in the memory, and implement the block chain stability testing method according to the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the method for testing stability of a blockchain according to the first aspect is implemented.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: according to the method provided by the embodiment of the application, when the current testing system is determined to be capable of executing the stability test, the target user information to be tested and the target intelligent contract instance to be tested are obtained from the pre-configured testing resource set; calling a target trading interface corresponding to a target intelligent contract instance through target user information from a pre-configured trading interface set so as to trade through the target trading interface; acquiring a transaction result obtained based on a target transaction interface; and determining the stability of the blockchain system according to the transaction result. Therefore, when the stability test of the current test system can be executed every time, corresponding transaction can be carried out through the obtained target user information and the target intelligent contract instance, so that the stability of the blockchain system is determined according to a transaction result, and the method for testing the stability of the blockchain is provided.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a block chain stability testing system according to an embodiment of the present disclosure;
fig. 2 is a block chain stability testing system according to another embodiment of the present disclosure;
fig. 3 is a flowchart of a block chain stability testing method according to an embodiment of the present application;
fig. 4 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Before further detailed description of the embodiments of the present invention, terms and expressions referred to in the embodiments of the present invention are described, and the terms and expressions referred to in the embodiments of the present invention are applicable to the following explanations.
A Block chain (Blockchain) is a storage structure for encrypted, chained transactions formed from blocks (blocks).
A Blockchain Network (Blockchain Network) incorporates new blocks into a set of nodes of a Blockchain in a consensus manner.
Transactions (transactions), equivalent to the computer term "Transaction," include operations that need to be committed to a blockchain network for execution and do not refer solely to transactions in the context of commerce, which embodiments of the present invention follow in view of the convention in blockchain technology that colloquially uses the term "Transaction. For example, a deployment (deployment) transaction is used to install a specified smart contract to a node in a blockchain network and is ready to be invoked; the Invoke (Invoke) transaction is used to append records of the transaction in the blockchain by invoking the smart contract and to perform operations on the state database of the blockchain, including update operations (including adding, deleting, and modifying key-value pairs in the state database) and query operations (i.e., querying key-value pairs in the state database).
Intelligent Contracts (Smart Contracts), also known as chain codes (chaincodes) or application codes, are programs deployed in nodes of a blockchain network, and the nodes execute the intelligent Contracts called in received transactions to update or query key-value data of a state database. The working principle of the intelligent contract mainly comprises the following steps: constructing an intelligent contract: the intelligent contract is made by a plurality of users in the block chain, and can be used for any transaction between any users. The agreement defines the rights and obligations of the parties to the transaction, which are programmed electronically by the developer, the code containing conditions that trigger the automatic execution of the contract. Storing the intelligent contract: once the encoding is completed, the intelligent contract is uploaded to the blockchain network, that is, each node of the whole network can receive the intelligent contract. Executing the intelligent contract: the intelligent contract can regularly check whether related events and trigger conditions exist or not, the events meeting the conditions are pushed to a queue to be verified, the verification nodes on the block chain firstly carry out signature verification on the events to ensure the validity of the events, most verification nodes agree with the events, the intelligent contract is successfully executed, and a user is informed of the successful execution.
According to an embodiment of the present application, a block chain stability testing system is provided. Referring to fig. 1, the system essentially comprises: an execution unit 101, an instantiation unit 102 and a contract adaptation unit 103;
the instantiation unit is used for storing a pre-configured test resource set;
a contract adaptation unit for providing a target transaction interface;
the execution unit is used for acquiring target user information to be tested and a target intelligent contract instance to be tested from the testing resource set of the instantiation unit, and calling a target transaction interface corresponding to the target intelligent contract instance from the contract adaptation unit so as to perform transaction through the target transaction interface; acquiring a transaction result obtained based on the target transaction interface; and determining the stability of the blockchain system according to the transaction result.
Optionally, the block chain stability testing system further includes a configuration unit;
the configuration unit is used for acquiring test configuration data, and the test configuration data comprises intelligent contract information and stability test information;
generating an intelligent contract instance set according to the intelligent contract information;
determining a user information set meeting the stability test information;
and storing the intelligent contract instance set and the user information set as a testing resource set to the instantiation unit.
Referring to fig. 2, in one embodiment of the present application, the block chain stability testing system includes:
configuration layer (i.e. the adaptation unit described above): the method mainly comprises a stability test scheme written by a user, wherein the configuration layer is divided into intelligent contract configuration and pressure test configuration, the service configuration is mainly detailed configuration required by each service and comprises 1. an intelligent contract name which represents an object capable of providing the service in the next stability test, and the maximum concurrency of the intelligent contract which represents that the intelligent contract is allowed to call a block system at most at the same time. The longest waiting time of the intelligent contract is as follows: representing the longest tolerance of the intelligent contract per call blockchain. The pressure measurement configuration is mainly a pressure measurement strategy required by the whole stability test, and comprises the following steps of 1. the stability test duration represents the total duration of the stability test; 2. the maximum concurrency of the stability test indicates how many service calls are allowed at most at a certain time in the stability test process. And 3, controlling the number of services to be scheduled at each moment in the stability test process of the block chain.
Execution layer (i.e., execution unit described above): the stability testing device is mainly composed of three components for controlling the whole stability testing process. The service scheduler is mainly responsible for controlling the user pool and the intelligent contract pool and simulating user behaviors. Data statistics is mainly based on the statistical stability test real-time situation of the result of each service dispatch. Visualization is to display the stability test result of a certain period through front-end rendering.
Instantiation layer (i.e. instantiation units as described above): the instantiation layer is mainly an object needing scheduling in the stability test and mainly comprises a user pool, an intelligent contract pool, a preparation pool, a calling pool and a waiting pool, wherein users in the user pool can simulate the behavior of a real scene, and each user can schedule only one intelligent contract at a certain moment. The intelligent contracts of the intelligent contract pool are represented as contracts that a user can currently schedule. Preparing a pool, namely a user which can be called currently, calling the pool as the user which is called currently, and waiting the pool as follows: users currently waiting for results.
Contract adaptation layer (i.e. the above-mentioned contract adaptation unit): the contract adaptation layer is a module that interacts with the blockchain system in the stability test. According to the characteristics of the block chain, the contract adaptation layer provides 2 interfaces, which are stability test interfaces provided by the test system for users to realize. The user can implement both interfaces. 1. A transaction interface is invoked. 2. Waiting for the transaction: and the system is used for judging whether the transaction is a valid transaction after the transaction is processed by the blockchain system.
Based on the same concept, an embodiment of the present application provides a block chain stability testing method, which can be applied to any form of electronic devices, such as a terminal and a server. The specific implementation of the method can refer to the description of the method embodiment, and repeated descriptions are omitted, as shown in fig. 3, the block chain stability testing method includes:
step 301, obtaining target user information to be tested and a target intelligent contract instance to be tested from a pre-configured testing resource set.
In some embodiments, the test resource set may be pre-configured by a tester on the test terminal, and the target user information to be tested and the target intelligent contract instance to be tested are obtained from the pre-configured test resource set, so as to further perform the stability test.
The testing terminal is provided with a testing system, and testers can perform relevant configuration on the testing system by operating the testing terminal.
In an alternative embodiment, the process of pre-configuring the set of test resources comprises:
acquiring test configuration data, wherein the test configuration data comprises intelligent contract information and stability test information; generating an intelligent contract instance set according to the intelligent contract information; determining a user information set meeting the stability test information; and determining the intelligent contract instance set and the user information set as a test resource set.
In some embodiments, the test configuration data may be set by a tester according to actual test requirements, where the tester may set in another file or directly input the test configuration data on a display interface of the test system, and after the setting is completed, the test configuration data may be acquired by the test terminal through uploading or clicking confirmation.
After the test terminal acquires the test configuration data, an intelligent contract instance set can be generated according to the intelligent contract information; determining a user information set meeting the stability test information; thereby resulting in a set of test resources.
Specifically, a configuration layer is arranged on the test system and is divided into intelligent contract configuration and pressure test configuration, and the intelligent contract configuration is mainly detailed configuration required by each service and comprises an intelligent contract name, intelligent contract maximum concurrency, intelligent contract initialization parameters and intelligent contract maximum waiting time. The pressure measurement configuration is mainly a pressure measurement strategy required by the whole stability test, and comprises the following steps: long stability, maximum stability concurrency and stability strategy.
Wherein the intelligent contract name represents an object that can be served by the next stability test; the maximum concurrency of the intelligent contracts means that the intelligent contracts are allowed to call the block system at most at the same time; the intelligent contract longest latency represents the longest tolerance limit of the intelligent contract to call the blockchain each time. The stability test duration represents the total duration of the stability test; the maximum concurrency of the stability test indicates how many service calls are allowed at most at a certain moment in the stability test process; the stability policy represents the number of services that will be scheduled at each time during the control block chain stability test.
The maximum concurrent amount of the intelligent contract, the longest waiting time of the intelligent contract, the maximum stability concurrent amount and the maximum stability time in the test configuration data can be used as test conditions after the configuration is completed.
In an optional embodiment, before obtaining the target user information to be tested and the target intelligent contract instance to be tested from the pre-configured test resource set, the method further includes:
judging whether the current test environment data meets the pre-configured test conditions;
and if so, determining that the current test system can execute the stability test, and executing the step of acquiring the target user information to be tested and the target intelligent contract instance to be tested from the pre-configured test resource set.
In some embodiments, before performing the stability test, it is determined whether a pre-configured test condition is satisfied according to the current test environment data, and if the pre-configured test condition is satisfied, it is determined that the stability test can be performed. And when the current test system is determined to be capable of executing the stability test, acquiring the target user information to be tested and the target intelligent contract example to be tested so as to perform subsequent stability test, thereby ensuring that the test can be smoothly performed.
Specifically, the test conditions may include, but are not limited to: the method comprises the following steps of stability test duration and a test resource execution strategy, wherein the test resource execution strategy comprises the maximum concurrency of test resources.
In an optional embodiment, the determining whether the current test environment data satisfies the preconfigured test condition includes:
judging whether the test duration in the current test environment data is less than the stability test duration or not; if the stability test duration is less than the stability test duration, judging whether the test resources in the current test environment data meet the test resource execution strategy or not; and if so, determining that the stability test can be executed currently.
In some embodiments, it is first determined whether the current test duration reaches the stability test duration, and if so, it is determined that the stability test is ended; if the number of the test resources in the current test system reaches the maximum concurrent amount of the test resources, waiting for the end of the test resources in the test, and if the number of the test resources in the test system does not reach the maximum concurrent amount of the test resources, acquiring target user information and a target intelligent contract example from idle test resources, so as to perform stability test. The idle test resource is a test resource which can be selected.
Step 302, from the pre-configured transaction interface set, a target transaction interface corresponding to the target intelligent contract instance is called through the target user information, so as to perform transaction through the target transaction interface.
In some embodiments, a contract adaptation unit is configured in the test system to interact with the blockchain system. According to the characteristics of the block chain, the contract adaptation unit comprises a plurality of contract adaptation modules, each contract adaptation module provides two interfaces, and the two interfaces are stability test interfaces provided by the test system for user information implementation. The user information may implement both interfaces. The two pieces of user information comprise a calling transaction interface and a waiting transaction interface, and the waiting transaction interface is used for judging whether the transaction is effective or not after the transaction is processed by the waiting blockchain system.
Therefore, after the target intelligent contract instance and the target user information are obtained, the target trading interface corresponding to the target intelligent contract instance can be called through the target user information, and trading is carried out through the target trading interface.
In an optional embodiment, obtaining the transaction result obtained based on the target transaction interface comprises:
obtaining a calling result of calling a target transaction interface; if the calling result is failure, determining the transaction result as transaction failure; if the calling result is successful, acquiring a transaction execution result within a preset time; if the transaction execution result is not obtained, determining the transaction result as transaction failure; and if the transaction execution result is obtained, determining the transaction result as the transaction success.
In some embodiments, after the target user information is acquired, a transaction calling interface realized by an intelligent contract is called through the user information, a transaction hash is waited to be returned, the behavior is set to be successful, if the calling is overtime or fails, the behavior is directly returned to be null, and the behavior is set to be failed. And checking whether the current transaction behavior is successful, if so, directly returning, and if so, inquiring the result of transaction execution waiting in overtime. If the transaction execution result is not inquired within the specified time, the action is set as failure.
And step 303, acquiring a transaction result obtained based on the target transaction interface.
In some embodiments, after the target transaction interface is called, the target transaction interface performs a transaction with the blockchain system, so as to obtain a transaction result fed back by the blockchain system.
Step 304, determining the stability of the blockchain system according to the transaction result.
In some embodiments, the test resource set includes a plurality of user information and a plurality of intelligent contract instances, and in the stability test process, a plurality of contract adaptation modules are configured in the contract adaptation unit, so that a situation that a plurality of stability tests are concurrent occurs, and a stability test duration is configured in the test configuration data, and after the stability test duration is reached, a plurality of transaction results are obtained. The transaction result comprises transaction success and transaction failure, so that the stability of the blockchain system can be determined according to the ratio of the transaction success to the transaction failure in the transaction result. For example, the transaction success rate is greater than 95%, and the blockchain system is determined to be stable.
In an alternative embodiment, after determining the stability of the blockchain system based on the transaction results, the method includes:
counting the transaction result in the test period to obtain a statistical result; and displaying the statistical result.
The test period can be the stability test duration, and after all transactions in the test period are finished, the transaction results are counted and visually displayed, so that the monitoring of testers can be facilitated.
It can be understood that the transaction result may be displayed in such a manner that each time a new transaction result is obtained, the new transaction result is displayed. Therefore, real-time monitoring of testing personnel is facilitated.
In one embodiment, the block chain stability testing method of the present application includes:
firstly, loading stability test configuration and reading configuration information.
Secondly, initializing the number of users according to the maximum stability concurrency in the configuration file, putting the users into a preparation pool, and putting each initialized intelligent contract instance into an intelligent contract pool according to the intelligent contracts in the configuration file.
And thirdly, checking whether the stability test is executed currently according to the stability test configuration, and if the stability test configuration is judged to be not executed before waiting, finishing the execution of the user. If yes, the next flow is executed
And fourthly, checking whether the preparation pool and the intelligent contract pool have resource scheduling services or not, and if not, returning to the previous step to check whether to continue invoking the stability test or not. If yes, the next process is carried out.
And fifthly, continuously inquiring whether to continuously call the stability testing service by the main program, selecting a user from the preparation pool by the newly-built subprogram, and randomly selecting a contract object from the intelligent contract.
And sixthly, introducing the selected user into a calling pool, calling a calling transaction interface realized by an intelligent contract through the user, waiting for returning a transaction hash, setting the behavior as successful, and directly returning to the null if the calling is overtime or failed, and setting the behavior as failed.
And seventhly, the user is introduced into a waiting pool, whether the current transaction behavior is successful or not is checked, if the current transaction behavior is unsuccessful, the current transaction behavior is directly returned, and if the current transaction behavior is successful, the transaction execution result is inquired within overtime. If the transaction execution result is not inquired within the specified time, the action is set as failure.
And eighth, collecting the calling result of the waiting pool, counting and visualizing the result, and transmitting the result to the preparation pool to enable the user to continue to execute the transaction.
In the block chain stability test method, the number of users, the parallel number of cases, the time for waiting for execution results and the like are directly configured through the configuration file, and the block chain stability test method is convenient and simple. The execution of the use case, the waiting of the result and the statistics are separated from each other, all modules of the system are mutually independent, the project has better expansibility, and when a new function is added, only the relevant interface of the service instance needs to be realized. And monitoring and displaying each index in real time.
Based on the same concept, an embodiment of the present application further provides an electronic device, as shown in fig. 4, the electronic device mainly includes: a processor 401, a memory 402 and a communication bus 403, wherein the processor 401 and the memory 402 communicate with each other via the communication bus 403. The memory 402 stores a program executable by the processor 401, and the processor 401 executes the program stored in the memory 402, so as to implement the following steps:
acquiring target user information to be tested and a target intelligent contract example to be tested from a pre-configured testing resource set;
calling a target trading interface corresponding to a target intelligent contract instance through target user information from a pre-configured trading interface set so as to trade through the target trading interface;
acquiring a transaction result obtained based on a target transaction interface;
and determining the stability of the blockchain system according to the transaction result.
The communication bus 403 mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 403 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
The Memory 402 may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the aforementioned processor 401.
The Processor 401 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc., and may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.
In yet another embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored, which, when run on a computer, causes the computer to perform the block chain stability testing method described in the above embodiment.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The available media may be magnetic media (e.g., floppy disks, hard disks, tapes, etc.), optical media (e.g., DVDs), or semiconductor media (e.g., solid state disks), among others.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for testing stability of a block chain, comprising:
acquiring target user information to be tested and a target intelligent contract example to be tested from a pre-configured testing resource set;
calling a target trading interface corresponding to the target intelligent contract instance through the target user information from a pre-configured trading interface set so as to trade through the target trading interface;
acquiring a transaction result obtained based on the target transaction interface;
and determining the stability of the blockchain system according to the transaction result.
2. The method for testing stability of a block chain according to claim 1, wherein before obtaining the target user information to be tested and the target intelligent contract instance to be tested from the pre-configured testing resource set, the method further comprises:
judging whether the current test environment data meets the pre-configured test conditions;
and if so, determining that the current test system can execute the stability test, and executing the step of acquiring the target user information to be tested and the target intelligent contract instance to be tested from the pre-configured test resource set.
3. The method of claim 2, wherein the pre-configured test conditions comprise: stability test duration and test resource execution strategy;
the judging whether the current test environment data meets the pre-configured test conditions includes:
judging whether the test duration in the current test environment data is less than the stability test duration or not;
if the stability test duration is less than the stability test duration, judging whether the test resources in the current test environment data meet the test resource execution strategy or not;
and if so, determining that the stability test can be executed currently.
4. The method of claim 1, wherein the pre-configuring the set of test resources comprises:
acquiring test configuration data, wherein the test configuration data comprises intelligent contract information and stability test information;
generating an intelligent contract instance set according to the intelligent contract information;
determining a user information set meeting the stability test information;
and determining that the intelligent contract instance set and the user information set are the test resource set.
5. The blockchain stability testing method of claim 4, wherein the intelligent contract information includes an intelligent contract name, an intelligent contract maximum concurrency, an intelligent contract initialization parameter, and an intelligent contract maximum wait duration;
the stability test information comprises stability duration, stability maximum concurrency and stability strategy.
6. The blockchain stability testing method of claim 1, wherein the obtaining the transaction result obtained based on the target transaction interface includes:
obtaining a calling result for calling the target transaction interface;
if the calling result is failure, determining that the transaction result is transaction failure;
if the calling result is successful, acquiring a transaction execution result within a preset time;
if the transaction execution result is not obtained, determining that the transaction result is transaction failure;
and if the transaction execution result is obtained, determining that the transaction result is successful.
7. The blockchain stability testing method of claim 1, wherein determining the stability of the blockchain system based on the transaction results comprises:
counting the transaction result in the test period to obtain a statistical result;
and displaying the statistical result.
8. A block chain stability testing system, comprising: an execution unit, an instantiation unit and a contract adaptation unit;
the instantiation unit is used for storing a pre-configured test resource set;
the contract adaptation unit is used for providing a target transaction interface;
the execution unit is used for acquiring target user information to be tested and a target intelligent contract instance to be tested from the testing resource set of the instantiation unit, and calling a target transaction interface corresponding to the target intelligent contract instance from the contract adaptation unit so as to perform transaction through the target transaction interface; acquiring a transaction result obtained based on the target transaction interface; and determining the stability of the blockchain system according to the transaction result.
9. The blockchain stability testing system of claim 8, further comprising a configuration unit;
the configuration unit is used for acquiring test configuration data, and the test configuration data comprises intelligent contract information and stability test information;
generating an intelligent contract instance set according to the intelligent contract information;
determining a user information set meeting the stability test information;
and storing the intelligent contract instance set and the user information set as the test resource set to the instantiation unit.
10. An electronic device, comprising: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory for storing a computer program;
the processor, configured to execute the program stored in the memory, and implement the block chain stability testing method according to any one of claims 1 to 7.
CN202111573357.5A 2021-12-21 2021-12-21 Block chain stability testing method and system and electronic equipment Pending CN114490321A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111573357.5A CN114490321A (en) 2021-12-21 2021-12-21 Block chain stability testing method and system and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111573357.5A CN114490321A (en) 2021-12-21 2021-12-21 Block chain stability testing method and system and electronic equipment

Publications (1)

Publication Number Publication Date
CN114490321A true CN114490321A (en) 2022-05-13

Family

ID=81494769

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111573357.5A Pending CN114490321A (en) 2021-12-21 2021-12-21 Block chain stability testing method and system and electronic equipment

Country Status (1)

Country Link
CN (1) CN114490321A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230143343A1 (en) * 2021-11-09 2023-05-11 Flipkart Internet Private Limited Method and system for regular testing of datacenter hardware

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230143343A1 (en) * 2021-11-09 2023-05-11 Flipkart Internet Private Limited Method and system for regular testing of datacenter hardware

Similar Documents

Publication Publication Date Title
CN107730196B (en) Project progress management method and terminal equipment
CN108415832B (en) Interface automation test method, device, equipment and storage medium
US7730452B1 (en) Testing a component of a distributed system
CN111510468B (en) Scheduling method and device of computing task, server and computing system
CN111522711A (en) Data monitoring processing system, method, execution end, monitoring end and electronic equipment
CN110728491B (en) Work order processing method and device, computer equipment and storage medium
CN109558313B (en) Method and device for constructing abnormal test scene
CN114979278A (en) Calculation power scheduling method, device and system based on block chain and electronic equipment
CN114490321A (en) Block chain stability testing method and system and electronic equipment
CN111798161A (en) Flow configuration method, device, equipment and storage medium
CN104462116A (en) Data selecting method and device
US20230401086A1 (en) Quality control system for quantum-as-a-service brokers
Narang et al. Comparative analysis of component based software engineering metrics
CN110618943B (en) Security service test method and device, electronic equipment and readable storage medium
CN111367694B (en) Event processing method, server and computer storage medium
CN115469833A (en) Method and device for implementing dynamic rule engine, electronic equipment and storage medium
CN114254991A (en) Target object reporting method, device and equipment
CN110166636B (en) Pressure testing device and method and storage medium
CN110704301B (en) TPC-E automatic test method and TPC-E test system
CN115687054A (en) Self-adaptive test method and device based on service segmentation and restoration
CN111240981A (en) Interface testing method, system and platform
Manik Design pattern evaluation on a restful api wrapper: A case study of software integration with an internet payment gateway using model-driven architecture
CN110737572A (en) Big data platform resource preemption test method, system, terminal and storage medium
CN117196508A (en) Automatic creation method, system and storage medium for workflow
CN113742244A (en) Big data test platform and data processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination