Pressure testing method and device, electronic equipment and storage medium

By dynamically adjusting the load fragments and generating a new load fragment collection, the problem that traditional system capacity testing requires multiple executions is solved, and the performance indicators of the application system to be tested are obtained in a stress test, which improves the pressure measurement efficiency.

CN119537173APending Publication Date: 2025-02-28THE BANK OF CHONGQING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411603004.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-02-28

Smart Images

  • Figure CN119537173A_ABST
    Figure CN119537173A_ABST
Patent Text Reader

Abstract

The invention discloses a pressure testing method and device, electronic equipment and a storage medium. The method comprises the steps that a pressure measurement script is sent to a pressure generator so that the pressure generator can execute the pressure measurement script, and a first pressure measurement request is sent to a to-be-tested application system; obtaining a first voltage measurement result of the to-be-measured application system, and determining a target load fragment in the first load fragment set according to the first voltage measurement result; determining an associated concurrence number according to a target concurrence number corresponding to the target load fragment, generating a second load fragment set according to the target concurrence number and the associated concurrence number, and sending the second load fragment set to the pressure generator, so that the pressure generator sends a second pressure measurement request to the to-be-tested application system based on the second load fragment set; and obtaining a second pressure measurement result of the to-be-measured application system, and determining performance index data according to the second pressure measurement result. According to the embodiment of the invention, the performance index of the to-be-tested application system can be obtained by executing the pressure test once, and the pressure test frequency is reduced, so that the pressure test efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a pressure testing method, device, electronic equipment and storage medium. Background Art

[0002] With the rapid development of today's digital economy, all enterprises and organizations cannot do without the support of information systems. System capacity issues have gradually become a key factor affecting system stability and reliability. In order to ensure the normal operation and efficient work of information systems, system capacity testing has become particularly important.

[0003] The main purpose of system capacity testing is to verify and evaluate the performance of the system under different load pressures to ensure that the system can meet the predetermined performance indicators and capacity requirements. The traditional test strategy for system capacity testing is to continuously increase the system load until the system reaches its performance bottleneck or the load can no longer be increased, and then record the system's performance and maximum processing capacity under various loads. However, the traditional test strategy can only evaluate the system's processing capacity under one load by performing a stress test. If the system capacity is to be finally evaluated, multiple stress tests must be performed, resulting in low stress test efficiency. Summary of the invention

[0004] The present invention provides a stress testing method, device, electronic equipment and storage medium, which can improve stress testing efficiency.

[0005] According to one aspect of the present invention, there is provided a stress testing method, comprising:

[0006] Sending a stress test script to a stress transmitter so that the stress transmitter executes the stress test script and sends a first stress test request to the application system to be tested, wherein the stress test script includes a first load segment set, and the first load segment set is a set of load segments;

[0007] Obtaining a first stress test result of the application system to be tested, and determining a target load segment in the first load segment set according to the first stress test result;

[0008] Determine an associated concurrency according to a target concurrency corresponding to the target load fragment, generate a second load fragment set according to the target concurrency and the associated concurrency, and send the second load fragment set to the stress generator, so that the stress generator sends a second stress test request to the application system to be tested based on the second load fragment set;

[0009] Obtain a second stress test result of the application system to be tested, and determine performance indicator data according to the second stress test result.

[0010] According to another aspect of the present invention, a stress testing script sending module is provided, which is used to send a stress testing script to a stress issuing machine, so that the stress issuing machine executes the stress testing script and sends a first stress testing request to the application system to be tested, wherein the stress testing script includes a first load segment set, and the first load segment set is a set of load segments;

[0011] A load segment determination module, configured to obtain a first stress test result of the application system to be tested, and determine a target load segment in the first load segment set according to the first stress test result;

[0012] a load fragment updating module, configured to determine an associated concurrency according to a target concurrency corresponding to the target load fragment, generate a second load fragment set according to the target concurrency and the associated concurrency, and send the second load fragment set to the stress transmitter, so that the stress transmitter sends a second stress test request to the application system to be tested based on the second load fragment set;

