Interface pressure testing method and apparatus

By automatically collecting and calculating interface stress test data, the inefficiency and inaccuracy caused by human experience in existing technologies are solved, and efficient and accurate interface stress testing and resource configuration suggestions are achieved.

CN119938432BActive Publication Date: 2025-11-18BEIJING JINGDONG YUANSHENG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311459649.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-03
Publication Date
2025-11-18
Estimated Expiration
2043-11-03

AI Technical Summary

Technical Problem

Existing interface stress testing methods rely on human experience, resulting in low efficiency and poor accuracy, which affects the performance of monitoring systems.

Method used

By automatically collecting peak monitoring data from the monitoring platform and calculating conversion and allocation coefficients, the stress test target can be automatically calculated, improving testing efficiency and accuracy.

Benefits of technology

It improves the efficiency and accuracy of interface stress testing, reduces the load on the monitoring system, enables stress testing at any time, and provides resource configuration suggestions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938432B_ABST
    Figure CN119938432B_ABST
Patent Text Reader

Abstract

The application discloses an interface pressure test method and device, and relates to the technical field of computers. A specific embodiment of the method comprises the following steps: obtaining peak monitoring data of a to-be-tested interface and an associated interface of a working system in a plurality of performance monitoring data in a preset statistical period; determining a conversion coefficient between the working system and a pressure test system according to pressure test resource configuration data and working resource configuration data applied in the pressure test system; determining an allocation coefficient of the to-be-tested interface in application by using the peak monitoring data of the to-be-tested interface and the associated interface in the key index value; determining a pressure test target containing a target value of a performance index according to the peak monitoring data of the to-be-tested interface, the conversion coefficient and the allocation coefficient; and comparing pressure test index data obtained through the pressure test with the pressure test target to obtain a pressure test result of the to-be-tested interface. The embodiment can improve the interface pressure test efficiency and the accuracy of pressure test target calculation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to an interface stress testing method and apparatus. Background Technology

[0002] Interface stress testing simulates the hardware and software environment of real-world applications and the system load during user operation, running test software under prolonged or heavy loads to test the performance, reliability, and stability of the interface under test. Before testing, stress test targets for each performance indicator need to be determined. These targets are then compared with the obtained stress test data after the test to obtain the stress test results. In existing technologies, testers need to manually count the interface call volume during historical periods of high intensity (i.e., periods of high interface call volume) and then determine the stress test targets based on this volume using their experience. This method requires frequent manual queries to the monitoring platform of the interface under test, which is inefficient and increases the load on the monitoring system, impacting its performance. Furthermore, the accuracy of stress test targets determined based on manual experience is low, failing to meet testing requirements. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide an interface stress testing method and apparatus that can automatically collect peak monitoring data from a monitoring platform and then automatically perform conversion calculations of stress test targets, thereby improving the efficiency of interface stress testing and the accuracy of stress test target calculations.

[0004] To achieve the above objectives, according to one aspect of the present invention, an interface stress testing method is provided.

[0005] The interface stress testing method of this invention is executed by a stress testing system that tests a working system. The method includes: acquiring peak monitoring data of the interface under test and associated interfaces of the working system in multiple performance monitoring data in a preset statistical period; wherein the interface under test and the associated interfaces belong to the same application, the performance monitoring data includes the index value of at least one performance indicator and the work resource configuration data of the application, and the peak monitoring data has the optimal index value of a preset key index among the multiple performance monitoring data; determining a conversion coefficient between the working system and the stress testing system based on the stress testing resource configuration data of the application and the work resource configuration data in the stress testing system; determining the allocation coefficient of the interface under test in the application using the index value of the key index of the peak monitoring data of the interface under test and the associated interfaces; determining a stress testing target including the target value of the performance indicator based on the peak monitoring data of the interface under test, the conversion coefficient, and the allocation coefficient; and comparing the stress testing index data obtained after stress testing with the stress testing target to obtain the stress testing result of the interface under test.

[0006] Optionally, the load testing resource configuration data includes: the number and specifications of the load testing servers for the application; the working resource configuration data includes: the number and specifications of the working servers for the application; and the step of determining the conversion coefficient between the working system and the load testing system based on the load testing resource configuration data of the application and the working resource configuration data in the load testing system includes: when the load testing server specifications of the application are the same as the working server specifications, determining the conversion coefficient as the quotient of the number of load testing servers and the number of working servers; when the load testing server specifications of the application are different from the working server specifications, dividing the total number of cores of the load testing servers of the application by the total number of cores of the working servers to obtain the conversion coefficient.

