Interface pressure testing method and device

By automatically collecting peak monitoring data of the monitoring platform and calculating conversion coefficients and allocation coefficients, the automated target calculation of interface stress testing is realized, solving the problems of low manual statistics and poor accuracy in the existing technology, and improving the testing efficiency and accuracy.

CN119938432AActive Publication Date: 2025-05-06BEIJING JINGDONG YUANSHENG TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, interface stress testing requires manual frequent query of monitoring platforms, which is low efficiency and affects the performance of monitoring systems. The standard accuracy of stress testing based on manual experience is low and cannot meet the testing needs.

Method used

By automatically collecting peak monitoring data from the monitoring platform, calculating conversion coefficients and allocation coefficients, and automatically performing conversion calculations of stress test targets to improve interface stress test efficiency and accuracy.

Benefits of technology

It improves the efficiency of interface pressure test and the accuracy of stress test target calculation, does not affect the performance of the monitoring platform, and broadens the data source of stress tests and improves the test effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938432A_ABST
    Figure CN119938432A_ABST
Patent Text Reader

Abstract

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

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an interface pressure testing method and device. Background Art

[0002] The interface stress test simulates the hardware and software environment of the actual application and the system load during user use, and runs the test software for a long time or under heavy load to test the performance, reliability and stability of the interface to be tested. Before the test, it is necessary to first determine the stress test target for each performance indicator, which is used to compare with the stress test indicator data obtained after the test is completed to obtain the stress test result. In the prior art, testers are required to manually count the interface call volume during the historical intensity period (i.e., the period with a large interface call volume), and then determine the stress test target based on this call volume according to manual experience. The above method requires manual frequent query of the monitoring platform of the interface to be tested, which is inefficient and causes an increase in the load of the monitoring system, affecting the performance of the monitoring system. The accuracy of the stress test target determined based on manual experience is low and cannot meet the test requirements. Summary of the invention

[0003] In view of this, an embodiment of the present invention provides an interface pressure testing method and device, which can automatically collect peak monitoring data of a monitoring platform and then automatically perform conversion calculations of pressure testing targets, thereby improving the efficiency of interface pressure testing and the accuracy of pressure testing target calculations.

[0004] To achieve the above objective, according to one aspect of the present invention, a method for testing interface pressure is provided.

[0005] The interface stress testing method of the embodiment of the present invention is executed by a stress testing system that tests a working system; the method includes: obtaining peak monitoring data of a test interface and an associated interface of the working system in a plurality of performance monitoring data in a preset statistical period; wherein the test interface and the associated interface belong to the same application, the performance monitoring data include an indicator value of at least one performance indicator and working resource configuration data of the application, and the peak monitoring data has an optimal indicator value of a preset key indicator in the performance indicator in the plurality of performance monitoring data; determining a conversion coefficient between the working system and the stress testing system according to the stress testing resource configuration data and the working resource configuration data of the application in the stress testing system; determining a distribution coefficient of the test interface in the application using the peak monitoring data of the test interface and the associated interface at the indicator value of the key indicator; determining a stress testing target including a target value of the performance indicator according to the peak monitoring data of the test interface, the conversion coefficient and the distribution coefficient, and comparing the stress testing indicator data obtained through the stress testing with the stress testing target to obtain a stress testing result of the test interface.

[0006] Optionally, the stress testing resource configuration data includes: the number and specifications of the stress testing servers of the application, and the working resource configuration data includes: the number and specifications of the working servers of the application; and 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 in the stress testing system and the working resource configuration data, including: when the specification of the stress testing server of the application is the same as the specification of the working server, the quotient of the number of stress testing servers of the application and the number of working servers is determined as the conversion coefficient; when the specification of the stress testing server of the application is different from the specification of the working server, the total number of cores of the stress testing server of the application is divided by the total number of cores of the working server to obtain the conversion coefficient.

[0007] Optionally, the allocation coefficient of the interface to be tested in the application is determined by utilizing the index value of the key indicator of the peak monitoring data of the interface to be tested and the associated interfaces, including: dividing the index value of the interface to be tested in the key indicator by the sum of the index values ​​of the interface to be tested and each associated interface in the key indicator to obtain the allocation coefficient.

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