[0013] The test result determination module is used to obtain a second stress test result of the application system to be tested, and determine performance indicator data according to the second stress test result.

[0014] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:

[0015] at least one processor; and

[0016] a memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the stress testing method described in any embodiment of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the stress testing method described in any embodiment of the present invention when executed.

[0019] The technical solution of the embodiment of the present invention is to send a first stress test request to the application system under test according to the stress test script by a stress transmitter, obtain the first stress test result of the application system under test, and determine the target load segment in the first load segment set in the stress test script according to the first stress test result. Then, determine the associated concurrency according to the target concurrency corresponding to the target load segment, generate a second load segment set according to the target concurrency and the associated concurrency, send a second stress test request to the application system under test according to the second load segment set by the stress transmitter, obtain the second stress test result of the application system under test, and determine the performance indicator data of the application system under test according to the second stress test result. The embodiment of the present invention realizes that the performance indicator of the application system under test can be obtained by executing a stress test once, thereby reducing the number of stress tests and improving the stress test efficiency.

[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0022] Figure 1 A flow chart of a pressure testing method provided by an embodiment of the present invention;

[0023] Figure 2 A timing diagram of a stress testing method provided by an embodiment of the present invention;

[0024] Figure 3 A schematic diagram of the structure of a pressure testing device provided by an embodiment of the present invention;

[0025] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] Figure 1 The flowchart of a stress test method provided by an embodiment of the present invention is applicable to the case of testing system performance. The method can be performed by a stress test device, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device. For example, the electronic device includes a mobile terminal, a PC or a server. Figure 1 As shown, the method includes:

[0029] S110: Send a stress testing script to a stress generating machine, so that the stress generating machine executes the stress testing script and sends a first stress testing request to the application system to be tested.

[0030] Among them, the stress testing script includes a first load segment set, which is a set of load segments. The load segments include the concurrency number and the duration of continuous stress testing, and the concurrency number represents the number of requests processed simultaneously by the application system under test. A stress machine refers to a machine used to simulate a large number of user access requests to test application performance. The stress machine can be one or more machines, which are used to initiate requests to the server corresponding to the application system under test to simulate the real user load. The first stress testing request refers to the request initiated by the stress machine to the server of the application system under test according to the stress testing script. The application system under test is an information system to be stress tested.

[0031] Exemplarily, a plurality of load segments are first configured, and the stress generator performs stress testing on the application under test according to the load segments to generate a first stress testing result.

[0032] In order to simulate user requests more realistically, test data is prepared before stress testing. Test data is divided into reusable data and non-reusable data. Test data can be prepared according to the performance requirements of the application system to be tested, where the performance requirements include requirements for user information and / or account information. For example, for an end-to-end system, business data associated with account information can be obtained from the system or from the database of the downstream system according to the business scenario. Optionally, exclude abnormal data in the business data. Create test data according to the business scenario. For example, construct the SMS verification code included in the loan-related business data as non-reusable data.

[0033] Methods for excluding abnormal data include: performing benchmark tests based on business data to determine whether the business data is normal data. If the business data is sent to the server by calling the interface and the server's response result is obtained, the business data is determined to be normal data. In addition, dirty data in business data is excluded based on blacklists, account freeze status, and account cancellation status.

[0034] Then, according to the rule of discontinuous database IDs and the data volume requirements included in the performance requirements, a corresponding amount of test data is randomly extracted from the business data after excluding dirty data.

[0035] Exemplarily, before sending the stress test script to the stress test machine, the method further includes: determining a first load segment set according to the incremental step of the concurrency number and the duration of the continuous stress test. Generating configuration information of the thread group according to the first load segment set, and generating the stress test script according to the configuration information. The configuration information includes the number of concurrent threads and the duration of the continuous stress test.