[0007] Optionally, determining the allocation coefficient of the interface under test in the application using the peak monitoring data of the interface under test and the associated interfaces in the indicator value of the key indicator includes: dividing the indicator value of the interface under test in the key indicator by the sum of the indicator values ​​of the interface under test and each associated interface in the key indicator to obtain the allocation coefficient.

[0008] Optionally, determining the stress test target including the target value of the performance indicator based on the peak monitoring data of the interface under test, the conversion coefficient, and the allocation coefficient includes: determining the preset period type in which the peak monitoring data of the interface under test is located, and using the conversion multiple corresponding to the determined period type as the target multiple; calculating the sum of the indicator values ​​of the peak monitoring data of the interface under test and the associated interface in the key indicator, and obtaining the total stress value based on the sum of the indicator values; and determining the target value of the key indicator as the product of the total stress value and the conversion coefficient, the allocation coefficient, and the target multiple.

[0009] Optionally, determining the stress test target including the target value of the performance index based on the peak monitoring data of the interface under test, the conversion coefficient, and the allocation coefficient further includes: for any other performance index besides the key index, obtaining the target value of the other index based on the index value of the other index in the peak monitoring data of the interface under test.

[0010] Optionally, the stress test index data includes: the index values ​​of the interface under test of the stress test system in the performance index, the performance index including the interface throughput and the resource utilization of the application as key indicators; and the method further includes: determining the changing trend of the interface under test in the interface throughput and the resource utilization based on the stress test index data of the interface under test in different statistical periods; issuing a prompt to increase the resource scale when the changing trend of the interface throughput and the resource utilization is increasing; issuing a prompt to maintain the resource scale when the changing trend of the interface throughput and the resource utilization is unchanged; and issuing a prompt to decrease the resource scale when the changing trend of the interface throughput and the resource utilization is decreasing.

[0011] Optionally, the optimal indicator value is the maximum indicator value, and the performance indicator further includes: response time; the resource utilization rate includes: CPU utilization rate, memory utilization rate and cache hit rate; the performance monitoring data of the interface under test further includes the identifier of the interface under test, the identifier of the application and at least one of the following: the interface caller identifier and the type of the working server.

[0012] To achieve the above objectives, according to another aspect of the present invention, an interface stress testing apparatus is provided.

[0013] The interface stress testing device of this invention is installed in a stress testing system for testing a working system. The device includes: a data synchronization unit, used to acquire peak monitoring data of the interface under test and associated interfaces of the working system from multiple performance monitoring data over a preset statistical period; wherein the interface under test and the associated interfaces belong to the same application, the performance monitoring data includes the index value of at least one performance indicator and the work resource configuration data of the application, and the peak monitoring data has the optimal index value of a preset key indicator among the multiple performance monitoring data; a coefficient calculation unit, used to determine the conversion coefficient between the working system and the stress testing system based on the stress testing resource configuration data of the application and the work resource configuration data in the stress testing system; and to determine the allocation coefficient of the interface under test in the application using the index value of the key indicator based on the peak monitoring data of the interface under test and the associated interfaces; and a test target estimation unit, used to determine a stress test target including the target value of the performance indicator based on the peak monitoring data of the interface under test, the conversion coefficient, and the allocation coefficient, and to compare the stress testing index data obtained after stress testing with the stress test target to obtain the stress test result of the interface under test.

[0014] To achieve the above objectives, according to another aspect of the present invention, an electronic device is provided.

[0015] An electronic device according to the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the interface stress testing method provided by the present invention.

[0016] To achieve the above objectives, according to another aspect of the present invention, a computer-readable storage medium is provided.

[0017] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the interface stress testing method provided by the present invention.

[0018] According to the technical solution of the present invention, the embodiments described above have the following advantages or beneficial effects:

[0019] The stress testing system first automatically acquires peak monitoring data from multiple performance monitoring data points of the interface under test and related interfaces of the working system within a preset statistical period from the monitoring platform. Then, based on the stress testing resource configuration data and working resource configuration data of the application to which the interface under test belongs, it determines the conversion coefficient between the working system and the stress testing system. Furthermore, it uses the peak monitoring data of the interface under test and related interfaces to determine the allocation coefficient of the interface under test within the aforementioned applications, based on the index values ​​of key indicators. Subsequently, the stress testing system determines the stress test target, which includes the target values ​​of each performance index, based on the peak monitoring data of the interface under test, the aforementioned conversion coefficient, and the allocation coefficient. After the test is completed, the stress test index data obtained through the stress test is compared with the stress test target to obtain the stress test result of the interface under test. In this way, by periodically and automatically collecting monitoring data and automatically calculating the stress test target, the efficiency of interface stress testing and the accuracy of stress test target calculation are improved, without affecting the performance of the monitoring platform. This invention does not rely on peak monitoring data during periods of high intensity to calculate stress test targets. Instead, it calculates stress test targets based on peak monitoring data from any period (including routine work periods) by using conversion coefficients between the working system and the stress test system, conversion factors between the peak monitoring data period and the stress test environment, and allocation coefficients for the interface under test in the application. This broadens the data sources for stress testing and improves stress test effectiveness through diversified data sources. Furthermore, this invention can analyze the changing trends of stress test indicators across different statistical periods and provide adjustment suggestions for the current resource scale based on the analysis results, thereby improving the rationality of resource allocation in the working system.

[0020] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0021] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0022] Figure 1 This is a schematic diagram of the main steps of the interface stress testing method in this embodiment of the invention;

[0023] Figure 2 This is a schematic diagram of the overall process of the interface stress testing method in this embodiment of the invention;

[0024] Figure 3 This is a schematic diagram of the data synchronization process according to an embodiment of the present invention;

[0025] Figure 4 This is a schematic diagram of the components of the interface stress testing device in an embodiment of the present invention;

[0026] Figure 5 This is an exemplary system architecture diagram that can be applied thereto according to embodiments of the present invention;

[0027] Figure 6 This is a schematic diagram of the electronic device structure used to implement the interface stress testing method in the embodiments of the present invention. Detailed Implementation

[0028] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0029] It should be noted that, unless otherwise specified, the embodiments of the present invention and the technical features thereof can be combined with each other.

[0030] Figure 1 This is a schematic diagram of the main steps of the interface stress testing method according to an embodiment of the present invention.

[0031] like Figure 1 As shown, the interface stress testing method of this embodiment of the invention is executed by a stress testing system, which is used to perform stress testing on the working system. In this embodiment, the working system is an application system running in a working environment of actual business scenarios, while the stress testing system is isolated from the working system and is a test system running in a stress testing environment, not participating in actual business scenarios. The interface stress testing method of this embodiment of the invention can be specifically executed according to the following steps:

[0032] Step S101: Obtain the peak monitoring data of the interface under test and associated interfaces of the working system in multiple performance monitoring data in a preset statistical period.

[0033] In practical applications, a working system typically consists of multiple applications, each with at least one interface. A stress testing system can test any of these interfaces. For any interface under test, its associated interfaces refer to other interfaces belonging to the same application. In this embodiment of the invention, the stress testing system can obtain peak monitoring data from multiple performance monitoring data points within a preset statistical period from a pre-set monitoring platform.

[0034] The performance monitoring data mentioned above refers to the performance metrics of the working system monitored by the monitoring platform within the current monitoring period (e.g., the past minute). This data can be obtained by filtering the raw monitoring data output by the monitoring platform. In addition to performance monitoring data, the raw monitoring data may also include server IP information, data center information, etc.

[0035] Performance monitoring data may include the identifier of the interface under test, the identifier of the application to which the interface under test belongs, the value of at least one performance metric, and the resource configuration data of the application to which the stress testing system belongs. These performance metrics may include key metrics, response time metrics, and resource utilization metrics. Among these, the key metric, being the most important stress testing metric, can be interface throughput, i.e., TPS (Transactions per Second). The response time metric can be a statistical value of response time, such as TP99 (the response time at the 99th percentile of multiple requests sorted from smallest to largest). Resource utilization includes: CPU utilization, memory utilization, cache hit rate, etc. The resource configuration data may include the number and specifications of the servers (hereinafter referred to as working servers) of the application to which the interface under test belongs in the working system. Similarly, the stress testing resource configuration data, which will be described later, may include the number and specifications of the application's stress testing servers (i.e., the servers of the application to which the interface under test belongs in the stress testing system). For example, specifications refer to the server's configuration information in terms of central processing unit (CPU), memory, hard disk, etc. For instance, a server's specifications include 8 CPU cores and 16GB of memory. In specific applications, performance monitoring data may also include the interface caller identifier and the type of worker server (e.g., whether the worker server is used as an application server, cache, or database).

[0036] Peak monitoring data represents the optimal value of a preset key performance indicator among the multiple performance monitoring data points mentioned above, such as the maximum value for the interface throughput indicator. In other words, peak monitoring data represents the peak performance within the overall performance monitoring data. The preset statistical period can be a preset duration, the closest time period to the current moment (i.e., the moment the stress test target is calculated or the moment the stress test begins), such as the most recent month.