[0009] Optionally, the stress test target including the target value of the performance indicator is determined based on the peak monitoring data of the interface to be tested, the conversion coefficient and the allocation coefficient, further including: for any other indicator among the performance indicators except the key indicator, the target value of the other indicator is obtained based on the indicator value of the other indicator in the peak monitoring data of the interface to be tested.

[0010] Optionally, the stress testing indicator data includes: the indicator value of the interface to be tested of the stress testing system in the performance indicator, and the performance indicator includes the interface throughput and the resource utilization of the application as the key indicators; and the method further includes: determining the change trend of the interface throughput and the resource utilization of the interface to be tested according to the stress testing indicator data of the interface to be tested in different statistical periods; when the change trend of the interface throughput and the resource utilization is increasing, issuing a prompt to increase the resource scale; when the change trend of the interface throughput and the resource utilization is unchanged, issuing a prompt to maintain the resource scale; when the change trend of the interface throughput and the resource utilization is decreasing, issuing a prompt to reduce the resource scale.

[0011] Optionally, the optimal index value is the maximum index value, and the performance index further includes: response time; the resource utilization includes: central processing unit CPU utilization, memory utilization and cache hit rate; the performance monitoring data of the interface to be tested further includes the identification of the interface to be tested, the identification of the application and at least one of the following data: interface caller identification, the category of the working server.

[0012] To achieve the above objective, according to another aspect of the present invention, an interface pressure testing device is provided.

[0013] The interface stress testing device of the embodiment of the present invention is arranged in a stress testing system for testing a working system; the device comprises: a data synchronization unit, used to obtain peak monitoring data of a test interface and an associated interface of the working system in a plurality of performance monitoring data in a preset statistical period; wherein the test interface and the associated interface belong to the same application, the performance monitoring data comprises an indicator value of at least one performance indicator and working resource configuration data of the application, and the peak monitoring data has an optimal indicator value of a preset key indicator in the performance indicator in the plurality of performance monitoring data; a coefficient calculation unit, used to determine a conversion coefficient between the working system and the stress testing system according to the stress testing resource configuration data and the working resource configuration data of the application in the stress testing system; and to determine a distribution coefficient of the test interface in the application using the peak monitoring data of the test interface and the associated interface at the indicator value of the key indicator; and a test target estimation unit, used to determine a stress testing target including a target value of the performance indicator according to the peak monitoring data of the test interface, the conversion coefficient and the distribution coefficient, and to compare the stress testing indicator data obtained through the stress test with the stress testing target to obtain a stress testing result of the test interface.

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

[0015] An electronic device of the present invention includes: one or more processors; a 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 interface stress testing method provided by the present invention.

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

[0017] A computer-readable storage medium of the present invention stores a computer program, which implements the interface pressure testing method provided by the present invention when executed by a processor.

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

[0019] The stress testing system first automatically obtains the peak monitoring data of the interface to be tested and the associated interface of the working system in multiple performance monitoring data of the preset statistical period from the monitoring platform, and then determines the conversion coefficient between the working system and the stress testing system according to the stress testing resource configuration data and the working resource configuration data of the application to which the interface to be tested belongs in the stress testing system, and uses the peak monitoring data of the interface to be tested and the associated interface in the index value of the key index to determine the allocation coefficient of the interface to be tested in the above application. Thereafter, the stress testing system determines the stress testing target including the target value of each performance index according to the peak monitoring data of the interface to be tested, the above 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 to be tested. In this way, the efficiency of interface stress testing and the accuracy of stress testing target calculation are improved by periodically automatically collecting monitoring data and automatically calculating stress testing targets, while not affecting the performance of the monitoring platform. The embodiment of the present invention does not rely on the peak monitoring data of the intensity period to calculate the stress test target. By calculating the conversion coefficient between the working system and the stress test system, the conversion multiple calculation between the period type of the peak monitoring data and the stress test environment, and the distribution coefficient calculation of the interface to be tested in the application, the stress test target can be calculated based on the peak monitoring data of any period (including the daily working period), thereby broadening the data source of the stress test and improving the stress test effect through the diversification of the source data. In addition, the embodiment of the present invention can also analyze the change trend of the stress test indicator data of different statistical periods, and derive adjustment suggestions for the current resource scale based on the analysis results, thereby improving the rationality of resource allocation of the working system.