[0036] Specifically, multiple load fragments configured for the thread group are obtained. For example, according to the setting operation, 5 threads are set to perform a 5-minute stress test, and then 10 threads are set to perform a 5-minute stress test. The number of concurrency is increased in an incremental step to obtain multiple load fragments to form a first load fragment set. The configuration information of the thread group is generated according to the number of concurrency and the duration of the continuous stress test of each load fragment in the first load fragment set, and the configuration information is written into the stress test script. The stress test script and test data are transmitted to the stress transmitter through the gateway. It should be noted that the continuous stress test time included in the load fragment must be long enough to avoid inaccurate analysis due to too little test data.

[0037] The stress tester receives and executes the stress test script and test data, and sends a request to the application system to be tested to simulate user operations to perform stress testing on the application system to be tested. For example, the stress tester generates a first stress test request based on the stress test script and test data, and sends the first stress test request to the application system to be tested. The first stress test request may include data for simulating actual user behavior and data interaction. The application system to be tested performs a preliminary stress test according to the first stress test request to obtain a first stress test result.

[0038] S120: Obtain a first stress test result of the application system to be tested, and determine a target load segment in the first load segment set according to the first stress test result.

[0039] Wherein, the first stress test result represents the stress test result of the preliminary stress test phase corresponding to the load segment in the first load segment set. In the preliminary stress test phase, a stress test is performed on the application system to be tested based on each load segment in the first load segment set and the test data. The first stress test result includes the hardware resource data and / or application link data of the application system to be tested. Wherein, the hardware resource data includes the usage rate and / or saturation of at least one of the system hardware resources such as CPU, memory, network, IO, etc. of the application system to be tested. The application link data includes the response time and / or throughput of the application system to be tested.

[0040] The target load segment represents the load segment when the hardware resource data and the application link data of the application system to be tested are both in the optimal state.

[0041] Exemplarily, during the process of performing stress testing on the application system to be tested, the hardware resource data and / or application link data of the application system to be tested corresponding to each load segment are obtained. Based on the stress data corresponding to the first stress test request, the hardware resource data of the application system to be tested, and at least one of the application link indicator data, the first performance data of the application system to be tested under different concurrency numbers is determined. A preset optimization algorithm is used to determine the target load segment in the first load segment set based on the first performance data, wherein the system performance data corresponding to the target load segment is better than the system performance data corresponding to other load segments in the first load set.

[0042] For example, the preliminary stress data represents the stress data corresponding to the first stress test request, and the preliminary stress data may be performance data associated with the stress machine and the preliminary stress test phase. The first performance data may be preliminary stress data, hardware resource data, and application link indicator data. Alternatively, the preliminary stress data, hardware resource data, and application link indicator data may be processed to obtain the first performance data.

[0043] Predictive optimization algorithms include Bayesian optimization, a strategy for global optimization that uses Bayesian statistical inference to select points for evaluation that are most likely to improve the objective function.

[0044] During the stress test, it is determined based on the first stress test result whether the system capacity of the application system to be tested exceeds the set capacity, resulting in excessive system pressure, or whether the system capacity is lower than the set capacity, resulting in insufficient system pressure. The load segment is changed based on the judgment result, and the changed load segment is notified to the stress generator without stopping the stress test.

[0045] Specifically, a Bayesian optimization algorithm is used to analyze the first stress test result in real time to determine a target load segment when both the hardware resource data and the application link data of the application system to be tested are in an optimal state.

[0046] S130. Determine the associated concurrency according to the target concurrency corresponding to the target load fragment, generate a second load fragment set according to the target concurrency and the associated concurrency, and send the second load fragment set to the stress transmitter, so that the stress transmitter sends a second stress test request to the application system under test based on the second load fragment set.

[0047] Among them, the associated concurrency is the concurrency within the set numerical range before and after the target concurrency. N new concurrency numbers before and after the target concurrency can be generated by the Bayesian optimization algorithm. A new load segment is generated based on the new concurrency and the duration of the continuous stress test in the target load segment. A second load segment set is formed based on the target load segment and the new load segment. The second stress test request refers to a request initiated by the stress test machine to the server of the application system to be tested based on the second load segment set and the test data.

