Application pressure measurement method and device, electronic equipment and storage medium

By automatically adjusting the number of service requests and dynamically adjusting the pressure measurement plurality based on the pressure measurement index data, the problem of low manual analysis and adjustment efficiency in the prior art is solved, and the efficiency and reliability of application pressure measurement are improved.

CN118885376APending Publication Date: 2024-11-01TENPAY PAID TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310470847.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-24
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

In the prior art, when applying pressure measurement, it is necessary to manually analyze and adjust the number of service requests, which is inefficient and poor reliability, making it difficult to quickly explore the maximum number of service requests for concurrent processing.

Method used

Provide an application pressure measurement method and device, by obtaining the target pressure measurement task, sending a preset number of service requests to the target application server, obtaining pressure measurement indicator data, determining the pressure measurement magnification based on the data, and automatically adjusting the number of service requests until Meet the pressure measurement end condition and realize automatic dynamic adjustment.

Benefits of technology

It improves the efficiency and reliability of applied stress testing, reduces manual intervention, and can quickly explore the maximum number of business requests for concurrent processing, reducing labor costs during stress testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118885376A_ABST
    Figure CN118885376A_ABST
Patent Text Reader

Abstract

The invention discloses an application pressure testing method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a target pressure testing task which indicates to carry out the pressure testing of a preset business interface of a target application server, sending a preset number of service requests corresponding to a preset service interface to a target application server based on the target pressure test task to perform a pressure test to obtain pressure test index data, the pressure measurement index data represents the response condition of the target application server to the preset number of service requests and the machine performance condition in the process that the target application server responds to the preset number of service requests, under the condition that it is determined that the pressure measurement multiplying power needs to be adjusted based on the pressure measurement index data, the target pressure measurement multiplying power is determined, and the target pressure measurement multiplying power is adjusted based on the target pressure measurement multiplying power. And adjusting the number of the service requests sent in the pressure test until a pressure test ending condition is met, and obtaining a pressure test result. According to the invention, the test efficiency and reliability of the application pressure test are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of application testing, and in particular to an application stress testing method, device, electronic device and storage medium. Background Art

[0002] Before an application is put into production, it is usually necessary to perform stress testing on the application in a test environment to ensure that the application meets the expected requirements. In related technologies, when performing stress testing, in order to explore the bottleneck of stress testing (such as the maximum number of business requests that the application can process concurrently), a dedicated tester is required to manually analyze whether the current stress testing task has reached a bottleneck. If not, the number of business requests needs to be manually adjusted. This method of manually analyzing the stress testing situation and adjusting the number of business requests is obviously too slow and has poor reliability. Summary of the invention

[0003] In order to solve the problems of the prior art, the embodiments of the present application provide an application stress testing method, device, electronic device and storage medium. The technical solution is as follows:

[0004] In one aspect, a method for application stress testing is provided, the method comprising:

[0005] Obtain a target stress test task; the target stress test task indicates to perform stress test on the preset business interface of the target application server;

[0006] Based on the target stress testing task, a preset number of business requests corresponding to the preset business interface are sent to the target application server to perform stress testing, and stress testing indicator data is obtained; the stress testing indicator data represents the response of the target application server to the preset number of business requests and the machine performance of the target application server in the process of responding to the preset number of business requests;

[0007] If it is determined based on the stress testing indicator data that the stress testing ratio needs to be adjusted, determine the target stress testing ratio; the stress testing ratio represents the adjustment range of the number of business requests sent;

[0008] Based on the target stress testing ratio, the number of business requests sent to the preset business interface of the target application server during the stress test is adjusted until the stress testing end condition is met, and the stress testing result corresponding to the target stress testing task is obtained; the stress testing result represents the number of business requests sent corresponding to the target stress testing task at the end of the stress testing.

[0009] In another aspect, an application stress testing device is provided, the device comprising:

[0010] An acquisition module is used to acquire a target stress test task; the target stress test task indicates to perform stress test on a preset business interface of a target application server;

[0011] A stress testing module is used to send a preset number of business requests corresponding to a preset business interface to a target application server based on a target stress testing task to perform a stress test and obtain stress testing indicator data; the stress testing indicator data represents the response of the target application server to the preset number of business requests and the machine performance of the target application server in the process of responding to the preset number of business requests;

[0012] A determination module is used to determine a target stress testing ratio when it is determined based on stress testing indicator data that the stress testing ratio needs to be adjusted; the stress testing ratio represents the adjustment range of the number of business requests sent;

[0013] The adjustment module is used to adjust the number of business requests sent to the preset business interface of the target application server during the stress test based on the target stress testing multiple, until the stress testing end condition is met, and obtain the stress testing result corresponding to the target stress testing task; the stress testing result is used to indicate whether the target stress testing task is successful.

[0014] In an exemplary embodiment, the apparatus further comprises:

[0015] A first comparison module is used to compare the first stress test indicator data with the preset response indicator to obtain a first comparison result; the first stress test indicator data represents the response of the target application server to a preset number of business requests;

[0016] A first generating module, configured to generate first stress testing ratio adjustment information when the first comparison result indicates that the first stress testing indicator data exceeds a preset response indicator;

[0017] A second comparison module is used to compare the second stress test indicator data with the preset machine performance indicator to obtain a second comparison result when the first comparison result indicates that the first stress test indicator data does not exceed the preset response indicator; the second stress test indicator data represents the machine performance of the target application server in the process of responding to a preset number of business requests;

[0018] A second generating module is used to generate first stress test ratio adjustment information when the second comparison result indicates that the second stress test indicator data exceeds the preset machine performance indicator;

[0019] The first stress testing ratio adjustment information indicates that the stress testing ratio is to be reduced.

[0020] In an exemplary embodiment, the second stress measurement indicator data includes network bandwidth usage; the device further includes:

[0021] The third generating module is used to generate second stress testing ratio adjustment information when the network bandwidth utilization rate does not reach the preset network bandwidth index; the second stress testing ratio adjustment information indicates to increase the stress testing ratio.

[0022] In an exemplary embodiment, the determining module includes:

[0023] An adjustment direction determination module, configured to determine a target adjustment direction based on the first stress test ratio adjustment information or the second stress test ratio adjustment information;

[0024] A parameter acquisition module, used to acquire a preset basic adjustment ratio and a preset adjustment step; the preset adjustment step represents the ratio of the number of sent service requests to be adjusted along the target adjustment direction; the preset basic adjustment ratio is a positive number greater than or equal to 1;

[0025] The stress testing ratio determination module is used to determine the target stress testing ratio based on a preset basic adjustment ratio, a target adjustment direction and a preset adjustment step size.

[0026] In an exemplary embodiment, the apparatus further comprises:

[0027] The abort module is used to abort the stress test corresponding to the target stress test task in response to the process abnormality information of the target application server; the process abnormality information of the target application server indicates that the target application process is abnormal;

[0028] An exception determination module, used to determine the exception type indicated by the process exception information;

[0029] A process acquisition module is used to acquire the repair application process corresponding to the target application process when the exception type is non-heartbeat exception;

[0030] A repair module, used for repairing a target application process based on the repair application process;

[0031] The first recovery module is used to restore the stress test corresponding to the target stress testing task when it is determined that the target application process is repaired.