[0020] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0022] Figure 1 It is a schematic diagram of the main steps of the interface pressure testing method in an embodiment of the present invention;

[0023] Figure 2 It is a schematic diagram of the overall process of the interface pressure testing method in an embodiment of the present invention;

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

[0025] Figure 4 It is a schematic diagram of components of an interface pressure testing device according to an embodiment of the present invention;

[0026] Figure 5 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;

[0027] Figure 6 It is a schematic diagram of the structure of an electronic device used to implement the interface pressure testing method in an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0029] It should be pointed out that the embodiments of the present invention and the technical features therein may be combined with each other without conflict.

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

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

[0032] Step S101: obtaining peak monitoring data of a plurality of performance monitoring data of an interface to be tested and associated interfaces of a working system in a preset statistical period.

[0033] In actual applications, a working system is generally composed of multiple applications, each of which has at least one interface, and the stress testing system can test any of the interfaces. For any interface to be tested, its associated interface refers to other interfaces that belong to the same application as the interface to be tested. In an embodiment of the present invention, the stress testing system can obtain peak monitoring data from multiple performance monitoring data of a preset statistical period from a preset monitoring platform.

[0034] The above performance monitoring data refers to the performance indicator data of the working system monitored by the monitoring platform in the current monitoring cycle (for example, the past minute), which can be the data obtained by filtering the original monitoring data output by the monitoring platform. In addition to the performance monitoring data, the above original monitoring data can also include server IP information, computer room information, etc.

[0035] The performance monitoring data may include the identification of the interface to be tested, the identification of the application to which the interface to be tested belongs, the index value of at least one performance index, and the working resource configuration data of the application to which the stress test system belongs. The above performance indicators may include key indicators, response time indicators, and resource utilization indicators. Among them, the key indicator, as the most important stress test indicator, may be the interface throughput, i.e., TPS (Transaction per Second), the index value of the response time indicator may be a statistical value of the response time such as TP99 (sorting the response time of multiple requests from small to large, the response time at the 99% position is TP99), and the resource utilization includes: CPU utilization, memory utilization, cache hit rate, etc. The above working 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 to be tested of the working system belongs. Similarly, the stress test resource configuration data to be described later may include the number and specifications of the stress test servers of the application (i.e., the servers of the application to which the interface to be tested of the stress test system belongs). For example, the specification refers to the configuration information of the server in terms of the central processing unit (CPU), memory, hard disk, etc. For example, the specification of a server is 8 CPU cores and 16GB memory. In specific applications, performance monitoring data can also include the interface caller identifier and the category of the working server (for example, whether the working server is an application server, cache, or database).

[0036] The peak monitoring data has the optimal index value of the preset key index in the performance index among the above multiple performance monitoring data, for example, it has the maximum value in the interface throughput index. It can be understood that the peak monitoring data can represent the peak performance in the performance monitoring data. The above preset statistical period can be a preset time period closest to the current moment (i.e., the moment when the stress test target calculation is performed or the moment when the stress test is started), for example, the month closest to the current moment.

[0037] In specific applications, the original monitoring data collected by at least one monitoring platform can be regularly stored in the offline data platform. The original monitoring data in the offline data platform can be filtered through scheduled tasks to form performance monitoring data. The performance monitoring data can be classified and stored in multiple databases or database tables. For example, the key indicator part, other indicators (indicators other than key indicators in performance indicators) part, and work resource configuration data part of the performance monitoring data are classified and stored, thereby reducing the database pressure caused by subsequent query operations. The above automatic monitoring data collection method can improve the efficiency of interface stress testing. Since there is no frequent manual query, it will not affect the performance of the monitoring platform.

[0038] Step S102: Determine the conversion coefficient between the working system and the stress testing system according to the stress testing resource configuration data and the working resource configuration data applied in the stress testing system; determine the allocation coefficient of the interface to be tested in the application using the index value of the key index of the peak monitoring data of the interface to be tested and the associated interface.

[0039] Since the working system and the stress test system have different server resources, the indicator values ​​in the peak monitoring data of the working system cannot be directly used as stress test targets. In addition, the total call volume of the stress test at the application level (hereinafter referred to as the total stress value) needs to be allocated to multiple interfaces of the same application in a certain proportion, so the allocation coefficient of each interface needs to be determined in advance. In this step, the stress test system can determine the above conversion coefficient based on the stress test resource configuration data and the working resource configuration data of the application in the stress test system, and use the peak monitoring data of the interface to be tested and the associated interface to determine the allocation coefficient of the key indicator in the application.

[0040] Specifically, when the specifications of the applied stress testing server are the same as those of the working server, the stress testing system determines the quotient of the number of applied stress testing servers and the number of working servers as the above conversion coefficient. When the specifications of the applied stress testing server are different from those of the working server, the stress testing system divides the total number of cores of the applied stress testing server by the total number of cores of the working server to obtain the above conversion coefficient. The stress testing system can divide the index value of the key indicator of the interface to be tested by the sum of the index values ​​of the key indicator of the interface to be tested and each associated interface to obtain the above allocation coefficient.

[0041] In actual scenarios, stress testing requires the interface to be tested to be subjected to a large load of pressure treatment, such as issuing a large number of call requests to test the reliability of the interface to be tested, but the peak monitoring data previously obtained may be data of different period types, and does not have the above characteristics of large loads. For example, the collection time of the peak monitoring data can be in the daily work period with less pressure, the first intensity period with greater pressure, and the second intensity period with the greatest pressure. The daily work period, the first intensity period, and the second intensity period all belong to the above period types, and the conversion multiples corresponding to the different period types can be preset (which can be a value greater than 1). For example, the conversion multiple of the daily work period is 5, the conversion multiple of the first intensity period is 1.5, and the conversion multiple of the second intensity period is 1.1. The stress testing system can determine the preset period type of the peak monitoring data of the interface to be tested, and use the conversion multiple corresponding to the determined period type as the target multiple. In this way, the conversion from the peak monitoring data collection date to the stress test environment can be realized, and the setting of the conversion multiple greater than 1 can ensure that the pressure value in the stress test covers the pressure extremes that may be encountered in the working environment.

[0042] Step S103: Determine a stress test target including a target value of a performance indicator according to the peak monitoring data, conversion coefficient and allocation coefficient of the interface to be tested, and compare the stress test indicator data obtained through the stress test with the stress test target to obtain a stress test result of the interface to be tested.

[0043] In this step, the stress test system can perform the following steps to obtain the stress test target. Specifically, the stress test system first calculates the sum of the index values ​​of the peak monitoring data of the interface to be tested and each associated interface in the key indicator, adjusts the sum of the above index values ​​(it can be a small adjustment) to obtain the total stress value, and then determines the product of the total stress value and the conversion coefficient, the allocation coefficient and the target multiple as the target value of the key indicator in the stress test target. It can be understood that the above total stress value is set based on the sum of the peak call volume of the interface to be tested and each associated interface, which can represent the peak call volume of the working system in the application dimension during the data collection period, and the conversion coefficient represents the resource configuration conversion between the working system and the stress test system, the target multiple represents the conversion between the data collection period and the stress test requirements, and the allocation coefficient represents the allocation share of the interface to be tested in the application to which it belongs. The total stress value can be converted into the throughput requirement of the interface to be tested corresponding to the stress test server resources in the stress test environment by multiplying the total stress value with the conversion coefficient, the allocation coefficient and the target multiple, that is, the target value of the interface throughput indicator in the stress test target of the interface to be tested.

[0044] Since the response time index and resource utilization index remain relatively stable when the call volume changes, they can be adjusted based on the corresponding index values ​​of the peak monitoring data to obtain the target values ​​of the above indicators in the stress test target. That is, for any other indicator in the performance indicator except the key indicator, the stress testing system obtains the target value of the other indicator based on the index value of the other indicator in the peak monitoring data of the interface to be tested. In this way, the target value of each performance indicator in the stress test target can be obtained. Thereafter, the stress testing system can compare the stress testing index data obtained through the stress test with the stress testing target to obtain the stress test result of the interface to be tested. Specifically, the above stress testing index data includes the index values ​​of the above performance indicators of the interface to be tested of the stress testing system obtained through the stress test. By comparing the stress testing index data with the stress testing target, it can be obtained whether the interface to be tested meets the requirements in each performance indicator, and then the stress test result is obtained through the comprehensive judgment of multiple performance indicators.

[0045] Through the automatic calculation of stress test targets, the present invention can improve the efficiency of interface stress testing and the accuracy of stress test target calculation. In addition, the embodiment of the present invention does not rely on the peak monitoring data of the intensity period to calculate the stress test target. By calculating the conversion coefficient between the working system and the stress test system, the conversion multiple calculation between the period type of the peak monitoring data and the stress test environment, and the distribution coefficient calculation of the interface to be tested in the application, the stress test target can be calculated based on the peak monitoring data of any period (including the daily working period), thereby broadening the data source of the stress test and improving the stress test effect through the diversification of the source data.

[0046] In one embodiment, after obtaining the above stress test index data, the stress test system can also detect whether the interface call volume of the interface to be tested matches the current resource scale according to the stress test index data of different statistical periods. Specifically, the stress test system can determine the change trend of the interface throughput index value and the resource utilization index value of the interface to be tested in different statistical periods according to the stress test index data of the interface to be tested in different statistical periods, and the above change trend can be calculated using a known algorithm based on derivation. In the case where the change trend is rising, it means that the business volume is in the rising stage, and the stress test system can issue a prompt to increase the resource scale to the relevant staff; in the case where the change trend is unchanged, it means that the business volume remains stable, and the stress test system can issue a prompt to maintain the resource scale to the relevant staff or not issue a prompt; in the case where the change trend is falling, it means that the business volume is in the falling stage, and the stress test system can issue a prompt to reduce the resource scale to the relevant staff, thereby improving the rationality of resource allocation of the working system.

[0047] A specific embodiment of the present invention is described below. Figure 2 and Figure 3 .

[0048] The stress testing system may include a data synchronization end, a computing end, and an execution end. The data synchronization end is used to collect monitoring data from the monitoring end. The monitoring end is used to monitor the working system and store the collected original monitoring data in the monitoring summary end. The monitoring summary end regularly pushes the original monitoring data to the offline data platform of the data synchronization end. After the data of the offline data platform undergoes intelligent filtering steps and classified storage, it forms performance monitoring data stored in multiple databases or database tables. The computing end is used to calculate the stress testing target based on the input stress testing resource configuration data and the peak monitoring data read from the database. The execution end is used to perform the stress test of the interface to be tested, and after obtaining the stress testing indicator data, it is compared with the stress testing target to obtain the final stress testing result. On the other hand, the execution end can also calculate the changing trend of the interface throughput indicator value and the resource utilization indicator value in different statistical periods, and then issue corresponding reminders about resource scale adjustment.

[0049] The embodiment of the present invention improves the efficiency of stress testing by automatically collecting monitoring data and automatically estimating and calculating stress testing targets, and keeps the performance of the monitoring platform stable by reducing the call volume of the monitoring platform interface (the embodiment of the present invention can collect performance monitoring data from an offline table that regularly collects monitoring platform data). In addition, the embodiment of the present invention does not rely on the peak monitoring data of the intensity period to calculate the stress testing target. By calculating the conversion coefficient between the working system and the stress testing system, the conversion multiple calculation of the period type of the peak monitoring data and the stress testing environment, and the distribution coefficient calculation of the interface to be tested in the application, the stress testing target can be calculated based on the peak monitoring data of any period (including the daily working period), thereby broadening the data source of the stress test and improving the stress testing effect through the diversification of the source data. In addition, the embodiment of the present invention can automatically monitor the impact of the change in the call volume on the interface and system resources, perform performance testing on the interface in a timely manner, and feedback the interface performance problem to the relevant personnel at the appropriate time, and make precise adjustments to the online resources, so as to ensure the stability of the online system and reduce the waste of system resources.

[0050] It should be noted that the collection, collection, update, analysis, processing, use, transmission, storage and other aspects of user personal information that may be involved in the technical solution of the present invention are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.

[0051] For the above-mentioned method embodiments, for the convenience of description, they are expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the order of the actions described, and some steps can actually be performed in other orders or simultaneously. In addition, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily necessary to implement the present invention.

[0052] In order to better implement the above-mentioned solution of the embodiment of the present invention, relevant devices for implementing the above-mentioned solution are also provided below.