[0048] Exemplarily, a parameter value range is determined according to a target concurrency number corresponding to the target load segment. An adjustment parameter is determined within the parameter value range, and the target concurrency number is adjusted according to the adjustment parameter to obtain at least two associated concurrencies. At least three load segments are generated according to the target load segment and the at least two associated concurrencies, and a second load segment set is generated according to the at least three load segments.

[0049] Among them, the parameter value range can characterize the set value range before and after the target concurrency number. The adjustment parameter in the parameter value range can be determined based on the target concurrency number through the Bayesian optimization algorithm. The adjustment parameter can be used to increase the target concurrency number and reduce the target concurrency number. For example, the adjustment parameter can be ±d, where d is a positive integer. At least two new load segments are generated in combination with the continuous stress test duration and the associated concurrency number included in the target load segment, and a second load segment set is formed based on the target load segment and the at least two new load segments. The second load segment set is sent to the stress transmitter so that the stress transmitter sends a second stress test request to the application system to be tested according to the second load segment set.

[0050] Specifically, the compressor receives the second load segment set, calculates the difference between the concurrency of any load segment in the second load segment set and the current concurrency, increases or decreases the concurrency according to the difference, and reports the concurrency change result to the monitoring system through the gateway.

[0051] The change result includes the change in the number of concurrent connections and the corresponding change start time and change end time. After receiving the change result, the monitoring system records the change start time, change end time and expected number of concurrent connections corresponding to the load segment, so that after the stress test is completed, the specific flow changes during the entire stress test process can be viewed.

[0052] S140. Obtain a second stress test result of the application system to be tested, and determine performance indicator data according to the second stress test result.

[0053] The second stress test result represents the stress test result of the fine stress test phase corresponding to the load segment in the second load segment set. The fine stress test phase refers to the phase of stress testing the application system to be tested using the second load segment set.

[0054] For example, the second stress test result includes fine resource data, etc. The fine resource data includes at least one of the CPU and / or memory usage, disk read / write speed, and network read / write speed. The fine stress data represents the stress data corresponding to the second stress test request, that is, the performance data associated with the fine stress test stage of the stress machine. The fine stress data includes at least one of the average response time, the number of transactions processed per second, the success rate, the total number of requests, and the total number of failures.

[0055] Exemplarily, obtaining a second stress test result of the application system under test, and determining performance indicator data based on the second stress test result includes: obtaining hardware resource data and / or application link indicator data generated by the application system under test in response to the second stress test request as the second stress test result. Determine the second performance data of the application system under test under different concurrency numbers based on the second stress test result and the stress data corresponding to the second stress test request. Use a preset optimization algorithm to determine the target load segment in the second load segment set based on the second performance data, and perform aggregation calculation on the second stress test result and stress data corresponding to the target load segment in the second load segment set to obtain the performance indicator data.

[0056] For example, the refined resource data and refined pressure data corresponding to different load segments are used as the second performance data under different concurrency numbers. Alternatively, the refined resource data and refined pressure data corresponding to different load segments are processed to obtain the second performance data.

[0057] Optionally, delete the unstable data in the second stress test result and the stress data corresponding to the target load segment in the second load segment set, wherein the unstable data represents the second stress test result and stress data in the stage of increasing concurrency, the second stress test result and stress data in the stage of decreasing concurrency, and the second stress test result and stress data whose data fluctuation exceeds a set fluctuation threshold. Aggregate calculation is performed on the second stress test result and stress data after deleting the unstable data to obtain the performance indicator data.

[0058] Since the load segment includes a concurrency increase segment, a concurrency stability segment, and a concurrency decrease segment. The second stress test results and refined stress data of the concurrency increase segment and the concurrency decrease segment are not stable. In addition, in the second stress test results and refined stress data, data with large fluctuations are also unstable data. By deleting the unstable data in the second stress test results and refined stress data corresponding to the target load segment in the second load segment set, the second performance data is determined according to the second stress test results and refined stress data after deleting the unstable data, so that the calculated performance indicator data is more accurate and reasonable.