[0032] In an exemplary embodiment, the apparatus further comprises:

[0033] The second recovery module is used to restore the stress test corresponding to the target stress testing task when the abnormality type is a heartbeat abnormality.

[0034] In an exemplary embodiment, the apparatus further comprises:

[0035] The detection module is used to perform heartbeat detection on each application process in the target application server at a preset time interval to obtain the heartbeat detection result of each application process;

[0036] The fourth generating module is used to generate process abnormality information based on the application process corresponding to the first heartbeat detection result when there is a first heartbeat detection result; the first heartbeat detection result indicates no heartbeat.

[0037] In an exemplary embodiment, the apparatus further comprises:

[0038] A fifth generating module, used to generate target notification information based on the process abnormality information of the target application server;

[0039] The sending module is used to send the process abnormality information of the target application server to the target receiving end based on the target notification information.

[0040] On the other hand, an electronic device is provided, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the application stress testing method of any one of the above aspects.

[0041] On the other hand, a computer-readable storage medium is provided, in which at least one instruction or at least one program is stored. The at least one instruction or the at least one program is loaded and executed by a processor to implement an application stress testing method as described in any of the above aspects.

[0042] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the application stress testing method of any aspect above.

[0043] In the embodiment of the present application, a target stress testing task is obtained, the target stress testing task indicates to perform stress testing on a preset business interface of a target application server, and a preset number of business requests corresponding to the preset business interface are sent to the target application server based on the target stress testing task to perform stress testing, and stress testing indicator data is obtained, the stress testing indicator data characterizing the response of the target application server to the preset number of business requests and the machine performance of the target application server in the process of responding to the preset number of business requests, and in the case of determining that the stress testing multiplier needs to be adjusted based on the stress testing indicator data, a target stress testing multiplier is determined, wherein the stress testing multiplier characterizes the adjustment range of the number of business requests sent, and then based on the target stress testing multiplier, the stress testing multiplier is adjusted to send the target application server to the target application server in the stress test. The number of business requests sent by the preset business interface of the server is counted until the stress testing end condition is met, and the stress testing result corresponding to the target stress testing task is obtained, and the stress testing result represents the number of business requests sent corresponding to the target stress testing task at the end of the stress testing; in this case, the adjustment of the stress testing ratio can be determined based on the automatic analysis result of the stress testing indicator data in the target stress testing task, so as to realize automatic dynamic adjustment of the number of business requests sent until the stress testing end condition is met, and output the corresponding stress testing result. Compared with the prior art that requires manual analysis and adjustment of the number of business requests sent, the technical solution provided by the present application can effectively improve the efficiency and reliability of stress testing on the preset business interface of the target application server. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0045] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0046] Figure 2 This is a flow chart of an application stress testing method provided in an embodiment of the present application.

[0047] Figure 3 This is a schematic diagram of a management page for application stress testing provided in an embodiment of the present application;

[0048] Figure 4 It is a flowchart of another application stress test provided by an embodiment of the present application;

[0049] Figure 5 It is a flow chart of comparing stress test indicator data with preset indicators provided in an embodiment of the present application;

[0050] Figure 6This is a schematic diagram of a stress test ratio decision strategy provided in an embodiment of the present application;

[0051] Figure 7 This is a schematic diagram of a system framework for application stress testing provided in an embodiment of the present application;

[0052] Figure 8 is a structural block diagram of an application stress testing device provided in an embodiment of the present application;

[0053] Fig. 9 It is a hardware structure block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0055] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application 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 interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0056] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0057] See also Figure 1 , which is a schematic diagram of an implementation environment provided by an embodiment of the present application, wherein the implementation environment includes a stress testing management terminal 110, a stress testing server 120 and a target application server 130, wherein the terminal 110 and the stress testing server 120, and the stress testing server 120 and the target application server 130 can communicate via a wired or wireless network connection.

[0058] The stress test management terminal 110 may be a terminal corresponding to the stress test personnel, and the stress test personnel may upload the stress test task to the corresponding stress test server 120 through the stress test management terminal 110, and then the stress test server 120 may execute the corresponding stress test task. The target application server 130 is a server that provides background services for the target application, and the background services include responding to business requests for calling preset business interfaces.

[0059] Optionally, the stress testing management terminal 110 may be a smart phone, a tablet computer, a laptop computer, a digital assistant, a smart wearable device, a vehicle-mounted terminal, etc.

[0060] The stress testing server 120 and the target application server 130 involved in the embodiments of the present application can be independent physical servers, or a server cluster or distributed system composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network) and big data and artificial intelligence platforms.

[0061] See also Figure 2 , which is a flow chart of an application stress testing method provided in an embodiment of the present application, which can be applied to Figure 1 The stress test server in the embodiment. It should be noted that this specification provides method operation steps as described in the embodiments or flow charts, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or product is executed, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiments or drawings. Specific examples Figure 2 As shown, the method may include:

[0062] S201: Obtain a target stress testing task; the target stress testing task indicates to perform stress testing on a preset business interface of a target application server.

[0063] Among them, the target stress testing task can be a stress testing task that includes a preset business interface identifier of the target application server and a preset number of business requests to be sent. Optionally, the method for generating a business request may include: first obtaining test data, the test data may be virtual data constructed by the tester, and usually the test data includes multiple groups of data. For example, for a user order query business, the test data may include multiple user names and the product name corresponding to each user name, and each group of data may include a user name and a corresponding product name; thereby, the above test data can be used as input parameter data to construct the above preset number of business requests.

[0064] In an exemplary embodiment, before step S201, the method further includes determining a triggering mode (such as manual triggering or timed triggering) and a preparation step for deploying the target application; see Figure 3 , which shows a schematic diagram of a management page for application stress testing provided in an embodiment of the present application. When a user clicks the "Pipeline" control on the management page, the following can be displayed on the management page: Figure 3In the "Build Trigger" page shown, there are two build trigger methods. One is manual trigger. Selecting this trigger method means that the time when the target stress test task is executed depends on the tester's trigger stress test operation. The other is scheduled trigger. This trigger method means that the time when the target stress test task is executed depends on the time set by the tester. For example, when the tester sets the stress test start time to 20:00, it indicates that the target stress test task will start at 20:00. This trigger method does not require manual stress testing, reducing the manpower cost of stress testing. When the tester clicks any of the "Manual Trigger" or "Scheduled Trigger" controls, it indicates that this trigger mode is selected, and the tester will jump to the "Build Environment 1" page. By clicking the "Pull Command Line" control, the required code file can be selected from the corresponding file list and downloaded to the specified storage location. Optionally, these code files can be stored locally in the stress testing management terminal or in other terminals or servers; then click the "Compile" control to compile the above code files into executable files (such as binary files); continue to click the "Archive Component" control to compress the above multiple executable files into a compressed file, which can then be sent to the specified server, which can It is a server where the test environment is deployed (such as the target application server). The designated server can also be a transit server for performing subsequent unpacking and other steps. When the archiving operation is completed, it will jump to the "Update Joint Debugging Environment" page. By clicking the "Unpack", "Component Distribution" and "Deploy Target Application" controls in sequence, you can decompress the compressed file in sequence, place the executable file in the specified directory, and load the executable file into the test environment to complete the deployment of the target application. When there is an ongoing stress testing task in the test environment, you can pause the deployment of the target application by clicking the "Wait" control. When there is no ongoing stress testing task in the test environment, click the "Deploy Target Application" control again to complete the deployment of the target application.