[0037] In practical applications, raw monitoring data collected by at least one monitoring platform can be periodically stored on an offline data platform. This raw monitoring data can be filtered through scheduled tasks to generate performance monitoring data. This performance monitoring data can be categorized and stored in multiple databases or tables. For example, it can be categorized and stored as key performance indicators, other performance indicators (excluding key indicators), and work resource configuration data, thereby reducing database pressure caused by subsequent query operations. This automatic monitoring data collection method improves the efficiency of interface stress testing, and because it eliminates frequent manual queries, it does not affect the performance of the monitoring platform.

[0038] Step S102: Determine the conversion coefficient between the working system and the stress testing system based on the stress test resource configuration data and working resource configuration data used in the stress test system; determine the allocation coefficient of the interface under test in the application using the peak monitoring data of the interface under test and associated interfaces and the index values ​​of key indicators.

[0039] Because the working system and the stress testing system have different server resources, the metric values ​​in the peak monitoring data of the working system cannot be directly used as the stress testing target. Furthermore, the total call volume for application-level stress testing (hereinafter referred to as the total stress value) needs to be allocated to multiple interfaces of the same application according to a certain ratio; therefore, the allocation coefficient for each interface needs to be determined in advance. In this step, the stress testing system can determine the above conversion coefficients based on the stress testing resource configuration data and working resource configuration data of the application within the stress testing system, and use the peak monitoring data of the interface under test and related interfaces to determine the allocation coefficient of the interface under test in the application based on the metric values ​​of key indicators.

[0040] Specifically, when the application's load testing server specifications are the same as the working server specifications, the load testing system determines the conversion factor as the quotient of the number of application load testing servers and the number of working servers. When the application's load testing server specifications are different from the working server specifications, the load testing system divides the total number of cores on the application load testing servers by the total number of cores on the working servers to obtain the conversion factor. The load testing system can also divide the key performance indicator (KPI) value of the interface under test by the sum of the KPI values ​​of the interface under test and all related interfaces to obtain the allocation factor.

[0041] In real-world scenarios, stress testing requires applying heavy loads to the interface under test, such as issuing a large number of call requests to test its reliability. However, the previously acquired peak monitoring data may be from different time periods and does not exhibit the characteristics of such heavy loads. For example, the peak monitoring data collection time could fall within a low-pressure daily work period, a high-pressure first-intensity period, or a high-pressure second-intensity period. Since the daily work period, the first-intensity period, and the second-intensity period all fall into these time periods, a conversion factor (which can be greater than 1) can be preset for each time period. For instance, the conversion factor for the daily work period could be 5, the first-intensity period 1.5, and the second-intensity period 1.1. The stress testing system can determine the preset time period in which the peak monitoring data of the interface under test falls and use the conversion factor corresponding to that time period as the target factor. This allows for the conversion between the peak monitoring data collection date and the stress testing environment. Setting a conversion factor greater than 1 ensures that the stress values ​​during the stress test cover the extreme stress values ​​that the working environment might encounter.

[0042] Step S103: Determine the stress test target, which includes the target value of the performance index, based on the peak monitoring data, conversion coefficient, and allocation coefficient of the interface under test. Compare the stress test index data obtained after stress test with the stress test target to obtain the stress test result of the interface under test.

[0043] In this step, the stress testing system can perform the following steps to obtain the stress testing target. Specifically, the stress testing system first calculates the sum of the peak monitoring data of the interface under test and each associated interface at the key indicator values. The sum of these indicator values ​​is then adjusted (may be slightly adjusted) to obtain the total stress value. Subsequently, the product of the total stress value and the conversion coefficient, allocation coefficient, and target multiple is determined as the target value of the key indicator in the stress testing target. It can be understood that the above total stress value is set based on the sum of the peak call volumes of the interface under test and each associated interface, representing the peak call volume of the working system in the application dimension during the data collection period. The conversion coefficient represents the resource configuration conversion between the working system and the stress testing system, the target multiple represents the conversion between the data collection period and the stress testing requirements, and the allocation coefficient represents the allocation share of the interface under test in its application. Multiplying the total stress value by the conversion coefficient, allocation coefficient, and target multiple converts the total stress value into the throughput requirement of the interface under test corresponding to the stress testing server resources in the stress testing environment, i.e., the target value of the interface throughput indicator in the stress testing target of the interface under test.