[0059] The second performance data is analyzed by using a Bayesian optimization algorithm to obtain a load segment in the second load segment set that makes the hardware resource data and application link data of the application system to be tested both in the optimal state. For the target load segment in the second load segment, all the detailed stress data reported from the stress generator and the second stress test results monitored in the monitoring system are aggregated and calculated within the start time and end time of the stable concurrency period of the target load segment to obtain the performance indicator data of the application system to be tested. The performance indicator data includes the maximum concurrency of the application system to be tested. Alternatively, the performance indicator data includes the system capacity of the application system to be tested, etc.

[0060] The disclosed embodiment sends a first stress test request to the application system under test according to the stress test script through a stress test machine, obtains a first stress test result of the application system under test, and determines a target load segment in the first load segment set in the stress test script according to the first stress test result. Then, the associated concurrency is determined according to the target concurrency corresponding to the target load segment, a second load segment set is generated according to the target concurrency and the associated concurrency, a second stress test request is sent to the application system under test according to the second load segment set through the stress test machine, and a second stress test result of the application system under test is obtained, and performance indicator data of the application system under test is determined according to the second stress test result. The embodiment of the present invention realizes that the performance indicator of the application system under test can be obtained by executing a stress test once, thereby reducing the number of stress tests and improving the stress test efficiency.

[0061] Figure 2 A timing diagram of a stress testing method provided by an embodiment of the present invention. Figure 2 As shown, the method includes:

[0062] S210: The stress tester obtains configuration information of the load segment, and sends a first stress test request to the application system to be tested according to the load segment, so as to perform a stress test on the application system to be tested.

[0063] S220: The application system to be tested generates a first stress testing result in response to the first stress testing request, and sends the first stress testing result to the stress generator.

[0064] S230. Dynamically change the load segment according to the first stress test result.

[0065] Exemplarily, the monitoring system generates first performance data according to the first stress test result and the stress data corresponding to the first stress test request, determines the target load segment in the first load segment set according to the first performance data, determines the associated concurrency according to the concurrency corresponding to the target load segment, generates a second load segment set according to the target concurrency and the associated concurrency, and sends the second load segment set to the stress generator. The stress generator generates load change content based on the second load segment set, and displays the load change content for user confirmation. The user can input a confirmation operation for the load change to indicate confirmation of the load change content.

[0066] S240: In response to the confirmation operation of the second load segment set, the stress tester sends a second stress test request to the application system to be tested based on the second load segment set.

[0067] S250: The application system to be tested generates a second stress test result in the fine stress test phase, and sends the second stress test result to the stress generator.

[0068] S260: After the stress test is completed, the generator creates an analysis task and obtains the second stress test result of the generator through the analysis task.

[0069] S270, the analysis task obtains a second stress test result of the application system to be tested, and determines performance indicator data according to the second stress test result.

[0070] S280. Output performance indicator data to the user end.

[0071] The embodiment of the present invention provides a method for evaluating the maximum capacity of the application system to be tested by performing a one-side stress test by preparing test data only once. Specifically, the technical solution of the present invention configures multiple load fragments in the preliminary stress test stage to obtain a first load fragment set. In addition, by setting an automatic stress rule, the stress generator performs a stress test on the application system to be tested according to the load fragments in the first load fragment set to generate a first stress test result.

[0072] In the process of performing stress testing, a Bayesian optimization algorithm is used to analyze the first stress test results corresponding to each load segment in real time to determine the target load segment in the first load segment set. For example, the first stress test result includes the response time, throughput, and system hardware resources (such as the utilization rate and saturation of at least one of the CPU, memory, network, and IO) of the application system to be tested. The target concurrency is determined according to the target load segment in the first load segment set. Then, the associated concurrency is determined according to the target concurrency, and a new load segment is generated based on the associated concurrency and the continuous stress test duration included in the target load segment. The new load segment and the target load segment are combined to form a second load segment set. The stress generator performs stress testing on the application system to be tested again according to the load segments in the second load segment set to generate a second stress test result, thereby obtaining a stress test result that is close to the system performance bottleneck.