[0065] Afterwards, by clicking the "Stress Test" control, it indicates that the stress test has been started. If the manual trigger method was selected before, the following steps S201-S207 will be executed; if the timed trigger method was selected before, the following steps S201-S207 will be executed at the specified time.

[0066] Continue reading Figure 3The management page also has "Notification", "Permission" and "Basic Settings" controls. By clicking the "Notification" control, testers can view the notification information generated during the stress test, such as process exception information; by clicking the "Permission" control, the permission setting page can be displayed. Relevant personnel can set which personnel have which stress test permissions on this permission setting page. By clicking the "Basic Settings" control, the parameters of each plug-in involved in the entire deployment target application process mentioned above can be displayed.

[0067] S203: Based on the target stress testing task, a preset number of business requests corresponding to a preset business interface are sent to the target application server to perform a stress test to obtain stress testing indicator data; the stress testing indicator data represents the response of the target application server to the preset number of business requests and the machine performance of the target application server in the process of responding to the preset number of business requests.

[0068] In an exemplary embodiment, see Figure 4 , which is a schematic diagram of another application stress test process provided by an embodiment of the present application. Figure 3 After the management page shown in the figure completes the deployment of the target application and starts the stress test, the packet dispatching controller can be used to send a preset number of business requests. Each business request will be sent to the target application server in the form of a data packet. Usually, each business request corresponds to a data packet. Optionally, in order to avoid repeatedly developing the packet dispatching logic code when developing the stress test logic code, the packet dispatching application that supports concurrency and machine performance testing can be encapsulated into a packet dispatching interface. When the packet dispatching is required, the packet dispatching interface can be directly called. Specifically, the packet dispatching interface can be called by the packet dispatching controller (referring to a logic code written by the developer to control whether to dispatch the packet) to realize the concurrency of the preset number of business requests. Optionally, the packet dispatching application can be a packet dispatching method based on the golang language. This packet dispatching method can support concurrency and machine performance testing. Other types of packet dispatching tools such as Jmeter, LoadRuner, Locust, etc. can also be used as needed.

[0069] In an exemplary embodiment, the stress testing server may include a stress testing platform and a detection platform. The stress testing platform is used to perform stress testing and analysis of stress testing indicator data, adjustment of stress testing multiples, and other steps. The detection platform is used to obtain stress testing indicator data corresponding to the stress testing, and send the stress testing indicator data to the stress testing platform, so that the stress testing platform can compare the stress testing indicator data with the preset indicators to obtain the comparison results, and perform different stress testing steps based on different comparison results. The stress testing indicator data includes first stress testing indicator data and second stress testing indicator data. The preset indicators include preset response indicators and preset machine performance indicators. The first stress testing indicator data represents the response of the target application server to a preset number of business requests, and the second stress testing indicator data represents the machine performance of the target application server in the process of responding to a preset number of business requests. In another exemplary embodiment, the stress testing server can be used as a stress testing platform. The implementation environment of the present application also includes a detection server, which can also be called a detection platform. This distributed layout method can reduce the system overhead of the stress testing server while improving data processing efficiency.

[0070] In an exemplary implementation, step S203 may specifically include: sending a preset number of business requests corresponding to a preset business interface to the target application server based on the target stress testing task to perform a stress test to obtain stress testing process data; determining the stress testing indicator data based on the stress testing process data; the stress testing process data includes response data and machine performance data.

[0071] The response data may refer to the data of the target application server's response to a preset number of service requests, and may specifically include the following data:

[0072] The error code refers to the failure identification data indicating that there is an error in the execution of the target stress testing task, such as "error" and "null", which can be a field customized by the developer.

[0073] The specified error code is a type of error code. According to the stress test, the key error code to be tested needs to be specified. For example, when the response time of a business request is too long, an error code AAA will be returned. AAA can be used as the specified error code. Since the response time is too long, it may be caused by the downstream service application not being able to provide services well. When the relevant personnel see the error code AAA in the log later, they can quickly locate the target application process that caused the error for repair. It can be understood that the specified error code is the error code set by the tester according to the characteristics of the stress test task, so for different stress test tasks, the corresponding specified error code may be different.

[0074] Response time refers to the time it takes for the stress testing platform to send a business request and receive a response result corresponding to the business request.

[0075] The success or failure of a request may refer to the response result indicating a successful response or a failed response corresponding to the business request received by the stress testing platform. Specifically, "OK" may be used as the response result for a successful response, and "NO" may be used as the response result for a failed response. That is, if the stress testing platform receives a response result of "OK" corresponding to the business request, it indicates that the business request has responded successfully. If the stress testing platform receives a response result of "NO" corresponding to the business request, it indicates that the business request has failed to respond. Usually, a packet sending controller can send multiple data packets (i.e., multiple business requests) per second, so the instantaneous success number (the number of business requests that respond successfully per second) or the instantaneous failure number (the number of business requests that fail to respond per second) can be used to measure the success or failure of a request.

[0076] Furthermore, the above response data also includes the success or failure of each application process, wherein the failure of the application process can be reflected by the above error code, so that when the application process is subsequently detected, the abnormal application process can be quickly located and repaired.

[0077] The machine performance data may refer to the machine performance data of the target application server in the process of responding to a preset number of service requests, and may include the following data:

[0078] The central processing unit (CPU) utilization rate specifically refers to the CPU utilization rate of the target application server, indicating the CPU utilization status of the target application server in the process of responding to a preset number of service requests. Usually, if the CPU utilization rate is too high, it will cause the response time of the service request to be prolonged.

[0079] The memory usage rate specifically refers to the memory usage rate of the target application server, which indicates the memory usage of the target application server in the process of responding to a preset number of business requests. Usually, if the memory usage rate is too high, it will cause the response time of the business request to be prolonged.

[0080] The network bandwidth utilization rate is used to describe the congestion of the network transmission channel for sending business requests and receiving response results in the target stress testing task. Generally, the higher the network bandwidth utilization rate, the more congested the network transmission channel is, which may cause the response time of the business request to be longer.

[0081] The above is only an example of machine performance data. According to the actual stress test needs, other machine performance data can also be detected, such as disk input and output numbers, etc., which are not limited here. Since different stress test process data are stored in different locations, such as response data can be stored in the stress test management terminal or the stress test server, and the CPU usage rate in the machine performance data is stored on the target application server, the detection platform can obtain the corresponding stress test process data by calling the corresponding data acquisition interface. Of course, the stress test server and the target application server can also report the above stress test process data to the detection platform in real time or at regular intervals (such as 2 seconds, 3 seconds, etc.). Specifically, the stress test process data can be reported to the detection platform in the form of logs and stored in the time series database, so that the above stress test data will be stored in the time series database as time series data (i.e., data with timestamps). The required stress test indicator data can be obtained by processing the above time series data later.

[0082] In an exemplary implementation, the stress testing indicator data includes first stress testing indicator data and second stress testing indicator data, wherein the first stress testing indicator data may specifically include the number of error codes within 5 seconds, the number of specified error codes, the specified time consumption, and the failure rate.

[0083] The number of error codes within 5 seconds can be obtained by taking the number of error codes existing in the time series data with an interval of 5 seconds from the latest time node as the number of error codes within 5 seconds.

[0084] The specified time consumption may specifically include N99 time consumption and N95 time consumption, wherein N99 time consumption may refer to the total response time consumption corresponding to the remaining service requests after excluding the service requests corresponding to the highest and lowest response time consumptions / the number of the remaining service requests. If the preset number corresponding to the service requests is N, and N is an integer greater than 2, then N99 time consumption may be expressed based on the following formula (1):

[0085]

[0086] Among them, t i Indicates the response time of the i-th service request among the remaining service requests.

[0087] N95 time consumption may refer to the sum of response time consumptions corresponding to 95% of the remaining service requests randomly selected from the remaining service requests after excluding the service requests corresponding to the highest and lowest response time consumptions / the 95% remaining number. Continuing with the above example, N95 time consumption may be expressed based on the following formula (2):

[0088] (N-2)×095

[0089]

[0090] Among them, t i Indicates the response time of the jth service request among the remaining 95% of the service requests.

[0091] The failure rate may refer to the number of instantaneous failures / total number of packets sent per second (i.e., the number of service requests sent per second), or it may refer to the number of service requests with failed responses / preset number after a preset number of service requests are sent.

[0092] It can be understood that the present application measures the stress test situation based on the failure rate, and can also be measured by the success rate as needed. Similar to the calculation method of the failure rate, the success rate can refer to the instantaneous number of successes / total number of packets sent per second, or it can refer to the number of successful response results in a preset number of business requests / preset number after a preset number of business requests are sent. The stress test situation can also be measured by the response time corresponding to each business request, such as setting a time consumption threshold, considering the comparison result of the response time corresponding to each business request with the time consumption threshold, and judging the stress test situation based on the comparison result of the time consumption.

[0093] In an exemplary embodiment, see Figure 5 , which is a schematic diagram of a process of comparing stress test indicator data with preset indicators provided in an embodiment of the present application. After step S203, the method further includes a process of comparing the stress test indicator data with the preset indicators, which is as follows:

[0094] S501: Compare the first stress test indicator data with the preset response indicator to obtain a first comparison result; the first stress test indicator data represents the response of the target application server to a preset number of business requests.

[0095] See also Figure 6 , which shows a schematic diagram of a stress test ratio decision strategy provided by an embodiment of the present application. The stress test ratio decision strategy can be used to analyze the first stress test indicator data to decide whether the stress test ratio needs to be adjusted. Specifically, the first stress test indicator data can include the number of error codes within 5 seconds, the number of specified error codes, the specified time consumption and the failure rate. Correspondingly, the preset response indicators include a first preset response indicator M1, a second preset response indicator M2, a third preset response indicator M3 and a fourth preset response indicator M4, wherein, when the number of specified error codes is counted within 5 seconds, M1 is greater than M2.

[0096] S503: When the first comparison result indicates that the first stress testing indicator data exceeds the preset response indicator, generate first stress testing ratio adjustment information; the first stress testing ratio adjustment information indicates that the stress testing ratio is to be reduced.

[0097] See also Figure 6 The first comparison result may specifically include the following five situations:

[0098] The first case may be that when the number of error codes within 5 seconds is greater than M1, a fuse signal is generated to terminate the stress test corresponding to the target stress test task. Specifically, this can be done by terminating the package sending process of the package sending controller and the target application process in the target application server.

[0099] The second situation may be that the number of error codes within 5 seconds is less than or equal to M1, and the number of specified error codes is greater than M2, and the first stress testing ratio adjustment information is generated, and the first stress testing ratio adjustment information indicates to reduce the stress testing ratio.

[0100] The third situation may be that the number of error codes within 5 seconds is less than or equal to M1, the number of specified error codes is less than or equal to M2, and the specified time consumption is greater than M3, and the first stress test ratio adjustment information is generated.

[0101] The fourth situation may be that the number of error codes within 5 seconds is less than or equal to M1, the number of specified error codes is less than or equal to M2, the specified time consumption is less than or equal to M3, and the failure rate is greater than M4, and the first stress test ratio adjustment information is generated.

[0102] The fifth situation may be that the number of error codes within 5 seconds is less than or equal to M1, the number of specified error codes is less than or equal to M2, the specified time consumption is less than or equal to M3, and the failure rate is less than or equal to M4, and the step of comparing the second stress test indicator data with the preset machine performance indicator is continued.

[0103] In this embodiment, the first comparison result indicating that the first stress testing indicator data exceeds the preset response indicator may refer to the first comparison result being the second, third, and fourth cases mentioned above.

[0104] S505: When the first comparison result indicates that the first stress test indicator data does not exceed the preset response indicator, the second stress test indicator data is compared with the preset machine performance indicator to obtain a second comparison result; the second stress test indicator data represents the machine performance of the target application server in the process of responding to a preset number of business requests.

[0105] In an exemplary embodiment, the second stress testing indicator data may include CPU usage, memory usage and network bandwidth usage. Correspondingly, the preset machine performance indicators include a first preset machine performance indicator M5, a second preset machine performance indicator M6 and a third preset machine performance indicator M7.

[0106] S507: When the second comparison result indicates that the second stress testing indicator data exceeds the preset machine performance indicator, generate first stress testing ratio adjustment information.

[0107] See also Figure 6The second comparison result may specifically include the following four situations:

[0108] The first case may be that the CPU usage is greater than M5, and the first stress test ratio adjustment information is generated.

[0109] The second case may be that the CPU usage is less than or equal to M5, and the memory usage is greater than M6, and the first stress test ratio adjustment information is generated.

[0110] The third case may be that the CPU usage is less than or equal to M5, the memory usage is less than or equal to M6, and the network bandwidth usage is greater than M6, and the first stress test ratio adjustment information is generated;

[0111] The fourth situation may be that the CPU usage is less than or equal to M5, the memory usage is less than or equal to M6, and the network bandwidth usage is less than M7, and the second stress testing ratio adjustment information is generated, and the second stress testing ratio adjustment information indicates to increase the stress testing ratio.

[0112] In this embodiment, the second comparison result indicating that the second stress test indicator data exceeds the preset machine performance indicator may refer to the second comparison result being the first, second, and third cases mentioned above.

[0113] In an exemplary embodiment, please refer to Figure 5 , the method further comprises:

[0114] S509: When the network bandwidth usage rate does not reach the preset network bandwidth indicator, generate second stress testing ratio adjustment information; the second stress testing ratio adjustment information indicates to increase the stress testing ratio.

[0115] In this embodiment, the situation where the network bandwidth utilization rate does not reach the preset network bandwidth index means that the second comparison result is the fourth situation mentioned above, that is, the CPU utilization rate is less than or equal to M5, the memory utilization rate is less than or equal to M6, and the network bandwidth utilization rate is less than M7.

[0116] By analyzing the stress testing indicator data through the above stress testing ratio decision strategy, an analysis result can be obtained, so as to indicate whether to increase the stress testing ratio, decrease the stress testing ratio, blow the circuit or end the stress testing based on the analysis result. If the stress testing ratio is increased or decreased, continue to execute the following steps S205-S207 to obtain the stress testing result. The whole process is automatically executed in a loop, and no manual analysis and debugging are required, thereby improving the efficiency of stress testing.