[0044] Since response time and resource utilization metrics remain relatively stable despite changes in call volume, they can be adjusted based on the corresponding metric values ​​in the peak monitoring data to obtain the target values ​​for these metrics in the stress test objective. That is, for any performance metric other than the critical metric, the stress testing system obtains the target value of that metric based on the metric value in the peak monitoring data of the interface under test. In this way, the target value for each performance metric in the stress test objective can be obtained. Subsequently, the stress testing system can compare the stress test metric data obtained after stress testing with the stress test objective to obtain the stress test results for the interface under test. Specifically, the stress test metric data includes the metric values ​​of the interface under test obtained by the stress testing system in the above performance metrics. By comparing the stress test metric data with the stress test objective, it can be determined whether the interface under test meets the requirements for each performance metric, and then the stress test result is obtained through a comprehensive judgment of multiple performance metrics.

[0045] By automatically calculating stress test targets, this invention improves the efficiency and accuracy of interface stress testing. Furthermore, this invention does not rely on peak monitoring data during periods of high intensity to calculate stress test targets. Instead, it calculates stress test targets based on peak monitoring data from any period (including routine work periods) by using conversion coefficients between the working system and the stress testing system, conversion factors between the peak monitoring data period and the stress testing environment, and allocation coefficients for the interface under test in the application. This broadens the data sources for stress testing and improves stress testing effectiveness through diversified data sources.

[0046] In one embodiment, after obtaining the above stress test metrics data, the stress test system can also detect whether the interface call volume of the interface under test matches the current resource scale based on the stress test metrics data of different statistical periods. Specifically, the stress test system can determine the changing trends of the interface throughput and resource utilization metrics of the interface under test in different statistical periods based on the stress test metrics data of the interface under test in different statistical periods. These changing trends can be calculated using known algorithms based on differentiation. If the changing trend is upward, it indicates that the business volume is in an upward phase, and the stress test system can issue a prompt to relevant personnel to increase the resource scale; if the changing trend is unchanged, it indicates that the business volume is stable, and the stress test system can issue a prompt to relevant personnel to maintain the resource scale or not issue a prompt; if the changing trend is downward, it indicates that the business volume is in a downward phase, and the stress test system can issue a prompt to relevant personnel to reduce the resource scale, thereby improving the rationality of resource allocation of the work system.

[0047] The following describes a specific embodiment of the present invention; see [link to specific embodiment]. Figure 2 and Figure 3 .

[0048] A stress testing system can include a data synchronization end, a computing end, and an execution end. The data synchronization end collects monitoring data from the monitoring end. The monitoring end monitors the working system and stores the collected raw monitoring data in the monitoring aggregation end. The monitoring aggregation end periodically pushes the raw monitoring data to the offline data platform of the data synchronization end. After intelligent filtering and classification, this data in the offline data platform forms performance monitoring data stored in multiple databases or database tables. The computing end calculates the stress test target based on the input stress test resource configuration data and the peak monitoring data read from the database. The execution end executes the stress test on the interface under test and compares the obtained stress test index data with the stress test target to obtain the final stress test result. On the other hand, the execution end can also calculate the changing trends of interface throughput and resource utilization index values ​​in different statistical periods, and then issue corresponding reminders for resource scale adjustments.

[0049] This invention improves stress testing efficiency by automatically collecting monitoring data and automatically estimating stress test targets. It maintains stable monitoring platform performance by reducing the number of calls to the monitoring platform interface (performance monitoring data can be collected from an offline table that periodically collects monitoring platform data). Furthermore, this invention does not rely on peak monitoring data during periods of high intensity to calculate stress test targets. Instead, it calculates stress test targets based on peak monitoring data from any period (including daily work periods) by calculating conversion factors between the working system and the stress test system, conversion multiples between the peak monitoring data period type and the stress test environment, and allocation factors for the interface under test in the application. This broadens the data sources for stress testing and improves stress test effectiveness through diversified data sources. In addition, this invention can automatically monitor the impact of call volume changes on interfaces and system resources, conduct timely performance testing on interfaces, and report interface performance issues to relevant personnel at appropriate times. This allows for precise adjustments to online resources, ensuring the stability of the online system and reducing system resource waste.

[0050] It should be noted that the technical solutions of this invention, including the collection, updating, analysis, processing, use, transmission, and storage of user personal information, all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.

[0051] For the foregoing method embodiments, they are described as a series of actions for ease of description. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, and some steps may actually be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential for implementing the present invention.

[0052] To facilitate better implementation of the above-described solutions of the embodiments of the present invention, related apparatus for implementing the above-described solutions is also provided below.