[0053] See also Figure 4 As shown, the interface stress testing device 400 provided by the embodiment of the present invention is arranged 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] Among them, the data synchronization unit 401 can be used to obtain the peak monitoring data of the interface to be tested and the associated interface of the working system in multiple performance monitoring data of a preset statistical period; wherein the interface to be tested and the associated interface belong to the same application, the performance monitoring data include the indicator value of at least one performance indicator and the working resource configuration data of the application, and the peak monitoring data has the optimal indicator value of the preset key indicator in the performance indicator in 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 according to the stress testing resource configuration data and the working resource configuration data of the application in the stress testing system; the peak monitoring data of the interface to be tested and the associated interface are used to determine the distribution coefficient of the interface to be tested in the application at the indicator value of the key indicator; the test target estimation unit 403 can be used to determine the stress testing target including the target value of the performance indicator based on the peak monitoring data of the interface to be tested, the conversion coefficient and the distribution coefficient, and compare the stress testing indicator data obtained after the stress test with the stress testing target to obtain the stress testing result of the interface to be tested.

[0055] In an embodiment of the present invention, the stress testing resource configuration data includes: the number and specifications of the stress testing servers of the application, and the working resource configuration data includes: the number and specifications of the working servers of the application; and the coefficient calculation unit 402 can be further used to: when the specifications of the stress testing servers of the application are the same as the specifications of the working servers, determine the quotient of the number of stress testing servers of the application and the number of working servers as the conversion coefficient; when the specifications of the stress testing servers of the application are different from the specifications of the working servers, divide the total number of cores of the stress 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 may be further used to: divide the index value of the interface to be tested in the key index by the sum of the index values ​​of the interface to be tested and each associated interface in the key index 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 to be tested 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 to be tested and the associated interface in the key indicator, and obtain the total pressure value based on the sum of the index values; determine the product of the total pressure value and the conversion coefficient, the allocation coefficient and the target multiple as the target value of the key indicator.

[0058] Preferably, the test target estimation unit 403 may be further configured to: for any other indicator in the performance indicators except the key indicator, obtain a target value of the other indicator based on the indicator value of the other indicator in the peak monitoring data of the interface to be tested.

[0059] As a preferred scheme, the stress testing indicator data includes: the indicator value of the interface to be tested of the stress testing system in the performance indicator, and the performance indicator includes the interface throughput and the resource utilization of the application as the key indicators; and the test target estimation unit 403 can be further used to: determine the change trend of the interface throughput and the resource utilization of the interface to be tested according to the stress testing indicator data of the interface to be tested in different statistical periods; when the change trend of the interface throughput and the resource utilization is increasing, issue a prompt to increase the resource scale; when the change trend of the interface throughput and the resource utilization is unchanged, issue a prompt to maintain the resource scale; when the change trend of the interface throughput and the resource utilization is decreasing, issue a prompt to reduce the resource scale.

[0060] In addition, in an embodiment of the present invention, the optimal index value is the maximum index value, and the performance index further includes: response time; the resource utilization includes: central processing unit CPU utilization, memory utilization and cache hit rate; the performance monitoring data of the interface to be tested further includes the identification of the interface to be tested, the identification of the application and at least one of the following data: the interface caller identification, the category of the working server.

[0061] According to the technical solution of the embodiment of the present invention, the stress testing system automatically acquires and classifies monitoring data to grasp the daily performance and resource utilization of each interface in real time; through automated stress testing target estimation calculation, it can obtain relatively accurate stress testing targets based on the comparison between the working environment and the stress testing environment to complete the stress test. The stress testing system can also analyze the change trend of stress testing indicator data in multiple statistical periods, and then give suggestions for optimizing system resources, thereby improving the rationality of system resource configuration.

[0062] Figure 5 An exemplary system architecture 500 is shown to which an interface pressure testing method or an interface pressure testing device according to an embodiment of the present invention can be applied.

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

[0064] The user can use the terminal devices 501, 502, 503 to interact with the server 505 through the network 504 to receive or send messages, etc. Various client applications can be installed on the terminal devices 501, 502, 503, such as a stress test application (only an example).

[0065] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0066] The server 505 may be a server that provides various services, such as a background server (only an example) that provides support for the stress test application operated by the user using the terminal devices 501, 502, 503. The background server may process the received stress test request and feed back the processing result (such as the stress test result - only an example) to the terminal devices 501, 502, 503.