[0117] In an exemplary embodiment, Figure 6The stress test ratio decision strategy shown can be a decision tree model, then the number of error codes within 5 seconds can be used as the root node, the number of specified error codes, specified time consumption, failure rate, CPU usage, memory usage and network bandwidth usage are used as internal nodes, and fuse, reduce the stress test ratio, increase the stress test ratio and end of stress test are used as leaf nodes, indicating the decision results of the corresponding root node or internal node. The decision tree model can be pre-set by relevant personnel as needed, or can be obtained by learning and training based on historical stress test indicator data. It should be noted that the historical stress test indicator data can be historical data obtained by stress testing the same target application; specifically, the sample set used to train the decision tree model includes multiple samples, each sample corresponds to a set of stress test indicator data and a corresponding decision result, such as sample 1 can be that the number of error codes within 5 seconds is greater than M1 (i.e., stress test indicator data), and fuse (i.e., decision result); sample 2 can be that the number of error codes within 5 seconds is less than or equal to M1, the number of specified error codes is greater than M2 (i.e., stress test indicator data), and the stress test ratio is reduced (i.e., decision result).

[0118] In an exemplary embodiment, the method for training a decision tree and updating historical stress testing indicator data includes: constructing a sample set based on historical stress testing indicator data and corresponding decision results; determining a target decision tree model based on the sample set; and updating the sample set based on the stress testing indicator data and corresponding decision results of the target stress testing task when the target stress testing task is completed.

[0119] Specifically, in order to further improve the accuracy of the decision results of the decision tree model, this can be achieved by improving the accuracy of the sample data. The historical stress testing indicator data can be screened to eliminate abnormal data that does not conform to the norm, thereby obtaining sample data for training the decision tree model. This process can be automatically screened through written logic code or performed manually.

[0120] The decision results may include circuit breaking, lowering the stress test ratio, raising the stress test ratio, and ending the stress test.

[0121] Exemplarily, after obtaining the sample set, the information gain corresponding to each attribute can be calculated. Continuing with the above example, the sample set includes 7 attributes, namely the number of error codes within 5 seconds, the number of specified error codes, the specified time consumption, the failure rate, CPU usage, memory usage and network bandwidth usage; generally, the greater the information gain, the greater the "purity improvement" obtained by dividing the corresponding attribute, so the information gain can be used to select the division attributes of the decision tree, such as whether the root node is the number of error codes within 5 seconds, the number of specified error codes, the specified time consumption, the failure rate, the CPU usage, the memory usage, or the network bandwidth usage.

[0122] The information gain Gain(S, a) corresponding to attribute a can be expressed based on the following formula (3):

[0123]

[0124] Assuming that the proportion of samples of category c in the sample set S is p(c), c = 1, 2, 3, C, the information entropy Ent(S) of S can be expressed based on the following formula (4):

[0125]

[0126] In the embodiment of the present application, for the entire sample set S, according to the decision results, it can include four categories of samples, namely, circuit breaking, lowering the stress test ratio, increasing the stress test ratio, and ending the stress test.

[0127] Information entropy originates from the concept of information theory and is used to measure the impurity of sample values. The smaller the value of Ent(S), the higher the purity of S.

[0128] If a discrete attribute a has V possible values ​​a 1 , a 2 , ..., a V , if a is used to divide the sample set S, V branch nodes will be generated, where the Vth branch node contains all the samples in S whose value is a on attribute a V The sample is denoted as S v , so according to formula (4) we can calculate S v The information entropy of , and considering that different branch nodes contain different numbers of samples, weights are assigned to branch nodes, that is, the branch nodes with more samples have a greater influence. Then, the information gain obtained by dividing the sample set S by attribute a can be calculated, and the attribute with the largest information gain is used as the attribute of the partition node.

[0129] Therefore, as historical indicator data continues to increase, new decision tree models can be continuously learned and trained, and the decision tree model can be used as a stress testing ratio decision strategy to analyze the stress testing indicator data corresponding to the target stress testing task. This not only ensures the accuracy of the decision results for the target stress testing task, but also further improves the test efficiency because there is no need for manual formulation and analysis of decision strategies.

[0130] In an exemplary embodiment, after sending a preset number of business requests corresponding to a preset business interface to the target application server based on the target stress test task in step S203 for stress testing, the method further includes: in response to the process exception information of the target application server, terminating the stress test corresponding to the target stress test task; the process exception information of the target application server indicates that the target application process has an exception; determining the exception type of the exception indicated by the process exception information; in the case where the exception type is a non-heartbeat exception, obtaining the repair application process corresponding to the target application process; repairing the target application process based on the repair application process; and when it is determined that the repair of the target application process is completed, resuming the stress test corresponding to the target stress test task. In this way, the exception type can be determined based on the process exception information of the target application server, and then the corresponding repair application can be obtained to repair the target application. When the repair is completed, the corresponding stress test is automatically resumed. The entire repair process is automatic repair, thereby ensuring the continuous execution of the stress test, and compared with the prior art method of manually analyzing, repairing and resuming the stress test after receiving the abnormal information, the entire repair process has the characteristics of high efficiency.

[0131] Based on different ways of detecting process abnormal information, the following two ways of generating process abnormal information can be included. When the detection method is to use heartbeat detection technology to detect process heartbeat, in an exemplary embodiment, before the above step responds to the process abnormal information of the target application server and terminates the stress test corresponding to the target stress test task, the method further includes: performing heartbeat detection on each application process in the target application server at a preset time interval to obtain the heartbeat detection result of each application process; in the case of a first heartbeat detection result, generating process abnormal information based on the application process corresponding to the first heartbeat detection result; the first heartbeat detection result indicates no heartbeat. The method of generating abnormal information by detecting the heartbeat of the application process has the characteristics of simple implementation and accurate understanding of the status of each application process. In an exemplary embodiment, the heartbeat detection result can also include a second heartbeat detection result, and the second heartbeat result indicates that the heartbeat value is less than or equal to a preset threshold; after obtaining the heartbeat detection result of each application process, the method further includes: in the case of a second heartbeat detection result, generating process abnormal information based on the application process corresponding to the second heartbeat detection result.

[0132] In an exemplary embodiment, when the exception type is a heartbeat exception, such as an application process with no heartbeat, it is most likely caused by too many business requests, or it may be because when it is determined based on the stress testing indicator data that the stress testing ratio needs to be adjusted, the stress test corresponding to the target stress testing task may be terminated first, resulting in no heartbeat in the application process; but no matter which of the above situations is considered in the above step S203, so in step S203, after sending a preset number of business requests corresponding to a preset business interface to the target application server based on the target stress testing task for stress testing, the method may also specifically include the following steps: in response to the process exception information of the target application server, terminating the stress test corresponding to the target stress testing task; the process exception information of the target application server indicates that there is an exception in the target application process; determining the exception type indicated by the process exception information; and when the exception type is a heartbeat exception, resuming the stress test corresponding to the target stress testing task, that is, resuming the normal stress testing steps. In this way, by first determining the type of exception, only when the exception type is not a heartbeat exception, that is, there may be a problem with the application itself, will the abnormal application process be repaired. When the exception type is a heartbeat exception, the stress test is directly resumed without repair, further improving the efficiency of the overall stress test.