[0073] Specifically, the stress tester updates the current concurrency number according to the concurrency number of the load fragments in the second load fragment set, and creates an analysis task to automatically remove the unstable stress test data in the fine resource data and fine stress test data when the concurrency number changes. Based on the fine resource data and fine stress test data after removing the unstable stress test data, a stress test is performed on the application system to be tested. The second stress test result is obtained, and the performance indicator data is determined according to the second stress test result to increase the accuracy of the performance indicator data. The embodiment of the present invention achieves the effect of improving the efficiency of system capacity testing and increasing the accuracy of system capacity testing results.

[0074] Optionally, if a large number of errors are detected in the application system to be tested during the preliminary stress test phase or the refined stress test phase, the current concurrency can be reduced to 0 to troubleshoot and resolve the error without ending the stress test. After the error is resolved, the concurrency can be adjusted to the expected value to resume the stress test, avoiding the waste of non-reusable test data in certain business scenarios due to stopping the stress test.

[0075] The embodiments of the present invention can solve the problem that the traditional stress testing scheme can only evaluate the processing capacity of the application system under one load after performing one stress test, and multiple stress tests need to be performed to evaluate the system capacity. It can also solve the problem that when the traditional stress testing tool calculates the performance indicator data under one load, the data involved in the calculation includes the performance indicator data of the load increment process, resulting in deviations in the statistical data. In addition, the traditional stress testing scheme will interrupt the test when the application system under test reports a large number of errors, resulting in the non-reusable stress testing data in some business scenarios having to be discarded and re-prepared, and preparing these stress testing data is very time-consuming and labor-intensive, which greatly affects the efficiency of the stress testing.

[0076] The present invention divides the stress test into a preliminary stress test phase and a fine stress test phase. In the preliminary stress test phase, multiple load segments are configured, and the stress generator performs stress testing on the application system to be tested according to the load segments to generate a first stress test result. During the stress test process, the Bayesian optimization algorithm is used to analyze the first stress test result to determine the target load segment. The target concurrency included in the target load segment is obtained, and the associated concurrency is determined based on the target concurrency. The target concurrency and the associated concurrency are sent to the stress generator. The stress generator adjusts the concurrency according to the target concurrency or the associated concurrency, and performs stress testing on the application system to be tested based on the adjusted concurrency to obtain a second stress test result. The stress test data in the concurrency rising stage, the stress test data in the concurrency falling stage, and the stress test data with data fluctuation exceeding a preset threshold in the second stress test result are deleted, and then the performance indicator data is determined based on the second stress test result after the deletion operation, so that the performance indicator data is more accurate and reasonable. The entire process described above does not require stopping the stress test. Only one stress test is required to obtain the maximum number of concurrency that the application system under test can support, thereby reducing the number of stress tests and improving the efficiency of stress testing.

[0077] Optionally, after the stress test is completed, create an analysis task. By analyzing the performance indicator data under different concurrency numbers through the analysis task, there is no need to manually organize the stress test results, reducing the labor cost of writing stress test reports.

[0078] Figure 3 The present invention provides a schematic diagram of a pressure test device according to an embodiment of the present invention. The pressure test device can be configured in an electronic device. For example, the electronic device includes a mobile terminal, a PC, or a server.

[0079] like Figure 3 As shown, the device includes: a stress testing script sending module 310, a load segment determining module 320, a load segment updating module 330 and a test result determining module 340.

[0080] The stress testing script sending module 310 is used to send the stress testing script to the stress generating machine so that the stress generating machine executes the stress testing script and sends a first stress testing request to the application system to be tested, wherein the stress testing script includes a first load segment set, and the first load segment set is a set of load segments;

[0081] A load segment determination module 320 is configured to obtain a first stress test result of the application system to be tested, and determine a target load segment in the first load segment set according to the first stress test result;