[0053] Please see Figure 4 As shown, the interface stress testing device 400 provided in this embodiment of the invention is set in a stress testing system for testing a working system, and may include: a data synchronization unit 401, a coefficient calculation unit 402, and a test target estimation unit 403.

[0054] The data synchronization unit 401 can be used to acquire peak monitoring data of the interface under test and associated interfaces of the working system in multiple performance monitoring data in a preset statistical period; wherein the interface under test and the associated interface belong to the same application, the performance monitoring data includes the index value of at least one performance indicator and the working resource configuration data of the application, and the peak monitoring data has the optimal index value of the preset key index among the multiple performance monitoring data; the coefficient calculation unit 402 can be used to determine the conversion coefficient between the working system and the stress testing system based on the stress testing resource configuration data of the application and the working resource configuration data in the stress testing system; and use the peak monitoring data of the interface under test and the associated interface to determine the allocation coefficient of the interface under test in the application based on the index value of the key index; the test target estimation unit 403 can be used to determine the stress test target including the target value of the performance index based on the peak monitoring data of the interface under test, the conversion coefficient and the allocation coefficient, and compare the stress testing index data obtained after stress testing with the stress test target to obtain the stress test result of the interface under test.

[0055] In this embodiment of the invention, the load testing resource configuration data includes: the number and specifications of the load testing servers for the application; the working resource configuration data includes: the number and specifications of the working servers for the application; and the coefficient calculation unit 402 can be further configured to: when the load testing server specifications of the application are the same as the working server specifications, determine the quotient of the number of load testing servers and the number of working servers as the conversion coefficient; when the load testing server specifications of the application are different from the working server specifications, divide the total number of cores of the load testing servers of the application by the total number of cores of the working servers to obtain the conversion coefficient.

[0056] In a specific application, the coefficient calculation unit 402 can be further used to: divide the index value of the interface under test in the key indicator by the sum of the index values ​​of the interface under test and each associated interface in the key indicator to obtain the allocation coefficient.

[0057] In practical applications, the test target estimation unit 403 can be further used to: determine the preset period type in which the peak monitoring data of the interface under test is located, and use the conversion multiple corresponding to the determined period type as the target multiple; calculate the sum of the index values ​​of the peak monitoring data of the interface under test and the associated interface in the key indicator, and obtain the total pressure value based on the sum of the index values; and determine the target value of the key indicator by multiplying the total pressure value by the conversion coefficient, the allocation coefficient and the target multiple.

[0058] Preferably, the test target estimation unit 403 can be further used to: for any other performance indicator besides the key indicator, obtain the target value of the other indicator based on the indicator value of the peak monitoring data of the interface under test.

[0059] As a preferred embodiment, the stress test index data includes: the index values ​​of the interface under test of the stress test system in the performance index, wherein the performance index includes the interface throughput and the resource utilization rate of the application as key indicators; and the test target estimation unit 403 can be further configured to: determine the changing trend of the interface under test in the interface throughput and the resource utilization rate based on the stress test index data of the interface under test in different statistical periods; issue a prompt to increase the resource scale when the changing trend of the interface throughput and the resource utilization rate is increasing; issue a prompt to maintain the resource scale when the changing trend of the interface throughput and the resource utilization rate is unchanged; and issue a prompt to decrease the resource scale when the changing trend of the interface throughput and the resource utilization rate is decreasing.

[0060] Furthermore, in this embodiment of the invention, the optimal indicator value is the maximum indicator value, and the performance indicator further includes: response time; the resource utilization rate includes: CPU utilization rate, memory utilization rate and cache hit rate; the performance monitoring data of the interface under test further includes the identifier of the interface under test, the identifier of the application and at least one of the following: the interface caller identifier and the type of the working server.

[0061] According to the technical solution of this invention, the stress testing system automatically acquires and categorizes monitoring data to monitor the daily performance and resource utilization of each interface in real time. Through automated stress test target estimation, it can obtain relatively accurate stress test targets based on a comparison between the working environment and the stress testing environment to complete the stress test. The stress testing system can also analyze the changing trends of stress test indicator data over multiple statistical periods, and then provide optimization suggestions for system resources, thereby improving the rationality of system resource allocation.

[0062] Figure 5 An exemplary system architecture 500 is shown that can be applied to the interface stress testing method or interface stress testing apparatus of the present invention.

[0063] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, and 503, network 504, and server 505 (this architecture is merely an example; the components included in a specific architecture may be adjusted according to the specific circumstances of the invention). Network 504 serves as the medium for providing a communication link between terminal devices 501, 502, and 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0064] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various client applications, such as stress testing applications (for example only), can be installed on terminal devices 501, 502, and 503.