[0133] In another exemplary embodiment, for the case where the detection method is to detect whether the process is abnormal by analyzing whether there is a process abnormality error code in the stress testing indicator data, before the stress test corresponding to the target stress testing task is terminated in response to the process abnormality information of the target application server in the above step, the method may also specifically include the following steps: in the case where there is a process abnormality error code in the stress testing indicator data, the process abnormality information is generated based on the application process corresponding to the process abnormality error code. In this way, the application process with abnormality can also be repaired later, but in the actual test process, since there are multiple application processes in the target application server, there may be only one or a few application processes with abnormalities, which may not have a significant impact on the response situation. However, when only one application process has an error, it is repaired, which will affect the stress testing efficiency. Therefore, in order to avoid the above situation, the stress testing efficiency is improved. Optionally, in the case where the number of process abnormality error codes in the stress testing indicator data is greater than or equal to the preset number value, the process abnormality information is generated based on the application process corresponding to the process abnormality error code.

[0134] In order to further ensure that more expected stress test results and target applications can be obtained, the above two methods can be combined, that is, the heartbeat detection method and the process exception error code detection method can be used to detect the application process.

[0135] In order to facilitate relevant personnel to timely understand the stress testing situation, especially the stress testing abnormal situation, so that subsequent relevant personnel can summarize experience based on the stress testing abnormal situation, update and improve the target application, and also facilitate relevant personnel to deal with major stress testing abnormal situations in a timely manner. In an exemplary embodiment, after terminating the stress test corresponding to the target stress testing task, the method also includes: generating target notification information based on the process abnormality information of the target application server; based on the target notification information, sending the process abnormality information of the target application server to the target receiving end. The target receiving end can be a stress testing platform or a terminal held by relevant personnel (such as a mobile phone, computer, etc.).

[0136] S205: When it is determined based on the stress testing indicator data that the stress testing ratio needs to be adjusted, determine a target stress testing ratio; the stress testing ratio represents an adjustment range of the number of sent business requests.

[0137] In an exemplary embodiment, the specific implementation of determining the target stress testing ratio in step S205 may be: determining the target adjustment direction based on the first stress testing ratio adjustment information or the second stress testing ratio adjustment information; obtaining a preset basic adjustment ratio and a preset adjustment step; the preset adjustment step represents the ratio of the number of business requests sent along the target adjustment direction; the preset basic adjustment ratio is a positive number greater than or equal to 1; determining the target stress testing ratio based on the preset basic adjustment ratio, the target adjustment direction and the preset adjustment step. In this way, by first determining the adjustment direction based on the stress testing ratio adjustment information, and adjusting the preset basic adjustment ratio along the target adjustment direction based on the preset adjustment step to obtain the target stress testing ratio, real-time dynamic adjustment of the stress testing ratio can be achieved.

[0138] Exemplarily, taking the determination of the target adjustment direction based on the first stress test ratio adjustment information as an example, the target adjustment direction can be "-", that is, a minus sign. When the preset basic adjustment ratio is 1 and the preset adjustment step is 0.1, the target stress test ratio = 1-0.1 = 0.9. Optionally, the preset basic adjustment ratio can also be 1.1, 1.2, or 2, 3, etc., without limitation here. The preset adjustment step can be fixed or not. Specifically, the initial value of the preset basic adjustment ratio can be 1, and the subsequent preset basic adjustment ratio can be the target stress test ratio obtained last time. For example, when the first adjustment needs to be reduced by 0.1, the target stress test ratio obtained is 0.9. When the second judgment result also needs to be reduced by 0.1, 0.9 will be used as the preset basic adjustment ratio for reduction, and the target stress test ratio will be 0.8.

[0139] Since the number of business requests needs to be adjusted, such as the number of business requests needs to be lowered, if the sending of all preset number of business requests has been completed, it is necessary to re-execute the stress test of the adjusted number of business requests, so there is no need to continue to execute the application process corresponding to the current preset number of business requests. Therefore, in order to reduce the system overhead and avoid waste of resources, in an exemplary embodiment, after determining that the stress test ratio needs to be adjusted based on the stress test indicator data in step S205, the method also includes: terminating the stress test corresponding to the target stress test task. When the target stress test ratio is subsequently determined and the number of business requests is adjusted, the stress test of the adjusted number of business requests will be automatically executed. However, the above-mentioned method of executing the step of terminating the stress test corresponding to the target stress testing task whenever the stress testing ratio needs to be adjusted is relatively extreme, which will lead to a decrease in the stress testing efficiency of other types of stress tests that may not need to be terminated. In order to avoid the above situation, in another exemplary embodiment, the specific implementation of step S207 may include: based on the target stress testing ratio, adjusting the number of business requests sent to the preset business interface of the target application server in the stress test to obtain the target number of business requests sent, updating the target stress testing task based on the target number, sending the target number of business requests to the preset business interface of the target application server based on the target stress testing task for stress testing, and obtaining target stress testing indicator data; when it is determined based on the target stress testing indicator data that the stress testing ratio needs to be adjusted, repeatedly determining the target stress testing ratio, adjusting the number of business requests sent to the preset business interface of the target application server in the stress test based on the target stress testing ratio to obtain the target number of business requests, sending the target number of business requests to the preset business interface of the target application server for stress testing, and obtaining the target stress testing indicator data, until the stress testing end condition is met. In the above steps, the target number of business requests sent to the preset business interface of the target application server based on the target stress testing task for stress testing includes: obtaining the number of business requests sent, if the number sent is less than the target number, determining the required number based on the sent number and the target number, obtaining the required number of business requests, and sending the required number of business requests to the preset business interface of the target application server for stress testing. After the above steps obtain the number of business requests sent, the method further includes: if the number sent is greater than or equal to the target number, terminating the stress test corresponding to the target stress testing task, obtaining the target number of business requests, and sending the target number of business requests to the preset business interface of the target application server for stress testing.

[0140] S207: Based on the target stress testing ratio, adjust the number of business requests sent to the preset business interface of the target application server during the stress test until the stress testing end condition is met, and obtain the stress testing result corresponding to the target stress testing task; the stress testing result represents the number of business requests sent corresponding to the target stress testing task at the end of the stress testing.

[0141] In an exemplary embodiment, the stress test termination condition is met in step S207, including: the network bandwidth usage rate reaches the preset network bandwidth index. Figure 4 and Figure 6 , specifically, it can refer to the case where the comparison result is the third comparison result, and the third comparison result can be that the CPU usage is less than or equal to M5, the memory usage is less than or equal to M6, and the network bandwidth usage is equal to M7. In the case of ending the stress test, the stress test result can be output in the end, and the corresponding stress test indicator data can also be output. The stress test indicator data is the stress test bottleneck corresponding to the target stress test task. When the stress test is completed, the steps of issuing and launching the target application can be executed, which means that the target application that has been tested OK is sent to the specified directory and deployed to the formal environment.

[0142] See also Figure 7 , which shows a schematic diagram of a system framework for application stress testing provided in an embodiment of the present application. The system framework for application stress testing mainly includes the following parts:

[0143] Use cases: Specifically, they include the process of packaging, sending packages, assertion, and reporting. Packaging can refer to the grouping of test data so that each service request corresponds to a set of test data; sending packages can refer to host A sending service requests to host B in the form of data packets; assertion in testing can refer to the process of verifying the rule conditions that need to be met in the test (such as the process of comparing the stress test indicator data with the preset response indicators mentioned above); reporting usually refers to the process in which the stress test platform and the target server send the generated relevant stress test data to the detection platform in the form of logs during the stress test.

[0144] Logical layer: used to translate abstract protocols into required protocol data or packets through specific logic.

[0145] Protocol layer: used to encapsulate data, specifically can generate header data, body data and encrypted data, where encrypted data can refer to the data after encrypting the body data.

[0146] Public method layer: contains various methods used to support the above use cases, logic layer and protocol layer, such as encryption algorithm, packet sending method, protocol serialization (which enables the logic layer to convert code files into binary files), Universally Unique Identifier (UUID) generation method (which can be used to generate the identifier of the data packet), L5 and other common methods (used to dynamically obtain the routing address); also contains data required for various tests, such as user data, Internet Protocol (IP) data, transaction data, merchant data, etc.

[0147] It can be seen from the above technical solutions of the embodiments of the present application that Figure 4 In the embodiment of the present application, a target stress testing task is obtained, and a preset number of business requests corresponding to a preset business interface are sent to the target application server based on the target stress testing task to perform stress testing, so as to obtain stress testing indicator data. Then, the stress testing indicator data can be analyzed and decided based on the stress testing ratio decision strategy. When the decision result is that the stress testing ratio needs to be adjusted, the target stress testing ratio can be determined, and then the number of business requests sent to the preset business interface of the target application server in the stress test can be dynamically adjusted based on the target stress testing ratio until the stress testing end condition is met, so as to obtain the stress testing result corresponding to the target stress testing task, and also obtain the corresponding stress testing bottleneck (i.e., the stress testing indicator data corresponding to the stress testing result). The execution of the entire stress testing, the analysis of the data, and the output of the results are all automatically executed, so as to improve the efficiency of the stress testing. In addition, the stress testing indicator data can be detected and timely terminated and fused to avoid major online accidents. The above-mentioned stress testing ratio decision strategy can also be obtained by learning and training the historical stress testing indicator data and the decision results, and can be continuously updated and optimized, so as to improve the accuracy of the stress testing results.

[0148] Corresponding to the application stress testing methods provided in the above-mentioned embodiments, an embodiment of the present application also provides an application stress testing device. Since the application stress testing device provided in the embodiment of the present application corresponds to the application stress testing methods provided in the above-mentioned embodiments, the implementation methods of the aforementioned application stress testing methods are also applicable to the application stress testing device provided in this embodiment and will not be described in detail in this embodiment.

[0149] See also Figure 8 , which is a schematic diagram of the structure of an application stress test device provided in an embodiment of the present application, the device has the function of implementing the application stress test method in the above method embodiment, and the function can be implemented by hardware, or by hardware executing corresponding software. Figure 8 As shown, the device may include:

[0150] The acquisition module 810 is used to acquire a target stress test task; the target stress test task indicates to perform stress test on a preset business interface of a target application server;

[0151] The stress testing module 820 is used to send a preset number of business requests corresponding to a preset business interface to the target application server based on the target stress testing task to perform stress testing and obtain stress testing indicator data; the stress testing indicator data represents the response of the target application server to the preset number of business requests and the machine performance of the target application server in the process of responding to the preset number of business requests;

[0152] The determination module 830 is used to determine a target stress testing ratio when it is determined based on the stress testing indicator data that the stress testing ratio needs to be adjusted; the stress testing ratio represents the adjustment range of the number of business requests sent;

[0153] The adjustment module 840 is used to adjust the number of business requests sent to the preset business interface of the target application server during the stress test based on the target stress testing ratio until the stress testing end condition is met, and obtain the stress testing result corresponding to the target stress testing task; the stress testing result is used to indicate whether the target stress testing task is successful.

[0154] In an exemplary embodiment, the apparatus further comprises:

[0155] A first comparison module is used to compare the first stress test indicator data with the preset response indicator to obtain a first comparison result; the first stress test indicator data represents the response of the target application server to a preset number of business requests;

[0156] A first generating module, configured to generate first stress testing ratio adjustment information when the first comparison result indicates that the first stress testing indicator data exceeds a preset response indicator;

[0157] A second comparison module is used to compare the second stress test indicator data with the preset machine performance indicator to obtain a second comparison result when the first comparison result indicates that the first stress test indicator data does not exceed the preset response indicator; the second stress test indicator data represents the machine performance of the target application server in the process of responding to a preset number of business requests;

[0158] A second generating module is used to generate first stress test ratio adjustment information when the second comparison result indicates that the second stress test indicator data exceeds the preset machine performance indicator;

[0159] The first stress testing ratio adjustment information indicates that the stress testing ratio is to be reduced.

[0160] In an exemplary embodiment, the second stress measurement indicator data includes network bandwidth usage; the device further includes:

[0161] The third generating module is used to generate second stress testing ratio adjustment information when the network bandwidth utilization rate does not reach the preset network bandwidth index; the second stress testing ratio adjustment information indicates to increase the stress testing ratio.

[0162] In an exemplary embodiment, the determination module 830 includes:

[0163] An adjustment direction determination module, configured to determine a target adjustment direction based on the first stress test ratio adjustment information or the second stress test ratio adjustment information;

[0164] A parameter acquisition module, used to acquire a preset basic adjustment ratio and a preset adjustment step; the preset adjustment step represents the ratio of the number of sent service requests to be adjusted along the target adjustment direction; the preset basic adjustment ratio is a positive number greater than or equal to 1;

[0165] The stress testing ratio determination module is used to determine the target stress testing ratio based on a preset basic adjustment ratio, a target adjustment direction and a preset adjustment step size.

[0166] In an exemplary embodiment, the apparatus further comprises:

[0167] The abort module is used to abort the stress test corresponding to the target stress test task in response to the process abnormality information of the target application server; the process abnormality information of the target application server indicates that the target application process is abnormal;

[0168] An exception determination module, used to determine the exception type indicated by the process exception information;

[0169] A process acquisition module is used to acquire the repair application process corresponding to the target application process when the exception type is non-heartbeat exception;

[0170] A repair module, used for repairing a target application process based on the repair application process;

[0171] The first recovery module is used to restore the stress test corresponding to the target stress testing task when it is determined that the target application process is repaired.

[0172] In an exemplary embodiment, the apparatus further comprises:

[0173] The second recovery module is used to restore the stress test corresponding to the target stress testing task when the abnormality type is a heartbeat abnormality.

[0174] In an exemplary embodiment, the apparatus further comprises:

[0175] The detection module is used to perform heartbeat detection on each application process in the target application server at a preset time interval to obtain the heartbeat detection result of each application process;

[0176] The fourth generating module is used to generate process abnormality information based on the application process corresponding to the first heartbeat detection result when there is a first heartbeat detection result; the first heartbeat detection result indicates no heartbeat.

[0177] In an exemplary embodiment, the apparatus further comprises:

[0178] A fifth generating module, used to generate target notification information based on the process abnormality information of the target application server;

[0179] The sending module is used to send the process abnormality information of the target application server to the target receiving end based on the target notification information.

[0180] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0181] An embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement any application stress testing method provided in the above method embodiments.

[0182] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.

[0183] The method embodiments provided in the embodiments of the present application may be executed in a computer terminal, a server or a similar computing device, that is, the above-mentioned electronic device may include a computer terminal, a server or a similar computing device. Fig. 9 is a hardware structure block diagram of an electronic device running an application stress testing method provided in an embodiment of the present application, such as Fig. 9As shown, the server 900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 910 (the processor 910 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 930 for storing data, and one or more storage media 920 (such as one or more mass storage devices) for storing application programs 923 or data 922. Among them, the memory 930 and the storage medium 920 can be short-term storage or permanent storage. The program stored in the storage medium 920 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 910 can be configured to communicate with the storage medium 920 and execute a series of instruction operations in the storage medium 920 on the server 900. The server 900 may also include one or more power supplies 960, one or more wired or wireless network interfaces 950, one or more input and output interfaces 940, and / or one or more operating systems 921, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, FreeBSD TM, etc.

[0184] The input / output interface 940 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 900. In one example, the input / output interface 940 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 940 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0185] It can be understood by those skilled in the art that Fig. 9 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig. 9 More or fewer components as shown, or with Fig. 9 Different configurations are shown.

[0186] An embodiment of the present application also provides a computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing an application stress testing method. The at least one instruction or the at least one program is loaded and executed by the processor to implement any application stress testing method provided by the above method embodiments.

[0187] The embodiments of the present application also provide a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs any one of the application stress testing methods provided in the above method embodiments.

[0188] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0189] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0190] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0191] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0192] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. An application stress testing method, It is characterized in that The method comprises: Obtain a target stress testing task; the target stress testing task indicates to perform stress testing on a preset business interface of a target application server; Based on the target stress testing task, a preset number of service requests corresponding to the preset service interface are sent to the target application server to perform stress testing, and stress testing indicator data is obtained; the stress testing indicator data represents the response of the target application server to the preset number of service requests and the machine performance of the target application server in the process of responding to the preset number of service requests; In the case where it is determined based on the stress testing indicator data that the stress testing ratio needs to be adjusted, determining a target stress testing ratio; the stress testing ratio represents an adjustment range of the number of the service requests sent; Based on the target stress testing ratio, the number of business requests sent to the preset business interface of the target application server in the stress test is adjusted until the stress testing end condition is met, and the stress testing result corresponding to the target stress testing task is obtained; the stress testing result represents the number of the business requests sent corresponding to the target stress testing task at the end of the stress testing.

2. The method according to claim 1, It is characterized in that After obtaining the stress testing indicator data, the method further includes: Comparing the first stress test indicator data with the preset response indicator to obtain a first comparison result; the first stress test indicator data represents the response of the target application server to the preset number of business requests; If the first comparison result indicates that the first stress testing indicator data exceeds the preset response indicator, generating first stress testing ratio adjustment information; When the first comparison result indicates that the first stress test indicator data does not exceed the preset response indicator, the second stress test indicator data is compared with the preset machine performance indicator to obtain a second comparison result; the second stress test indicator data represents the machine performance of the target application server in the process of responding to the preset number of business requests; If the second comparison result indicates that the second stress testing indicator data exceeds the preset machine performance indicator, generating the first stress testing ratio adjustment information; The first stress testing ratio adjustment information indicates that the stress testing ratio is to be reduced.

3. The method according to claim 2, It is characterized in that The second stress test indicator data includes network bandwidth usage; the method further includes: When the network bandwidth usage rate does not reach the preset network bandwidth indicator, second stress testing ratio adjustment information is generated; the second stress testing ratio adjustment information indicates to increase the stress testing ratio.

4. The method according to claim 3, It is characterized in that Determining the target stress testing ratio includes: Determine a target adjustment direction based on the first stress testing ratio adjustment information or the second stress testing ratio adjustment information; Obtaining a preset basic adjustment ratio and a preset adjustment step; the preset adjustment step represents the ratio of the number of the service requests sent to be adjusted along the target adjustment direction; the preset basic adjustment ratio is a positive number greater than or equal to 1; The target stress testing ratio is determined based on the preset basic adjustment ratio, the target adjustment direction and the preset adjustment step size.

5. The method according to any one of claims 1 to 4, It is characterized in that After sending a preset number of service requests corresponding to the preset service interface to the target application server based on the target stress testing task to perform stress testing, the method further includes: In response to the process exception information of the target application server, terminating the stress test corresponding to the target stress testing task; the process exception information of the target application server indicates that the target application process is abnormal; Determine the exception type of the exception indicated by the process exception information; When the abnormality type is a non-heartbeat abnormality, obtaining a repair application process corresponding to the target application process; Repairing the target application process based on the repair application process; When it is determined that the target application process is repaired, the stress test corresponding to the target stress testing task is resumed.

6. The method according to claim 5, It is characterized in that The method further comprises: When the abnormality type is a heartbeat abnormality, the stress test corresponding to the target stress testing task is resumed.

7. The method according to claim 6, It is characterized in that Before terminating the stress test corresponding to the target stress testing task in response to the process abnormality information of the target application server, the method further includes: Performing heartbeat detection on each application process in the target application server at a preset time interval to obtain a heartbeat detection result of each application process; In the case where there is a first heartbeat detection result, the process abnormality information is generated based on the application process corresponding to the first heartbeat detection result; the first heartbeat detection result indicates no heartbeat.

8. The method according to claim 5, It is characterized in that After terminating the stress test corresponding to the target stress testing task, the method further includes: Generate target notification information based on the process exception information of the target application server; Based on the target notification information, the process exception information of the target application server is sent to the target receiving end.

9. An application stress testing device, It is characterized in that The device comprises: An acquisition module is used to acquire a target stress test task; the target stress test task indicates to perform stress test on a preset business interface of a target application server; A stress testing module is used to send a preset number of business requests corresponding to the preset business interface to the target application server based on the target stress testing task to perform stress testing, and obtain stress testing indicator data; the stress testing indicator data represents the response of the target application server to the preset number of business requests and the machine performance of the target application server in the process of responding to the preset number of business requests; A determination module, configured to determine a target stress testing ratio when it is determined based on the stress testing indicator data that the stress testing ratio needs to be adjusted; the stress testing ratio represents an adjustment range of the number of the business requests sent; An adjustment module is used to adjust the number of business requests sent to the preset business interface of the target application server in the stress test based on the target stress testing ratio until the stress testing end condition is met, and obtain the stress testing result corresponding to the target stress testing task; the stress testing result is used to indicate whether the target stress testing task is successful.

10. An electronic device, It is characterized in that It comprises a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the application stress testing method according to any one of claims 1 to 8.

11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the application stress testing method according to any one of claims 1 to 8.

12. A computer program product, It is characterized in that The computer program product includes at least one instruction or at least one program segment, and the at least one instruction or the at least one program segment is loaded and executed by a processor to implement the application stress testing method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Model inference server pressure measurement data-oriented filtering method and device

    CN122332371A