[0082] The load fragment updating module 330 is used to determine the associated concurrency according to the target concurrency corresponding to the target load fragment, generate a second load fragment set according to the target concurrency and the associated concurrency, and send the second load fragment set to the stress transmitter, so that the stress transmitter sends a second stress test request to the application system under test based on the second load fragment set;

[0083] The test result determination module 340 is used to obtain a second stress test result of the application system to be tested, and determine performance indicator data according to the second stress test result.

[0084] Optionally, the load segment includes a concurrency number and a continuous stress test duration, where the concurrency number represents the number of requests processed simultaneously by the application system under test.

[0085] Before sending the stress test script to the stress test machine, the following steps are also required:

[0086] Determine a first load fragment set according to the incremental step of the concurrency number and the duration of the continuous stress test;

[0087] Configuration information of the thread group is generated according to the first load fragment set, and a stress testing script is generated according to the configuration information.

[0088] Optionally, the first stress testing result includes hardware resource data and / or application link data of the application system to be tested.

[0089] The load segment determination module 320 is specifically used for:

[0090] Determine first performance data of the application system under different concurrency numbers according to the stress data corresponding to the first stress test request, and at least one of the resource data and application link indicator data of the application system under test;

[0091] A preset optimization algorithm is used to determine a target load fragment in the first load fragment set according to the first performance data, wherein the system performance data corresponding to the target load fragment is better than the system performance data corresponding to other load fragments in the first load set.

[0092] Optionally, the payload segment updating module 330 is specifically configured to:

[0093] Determine a parameter value range according to the target concurrency number corresponding to the target load segment;

[0094] Determining an adjustment parameter within the parameter value range, and adjusting the target concurrency number according to the adjustment parameter to obtain at least two associated concurrency numbers;

[0095] At least three load fragments are generated according to the target load fragment and the at least two associated concurrency numbers, and a second load fragment set is generated according to the at least three load fragments.

[0096] Optionally, the test result determination module 340 is specifically configured to:

[0097] Acquire hardware resource data and / or application link indicator data generated by the application system to be tested in response to the second stress testing request as a second stress testing result;

[0098] Determining second performance data of the application system under test at different concurrency numbers according to the second stress testing result and the stress data corresponding to the second stress testing request;

[0099] A preset optimization algorithm is used to determine the target load fragment in the second load fragment set according to the second performance data, and the second stress test results and stress data corresponding to the target load fragment in the second load fragment set are aggregated and calculated to obtain the performance indicator data.

[0100] Optionally, the performing aggregating calculation on the second stress test result and stress data corresponding to the target load fragment in the second load fragment set to obtain the performance indicator data includes:

[0101] Delete the second stress test result and unstable data in the stress data corresponding to the target load segment in the second load segment set, wherein the unstable data represents the second stress test result and stress data in the stage of increasing concurrency, the second stress test result and stress data in the stage of decreasing concurrency, and the second stress test result and stress data whose data fluctuation exceeds the set fluctuation threshold;

[0102] Aggregate calculation is performed on the second stress test result after deleting the unstable data and the stress data to obtain the performance indicator data.

[0103] Optionally, the preset optimization algorithm includes a Bayesian optimization algorithm.

[0104] The pressure testing device provided in the embodiment of the present invention can execute the pressure testing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0105] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are only for example and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0106] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0107] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0108] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the stress testing method.

[0109] In some embodiments, the stress testing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the stress testing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the stress testing method in any other appropriate manner (e.g., by means of firmware).

[0110] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0111] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0112] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0113] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0114] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0115] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0116] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0117] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A stress testing method, characterized in that: include: Sending a stress test script to a stress transmitter so that the stress transmitter executes the stress test script and sends a first stress test request to the application system to be tested, wherein the stress test script includes a first load segment set, and the first load segment set is a set of load segments; Obtaining a first stress test result of the application system to be tested, and determining a target load segment in the first load segment set according to the first stress test result; Determine an associated concurrency according to a target concurrency corresponding to the target load fragment, generate a second load fragment set according to the target concurrency and the associated concurrency, and send the second load fragment set to the stress generator, so that the stress generator sends a second stress test request to the application system to be tested based on the second load fragment set; Obtain a second stress test result of the application system to be tested, and determine performance indicator data according to the second stress test result.