[0067] It should be noted that the interface pressure testing method provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the interface pressure testing device is generally arranged in the server 505 .

[0068] It should be understood that Figure 5The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0069] The present invention also provides an electronic device. The electronic device of an embodiment of the present invention includes: one or more processors; a 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 interface stress testing method provided by the present invention.

[0070] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of an electronic device suitable for implementing an embodiment of the present invention. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions 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 according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the computer system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other 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 the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 606 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, 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, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.

[0073] In particular, according to the embodiments disclosed in the present invention, the process described in the main step diagram above can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the main step diagram. In the above embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit 601, the above functions defined in the system of the present invention are executed.

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

[0075] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0076] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be arranged in a processor, for example, may be described as: a processor including a data synchronization unit, a coefficient calculation unit and a test target estimation unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the data synchronization unit may also be described as a "unit that provides peak monitoring data to the coefficient calculation unit".

[0077] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the device executes the following steps: obtaining peak monitoring data of a test interface and an associated interface of a working system in a preset statistical period from a plurality of performance monitoring data; wherein the test interface and the associated interface belong to the same application, the performance monitoring data include an indicator value of at least one performance indicator and working resource configuration data of the application, and the peak monitoring data has an optimal indicator value of a preset key indicator in the performance indicator in the plurality of performance monitoring data; determining a conversion coefficient between the working system and the stress testing system according to the stress testing resource configuration data and the working resource configuration data of the application in the stress testing system; determining a distribution coefficient of the test interface in the application using the peak monitoring data of the test interface and the associated interface at the indicator value of the key indicator; determining a stress testing target including a target value of the performance indicator according to the peak monitoring data of the test interface, the conversion coefficient and the distribution coefficient, and comparing the stress testing indicator data obtained through the stress testing with the stress testing target to obtain a stress testing result of the test interface.

[0078] In the technical solution of the embodiment of the present invention, the stress testing system first automatically obtains the peak monitoring data of the interface to be tested and the associated interface of the working system in multiple performance monitoring data of the preset statistical period from the monitoring platform, and then determines the conversion coefficient between the working system and the stress testing system according to the stress testing resource configuration data and the working resource configuration data of the application to which the interface to be tested belongs in the stress testing system, and uses the peak monitoring data of the interface to be tested and the associated interface in the index value of the key index to determine the allocation coefficient of the interface to be tested in the above application. Thereafter, the stress testing system determines the stress testing target including the target value of each performance indicator according to the peak monitoring data of the interface to be tested, the above 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 to be tested. In this way, the efficiency of the interface stress test and the accuracy of the stress test target calculation are improved by periodically automatically collecting monitoring data and automatically calculating the stress testing target, while not affecting the performance of the monitoring platform. The embodiment of the present invention does not rely on the peak monitoring data of the intensity period to calculate the stress test target. By calculating the conversion coefficient between the working system and the stress test system, the conversion multiple calculation of the period type of the peak monitoring data and the stress test environment, and the distribution coefficient calculation of the interface to be tested in the application, the stress test target can be calculated based on the peak monitoring data of any period, thereby broadening the data source of the stress test and improving the stress test effect through the diversification of the source data. In addition, the embodiment of the present invention can also analyze the change trend of the stress test indicator data of different statistical periods, and derive adjustment suggestions for the current resource scale based on the analysis results, thereby improving the rationality of resource allocation of the working system.

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

Claims

1. An interface pressure testing method, characterized in that: The method is performed by a stress testing system for testing a working system; the method comprises: Acquire peak monitoring data of the interface to be tested and the associated interface of the working system in multiple performance monitoring data of a preset statistical period; wherein, The interface to be tested and the associated interface belong to the same application, the performance monitoring data includes an indicator value of at least one performance indicator and working resource configuration data of the application, and the peak monitoring data has an optimal indicator value of a preset key indicator in the performance indicator among the multiple performance monitoring data; Determine the conversion coefficient between the working system and the stress testing system according to the stress testing resource configuration data of the application in the stress testing system and the working resource configuration data; determine the allocation coefficient of the interface to be tested in the application using the peak monitoring data of the interface to be tested and the associated interface at the index value of the key index; A stress test target including a target value of the performance indicator is determined based on the peak monitoring data of the interface to be tested, the conversion coefficient and the allocation coefficient, and the stress test indicator data obtained through the stress test is compared with the stress test target to obtain a stress test result of the interface to be tested.