[0065] Terminal devices 501, 502, and 503 can be various electronic devices with displays that support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0066] Server 505 can be a server that provides various services, such as a backend server (for example only) that supports the stress testing application operated by the user using terminal devices 501, 502, and 503. The backend server can process the received stress testing requests and feed back the processing results (such as stress test results - for example only) to terminal devices 501, 502, and 503.

[0067] It should be noted that the interface stress testing method provided in this embodiment of the invention is generally executed by server 505, and correspondingly, the interface stress testing device is generally set in server 505.

[0068] It should be understood that Figure 5The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0069] The present invention also provides an electronic device. The electronic device according to an embodiment of the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the interface stress testing method provided by the present invention.

[0070] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 600 suitable for implementing an electronic device according to embodiments of the present invention. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0071] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the computer system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0072] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 606 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0073] In particular, according to the embodiments disclosed in this invention, the processes described in the above main step diagrams can be implemented as computer software programs. For example, embodiments of this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the main step diagrams. In the above embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit 601, it performs the functions defined in the system of this invention.

[0074] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0075] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0076] The units described in the embodiments of the present invention can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including a data synchronization unit, a coefficient calculation unit, and a test target prediction unit. The names of these units do not necessarily limit the specific unit; for example, the data synchronization unit may also be described as "a unit that provides peak monitoring data to the coefficient calculation unit."

[0077] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist alone and not assembled into the device. The aforementioned computer-readable medium carries one or more programs. When the device executes the one or more programs, the steps performed by the device include: acquiring peak monitoring data of the interface under test and associated interfaces of the working system in multiple performance monitoring data in a preset statistical period; wherein the interface under test and the associated interfaces belong to the same application, the performance monitoring data includes the index value of at least one performance indicator and the working resource configuration data of the application, and the peak monitoring data has the optimal index value of a preset key indicator among the multiple performance monitoring data; determining the conversion coefficient between the working system and the stress testing system based on the stress testing resource configuration data of the application in the stress testing system and the working resource configuration data; determining the allocation coefficient of the interface under test in the application using the index value of the key indicator based on the peak monitoring data of the interface under test and the associated interfaces; determining a stress testing target including the target value of the performance indicator based on the peak monitoring data of the interface under test, the conversion coefficient, and the allocation coefficient; and comparing the stress testing index data obtained after stress testing with the stress testing target to obtain the stress testing result of the interface under test.

[0078] In the technical solution of this invention embodiment, the stress testing system first automatically acquires peak monitoring data from multiple performance monitoring data points of the interface under test and associated interfaces of the working system within a preset statistical period from the monitoring platform. Then, based on the stress testing resource configuration data and working resource configuration data of the application to which the interface under test belongs, the stress testing system determines the conversion coefficient between the working system and the stress testing system. Furthermore, it uses the peak monitoring data of the interface under test and associated interfaces to determine the allocation coefficient of the interface under test within the aforementioned applications, based on the index values ​​of key indicators. Subsequently, the stress testing system determines a stress testing target containing the target values ​​of each performance indicator based on the peak monitoring data of the interface under test, the conversion coefficient, and the allocation coefficient. After the test is completed, the stress testing index data obtained through the stress test is compared with the stress testing target to obtain the stress test result of the interface under test. In this way, by periodically and automatically collecting monitoring data and automatically calculating the stress testing target, the efficiency of interface stress testing and the accuracy of stress testing target calculation are improved, without affecting the performance of the monitoring platform. This invention does not rely on peak monitoring data during periods of high intensity to calculate stress test targets. Instead, it calculates stress test targets based on peak monitoring data from any period by using conversion factors between the working system and the stress test system, conversion multiples between the peak monitoring data period and the stress test environment, and allocation factors for the interface under test in the application. This broadens the data sources for stress testing and improves stress test effectiveness through diversified data sources. Furthermore, this invention can analyze the changing trends of stress test indicators across different statistical periods and provide adjustment suggestions based on the analysis results, thereby improving the rationality of resource allocation in the working system.

[0079] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. An interface stress testing method, characterized in that, The method is performed by a stress testing system that tests the working system; the method includes: Obtain the peak monitoring data of the interface under test and associated interfaces of the working system from multiple performance monitoring data points in a preset statistical period; wherein, The interface under test and the associated interface belong to the same application. The performance monitoring data includes the index value of at least one performance indicator and the working resource configuration data of the application. The peak monitoring data has the optimal index value of the preset key index among the multiple performance monitoring data. The conversion coefficient between the working system and the stress testing system is determined based on the stress testing resource configuration data of the application and the working resource configuration data in the stress testing system; the allocation coefficient of the interface under test in the application is determined using the peak monitoring data of the interface under test and the associated interface and the index value of the key indicator. Based on the peak monitoring data of the interface under test, the conversion coefficient, and the allocation coefficient, a stress test target containing the target value of the performance index is determined. The stress test index data obtained after stress testing is compared with the stress test target to obtain the stress test result of the interface under test.

2. The method according to claim 1, characterized in that, The load testing resource configuration data includes: the number and specifications of the load testing servers for the application; the working resource configuration data includes: the number and specifications of the working servers for the application; and the step of determining the conversion coefficient between the working system and the load testing system based on the load testing resource configuration data of the application and the working resource configuration data in the load testing system includes: When the specifications of the load testing server and the working server are the same, the quotient of the number of load testing servers and the number of working servers is determined as the conversion coefficient. When the specifications of the load testing server for the application differ from those of the working server, the conversion coefficient is obtained by dividing the total number of cores on the load testing server for the application by the total number of cores on the working server.

3. The method according to claim 1, characterized in that, The step of determining the allocation coefficient of the interface under test in the application using the peak monitoring data of the interface under test and the associated interface based on the index value of the key indicator includes: The allocation coefficient is obtained by dividing the index value of the interface under test in the key indicator by the sum of the index values ​​of the interface under test and each associated interface in the key indicator.

4. The method according to claim 1, characterized in that, The stress test target, which includes the target value of the performance index, is determined based on the peak monitoring data of the interface under test, the conversion coefficient, and the allocation coefficient, including: Determine the preset period type in which the peak monitoring data of the interface under test belongs, and use the conversion multiple corresponding to the determined period type as the target multiple; Calculate the sum of the peak monitoring data of the interface under test and the associated interface at the key indicator values, and obtain the total pressure value based on the sum of the indicator values; The target value of the key indicator is determined by multiplying the total pressure value by the conversion coefficient, the allocation coefficient, and the target multiple.

5. The method according to claim 1, characterized in that, The step of determining the stress test target, which includes the target value of the performance index, based on the peak monitoring data of the interface under test, the conversion coefficient, and the allocation coefficient, further includes: For any performance metric other than the key metric, the target value of the other metric is obtained based on the metric value of the peak monitoring data of the interface under test.

6. The method according to claim 1, characterized in that, The stress test performance data includes: the performance index values ​​of the interface under test of the stress test system, wherein the performance index includes interface throughput and resource utilization of the application as key indicators; and the method further includes: The trend of the interface throughput and resource utilization of the interface under test is determined based on the stress test index data of the interface under test in different statistical periods. If the interface throughput and resource utilization rate show an upward trend, a prompt to increase the resource scale will be issued; If the trends of the interface throughput and the resource utilization remain unchanged, a prompt to maintain the resource scale will be issued; If the interface throughput and resource utilization show a downward trend, a prompt to reduce the resource scale will be issued.

7. The method according to claim 6, characterized in that, The optimal indicator value is the maximum indicator value, and the performance indicator further includes: response time; The resource utilization rate includes: CPU utilization rate, memory utilization rate, and cache hit rate; The performance monitoring data of the interface under test further includes the identifier of the interface under test, the identifier of the application, and at least one of the following: the identifier of the interface caller and the type of the working server.

8. An interface stress testing device, characterized in that, A stress testing system installed to test a working system; the device includes: A data synchronization unit is used to acquire peak monitoring data of the interface under test and the associated interface of the working system in multiple performance monitoring data in a preset statistical period; wherein the interface under test and the associated interface belong to the same application, the performance monitoring data includes the index value of at least one performance indicator and the working resource configuration data of the application, and the peak monitoring data has the optimal index value of the preset key index among the multiple performance monitoring data. The coefficient calculation unit is used to determine the conversion coefficient between the working system and the stress testing system based on the stress test resource configuration data and the working resource configuration data of the application in the stress test system; and to determine the allocation coefficient of the interface under test in the application using the peak monitoring data of the interface under test and the associated interface in the index value of the key indicator. The test target estimation unit is used to determine the stress test target containing the target value of the performance index based on the peak monitoring data of the interface under test, the conversion coefficient and the allocation coefficient, and compare the stress test index data obtained after stress test with the stress test target to obtain the stress test result of the interface under test.

9. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Interface testing method and equipment

    CN109491894A

  • Pressure measurement method and device, electronic equipment and storage medium

    CN113127356A