2. The method according to claim 1, characterized in that The load segment includes the concurrency number and the duration of continuous stress testing, wherein the concurrency number indicates the number of requests processed simultaneously by the application system under test; Before sending the stress test script to the stress test machine, the following steps are also required: Determine a first load fragment set according to the incremental step of the concurrency number and the duration of the continuous stress test; Configuration information of the thread group is generated according to the first load fragment set, and a stress testing script is generated according to the configuration information.

3. The method according to claim 1, characterized in that The first stress test result includes hardware resource data and / or application link data of the application system to be tested; The determining, according to the first stress testing result, a target load segment in the first load segment set includes: Determine first performance data of the application system under different concurrency numbers according to the stress data corresponding to the first stress test request, and at least one of the resource data and application link indicator data of the application system under test; A preset optimization algorithm is used to determine a target load fragment in the first load fragment set according to the first performance data, wherein the system performance data corresponding to the target load fragment is better than the system performance data corresponding to other load fragments in the first load set.

4. The method according to claim 1, characterized in that: The step of determining the associated concurrency number according to the target concurrency number corresponding to the target load fragment, and generating a second load fragment set according to the target concurrency number and the associated concurrency number includes: Determine a parameter value range according to the target concurrency number corresponding to the target load segment; Determining an adjustment parameter within the parameter value range, and adjusting the target concurrency number according to the adjustment parameter to obtain at least two associated concurrency numbers; At least three load fragments are generated according to the target load fragment and the at least two associated concurrency numbers, and a second load fragment set is generated according to the at least three load fragments.

5. The method according to claim 1, characterized in that The obtaining a second stress test result of the application system to be tested, and determining performance indicator data according to the second stress test result, includes: Acquire hardware resource data and / or application link indicator data generated by the application system to be tested in response to the second stress testing request as a second stress testing result; Determining second performance data of the application system under test at different concurrency numbers according to the second stress testing result and the stress data corresponding to the second stress testing request; A preset optimization algorithm is used to determine the target load fragment in the second load fragment set according to the second performance data, and the second stress test results and stress data corresponding to the target load fragment in the second load fragment set are aggregated and calculated to obtain the performance indicator data.

6. The method according to claim 5, characterized in that The performing aggregating calculation on the second stress test result and the stress data corresponding to the target load segment in the second load segment set to obtain the performance indicator data includes: Delete the second stress test result and unstable data in the stress data corresponding to the target load segment in the second load segment set, wherein the unstable data represents the second stress test result and stress data in the stage of increasing concurrency, the second stress test result and stress data in the stage of decreasing concurrency, and the second stress test result and stress data whose data fluctuation exceeds the set fluctuation threshold; Aggregate calculation is performed on the second stress test result after deleting the unstable data and the stress data to obtain the performance indicator data.

7. The method according to claim 3 or 5, characterized in that: The preset optimization algorithm includes a Bayesian optimization algorithm.

8. A pressure testing device, characterized in that: include: A stress testing script sending module, configured to send a stress testing script to a stress generator, so that the stress generator executes the stress testing script and sends a first stress testing request to the application system to be tested, wherein the stress testing script includes a first load segment set, and the first load segment set is a set of load segments; A load segment determination module, configured to obtain a first stress test result of the application system to be tested, and determine a target load segment in the first load segment set according to the first stress test result; a load fragment updating module, configured to determine an associated concurrency according to a target concurrency corresponding to the target load fragment, generate a second load fragment set according to the target concurrency and the associated concurrency, and send the second load fragment set to the stress transmitter, so that the stress transmitter sends a second stress test request to the application system to be tested based on the second load fragment set; The test result determination module is used to obtain a second stress test result of the application system to be tested, and determine performance indicator data according to the second stress test result.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the stress testing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the stress testing method according to any one of claims 1 to 7 when executed.