2. The method according to claim 1, characterized in that The stress testing resource configuration data includes: the number and specifications of the stress testing servers of the application, and the working resource configuration data includes: the number and specifications of the working servers of the application; and the conversion coefficient between the working system and the stress testing system is determined according to the stress testing resource configuration data of the application in the stress testing system and the working resource configuration data, including: In the case where the specifications of the stress testing servers of the application are the same as the specifications of the working servers, the quotient of the number of stress testing servers of the application and the number of working servers is determined as the conversion coefficient; In the case where the specifications of the stress testing server of the application are different from those of the working server, the total number of cores of the stress testing server of the application is divided by the total number of cores of the working server to obtain the conversion coefficient.

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

4. The method according to claim 1, characterized in that: The step of determining the stress test target including the target value of the performance indicator according to the peak monitoring data of the interface to be tested, the conversion coefficient and the allocation coefficient comprises: Determine the preset period type in which the peak monitoring data of the interface to be tested is located, and use the conversion multiple corresponding to the determined period type as the target multiple; Calculating the sum of the index values ​​of the key index of the peak monitoring data of the interface to be tested and the associated interface, and obtaining a total pressure value based on the sum of the index values; The product of the total pressure value, the conversion coefficient, the distribution coefficient and the target multiple is determined as the target value of the key indicator.

5. The method according to claim 1, characterized in that The step of determining the stress test target including the target value of the performance indicator according to the peak monitoring data of the interface to be tested, the conversion coefficient and the allocation coefficient further includes: For any other indicator in the performance indicators except the key indicator, a target value of the other indicator is obtained based on the indicator value of the other indicator in the peak monitoring data of the interface to be tested.

6. The method according to claim 1, characterized in that The stress test index data includes: the index value of the interface to be tested of the stress test system in the performance index, the performance index includes the interface throughput as the key index and the resource utilization rate of the application; and the method further includes: Determine the change trend of the interface throughput and the resource utilization of the interface to be tested according to the stress testing indicator data of the interface to be tested in different statistical periods; When the interface throughput and the resource utilization rate show an upward trend, issuing a prompt to increase the resource scale; When the variation trends of the interface throughput and the resource utilization rate remain unchanged, issuing a prompt to maintain the resource scale; When the variation trends of the interface throughput and the resource utilization rate are decreasing, a prompt to reduce the resource scale is issued.

7. The method according to claim 6, characterized in that The optimal index value is the maximum index value, and the performance index 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 to be tested further includes the identifier of the interface to be tested, the identifier of the application, and at least one of the following data: the identifier of the interface caller, and the category of the working server.

8. An interface pressure testing device, characterized in that: Set in a pressure test system for testing a working system; the device includes: A data synchronization unit, used to obtain peak monitoring data of a plurality of performance monitoring data of a tested interface and an associated interface of the working system in a preset statistical period; wherein the tested interface and the associated interface belong to the same application, the performance monitoring data include an indicator value of at least one performance indicator and working resource configuration data of the application, and the peak monitoring data has an optimal indicator value of a preset key indicator in the performance indicator among the plurality of performance monitoring data; A coefficient calculation unit, used to determine the conversion coefficient between the working system and the stress testing system according to the stress testing resource configuration data of the application in the stress testing system and the working resource configuration data; and to determine the allocation coefficient of the interface to be tested in the application using the peak monitoring data of the interface to be tested and the associated interface at the index value of the key index; A test target estimation unit is used to determine a stress test target including a target value of the performance indicator based on the peak monitoring data of the interface to be tested, the conversion coefficient and the allocation coefficient, and compare the stress test indicator data obtained through the stress test with the stress test target to obtain a stress test result of the interface to be tested.

9. An electronic device, characterized in that: include: one or more processors; a 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 according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Interface testing method and equipment

    CN109491894A

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

    CN113127356A

  • Pressure testing device, method and system for AXI main equipment interface

    CN116089245A

  • Automated verification of platform configuration for workload deployment

    US20210117307A1

  • Method and system for automatic test plan generation

    WO2024104781A1