CN110221982B - Performance test method, device and equipment of business system and readable storage medium - Google Patents

Performance test method, device and equipment of business system and readable storage medium Download PDF

Info

Publication number
CN110221982B
CN110221982B CN201910524517.3A CN201910524517A CN110221982B CN 110221982 B CN110221982 B CN 110221982B CN 201910524517 A CN201910524517 A CN 201910524517A CN 110221982 B CN110221982 B CN 110221982B
Authority
CN
China
Prior art keywords
service system
test
performance
function
test data
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.)
Active
Application number
CN201910524517.3A
Other languages
Chinese (zh)
Other versions
CN110221982A (en
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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201910524517.3A priority Critical patent/CN110221982B/en
Publication of CN110221982A publication Critical patent/CN110221982A/en
Application granted granted Critical
Publication of CN110221982B publication Critical patent/CN110221982B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a performance test method, a device, equipment and a readable storage medium of a service system, wherein the method comprises the following steps: after receiving a performance test request of a test service system, analyzing a test script corresponding to the performance test request to obtain a placeholder in the test script; acquiring test data from a service database corresponding to a service system according to the function parameters corresponding to the placeholders, and establishing a mapping relation between the test data and the function parameters; writing test data corresponding to the function parameters of the placeholders into the test script based on the mapping relation to obtain a script to be executed; and sending the script to be executed to the service system so as to test the performance of the service system according to the script to be executed. The invention simplifies the data acquisition flow in the service database in the performance test process, thereby simplifying the operation flow of the performance test of the service system and improving the test efficiency of the performance test of the service system.

Description

Performance test method, device and equipment of business system and readable storage medium
Technical Field
The present invention relates to the field of performance testing technologies of financial technologies (Fintech), and in particular, to a performance testing method, apparatus, device and readable storage medium for a business system.
Background
With the continuous development of finance technology, especially internet technology finance, more and more technologies (such as distributed, blockchain, artificial intelligence, etc.) are applied in the finance field, but the finance industry also puts higher requirements on the technologies, such as performance test on equipment used in the finance field.
In the performance test process, in order to ensure the authenticity and reliability of the performance test result, a real business process needs to be simulated to perform the performance test, and the simulation process is actually a process of preparing test data and executing a test script. During the preparation of the test data, a part of the test data is temporarily generated, and another part of the test data is sourced from a service database of the service system. In the performance test apparatus, if the required test data is data stored in a service database, at this time, a worker for performance test needs to write an SQL (Structured Query Language ) statement, acquire the required test data from the service database by executing the SQL statement, export the acquired test data from the service database as a data file, and then import the data file into the performance test apparatus. When the performance test script is configured in the performance test equipment, the temporarily generated test data and the imported data file are associated, so that the data is read from the data file to perform performance test in the process of executing the performance test script, and the purpose of performing performance test through the data stored in the operation service database is achieved.
Therefore, in the current performance test process through operating the data stored in the database, a user is required to write SQL sentences manually to obtain test data in the database, the test data are exported into a data file to be stored in performance test equipment, the operation flow of performance test of a service system is complex, and the performance test efficiency is low.
Disclosure of Invention
The invention mainly aims to provide a performance testing method, device and equipment of a service system and a readable storage medium, and aims to solve the technical problems of complex operation flow and low performance testing efficiency of the conventional performance testing of the service system.
In order to achieve the above object, the present invention provides a performance test method for a service system, the performance test method for a service system comprising the steps of:
after receiving a performance test request of a test service system, analyzing a test script corresponding to the performance test request to obtain a placeholder in the test script;
acquiring test data from a service database corresponding to the service system according to the function parameters corresponding to the placeholders, and establishing a mapping relation between the test data and the function parameters;
Writing the test data corresponding to the function parameters of the placeholders into the test script based on the mapping relation to obtain a script to be executed;
and sending the script to be executed to the service system so as to test the performance of the service system according to the script to be executed.
Preferably, the step of obtaining test data from a service database corresponding to the service system according to the function parameter corresponding to the placeholder, and establishing a mapping relationship between the test data and the function parameter includes:
determining a placeholder function corresponding to the placeholder, acquiring function parameters in the placeholder function, and acquiring parameter numbers corresponding to the function parameters;
and acquiring test data corresponding to the function parameters from a service database corresponding to the service system, and establishing a mapping relation between the test data and the function numbers.
Preferably, after the step of determining the placeholder function corresponding to the placeholder, obtaining a function parameter in the placeholder function, and obtaining a parameter number corresponding to the function parameter, the method further includes:
if the parameter number corresponds to at least two data records in the service database, calculating the number of the data records corresponding to the parameter number;
The step of establishing the mapping relation between the test data and the function numbers comprises the following steps:
and establishing a mapping relation among the parameter numbers, the test data and the data record quantity.
Preferably, the step of obtaining the test data corresponding to the function parameter in the service database corresponding to the service system includes:
determining a service database corresponding to the service system according to database parameters in the function parameters, and connecting the service database;
generating a Structured Query Language (SQL) statement according to one or more types of function parameters including data table parameters, field parameters, query condition statements and field index parameters;
executing the SQL statement in the service database to obtain test data corresponding to the function parameters in the service database.
Preferably, after the step of obtaining test data from the service database corresponding to the service system according to the function parameter corresponding to the placeholder and establishing a mapping relationship between the test data and the function parameter, the method further includes:
storing the mapping relation into a preset cache database;
Writing the test data corresponding to the function parameters of the placeholders into the test script based on the mapping relation, wherein the step of obtaining the script to be executed comprises the following steps:
acquiring test data corresponding to the function parameters of the placeholders from the cache database based on the mapping relation;
determining the function position of the placeholder function corresponding to the placeholder in the test script, and writing test data corresponding to the function parameters of the placeholder in the function position to obtain the script to be executed.
Preferably, after the step of storing the mapping relationship in a preset cache database, the method further includes:
if the number of the performance test requests is greater than the number of the mapping relations, the step of acquiring test data corresponding to the function parameters of the placeholders from the cache database based on the mapping relations comprises the following steps:
based on the mapping relations, according to the sequence of storing the mapping relations, sequentially and circularly obtaining test data corresponding to the function parameters of the placeholders from the cache database from front to back until the number of the mapping relations corresponding to the obtained test data is equal to the request number.
Preferably, after the step of caching the mapping relationship in a preset cache database, the method further includes:
detecting whether the storage duration of the mapping relation is longer than a preset duration;
and if the storage time length of the mapping relation is longer than the preset time length, deleting the mapping relation corresponding to the storage time length longer than the preset time length in the cache database.
In addition, in order to achieve the above object, the present invention also provides a performance test device of a service system, where the performance test device of a service system includes:
the analyzing module is used for analyzing the test script corresponding to the performance test request after receiving the performance test request of the test service system to obtain the placeholder in the test script;
the acquisition module is used for acquiring test data from a service database corresponding to the service system according to the function parameters corresponding to the placeholders;
the building module is used for building a mapping relation between the test data and the function parameters;
the writing module is used for writing the test data corresponding to the function parameters of the placeholders into the test script based on the mapping relation to obtain a script to be executed;
And the sending module is used for sending the script to be executed to the service system so as to test the performance of the service system according to the script to be executed.
In addition, to achieve the above object, the present invention also provides a performance test apparatus for a service system, which includes a memory, a processor, and a performance test program for a service system stored on the memory and executable on the processor, the performance test program for a service system implementing the steps of the performance test method for a service system as described above when executed by the processor.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a performance test program of a service system, which when executed by a processor, implements the steps of the performance test method of a service system as described above.
The invention acquires the placeholder in the test script corresponding to the performance test request when the performance of the service system is required to be tested, acquires the test data in the service database corresponding to the service system according to the function parameter corresponding to the placeholder, establishes the mapping relation between the test data and the function parameter, writes the test data corresponding to the function parameter in the placeholder into the test script based on the mapping relation, obtains the script to be executed, and sends the script to be executed to the service system so as to test the performance of the service system according to the script to be executed. The method has the advantages that in the performance testing process of the service system, a worker for performance testing does not need to write SQL sentences manually to acquire test data stored in a service database in the service system, the placeholder in the test script can be used for acquiring the test data in the service database directly, namely, the placeholder is used for associating the service database, the acquisition flow of the data in the service database is simplified, the user of the performance testing equipment does not need to pay attention to the configuration information of the test script, the user of the performance testing equipment does not need to execute the connection service database to operate the service database, the operation of data is led out in the service database, the operation flow of the performance testing of the service system is simplified, and the testing efficiency of the performance testing of the service system is improved.
Drawings
FIG. 1 is a flow chart of a first embodiment of a performance testing method of a business system of the present invention;
FIG. 2 is a flow chart of a third embodiment of a performance testing method of the business system of the present invention;
FIG. 3 is a functional schematic block diagram of a preferred embodiment of a performance testing apparatus of the business system of the present invention;
FIG. 4 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The invention provides a performance testing method of a service system, referring to fig. 1, fig. 1 is a flow chart of a first embodiment of the performance testing method of the service system of the invention.
The embodiments of the present invention provide embodiments of a method of testing performance of a business system, it being noted that although a logic sequence is shown in the flow diagrams, in some cases the steps shown or described may be performed in a different order than that shown or described herein.
The performance testing method of the service system is applied to performance testing equipment, wherein a performance testing tool is installed in the performance testing equipment, and the performance testing equipment can comprise mobile terminals such as tablet computers, notebook computers, palm computers, personal digital assistants (Personal Digital Assistant, PDA) and the like, and fixed terminals such as digital TVs, desktop computers and the like. In various embodiments of a performance testing method of a business system, for convenience of description, the various embodiments are explained with performance testing equipment as an execution subject.
The performance test method of the service system comprises the following steps:
and step S10, after receiving a performance test request of the test service system, analyzing a test script corresponding to the performance test request to obtain a placeholder in the test script.
After the performance test equipment receives the performance test request of the test service system, the performance test equipment acquires a test script corresponding to the test request, wherein the test script is stored in the performance test equipment in advance. After the performance test equipment acquires the test script, the test script is analyzed to obtain the placeholder in the test script. It should be noted that, in different test scripts, there may be different placeholders, or there may be identical placeholders, specifically, different placeholders may be identified by the placeholder identifiers, each placeholder has a unique corresponding placeholder identifier, and test data acquired by different placeholders are different.
Step S20, test data are obtained from a service database corresponding to the service system according to the function parameters corresponding to the placeholders, and a mapping relation between the test data and the function parameters is established.
After the placeholders in the test script are obtained, the performance test equipment obtains the function parameters corresponding to the placeholders, obtains test data in a service database corresponding to the service system according to the function parameters, and then establishes a mapping relation between the test data and the function parameters according to the corresponding relation between the test data and the function parameters so as to obtain the mapping relation between the test data and the function parameters. It should be noted that, if a mapping relationship exists between one test data and a corresponding function parameter, and if the acquired test data is a bank card number, then a mapping relationship exists between each bank card number and the corresponding function parameter, that is, the number of mapping relationships of the mapping relationship is equal to the number of acquired test data.
In the embodiment of the invention, 5 function parameters are respectively a database parameter of a service database where the test data is located, a data table parameter of a data table where the test data is located, a field parameter of a field corresponding to the test data, a query condition statement for querying the test data in the data table and a field index parameter corresponding to the test data. The database parameters include, but are not limited to, database identifiers of the service databases and generation time of the service databases, wherein the database identifiers are information for uniquely identifying a certain service database, and the database identifiers can be database names of the service databases or other information capable of uniquely identifying the service databases; table parameters include, but are not limited to, table name and table creation date; the field parameters include, but are not limited to, a field name of a field in which the test data is located, a row number of a row in which the field is located, and a column number of a column in which the field is located; the field index parameters include, but are not limited to, the index name and the column number in which the index is located; the query conditional statement is preset in the test script. It should be noted that these 5 function parameters may not be present in all test scripts, and if some test scripts may not be present with field index parameters.
Further, step S20 includes:
step a, determining a placeholder function corresponding to the placeholder, acquiring function parameters in the placeholder function, and acquiring parameter numbers corresponding to the function parameters.
Specifically, after analyzing the test script to obtain an analysis result, the performance test device determines a placeholder function corresponding to the placeholder according to the analysis result, acquires function parameters in the placeholder function, and acquires parameter numbers corresponding to the function parameters. It should be noted that, when the placeholder exists in the test script, the data indicating the corresponding number of the placeholder in the test script is required to be dynamically acquired. Further, when the performance test device determines that the placeholder does not exist in the test script according to the analysis result, the performance test device does not need to acquire test data from a service database of the service system.
In this embodiment, for the convenience of recording, a parameter number is set for each function parameter, and the function parameter can be uniquely identified by the parameter number, and the expression form of the parameter number can be set according to specific needs, for example, the parameter number can be represented by a number, or the parameter number can be represented by a letter. Specifically, "1" may be used to represent the parameter number of the database parameter, "2" to represent the parameter number of the data table parameter, "3" to represent the parameter number of the field parameter, "4" to represent the parameter number of the query condition statement, and "5" to represent the parameter number of the field index parameter.
If there is code in the test script of "$ { CallAPI: getAccountNoFromDb (TBL_USER, 'tbl_USER b', 'ID, name', 'ID >10limit 100', 1) }", where "CallAPI" represents a placeholder, "GetAccountNoFromDb" represents a placeholder Fu Hanshu, (TBL_USER, 'tbl_USER b', 'ID, name', 'ID >10limit 100', 1) represents a function parameter of the placeholder function.
And b, acquiring test data corresponding to the function parameters from a service database corresponding to the service system, and establishing a mapping relation between the test data and the function numbers.
After the performance test equipment acquires the function parameters of the placeholder function, the performance test equipment acquires test data corresponding to the function parameters in a service database corresponding to the service system, and establishes a mapping relation between the acquired test data and function numbers corresponding to the function parameters. The mapping relationship may be expressed as < function number, test data >.
It should be noted that, the performance test device establishes communication connection with the service system, and the performance test device may call the data acquisition interface to acquire the test data corresponding to the function parameters in the service database of the service system. It can be understood that the data table where the test data to be acquired is located can be determined by the data table parameters, the field corresponding to the test data to be acquired can be determined by the field parameters, and the field index corresponding to the test data to be acquired can be determined by the field index parameters. In the mapping relationship, one test data may correspond to a plurality of function numbers. Through the mapping relation, the test data and the function numbers corresponding to the test data can be obtained,
Further, the step of obtaining the test data corresponding to the function parameter in the service database corresponding to the service system includes:
and b1, determining a service database corresponding to the service system according to database parameters in the function parameters, and connecting the service database.
After the performance testing equipment acquires the function parameters, the performance testing equipment determines a service database corresponding to the service system according to the database parameters in the function parameters and is connected with the service database. In the business system, a database table is stored in which database identifications and database configuration information of respective business databases are stored. Database configuration information includes, but is not limited to, IP (Internet Protocol Address, protocol for interconnection between networks) addresses, login account numbers and passwords for logging into the service database. Therefore, the performance test equipment can acquire corresponding database configuration information according to the database identification in the database parameters, and can be connected with the service database according to the database configuration information.
And b2, generating a Structured Query Language (SQL) statement according to one or more types of function parameters including data table parameters, field parameters, query condition statements and field index parameters.
When the performance test device is connected with the service database, the performance test device generates SQL (Structured Query Language ) sentences according to one or more types of function parameters including data table parameters, field parameters, query condition sentences and field index parameters. It should be noted that, in the performance test device, an SQL statement template is preset, in the SQL statement template, filling positions of the data table parameter, the field parameter, the query condition statement and the field index parameter are set, and the performance test device can generate the SQL statement by only filling the data table parameter, the field parameter, the query condition statement and the field index parameter into corresponding filling positions in the SQL statement template.
And b3, executing the SQL statement in the service database to acquire test data corresponding to the function parameters in the service database.
After the performance test equipment generates the SQL sentence, the performance test equipment executes the SQL sentence in the connected service database to obtain an execution result of executing the SQL sentence, wherein the execution result is test data corresponding to the function parameters acquired from the service database.
And step S30, writing the test data corresponding to the function parameters of the placeholders into the test script based on the mapping relation to obtain a script to be executed.
And step S40, the script to be executed is sent to the service system, so that the performance of the service system is tested according to the script to be executed.
After the mapping relation between the test data and the corresponding function parameters is established, the performance test equipment writes the test data corresponding to the function parameters of the placeholders into the test script based on the mapping relation, so as to obtain the script to be executed. It should be noted that, the script to be executed is a complete and executable test script. The performance test equipment can know the test data corresponding to the placeholder through the mapping relation, and the position of the test data in the test script can be determined through the placeholder.
And after the performance test equipment obtains the script to be executed, the performance test equipment sends the script to be executed to the service system so as to test the performance of the service system according to the script to be executed. It can be understood that, when the service system receives the script to be executed, the service system executes the script to be executed to obtain an execution result, and returns the execution result to the performance test device, and the performance test device can determine the performance of the service system according to the execution result.
According to the embodiment, when the performance of the service system is required to be tested, the placeholder in the test script corresponding to the performance test request is obtained, test data is obtained in the service database corresponding to the service system according to the function parameters corresponding to the placeholder, a mapping relation between the test data and the function parameters is established, the test data corresponding to the function parameters in the placeholder is written into the test script based on the mapping relation, a script to be executed is obtained, and the script to be executed is sent to the service system so as to test the performance of the service system according to the script to be executed. The method has the advantages that in the performance testing process of the service system, a worker for performance testing does not need to write SQL sentences manually to acquire test data stored in a service database in the service system, the placeholder in the test script can be used for acquiring the test data in the service database directly, namely, the placeholder is used for associating the service database, the acquisition flow of the data in the service database is simplified, the user of the performance testing equipment does not need to pay attention to the configuration information of the test script, the user of the performance testing equipment does not need to execute the connection service database to operate the service database, the operation of data is led out in the service database, the operation flow of the performance testing of the service system is simplified, and the testing efficiency of the performance testing of the service system is improved.
Further, a second embodiment of the performance test method of the service system of the present invention is provided.
The difference between the second embodiment of the performance testing method of the service system and the first embodiment of the performance testing method of the service system is that the performance testing method of the service system further includes:
and d, if the parameter number corresponds to at least two data records in the service database, calculating the number of the data records corresponding to the parameter number.
The step of establishing the mapping relation between the test data and the function numbers comprises the following steps:
and e, establishing a mapping relation among the parameter numbers, the test data and the data record quantity.
After the performance test equipment acquires the parameter number, the performance test equipment detects whether the parameter number corresponds to at least two data records in the service database. If the parameter number is detected to correspond to at least two data records in the service database, the performance test equipment calculates the number of the data records corresponding to the parameter number in the service database, and establishes a mapping relation among the parameter number, the test data and the number of the data records after the test data corresponding to the function parameter is acquired; if the parameter number is detected to correspond to only one data record in the service database, the performance test equipment establishes a mapping relation between the parameter number and test data. It can be understood that one function parameter corresponds to one parameter number, and therefore, the mapping relationship between the function parameter and the test data can be determined through the mapping relationship between the parameter number and the test data.
If the test data to be acquired is determined to be the bank card numbers according to the parameter numbers, in the service database, 10 bank card numbers of the users exist, in the process of establishing the mapping relationship, 10 mapping relationships can be established, namely, each bank card number of the user corresponds to one mapping relationship, and in the mapping relationship corresponding to each bank card number, a figure of 10 is also present to indicate that the mapping relationship corresponding to the 10 bank card numbers exists in total.
According to the method and the device, when the fact that the parameter number corresponds to at least two data records in the service database is detected, the number of the data records corresponding to the parameter number is calculated, and the mapping relation among the parameter number, the test data and the number of the data records is established, so that the number of the test data required to be acquired can be known rapidly in the process that the performance test equipment writes the test data into the test script, the time for generating the script to be executed can be known by the performance test equipment according to the number of the test data required to be acquired, and the intelligence of performance test is improved.
Further, a third embodiment of the performance testing method of the service system of the present invention is provided.
The difference between the third embodiment of the performance testing method of the service system and the first or second embodiment of the performance testing method of the service system is that, referring to fig. 2, the performance testing method of the service system further includes:
And step S50, storing the mapping relation into a preset cache database.
Step S30 includes:
step S31, test data corresponding to the function parameters of the placeholders are obtained from the cache database based on the mapping relation.
After the performance test equipment obtains the mapping relation, the performance test equipment stores the mapping relation into a preset cache database. When the performance test apparatus receives an execution request to execute a test operation, the performance test apparatus may parse the test script again to determine whether a placeholder exists in the test script. If the placeholder exists in the test script, the performance test equipment determines a placeholder function corresponding to the placeholder in the test script, obtains a function parameter corresponding to the placeholder function, determines a target mapping relation corresponding to test data required to be obtained in the cache database according to the function parameter or according to a function number corresponding to the function parameter, and obtains the test data corresponding to the function parameter of the placeholder from the cache database through the target mapping relation. The execution request can be automatically triggered after the performance test equipment stores the mapping relation in the cache database, or can be manually triggered in a display interface of the performance test equipment when a user corresponding to the performance test equipment needs.
Further, if it is determined that the placeholder does not exist in the test script, the performance test device directly sends the test script to the service system to test the service system according to the test script.
And step S32, determining the function position of the placeholder function corresponding to the placeholder in the test script, and writing test data corresponding to the function parameters of the placeholder in the function position to obtain the script to be executed.
After the performance test equipment acquires the test data from the cache database, the performance test equipment determines the function position of the function corresponding to the placeholder function of the placeholder in the test script, writes the test data corresponding to the function parameter of the placeholder in the function position, namely writes the test data acquired from the cache database in the function position, and obtains the test script written with the test data, thus obtaining the script to be executed. It will be appreciated that writing test data at the function location of the placeholder function is simply replacing the test data with the placeholder function.
According to the embodiment, the mapping relation is stored in the cache database, the required test data are obtained from the cache database when required, the obtained test data are written into the function position of the placeholder function in the test script, the script to be executed is obtained, dynamic generation of the data in the script to be executed is achieved, the mapping relation is not stored in the memory database of the performance test equipment, but is stored in the cache database, and in the performance test process, the reading and writing capability of the data of the memory database in the performance test equipment is guaranteed.
Further, the performance test method of the service system further comprises the following steps:
if the number of the performance test requests is greater than the number of the mappings, step S41 includes:
and g, based on the mapping relations, according to the sequence of storage of each mapping relation, sequentially and circularly acquiring test data corresponding to the function parameters of the placeholders from the cache database from front to back until the number of the mapping relations corresponding to the acquired test data is equal to the request number.
After the performance test equipment receives the execution request, the performance test equipment detects whether the request quantity of the performance test requests corresponding to the service system is larger than the mapping relation quantity of the mapping relation in the cache database. It should be noted that, the number of requests is the number of request data in the performance test request, if 100 bank card numbers are required for testing in the performance test request, the number of requests is 100. If the number of the requests is detected to be greater than the number of the mapping relations, the performance test equipment sequentially and circularly acquires test data corresponding to the function parameters of the placeholders from the cache database from front to back according to the sequence of storage of the mapping relations until the number of the mapping relations corresponding to the acquired test data is equal to the number of the requests, namely, until the number of the acquired test data is equal to the number of the requests.
If the number of requests is 100, but the number of corresponding mapping relations is 10, the performance test device needs to acquire test data corresponding to the function parameters of the placeholders in the 10 mapping relations according to the sequence stored in the 10 mapping relations to obtain test data corresponding to the previous 10 request numbers, then continue to acquire test data corresponding to the function parameters of the placeholders in the 10 mapping relations according to the sequence stored in the 10 mapping relations to obtain test data corresponding to the 11 th to 20 th request numbers, and so on until 100 test data are acquired.
In this embodiment, the performance test device may also acquire test data corresponding to the function parameters of the placeholders from the cache database in a sequential cycle from front to back without storing the sequence of each mapping relationship, for example, the performance test device may also acquire test data corresponding to the function parameters of the placeholders from the cache database randomly until the number of mapping relationships corresponding to the acquired test data is equal to the number of requests.
Further, when the number of the requests is detected to be smaller than or equal to the number of the mapping relations, the performance test equipment directly acquires test data corresponding to the number of the requests from the cache database.
According to the embodiment, when the number of the test data stored in the cache database is smaller than the number of the requests for performance test requests, the test data are acquired from the cache database in a sequential cycle from front to back according to the sequence of the storage of the mapping relations until the number of the mapping relations corresponding to the acquired test data is equal to the number of the requests, so that enough test data are ensured in the process of testing a service system, and the accuracy of performance test of the service system is further improved.
Further, a fourth embodiment of the performance testing method of the service system of the present invention is provided.
The difference between the fourth embodiment of the performance testing method of the service system and the third embodiment of the performance testing method of the service system is that the performance testing method of the service system further includes:
and h, detecting whether the storage duration of the mapping relation is longer than a preset duration.
And i, deleting the mapping relation corresponding to the storage time length larger than the preset time length in the cache database if the storage time length of the mapping relation is larger than the preset time length.
After the performance test device stores the mapping relation in the cache database, the performance test device detects whether the storage duration of the mapping relation is longer than a preset duration, wherein the preset duration can be set according to specific needs, and the preset duration is not limited in the embodiment. If the performance test equipment detects that the storage time length of the mapping relation is longer than the preset time length, the performance test equipment deletes the mapping relation corresponding to the storage time length longer than the preset time length in the cache database; if the performance test equipment detects that the storage duration of the mapping relation is smaller than or equal to the preset duration, the performance test equipment continues to detect whether the storage duration of the mapping relation is larger than the preset duration.
According to the embodiment, when the storage time length of the mapping relation is longer than the preset time length, the mapping relation corresponding to the storage time length longer than the preset time length in the cache database is deleted, the mapping relation is prevented from being stored in the performance test equipment for a long time, the data storage capacity of the performance test equipment is reduced, the mapping relation is prevented from being stored in the performance test equipment for a long time, the risk of leakage of test data is increased, and the safety of the data in the service system is improved.
Further, the performance test device may not obtain test data from the service system through the occupation Fu Zaiye service system in the performance test process, but obtain test data from the service database of the service system through the occupation symbol after receiving the execution request for executing the performance test request, and obtain only one test data from the service database each time, so as to realize the function of obtaining data from the service database for testing, and at this time, the statement of operating the service database needs to limit the query condition according to the execution request.
In addition, referring to fig. 3, the present invention also provides a performance testing apparatus of a service system, where the performance testing apparatus of the service system includes:
The analyzing module 10 is configured to analyze a test script corresponding to a performance test request after receiving the performance test request of the test service system, so as to obtain a placeholder in the test script;
the obtaining module 20 is configured to obtain test data from a service database corresponding to the service system according to the function parameter corresponding to the placeholder;
a building module 30, configured to build a mapping relationship between the test data and the function parameters;
the writing module 40 is configured to write the test data corresponding to the function parameters of the placeholder into the test script based on the mapping relationship, so as to obtain a script to be executed;
and the sending module 50 is used for sending the script to be executed to the service system so as to test the performance of the service system according to the script to be executed.
Further, the obtaining module 20 includes:
a first determining unit, configured to determine a placeholder Fu Hanshu corresponding to the placeholder;
the first acquisition unit is used for acquiring the function parameters in the placeholder function and acquiring the parameter numbers corresponding to the function parameters; acquiring test data corresponding to the function parameters from a service database corresponding to the service system;
The establishing module is also used for establishing a mapping relation between the test data and the function numbers.
Further, the performance testing device of the service system further comprises:
the calculation module is used for calculating the number of the data records corresponding to the parameter number if the parameter number corresponds to at least two data records in the service database;
the establishing module 30 is further configured to establish a mapping relationship among the parameter number, the test data, and the number of data records.
Further, the first determination unit includes:
a determining subunit, configured to determine a service database corresponding to the service system according to a database parameter in the function parameters;
a connection subunit, configured to connect to the service database;
a generating subunit, configured to generate a structured query language SQL statement according to one or more types of function parameters including a data table parameter, a field parameter, a query condition statement, and a field index parameter;
and the execution subunit is used for executing the SQL statement in the service database so as to acquire test data corresponding to the function parameters in the service database.
Further, the performance testing device of the service system further comprises:
The storage module is used for storing the mapping relation into a preset cache database;
the writing module 40 includes:
the second acquisition unit is used for acquiring test data corresponding to the function parameters of the placeholders from the cache database based on the mapping relation;
a second determining unit, configured to determine a function position of a placeholder function corresponding to the placeholder in the test script;
and the writing unit is used for writing test data corresponding to the function parameters of the placeholders in the function positions to obtain the script to be executed.
Further, the performance testing device of the service system includes:
the second obtaining unit is further configured to, if the number of requests of the performance test request is greater than the number of mapping relationships of the mapping relationships, sequentially and circularly obtain, from the cache database, test data corresponding to the function parameters of the placeholders from front to back according to the sequence of storing the mapping relationships based on the mapping relationships until the number of mapping relationships corresponding to the obtained test data is equal to the number of requests.
Further, the performance testing device of the service system further comprises:
the third detection module is used for detecting whether the storage duration of the mapping relation is longer than a preset duration;
And the deleting module is used for deleting the mapping relation corresponding to the storage time length larger than the preset time length in the cache database if the storage time length of the mapping relation is larger than the preset time length.
It should be noted that, the embodiments of the performance testing apparatus of the service system are substantially the same as the embodiments of the performance testing method of the service system, and are not described in detail herein.
In addition, the invention also provides performance test equipment of the service system. As shown in fig. 4, fig. 4 is a schematic structural diagram of a hardware running environment according to an embodiment of the present invention.
It should be noted that fig. 4 may be a schematic structural diagram of a hardware running environment of the performance test device of the service system. The performance test equipment of the service system of the embodiment of the invention can be terminal equipment such as PC, portable computer and the like.
As shown in fig. 4, the performance test apparatus of the service system may include: a processor 1001, such as a CPU, memory 1005, user interface 1003, network interface 1004, communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Optionally, the performance testing device of the service system may further include a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and so on.
Those skilled in the art will appreciate that the configuration of the performance testing apparatus of the business system shown in fig. 4 does not constitute a limitation of the performance testing apparatus of the business system, and may include more or fewer components than illustrated, or may combine certain components, or may be arranged in a different arrangement of components.
As shown in fig. 4, an operating system, a network communication module, a user interface module, and a performance test program of a business system may be included in a memory 1005 as one type of computer storage medium. The operating system is a program for managing and controlling the hardware and software resources of the performance test equipment of the service system, and supports the performance test program of the service system and the running of other software or programs.
In the performance test apparatus of the service system shown in fig. 4, the user interface 1003 is mainly used for connecting the service system and performing data communication with the service system; the network interface 1004 is mainly used for a background server and is in data communication with the background server; the processor 1001 may be used to call a performance test program of the service system stored in the memory 1005 and perform the steps of the performance test method of the service system as described above.
The specific implementation manner of the performance test device of the service system is basically the same as that of each embodiment of the performance test method of the service system, and is not repeated here.
In addition, the embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a performance test program of the service system, and the performance test program of the service system realizes the steps of the performance test method of the service system when being executed by a processor.
The specific implementation manner of the computer readable storage medium of the present invention is basically the same as the above embodiments of the performance testing method of the service system, and will not be described herein.
It should be noted that, in this document, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (13)

1. The performance test method of the service system is characterized by comprising the following steps of:
after receiving a performance test request of a test service system, analyzing a test script corresponding to the performance test request to obtain a placeholder in the test script;
acquiring test data from a service database corresponding to the service system according to the function parameters corresponding to the placeholders, and establishing a mapping relation between the test data and the function parameters;
storing the mapping relation into a preset cache database;
acquiring test data corresponding to the function parameters of the placeholders from the cache database based on the mapping relation;
determining a function position of a placeholder function corresponding to the placeholder in the test script, and writing test data corresponding to function parameters of the placeholder in the function position to obtain a script to be executed;
and sending the script to be executed to the service system so as to test the performance of the service system according to the script to be executed.
2. The performance testing method of a service system according to claim 1, wherein the step of acquiring test data from a service database corresponding to the service system according to the function parameter corresponding to the placeholder, and establishing a mapping relationship between the test data and the function parameter comprises:
Determining a placeholder function corresponding to the placeholder, acquiring function parameters in the placeholder function, and acquiring parameter numbers corresponding to the function parameters;
and acquiring test data corresponding to the function parameters from a service database corresponding to the service system, and establishing a mapping relation between the test data and the parameter numbers.
3. The method for testing performance of a service system according to claim 2, wherein after the steps of determining a placeholder function corresponding to the placeholder, obtaining function parameters in the placeholder function, and obtaining parameter numbers corresponding to the function parameters, further comprises:
if the parameter number corresponds to at least two data records in the service database, calculating the number of the data records corresponding to the parameter number;
the step of establishing the mapping relation between the test data and the parameter number comprises the following steps:
and establishing a mapping relation among the parameter numbers, the test data and the data record quantity.
4. The method for testing performance of a service system according to claim 2, wherein the step of obtaining test data corresponding to the function parameter in a service database corresponding to the service system comprises:
Determining a service database corresponding to the service system according to database parameters in the function parameters, and connecting the service database;
generating a Structured Query Language (SQL) statement according to one or more types of function parameters including data table parameters, field parameters, query condition statements and field index parameters;
executing the SQL statement in the service database to obtain test data corresponding to the function parameters in the service database.
5. The method for testing performance of a service system according to any one of claims 1 to 4, wherein after the step of storing the mapping relationship in a preset cache database, the method further comprises:
if the number of the performance test requests is greater than the number of the mapping relations, the step of acquiring test data corresponding to the function parameters of the placeholders from the cache database based on the mapping relations comprises the following steps:
based on the mapping relations, according to the sequence of storing the mapping relations, sequentially and circularly obtaining test data corresponding to the function parameters of the placeholders from the cache database from front to back until the number of the mapping relations corresponding to the obtained test data is equal to the request number.
6. The method for testing performance of a service system according to claim 4, further comprising, after the step of storing the mapping relation in a preset cache database:
detecting whether the storage duration of the mapping relation is longer than a preset duration;
and if the storage time length of the mapping relation is longer than the preset time length, deleting the mapping relation corresponding to the storage time length longer than the preset time length in the cache database.
7. A performance testing apparatus of a service system, wherein the performance testing apparatus of the service system comprises:
the analyzing module is used for analyzing the test script corresponding to the performance test request after receiving the performance test request of the test service system to obtain the placeholder in the test script;
the acquisition module is used for acquiring test data from a service database corresponding to the service system according to the function parameters corresponding to the placeholders;
the building module is used for building a mapping relation between the test data and the function parameters;
the storage module is used for storing the mapping relation into a preset cache database;
the second acquisition unit is used for acquiring test data corresponding to the function parameters of the placeholders from the cache database based on the mapping relation;
A second determining unit, configured to determine a function position of a placeholder function corresponding to the placeholder in the test script;
the writing unit is used for writing test data corresponding to the function parameters of the placeholders in the function positions to obtain scripts to be executed;
and the sending module is used for sending the script to be executed to the service system so as to test the performance of the service system according to the script to be executed.
8. The service system performance testing apparatus of claim 7, wherein the acquisition module comprises:
a first determining unit, configured to determine a placeholder Fu Hanshu corresponding to the placeholder;
the first acquisition unit is used for acquiring the function parameters in the placeholder function and acquiring the parameter numbers corresponding to the function parameters; acquiring test data corresponding to the function parameters from a service database corresponding to the service system;
the establishing module is also used for establishing a mapping relation between the test data and the parameter numbers.
9. The service system performance testing apparatus of claim 8, wherein the service system performance testing apparatus further comprises:
the calculation module is used for calculating the number of the data records corresponding to the parameter number if the parameter number corresponds to at least two data records in the service database;
The establishing module is also used for establishing a mapping relation among the parameter number, the test data and the data record number.
10. The performance testing apparatus of a service system according to claim 8, wherein the first determining unit includes:
a determining subunit, configured to determine a service database corresponding to the service system according to a database parameter in the function parameters;
a connection subunit, configured to connect to the service database;
a generating subunit, configured to generate a structured query language SQL statement according to one or more types of function parameters including a data table parameter, a field parameter, a query condition statement, and a field index parameter;
and the execution subunit is used for executing the SQL statement in the service database so as to acquire test data corresponding to the function parameters in the service database.
11. The performance testing apparatus of a service system according to any one of claims 7 to 10, wherein the performance testing apparatus of a service system comprises:
the second obtaining unit is further configured to, if the number of requests of the performance test request is greater than the number of mapping relationships of the mapping relationships, sequentially and circularly obtain, from the cache database, test data corresponding to the function parameters of the placeholders from front to back according to the sequence of storing the mapping relationships based on the mapping relationships until the number of mapping relationships corresponding to the obtained test data is equal to the number of requests.
12. A performance testing apparatus of a service system, characterized in that the performance testing apparatus of a service system comprises a memory, a processor and a performance testing program of a service system stored on the memory and executable on the processor, which performance testing program of a service system, when being executed by the processor, implements the steps of the performance testing method of a service system according to any one of claims 1 to 6.
13. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a performance test program of a service system, which when executed by a processor, implements the steps of the performance test method of a service system according to any one of claims 1 to 6.
CN201910524517.3A 2019-06-17 2019-06-17 Performance test method, device and equipment of business system and readable storage medium Active CN110221982B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910524517.3A CN110221982B (en) 2019-06-17 2019-06-17 Performance test method, device and equipment of business system and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910524517.3A CN110221982B (en) 2019-06-17 2019-06-17 Performance test method, device and equipment of business system and readable storage medium

Publications (2)

Publication Number Publication Date
CN110221982A CN110221982A (en) 2019-09-10
CN110221982B true CN110221982B (en) 2023-06-09

Family

ID=67817523

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910524517.3A Active CN110221982B (en) 2019-06-17 2019-06-17 Performance test method, device and equipment of business system and readable storage medium

Country Status (1)

Country Link
CN (1) CN110221982B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110825614A (en) * 2019-09-20 2020-02-21 华迪计算机集团有限公司 Performance test method and device based on electronic government affair application system
CN110765006A (en) * 2019-10-08 2020-02-07 贝壳技术有限公司 Flow testing method and device, computer readable storage medium and electronic device
CN111104325B (en) * 2019-12-17 2024-02-02 广州品唯软件有限公司 Data acquisition and analysis method and device for pressure test and readable storage medium
CN111427787B (en) * 2020-03-26 2023-05-30 杭州小影创新科技股份有限公司 Synchronous testing method for service data of heterogeneous database
CN113672677B (en) * 2020-04-30 2024-07-12 比亚迪汽车工业有限公司 Block chain-based job acquisition method, device, equipment and storage medium
CN111651363B (en) * 2020-06-29 2024-07-02 平安银行股份有限公司 Test data acquisition method and device, electronic equipment and medium
CN112597004A (en) * 2020-12-11 2021-04-02 广州品唯软件有限公司 SQL statement performance test method and device, computer equipment and storage medium
CN112527661B (en) * 2020-12-17 2024-04-26 平安消费金融有限公司 Verification method and device of data script and computer equipment
CN112882960A (en) * 2021-03-30 2021-06-01 中信银行股份有限公司 Data acquisition method and device
CN113360470A (en) * 2021-05-25 2021-09-07 深圳市珍爱捷云信息技术有限公司 MySQL-based sub-library and sub-table synchronization method and device, electronic equipment and computer-readable storage medium
CN113688025A (en) * 2021-09-07 2021-11-23 中国联合网络通信集团有限公司 Interface test method, device, equipment and storage medium
CN113986763A (en) * 2021-11-26 2022-01-28 中国银行股份有限公司 System automation test method and device
CN116340363B (en) * 2023-04-06 2024-01-30 河海大学 Data storage and loading method based on relational database and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103001815A (en) * 2011-09-13 2013-03-27 阿里巴巴集团控股有限公司 Method, device and system for acquiring test data
CN105512042A (en) * 2015-12-22 2016-04-20 广东金赋信息科技有限公司 Automatic generation method and device for testing data of database and testing system
CN108089982A (en) * 2017-12-08 2018-05-29 北京小度信息科技有限公司 Test method, device, electronic equipment and computer readable storage medium
CN109359045A (en) * 2018-10-16 2019-02-19 武汉斗鱼网络科技有限公司 A kind of test method, device, equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9098633B2 (en) * 2011-09-07 2015-08-04 Hewlett-Packard Indigo B.V. Application testing
US9235496B2 (en) * 2013-10-17 2016-01-12 Informatica Llc Domain centric test data generation
US20150227452A1 (en) * 2014-02-12 2015-08-13 Wipro Limited System and method for testing software applications

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103001815A (en) * 2011-09-13 2013-03-27 阿里巴巴集团控股有限公司 Method, device and system for acquiring test data
CN105512042A (en) * 2015-12-22 2016-04-20 广东金赋信息科技有限公司 Automatic generation method and device for testing data of database and testing system
CN108089982A (en) * 2017-12-08 2018-05-29 北京小度信息科技有限公司 Test method, device, electronic equipment and computer readable storage medium
CN109359045A (en) * 2018-10-16 2019-02-19 武汉斗鱼网络科技有限公司 A kind of test method, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
魏琴等.《网页设计与制作》.广州:广东经济出版社,2007,第314-316页. *

Also Published As

Publication number Publication date
CN110221982A (en) 2019-09-10

Similar Documents

Publication Publication Date Title
CN110221982B (en) Performance test method, device and equipment of business system and readable storage medium
US10387292B2 (en) Determining application test results using screenshot metadata
CN108984388B (en) Method and terminal equipment for generating automatic test case
WO2021184725A1 (en) User interface test method and apparatus, storage medium, and computer device
CN108984389B (en) Application program testing method and terminal equipment
CN111522922A (en) Log information query method and device, storage medium and computer equipment
CN105099811A (en) Interface testing method and device
CN110955409B (en) Method and device for creating resources on cloud platform
CN110825618A (en) Method and related device for generating test case
CN108111364B (en) Service system testing method and device
CN112866348B (en) Database access method and device, computer equipment and storage medium
CN111045879B (en) Method, device and storage medium for generating pressure test report
CN111654495B (en) Method, apparatus, device and storage medium for determining traffic generation source
CN110019444B (en) Operation request processing method, device, equipment and system
CN112650670A (en) Application testing method, device, system, electronic equipment and storage medium
CN110674023B (en) Interface testing method and device
CN109711656B (en) Multisystem association early warning method, device, equipment and computer readable storage medium
CN112988589A (en) Interface testing method, device and system
CN115022201B (en) Data processing function test method, device, equipment and storage medium
CN113342664B (en) Dial testing method, device, storage medium and computer equipment
CN112579428B (en) Interface testing method, device, electronic equipment and storage medium
CN110659191B (en) Buried data analysis method, buried data analysis device, computer equipment and storage medium
CN109726550A (en) Abnormal operation behavioral value method, apparatus and computer readable storage medium
CN110851254A (en) Equipment production method, device, server and storage medium based on microservice
CN115686506A (en) Data display method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant