CN111752789B - Pressure testing method, computer device and computer readable storage medium - Google Patents

Pressure testing method, computer device and computer readable storage medium Download PDF

Info

Publication number
CN111752789B
CN111752789B CN201910249037.0A CN201910249037A CN111752789B CN 111752789 B CN111752789 B CN 111752789B CN 201910249037 A CN201910249037 A CN 201910249037A CN 111752789 B CN111752789 B CN 111752789B
Authority
CN
China
Prior art keywords
data
target
cutting
pressure test
file
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
CN201910249037.0A
Other languages
Chinese (zh)
Other versions
CN111752789A (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.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili 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 Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN201910249037.0A priority Critical patent/CN111752789B/en
Publication of CN111752789A publication Critical patent/CN111752789A/en
Application granted granted Critical
Publication of CN111752789B publication Critical patent/CN111752789B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • G06F11/273Tester hardware, i.e. output processing circuits
    • G06F11/2733Test interface between tester and unit under test

Abstract

The present disclosure provides a pressure testing method, comprising: receiving a pressure test instruction, and acquiring data cutting parameters from the pressure test instruction; cutting data in a data file required for executing the pressure test according to the data cutting parameters; determining corresponding target data from the cut data; and executing the pressure test according to the target data. The present disclosure also provides a computer device and a computer-readable storage medium.

Description

Pressure testing method, computer device and computer readable storage medium
Technical Field
The present invention relates to the field of pressure testing technologies, and in particular, to a pressure testing method, a computer device, and a computer readable storage medium.
Background
With the service design of mainstream systems, interfaces have become bridges for communication between systems, and thus performance pressure measurement of interfaces has become more and more important.
In the prior art, when the pressure test is performed, the pressure test is usually performed by using the same batch of test parameters at the same time, and the interface service error is caused by repeated use of the test parameters, and the pressure test result is affected to a certain extent.
Disclosure of Invention
The disclosure aims to provide a pressure testing method, computer equipment and a computer readable storage medium, which are used for solving the defects that in the prior art, the interface service errors are caused and the pressure testing result is influenced when the pressure testing is carried out by using the same batch of testing parameters at the same time.
One aspect of the present disclosure provides a pressure testing method, the method comprising: receiving a pressure test instruction, and acquiring data cutting parameters from the pressure test instruction; cutting data in a data file required for executing the pressure test according to the data cutting parameters; determining corresponding target data from the cut data; and executing the pressure test according to the target data.
According to an embodiment of the present disclosure, the cutting the data in the data file required for performing the pressure test according to the data cutting parameter includes: determining the file size of the data file; and cutting the data in the data file according to the data cutting parameter and the file size.
According to an embodiment of the present disclosure, the data cutting parameter includes a number of data cuts, and cutting data in the data file according to the data cutting parameter and the file size includes: and cutting the data in the data file into the data cutting parts according to the file size, wherein the cut data of different parts occupy different data blocks.
According to an embodiment of the present disclosure, the determining corresponding target data from the cut data includes: determining a target data block from the data blocks obtained after cutting the data in the data file; and determining the data stored in the target data block as the target data.
According to an embodiment of the present disclosure, the determining a target data block from the data blocks obtained after cutting the data in the data file includes: acquiring a first target index contained in the pressure test instruction; determining a data block corresponding to the first target index from the data blocks obtained after the data in the data file are cut; and determining the data block corresponding to the first target index as the target data block.
According to an embodiment of the present disclosure, the determining a target data block from the data blocks obtained after cutting the data in the data file includes: receiving a pressurizing instruction for increasing the pressure flow rate of the pressure test, and acquiring a second target index from the pressurizing instruction; determining a data block corresponding to the second target index from the data blocks obtained after the data in the data file is cut; and determining the data block corresponding to the second target index as the target data block.
According to an embodiment of the present disclosure, the performing the pressure test according to the target data includes: reading first row data of the target data block corresponding to the second target index; judging whether the first line data is the data of a complete line or not; if yes, the pressure test is executed according to the first row data, and other row data in the target data block are continuously read.
According to an embodiment of the present disclosure, the pressure testing method further includes: if the first line data is judged not to be the data of a complete line, reading the next line data of the first line data from the target data block; and executing the pressure test according to the next row data, and continuing to read the other row data in the target data block.
A further aspect of the present disclosure provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor for implementing the steps of the method as any one of the above when the computer program is executed by the processor.
Yet another aspect of the present disclosure provides a computer-readable storage medium having stored thereon a computer program for implementing the steps of the method as any one of the above, when the computer program is executed by a processor.
According to the pressure test method, after a pressure test instruction for executing the pressure test is received, data cutting parameters contained in the pressure test instruction are obtained, data in a data file are cut by utilizing the data cutting parameters, further target data needed to be used in the pressure test are determined from the cut data, and then the pressure test is executed by utilizing the determined target data. When the embodiment of the disclosure is used for executing the pressure test, the data in the data file is cut, so that the data used in the pressure test process can be ensured not to be repeated, and the defects that interface service errors are caused and the pressure test result is influenced due to the fact that the pressure test is carried out by using the same batch of test parameters at the same time in the prior art can be overcome, and the effect of improving the accuracy of the pressure test result is realized.
Drawings
FIG. 1 schematically illustrates a flow chart of a pressure testing method according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a schematic diagram of reading target data according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a schematic diagram of Mellloi crush platform configuration information according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a schematic diagram of a Mellloi compression platform interface according to an embodiment of the present disclosure;
FIG. 5 schematically illustrates a preview view of a pressure measurement scenario in accordance with an embodiment of the present disclosure;
FIG. 6 schematically illustrates a schematic diagram of inputting data cutting parameters through a Mellloi compression measurement platform, according to an embodiment of the disclosure;
FIG. 7 schematically illustrates a schematic diagram of pressure test debug information in accordance with an embodiment of the present disclosure;
FIG. 8 schematically illustrates a schematic diagram of downloading a PDF format document according to an embodiment of the disclosure;
FIG. 9 schematically illustrates a schematic diagram of a pressure testing scheme according to an embodiment of the present disclosure;
FIG. 10 schematically illustrates a block diagram of a pressure testing system according to an embodiment of the disclosure; and
fig. 11 schematically illustrates a hardware architecture diagram of a computer device adapted to implement a pressure test method according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more apparent, the present disclosure will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present disclosure. Based on the embodiments in this disclosure, all other embodiments that a person of ordinary skill in the art would obtain without making any inventive effort are within the scope of protection of this disclosure.
According to the pressure test method, after a pressure test instruction for executing the pressure test is received, data cutting parameters contained in the pressure test instruction are obtained, data in a data file are cut by utilizing the data cutting parameters, further target data needed to be used in the pressure test are determined from the cut data, and then the pressure test is executed by utilizing the determined target data. When the embodiment of the disclosure is used for executing the pressure test, the data in the data file is cut, so that the data used in the pressure test process can be ensured not to be repeated, and the defects that interface service errors are caused and the pressure test result is influenced due to the fact that the pressure test is carried out by using the same batch of test parameters at the same time in the prior art can be overcome, and the effect of improving the accuracy of the pressure test result is realized.
Fig. 1 schematically illustrates a flow chart of a pressure testing method according to an embodiment of the present disclosure.
As shown in fig. 1, the pressure testing method may include steps S101 to S104, wherein:
step S101, a pressure test instruction is received, and data cutting parameters are obtained from the pressure test instruction.
The pressure test instruction may be an instruction for instructing to perform a pressure test (the pressure test may be simply referred to as a pressure test) on the preset interface. Before formally executing the pressure test, in order to avoid the defect that in the prior art, the interface service is wrongly reported and the pressure test result is affected due to the fact that the pressure test is performed by using the same batch of test parameters at the same time, the pressure test instruction in the embodiment of the present disclosure may carry the data cutting parameters, acquire the data cutting parameters, and then continue to execute step S102.
And step S102, cutting the data in the data file required by executing the pressure test according to the data cutting parameters. The data in the data file may include interface parameters of a preset interface.
Cutting the data in the data file required for performing the stress test according to the data cutting parameter may include: determining a file size of the data file; and cutting the data in the data file according to the data cutting parameter and the file size.
According to an embodiment of the present disclosure, the data cutting parameter may include a number of data cuts, and cutting the data in the data file according to the data cutting parameter and the file size may include: and cutting the data in the data file into the data cutting parts according to the file size, wherein the cut data of different parts occupy different data blocks.
Alternatively, the data in the data file may be cut equally into data cut portions according to the file size. For example, the file size is 9K, the number of data cuts is 3, and each cut data can occupy 3K space. The data in the data file may also be randomly split into data-split portions, which embodiments of the present disclosure do not limit.
Optionally, the data cutting parameter may further include a preset space size occupied by each cut data, so that in addition to cutting the data in the data file into the data cutting parts, it is required to ensure that the space size occupied by each cut data meets the preset space size. For example, the file size is 9K, the number of data cuts is 3, the preset space sizes are 2K,4K and 3K in sequence, the space size occupied by the first cut data is 2K, the space size occupied by the second cut data is 4K, and the space size occupied by the third cut data is 3K.
It should be noted that, the embodiments of the present disclosure do not cut the data file, but cut the data in the data file. For example, each cut data may be stored in one data block, and different cut data may be stored in different data blocks. Alternatively, each cut data may be stored in an associated number of data blocks, which embodiments of the present disclosure do not limit.
Step S103, corresponding target data are determined from the cut data.
The determining corresponding target data from the cut data may include: determining a target data block from the data blocks obtained after cutting the data in the data file; and determining the data stored in the target data block as the target data.
In an embodiment of the present disclosure, when performing a pressure test on a preset interface for the first time, determining a target data block from data blocks obtained after cutting data in the data file may include: acquiring a first target index contained in the pressure test instruction; determining a data block corresponding to the first target index from the data blocks obtained after the data in the data file are cut; and determining the data block corresponding to the first target index as the target data block.
Specifically, if the pressure test is performed on the preset interface for the first time, the pressure test includes a first target index, and the first target index may correspond to a data block where the preset number of pieces of cut data is located, for example, may correspond to a data block where the first number of pieces of cut data is located.
According to the embodiment of the disclosure, in the process of performing the pressure test on the preset interface, when the pressure flow rate is found to be insufficient, the pressure flow rate for the preset interface can be increased. The determining the target data block from the data blocks obtained after cutting the data in the data file may include: receiving a pressurizing instruction for increasing the pressure flow of the pressure test, and acquiring a second target index from the pressurizing instruction; determining a data block corresponding to the second target index from the data blocks obtained after the data in the data file are cut; and determining the data block corresponding to the second target index as the target data block.
Specifically, during execution of a pressure test on a preset interface, a user may trigger a multiple pressurization instruction, and embodiments of the present disclosure may also receive the multiple pressurization instruction. For each pressurization instruction, the pressurization instruction carries a second target index, the second target index may also correspond to a data block where the cut data of the preset number of copies is located, and the data blocks corresponding to each target index (such as the first target index and the second target index) are different. For example, in connection with the above example, for a first pressurization instruction received, the second target index may correspond to a data block where the second cut data is located.
Step S104, executing the pressure test according to the target data.
In the embodiment of the disclosure, when the pressure test is performed by using the target data in the target data block, the target data may be read in rows, and each row of target data is read, an HTTP request is generated by using the target data, and then the HTTP request is sent to an interface address corresponding to a preset interface, so as to test the performance of the preset interface.
According to an embodiment of the present disclosure, performing the pressure test according to the target data may include: reading first row data of the target data block corresponding to the second target index; judging whether the first line data is the data of a complete line or not; if yes, the pressure test is executed according to the first row data, and other row data in the target data block are continuously read. If the first line data is judged to be not the data of a complete line, reading the next line data of the first line data from the target data block; and executing the pressure test according to the next row of data, and continuing to read the other rows of data in the target data block.
Since the target data block corresponding to the second target index is not the first data block, it may happen that the first line data in the target data block is not the complete line. In this case, to ensure availability of data, it may be determined whether the first line data is data of a complete line. And if the first line data is a complete line, executing the pressure test according to the read first line data, further reading the next line data and continuing executing the pressure test based on the next line data. If the first line data is not a complete line, the second line data is read from the target data block, and a stress test is performed based on the read second line data.
The present disclosure can implement the above-described embodiments using the seek () method. Specifically, as shown in fig. 2, fig. 2 schematically shows a schematic diagram of reading target data according to an embodiment of the present disclosure. In fig. 2, the first byte position of the first line data of the target data block corresponding to the second target index is a pointer, the first line data is read and stored in a variable line, and it is determined whether the pointer is identical to the start position startlndex of the target data block and whether the pointer is not equal to 0. If not, the behavior is indicated to be complete, and the line is directly used. If so, the first line data is not the complete line. At this time, the next line of data can be continuously read, the read next line of data is stored to the previous variable line, the previous first line of data which is not the complete line is covered, and the line value is further returned to the interface for requesting use.
According to the pressure test method, after a pressure test instruction for executing the pressure test is received, data cutting parameters contained in the pressure test instruction are obtained, data in a data file are cut by utilizing the data cutting parameters, further target data needed to be used in the pressure test are determined from the cut data, and then the pressure test is executed by utilizing the determined target data. When the embodiment of the disclosure is used for executing the pressure test, the data in the data file is cut, so that the data used in the pressure test process can be ensured not to be repeated, and the defects that interface service errors are caused and the pressure test result is influenced due to the fact that the pressure test is carried out by using the same batch of test parameters at the same time in the prior art can be overcome, and the effect of improving the accuracy of the pressure test result is realized.
It should be noted that, as an alternative embodiment, the present disclosure may rely on the Melloi pressure measurement platform to send the pressure test instruction. The master pressure test convenience, zero coding and visualization of the Mellloi pressure test platform are realized, a user enters the Web-end Mellloi pressure test platform, one-key storage, debugging or pressure test can be realized through simple interface configuration under friendly interaction prompt information, and no tool is required to be installed. The existing Jmeter pressure testing tool only supports two modes of a command and a client, distributed pressure testing is relatively poor in support and is not easy to expand, a user needs to create a script in a complicated step or write an XML script manually in the Jmeter client, so that the labor cost is relatively high, and in addition, the Jmeter does not support the function of cutting data files. In the prior art, although another ng rinder pressure measurement tool supports Web end pressure measurement, a pressure measurement script needs to be written with great effort, for example, some basic parameterization, cookie adding functions and the like all need the user to realize coding, and the usability is poor. Some other pressure measurement tools, such as wrk, apache, benchmark, k, only support command line mode, no self-visual interface, and no distributed pressure measurement.
As shown in fig. 3 and 4, the Melloi pressure measurement platform of the present disclosure may provide the following convenient functional support: 1. default value of pressure measurement configuration and self definition: the page is automatically configured with basic pressure measurement information, and the pressure measurement can be performed only by logging in an interface address and a service tree node (a path for storing the pressure measurement script). The Melloi pressure measurement platform may automatically generate an interface name from the input interface address, such as for www.baidu.com/fsddfvhgfg= { dfdsvhs }, may combine the operators "/" and "? "as an interface name, i.e., fsddfv. As shown in fig. 5, fig. 5 is a preview view of a pressure measurement scene, taking 100 concurrent users in fig. 4, a pressure measurement duration of 180s, and a preheating time of 20s as an example, and it can be seen that 100 concurrent users can be reached after the preheating time of 20 s. In addition, the Melloi compression platform also supports user-defined modifications. 2. Login information: sufficient online account information is built in, and Web end login and APP end login can be effectively simulated. 3. Signature algorithm: various signature algorithms as shown in fig. 4 are built in, and other algorithms can be extended. 4. And (3) fusing rate configuration: and the configuration of response code fusing rate and service fusing rate is supported, and the on-line environmental safety is ensured to a certain extent. 5. Cutting data: the data cutting parameters are remotely transmitted, so that the data requirements of the service can be met. As shown in fig. 6, data cut parameters (i.e., the number of cuts in the figure) may be entered in the input box. 6. Debugging function: after the pressure measurement information is configured, the network, the interface state, the pressure measurement script and the like can be checked by clicking and debugging, so that the problem of correct and quick positioning is solved, and sufficient preparation is made for formal pressure measurement. As shown in fig. 7, the debugging will default to perform a small amount of press test on the interface, for example, 5 requests, print the 5 requests and the corresponding 5 response messages, and print the corresponding error messages if there is an error. 7. Support get, post request modes and business assertions. 8. And (3) storing and operating a pressure measurement script: the preservation function of the pressure measurement script is supported, and the repeated utilization of the pressure measurement script is realized. 9. The method supports the derivation of the pressure measurement report into a PDF format document, is convenient to view and share at any time, and can be viewed and shared by a user under the condition of no network. In order to facilitate the user to check the complete pressure measurement report after downloading, the function of converting the html report of the webpage into PDF can be realized in the Mellloi pressure measurement platform, and the user can download and store the report by one key. The function is mainly that the front end html2canvas is applied to directly screen-capture the whole page at the user browser end, render the whole page into a picture JPEG format, and then convert the picture into a PDF format document by adopting a JsPDF technology. As shown in fig. 8, the PDF press report download can be completed by clicking the camera button.
Fig. 9 schematically illustrates a schematic diagram of a pressure testing scheme according to an embodiment of the present disclosure.
The scheme shown in fig. 9 takes as an example that a pressure test instruction is sent through a Melloi pressure test platform and a pressure test is performed on a preset interface for the first time. First, the data file is uploaded to the shared storage by the Melloi pressure measurement platform, and then the data cut parameters (the number of cuts in fig. 9) and the first target index (the current index in fig. 9) in the pressure test instruction are transferred to the Jmeter by the Melloi pressure measurement platform. According to the method, file server read file logic of a Jmeter is modified, and a MyBufferedReader class is newly added, as in FIG. 9, a fileEnrey object is acquired, and a target data block (a data block of a current index in FIG. 9) corresponding to a first target index, such as the first data block, is determined by using a MyBufferedReader () method. And then determining a start byte and an end byte of the target data block, reading each row of the target data block from the head by a myreader.realine () method, judging whether the end byte of the row is the end byte after each row is read, if so, indicating that the target data block is read, and if not, continuing to read the data of the next row in the target data block.
Fig. 10 schematically illustrates a block diagram of a pressure testing system according to an embodiment of the disclosure.
As shown in fig. 10, the pressure test system 1000 may include a receiving module 1010, a cutting module 1020, a determining module 1030, and a processing module 1040, wherein:
and the receiving module 1010 is used for receiving a pressure test instruction and acquiring data cutting parameters from the pressure test instruction.
And a cutting module 1020, configured to cut data in a data file required for performing the pressure test according to the data cutting parameter.
And a determining module 1030, configured to determine corresponding target data from the cut data.
And the pressure testing module 1040 is configured to execute the pressure test according to the target data.
After a pressure test instruction for executing a pressure test is received, the pressure test system provided by the disclosure obtains data cutting parameters contained in the pressure test instruction, cuts data in a data file by utilizing the data cutting parameters, further determines target data required to be used in the pressure test from the cut data, and then executes the pressure test by utilizing the determined target data. When the embodiment of the disclosure is used for executing the pressure test, the data in the data file is cut, so that the data used in the pressure test process can be ensured not to be repeated, and the defects that interface service errors are caused and the pressure test result is influenced due to the fact that the pressure test is carried out by using the same batch of test parameters at the same time in the prior art can be overcome, and the effect of improving the accuracy of the pressure test result is realized.
As an alternative embodiment, the cutting module may include: a first determining unit configured to determine a file size of the data file; and the cutting unit is used for cutting the data in the data file according to the data cutting parameter and the file size.
As an alternative embodiment, the data cutting parameter includes a number of data cuts, and the cutting unit may be further configured to: and cutting the data in the data file into the data cutting parts according to the file size, wherein the cut data of different parts occupy different data blocks.
As an alternative embodiment, the determining module may include: the second determining unit is used for determining a target data block from data blocks obtained after cutting data in the data file; and a third determining unit configured to determine data stored in the target data block as the target data.
As an alternative embodiment, the second determining unit may include: the acquisition subunit is used for acquiring a first target index contained in the pressure test instruction; a first determining subunit, configured to determine a data block corresponding to the first target index from the data blocks obtained after cutting the data in the data file; and the second determining subunit is used for determining the data block corresponding to the first target index as the target data block.
As an alternative embodiment, the second determining unit may include: a receiving subunit, configured to receive a pressurization instruction for increasing the pressure flow of the pressure test, and acquire a second target index from the pressurization instruction; a third determining subunit, configured to determine, from the data blocks obtained after cutting the data in the data file, a data block corresponding to the second target index; and a fourth determining subunit, configured to determine a data block corresponding to the second target index as the target data block.
As an alternative embodiment, the pressure measurement module may include: a reading unit, configured to read first row data of the target data block corresponding to the second target index; a judging unit, configured to judge whether the first line data is data of a complete line; and the processing unit is used for executing the pressure test according to the first line data and continuously reading the other line data in the target data block under the condition that the first line data is judged to be the data of a complete line.
As an alternative embodiment, the pressure test system may further include: the reading module is used for reading the next line data of the first line data from the target data block under the condition that the first line data is not the data of a complete line; and the processing module is used for executing the pressure test according to the next row of data and continuously reading the other rows of data in the target data block.
Fig. 11 schematically illustrates a hardware architecture diagram of a computer device adapted to implement a pressure test method according to an embodiment of the present disclosure. In this embodiment, the computer apparatus 1100 is an apparatus capable of automatically performing numerical calculation and/or information processing in accordance with instructions set or stored in advance. For example, it may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including a stand-alone server or a server cluster composed of a plurality of servers), etc. As shown in fig. 11, the computer device 1100 includes at least, but is not limited to: the memory 1110, the processor 1120, and the network interface 1130 may be communicatively coupled to each other through a system bus. Wherein:
the memory 1110 includes at least one type of computer-readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 1110 may be an internal storage module of the computer device 1100, such as a hard disk or memory of the computer device 1100. In other embodiments, the memory 1110 may also be an external storage device of the computer device 1100, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the computer device 1100. Of course, memory 1110 may also include both internal memory modules of computer device 1100 and external memory devices. In this embodiment, the memory 1110 is typically used to store an operating system and various types of application software installed on the computer device 1100, such as program codes of a pressure test method, and the like. In addition, the memory 1110 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 1120 may be a central processing unit (Central Processing Unit, simply CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 1120 is generally used to control overall operation of the computer device 1100, such as performing control and processing related to data interaction or communication with the computer device 1100, and the like. In this embodiment, the processor 1120 is used to execute program code or process data stored in the memory 1110.
The network interface 1130 may include a wireless network interface or a wired network interface, which network interface 1130 is typically used to establish communications connections between the computer device 1100 and other computer devices. For example, the network interface 1130 is used to connect the computer device 1100 to an external terminal through a network, establish a data transmission path and a communication connection between the computer device 1100 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, abbreviated as GSM), wideband code division multiple access (Wideband Code Division Multiple Access, abbreviated as WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, etc.
It should be noted that FIG. 11 shows only a computer device having components 1110-1130, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead.
In this embodiment, the pressure testing method stored in the memory 1110 may be further divided into one or more program modules and executed by one or more processors (the processor 1120 in this embodiment) to complete the present invention.
The present embodiment also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the pressure testing method in the embodiment.
In this embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of a computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may also be an external storage device of a computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), etc. that are provided on the computer device. Of course, the computer-readable storage medium may also include both internal storage units of a computer device and external storage devices. In this embodiment, the computer readable storage medium is typically used to store an operating system installed on a computer device and various types of application software, such as program codes of the pressure test method in the embodiment, and the like. Furthermore, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be separately fabricated into individual integrated circuit modules, or a plurality of modules or steps in them may be fabricated into a single integrated circuit module. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
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 (8)

1. A method of pressure testing, the method comprising:
receiving a pressure test instruction, and acquiring data cutting parameters from the pressure test instruction;
cutting data in a data file required by executing the pressure test according to the data cutting parameters, wherein different data after cutting occupy different data blocks;
determining corresponding target data from the cut data;
performing the pressure test according to the target data;
the determining the corresponding target data from the cut data comprises the following steps:
determining a target data block from the data blocks obtained after cutting the data in the data file;
determining the data stored in the target data block as the target data;
the determining the target data block from the data blocks obtained after cutting the data in the data file comprises the following steps:
acquiring a first target index contained in the pressure test instruction;
determining a data block corresponding to the first target index from the data blocks obtained after the data in the data file are cut;
and determining the data block corresponding to the first target index as the target data block.
2. The method of claim 1, wherein the cutting data in the data file required to perform the stress test according to the data cutting parameters comprises:
determining a file size of the data file;
and cutting the data in the data file according to the data cutting parameter and the file size.
3. The method of claim 2, wherein the data cutting parameter includes a number of data cuts, and wherein cutting the data in the data file according to the data cutting parameter and the file size includes:
and cutting the data in the data file into the data cutting parts according to the file size, wherein the cut data of different parts occupy different data blocks.
4. The method of claim 1, wherein determining the target data block from the data blocks obtained after cutting the data in the data file comprises:
receiving a pressurizing instruction for increasing the pressure flow of the pressure test, and acquiring a second target index from the pressurizing instruction;
determining a data block corresponding to the second target index from the data blocks obtained after the data in the data file are cut;
and determining the data block corresponding to the second target index as the target data block.
5. The method of claim 4, wherein said performing said pressure test based on said target data comprises:
reading first row data of the target data block corresponding to the second target index;
judging whether the first line data is the data of a complete line or not;
if yes, the pressure test is executed according to the first row data, and other row data in the target data block are continuously read.
6. The method of claim 5, wherein the method further comprises:
if the first line data is judged to be not the data of a complete line, reading the next line data of the first line data from the target data block;
and executing the pressure test according to the next row of data, and continuing to read the other rows of data in the target data block.
7. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor is adapted to implement the steps of the method of any one of claims 1 to 6 when the computer program is executed.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program is for implementing the steps of the method according to any one of claims 1 to 6 when being executed by a processor.
CN201910249037.0A 2019-03-29 2019-03-29 Pressure testing method, computer device and computer readable storage medium Active CN111752789B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910249037.0A CN111752789B (en) 2019-03-29 2019-03-29 Pressure testing method, computer device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910249037.0A CN111752789B (en) 2019-03-29 2019-03-29 Pressure testing method, computer device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111752789A CN111752789A (en) 2020-10-09
CN111752789B true CN111752789B (en) 2024-04-16

Family

ID=72671348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910249037.0A Active CN111752789B (en) 2019-03-29 2019-03-29 Pressure testing method, computer device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111752789B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732557B (en) * 2020-12-30 2023-09-08 科来网络技术股份有限公司 Interface test script implementation method and automatic test method for data offset downloading
CN114510430B (en) * 2022-04-19 2022-07-12 北京焦点新干线信息技术有限公司 Distribution method and device of pressure measurement plan, server and computer storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021055A (en) * 2016-05-25 2016-10-12 乐视控股(北京)有限公司 Performance testing method and device for mixed interface
CN107294878A (en) * 2016-04-13 2017-10-24 中国移动通信有限公司研究院 Data transmission method, system and relevant device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107294878A (en) * 2016-04-13 2017-10-24 中国移动通信有限公司研究院 Data transmission method, system and relevant device
CN106021055A (en) * 2016-05-25 2016-10-12 乐视控股(北京)有限公司 Performance testing method and device for mixed interface

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陆玲,周航慈.《嵌入式系统软件设计中的数据结构》.北京航空航天大学出版社,2008,169-170. *

Also Published As

Publication number Publication date
CN111752789A (en) 2020-10-09

Similar Documents

Publication Publication Date Title
US10698797B2 (en) Mobile application program testing method, server, terminal, and storage medium
CN104468843A (en) File uploading method and device
CN110647471B (en) Interface test case generation method, electronic device and storage medium
CN108255701B (en) Scene testing method and mobile terminal
CN108459850B (en) Method, device and system for generating test script
CN111694749A (en) Automatic interface testing method and device, computer equipment and readable storage medium
CN112039900B (en) Network security risk detection method, system, computer device and storage medium
CN111752789B (en) Pressure testing method, computer device and computer readable storage medium
CN111309593A (en) JSON interface verification method, device and equipment and computer readable storage medium
CN110750443A (en) Webpage testing method and device, computer equipment and storage medium
CN103152327A (en) Configuration method, client and system for plug-in unit compressing and uncompressing
CN110597714A (en) Kafka message testing method and device, computer equipment and storage medium
US20190149571A1 (en) Method and device for repairing page vulnerability
CN112395187A (en) Test method, test system, computer device and storage medium
US10423472B2 (en) System and method for providing extended javascript object notation (JSON) remote procedure call (RPC) with mediator
CN112650674A (en) Method for remotely acquiring and debugging webpage log, computer equipment and storage medium
CN112416648A (en) Data verification method and device
CN111338644A (en) Task script deployment method and system
CN109669829A (en) A kind of diagnosis adjustment method, device and server based on BMC
CN114416420A (en) Equipment problem feedback method and system
CN113569551A (en) APP page configuration method, device, system and storage medium
CN112417324A (en) Chrome-based URL (Uniform resource locator) interception method and device and computer equipment
CN112465604A (en) Order distribution method and device, computer equipment and computer readable storage medium
CN112416750A (en) Application program boundary testing method and system
CN106598553B (en) Information card generation method, device and system

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