Automatic pressure measurement method and device for server interface performance

By determining the expected business scenarios and stress testing use cases of the interface to be tested, and performing pre-stress testing and target stress testing, the problem of inconsistent standards for interface stress testing use cases is solved, the accuracy and efficiency of interface stress testing are improved, and the effectiveness of marketing activities is ensured. Goes smoothly.

CN118819971APending Publication Date: 2024-10-22FOSHAN VIOMI ELECTRICAL TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310430984.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-20
Publication Date
2024-10-22

AI Technical Summary

Technical Problem

In the existing technology, the standards among server interface stress testing use cases are not uniform, resulting in low accuracy of stress testing results and affecting the normal progress of online marketing activities.

Method used

By determining the expected business scenarios and stress testing use cases of the interface to be tested, pre-stress testing and target stress testing operations are performed to determine interface performance, unify stress testing standards, and improve the reliability and accuracy of interface stress testing.

Benefits of technology

It achieves accurate evaluation and optimization of interface performance, ensures the normal progress of marketing activities, simplifies the traditional stress test preparation process, and improves stress test efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118819971A_ABST
    Figure CN118819971A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic pressure testing method and device for server interface performance. The method comprises the steps that a pressure testing case corresponding to a to-be-tested interface needing pressure testing is determined; performing pre-pressure testing operation on the to-be-tested interface through the pressure testing case corresponding to the to-be-tested interface to obtain a pre-pressure testing result of the to-be-tested interface, and judging whether the pre-pressure testing result shows that pre-pressure testing of the to-be-tested interface succeeds or not, if yes, performing target pressure testing operation on the to-be-tested interface according to target pressure testing parameters for pressure testing, and if not, performing target pressure testing operation on the to-be-tested interface. And obtaining a target pressure test result of the to-be-tested interface. Visibly, by implementing the method and the device, the pressure test cases of the to-be-tested interfaces needing pressure test can be intelligently determined, and automatic pressure test is performed on the to-be-tested interfaces, so that the pressure test standards among the pressure test cases of the interfaces can be unified, the pressure test reliability and accuracy of the to-be-tested interfaces can be further improved, and the test efficiency is improved. Therefore, an accurate interface voltage test result can be obtained, so that the performance of the to-be-tested interface can ensure the normal proceeding of marketing activities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet technology, and in particular to an automated stress testing method and device for server interface performance. Background Art

[0002] With the rapid development of Internet technology, online shopping has gradually become a popular consumption method. On major online shopping platforms, merchants often use various marketing methods to attract online consumers, such as discount marketing, point marketing, etc., so as to better promote and sell products.

[0003] In order to ensure the orderly progress of online marketing activities, it is generally necessary to stress test a large number of server interfaces before the marketing activities are carried out to ensure that the marketing activities at that time can be fully supported by network resources without resource conflicts. At present, different stress testing cases are often used in relevant stress testing schemes, but this will make the stress testing standards between each case inconsistent, making it difficult to improve the accuracy of the stress testing results, thus affecting the normal progress of online marketing activities. It can be seen that it is particularly important to provide a new server interface stress testing method to improve the accuracy of stress testing results. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method and device for automated stress testing of server interface performance, which can unify the stress testing standards between various interface stress testing use cases, thereby improving the reliability and accuracy of the stress testing of the interface to be tested, thereby obtaining accurate interface stress testing results, so that the performance of the interface to be tested can ensure the normal progress of marketing activities.

[0005] In order to solve the above technical problems, the first aspect of the present invention discloses an automated stress testing method for server interface performance, the method comprising:

[0006] Determine the interface to be tested that needs stress testing, and determine the stress testing use case corresponding to the interface to be tested;

[0007] Perform a pre-stress test operation on the interface to be tested through the stress test case corresponding to the interface to be tested, obtain a pre-stress test result of the interface to be tested, and determine whether the pre-stress test result indicates that the pre-stress test on the interface to be tested is successful;

[0008] When the judgment result is yes, the target stress testing operation is performed on the interface to be tested according to the target stress testing parameters for stress testing to obtain the target stress testing result of the interface to be tested; the target stress testing parameters include a stress testing duration parameter and / or a stress testing iteration number parameter, and the target stress testing result of the interface to be tested includes a stress testing duration threshold and / or a stress testing iteration number threshold of the interface to be tested, and the target stress testing result of the interface to be tested is used to indicate the interface performance parameters of the interface to be tested.

[0009] As an optional implementation manner, in the first aspect of the present invention, determining the interface to be tested that requires stress testing includes:

[0010] Determine the expected business scenario for determining the interface to be tested, and determine the scenario information of the expected business scenario; the scenario information includes at least one of expected marketing product information, expected product transaction mode information, expected cooperative merchant information, expected consumer online shopping habit information, expected online store marketing situation, and expected product marketing method information;

[0011] Determine, according to the scenario information of the expected business scenario, a plurality of expected calling interfaces required to be called in the expected business scenario, and determine interface implementation function information of each of the expected calling interfaces;

[0012] Determining the interface data flow direction of each of the expected calling interfaces according to the interface realization function information of each of the expected calling interfaces;

[0013] According to the interface data flow directions of all the expected calling interfaces, all the expected calling interfaces whose interface data flow directions are the preset data flow directions are determined from all the expected calling interfaces as the interfaces to be tested that need stress testing.

[0014] As an optional implementation manner, in the first aspect of the present invention, determining the stress test case corresponding to the interface to be tested includes:

[0015] Determine the scenario use case determination requirement information of the interface to be tested according to the scenario information of the expected business scenario; the scenario use case determination requirement information of the interface to be tested includes at least one of the interface assertion requirement information of the interface to be tested, the target scenario information of the expected business scenario to be extracted, and the scenario operation environment requirement information;

[0016] Determine the link use case determination requirement information of the interface to be tested according to the interface implementation function information of the interface to be tested and the corresponding interface data flow direction; the link use case determination requirement information of the interface to be tested includes at least one of the link data source requirement information, link request mode requirement information, link data destination requirement information and link operation environment requirement information of the interface to be tested;

[0017] Determine the requirement information according to the scenario use case of the interface to be tested and the requirement information according to the link use case, and determine the stress testing use case corresponding to the interface to be tested; the stress testing use case includes a stress testing scenario use case and a stress testing link use case.

[0018] As an optional implementation manner, in the first aspect of the present invention, performing a pre-stress test operation on the interface to be tested through a stress test case corresponding to the interface to be tested to obtain a pre-stress test result of the interface to be tested includes:

[0019] According to the stress test case corresponding to the interface to be tested, determine the database that the interface to be tested needs to access, and create a shadow library matching the database;

[0020] The interface to be tested is called by using the preset use case shadow traffic corresponding to the stress testing use case, so as to write the traffic data corresponding to the use case shadow traffic into the shadow library;

[0021] Obtain a first target condition of the flow data in the shadow library as a pre-stress test result of the interface to be tested; the first target condition of the flow data includes a first write condition of the flow data and / or a first working condition of a corresponding server, the first write condition of the flow data includes a first write error condition and / or a first write omission condition of the flow data, and the first working condition of the server corresponding to the flow data includes at least one of a first computing condition of a central processing unit of the server, a first cache condition of a memory, a first read / write condition of a hard disk, and a first data transmission condition of a broadband.

[0022] As an optional implementation manner, in the first aspect of the present invention, performing a target stress testing operation on the interface to be tested according to a target stress testing parameter for stress testing to obtain a target stress testing result of the interface to be tested includes:

[0023] According to the target stress testing parameters for stress testing and the preset use case shadow traffic corresponding to the stress testing use case, the interface to be tested is called to write the traffic data corresponding to the use case shadow traffic to the shadow library corresponding to the interface to be tested based on the target stress testing parameters;

[0024] Obtaining a second target condition of the flow data in the shadow library, and determining whether the second target condition is a preset stress test performance condition; the second target condition of the flow data includes a second write condition of the flow data and / or a second working condition of the corresponding server, the second write condition of the flow data includes a second write error condition and / or a second write omission condition of the flow data, and the second working condition of the server corresponding to the flow data includes at least one of a second computing condition of the central processing unit of the server, a second cache condition of the memory, a second read-write condition of the hard disk, and a second data transmission condition of the broadband;

[0025] When it is determined that the second target situation is the stress testing performance situation, the target stress testing parameters are updated, and the operation of calling the interface to be tested according to the target stress testing parameters for stress testing and the preset use case shadow traffic corresponding to the stress testing use case is triggered, so as to write the traffic data corresponding to the use case shadow traffic to the shadow library corresponding to the interface to be tested based on the target stress testing parameters;

[0026] When it is determined that the second target condition is not the stress test performance condition, the last target stress test parameter corresponding to the interface to be tested is obtained, and the target stress test result of the interface to be tested is determined according to the last target stress test parameter.

[0027] As an optional implementation, in the first aspect of the present invention, determining the requirement information according to the scenario use case of the interface to be tested and the link use case to determine the requirement information, and determining the stress test use case corresponding to the interface to be tested, includes:

[0028] Determine the interface parameters of the interface to be tested; the interface parameters of the interface to be tested include at least one of the interface state parameters, interface type parameters, interface working mode parameters and interface protection parameters of the interface to be tested;

[0029] Determine the impact of the stress test case corresponding to the interface to be tested according to the interface parameters of the interface to be tested, and judge whether the impact of the stress test case is greater than or equal to a preset impact threshold;

[0030] When it is determined that the impact determined by the stress testing use case is greater than or equal to the impact threshold, determining the stress testing use case corresponding to the interface to be tested according to the interface parameters of the interface to be tested, the requirement information determined by the scenario use case, and the requirement information determined by the link use case;

[0031] When it is determined that the impact determined by the stress testing use case is less than the impact threshold, the stress testing use case corresponding to the interface to be tested is determined according to the scenario use case determination requirement information of the interface to be tested and the link use case determination requirement information.

[0032] As an optional implementation manner, in the first aspect of the present invention, the determining whether the pre-stress test result indicates that the pre-stress test on the interface to be tested is successful includes:

[0033] Determining target writing parameters of the traffic data according to the first writing condition of the traffic data; the target writing parameters of the traffic data include writing accuracy and / or writing completeness of the traffic data;

[0034] Determining whether the target write parameter is greater than or equal to a preset write parameter threshold;

[0035] When it is determined that the target write parameter is greater than or equal to the write parameter threshold, determining the degree of influence on the operation of the server according to a first operation condition of the server corresponding to the traffic data;

[0036] Determining whether the absolute value of the work influence is less than or equal to a preset work influence threshold;

[0037] When it is determined that the work impact is less than or equal to the work impact threshold, determining the pre-stress test result indicates that the pre-stress test on the interface to be tested is successful.

[0038] A second aspect of the present invention discloses an automated stress testing device for server interface performance, the device comprising:

[0039] The first determination module is used to determine the interface to be tested that needs stress testing;

[0040] A second determination module is used to determine the stress test case corresponding to the interface to be tested;

[0041] A stress testing module, used to perform a pre-stress testing operation on the interface to be tested through a stress testing case corresponding to the interface to be tested, and obtain a pre-stress testing result of the interface to be tested;

[0042] A judging module, used to judge whether the pre-stress test result indicates that the pre-stress test on the interface to be tested is successful;

[0043] The stress testing module is further used to, when the judgment result of the judgment module is yes, perform a target stress testing operation on the interface to be tested according to the target stress testing parameters used for stress testing to obtain a target stress testing result of the interface to be tested; the target stress testing parameters include a stress testing duration parameter and / or a stress testing iteration number parameter, the target stress testing result of the interface to be tested includes a stress testing duration threshold and / or a stress testing iteration number threshold of the interface to be tested, and the target stress testing result of the interface to be tested is used to indicate the interface performance parameters of the interface to be tested.

[0044] As an optional implementation, in the second aspect of the present invention, the first determination module determines the interface to be tested that needs stress testing in the following manner:

[0045] Determine the expected business scenario for determining the interface to be tested, and determine the scenario information of the expected business scenario; the scenario information includes at least one of expected marketing product information, expected product transaction mode information, expected cooperative merchant information, expected consumer online shopping habit information, expected online store marketing situation, and expected product marketing method information;

[0046] Determine, according to the scenario information of the expected business scenario, a plurality of expected calling interfaces required to be called in the expected business scenario, and determine interface implementation function information of each of the expected calling interfaces;

[0047] Determining the interface data flow direction of each of the expected calling interfaces according to the interface realization function information of each of the expected calling interfaces;

[0048] According to the interface data flow directions of all the expected calling interfaces, all the expected calling interfaces whose interface data flow directions are the preset data flow directions are determined from all the expected calling interfaces as the interfaces to be tested that need stress testing.

[0049] As an optional implementation, in the second aspect of the present invention, the second determination module determines the stress test case corresponding to the interface to be tested in the following manner:

[0050] Determine the scenario use case determination requirement information of the interface to be tested according to the scenario information of the expected business scenario; the scenario use case determination requirement information of the interface to be tested includes at least one of the interface assertion requirement information of the interface to be tested, the target scenario information of the expected business scenario to be extracted, and the scenario operation environment requirement information;

[0051] Determine the link use case determination requirement information of the interface to be tested according to the interface implementation function information of the interface to be tested and the corresponding interface data flow direction; the link use case determination requirement information of the interface to be tested includes at least one of the link data source requirement information, link request mode requirement information, link data destination requirement information and link operation environment requirement information of the interface to be tested;

[0052] Determine the requirement information according to the scenario use case of the interface to be tested and the requirement information according to the link use case, and determine the stress testing use case corresponding to the interface to be tested; the stress testing use case includes a stress testing scenario use case and a stress testing link use case.

[0053] As an optional implementation, in the second aspect of the present invention, the stress testing module performs a pre-stress testing operation on the interface to be tested through the stress testing case corresponding to the interface to be tested, and obtains the pre-stress testing result of the interface to be tested in the following manner:

[0054] According to the stress test case corresponding to the interface to be tested, determine the database that the interface to be tested needs to access, and create a shadow library matching the database;

[0055] The interface to be tested is called by using the preset use case shadow traffic corresponding to the stress testing use case, so as to write the traffic data corresponding to the use case shadow traffic into the shadow library;

[0056] Obtain a first target condition of the flow data in the shadow library as a pre-stress test result of the interface to be tested; the first target condition of the flow data includes a first write condition of the flow data and / or a first working condition of a corresponding server, the first write condition of the flow data includes a first write error condition and / or a first write omission condition of the flow data, and the first working condition of the server corresponding to the flow data includes at least one of a first computing condition of a central processing unit of the server, a first cache condition of a memory, a first read / write condition of a hard disk, and a first data transmission condition of a broadband.

[0057] As an optional implementation, in the second aspect of the present invention, the stress testing module performs a target stress testing operation on the interface to be tested according to the target stress testing parameters for stress testing, and obtains the target stress testing result of the interface to be tested in the following manner:

[0058] According to the target stress testing parameters for stress testing and the preset use case shadow traffic corresponding to the stress testing use case, the interface to be tested is called to write the traffic data corresponding to the use case shadow traffic to the shadow library corresponding to the interface to be tested based on the target stress testing parameters;

[0059] Obtaining a second target condition of the flow data in the shadow library, and determining whether the second target condition is a preset stress test performance condition; the second target condition of the flow data includes a second write condition of the flow data and / or a second working condition of the corresponding server, the second write condition of the flow data includes a second write error condition and / or a second write omission condition of the flow data, and the second working condition of the server corresponding to the flow data includes at least one of a second computing condition of the central processing unit of the server, a second cache condition of the memory, a second read-write condition of the hard disk, and a second data transmission condition of the broadband;

[0060] When it is determined that the second target situation is the stress testing performance situation, the target stress testing parameters are updated, and the operation of calling the interface to be tested according to the target stress testing parameters for stress testing and the preset use case shadow traffic corresponding to the stress testing use case is triggered, so as to write the traffic data corresponding to the use case shadow traffic to the shadow library corresponding to the interface to be tested based on the target stress testing parameters;

[0061] When it is determined that the second target condition is not the stress test performance condition, the last target stress test parameter corresponding to the interface to be tested is obtained, and the target stress test result of the interface to be tested is determined according to the last target stress test parameter.

[0062] As an optional implementation, in the second aspect of the present invention, the second determination module determines the requirement information according to the scenario use case of the interface to be tested and the link use case to determine the requirement information, and the method of determining the stress test use case corresponding to the interface to be tested is specifically:

[0063] Determine the interface parameters of the interface to be tested; the interface parameters of the interface to be tested include at least one of the interface state parameters, interface type parameters, interface working mode parameters and interface protection parameters of the interface to be tested;

[0064] Determine the impact of the stress test case corresponding to the interface to be tested according to the interface parameters of the interface to be tested, and judge whether the impact of the stress test case is greater than or equal to a preset impact threshold;

[0065] When it is determined that the impact determined by the stress testing use case is greater than or equal to the impact threshold, determining the stress testing use case corresponding to the interface to be tested according to the interface parameters of the interface to be tested, the requirement information determined by the scenario use case, and the requirement information determined by the link use case;

[0066] When it is determined that the impact determined by the stress testing use case is less than the impact threshold, the stress testing use case corresponding to the interface to be tested is determined according to the scenario use case determination requirement information of the interface to be tested and the link use case determination requirement information.

[0067] As an optional implementation, in the second aspect of the present invention, the judgment module judges whether the pre-stress test result indicates that the pre-stress test of the interface to be tested is successful in the following manner:

[0068] Determining target writing parameters of the traffic data according to the first writing condition of the traffic data; the target writing parameters of the traffic data include writing accuracy and / or writing completeness of the traffic data;

[0069] Determining whether the target write parameter is greater than or equal to a preset write parameter threshold;

[0070] When it is determined that the target write parameter is greater than or equal to the write parameter threshold, determining the degree of influence on the operation of the server according to a first operation condition of the server corresponding to the traffic data;

[0071] Determining whether the absolute value of the work influence is less than or equal to a preset work influence threshold;

[0072] When it is determined that the work impact is less than or equal to the work impact threshold, determining the pre-stress test result indicates that the pre-stress test on the interface to be tested is successful.

[0073] The third aspect of the present invention discloses another automatic stress testing device for server interface performance, the device comprising:

[0074] A memory storing executable program code;

[0075] a processor coupled to the memory;

[0076] The processor calls the executable program code stored in the memory to execute the automated stress testing method for server interface performance disclosed in the first aspect of the present invention.

[0077] A fourth aspect of the present invention discloses a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the automated stress testing method for server interface performance disclosed in the first aspect of the present invention.

[0078] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0079] In the embodiment of the present invention, the stress test use case corresponding to the interface to be tested that needs stress testing is determined; through the stress test use case corresponding to the interface to be tested, a pre-stress test operation is performed on the interface to be tested to obtain the pre-stress test result of the interface to be tested, and it is determined whether the pre-stress test result indicates that the pre-stress test of the interface to be tested is successful. If so, the target stress test operation is performed on the interface to be tested according to the target stress test parameters used for stress testing to obtain the target stress test result of the interface to be tested. It can be seen that the implementation of the present invention can intelligently determine the stress test use case of the interface to be tested that needs stress testing, and perform automated stress testing on the interface to be tested. In this way, the stress test standards between the stress test use cases of each interface can be unified, and then the reliability and accuracy of the stress test on the interface to be tested can be improved, so that accurate interface stress test results can be obtained to ensure that the performance of the interface to be tested matches the corresponding marketing activity scenario and ensure the normal progress of the marketing activity; at the same time, through the automated stress testing of the interface performance, the traditional stress test preparation process can be simplified, thereby improving the efficiency of stress testing of the interface performance. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0081] Figure 1 It is a schematic diagram of an automated stress testing architecture for server interface performance disclosed in an embodiment of the present invention;

[0082] Figure 2 It is a flow chart of an automated stress testing method for server interface performance disclosed in an embodiment of the present invention;

[0083] Figure 3 It is a flow chart of another automated stress testing method for server interface performance disclosed in an embodiment of the present invention;

[0084] Figure 4 It is a structural schematic diagram of an automated stress testing device for server interface performance disclosed in an embodiment of the present invention;

[0085] Figure 5 It is a structural schematic diagram of another automatic stress testing device for server interface performance disclosed in an embodiment of the present invention;

[0086] Figure 6 It is a schematic diagram of a process for determining an interface to be tested disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

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

[0088] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.

[0089] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0090] The present invention discloses an automated stress testing method and device for server interface performance, which can unify stress testing standards among various interface stress testing use cases, thereby improving the reliability and accuracy of stress testing of interfaces to be tested, thereby obtaining accurate interface stress testing results, so that the performance of interfaces to be tested can ensure the normal progress of marketing activities.

[0091] Embodiment 1

[0092] See also Figure 2 , Figure 2 1 is a flow chart of an automated stress testing method for server interface performance disclosed in an embodiment of the present invention. Figure 2 The described automated stress testing method for server interface performance can be applied to server interface performance stress testing in various marketing activity scenarios, such as Double 11 activities, 618 promotion activities, etc., which is not limited by the embodiments of the present invention. Optionally, the method can be implemented by a server interface stress testing system (such as a visual automatic stress testing platform). The server interface stress testing system can be integrated in a server interface stress testing device, or it can be a local server or cloud server for processing the server interface stress testing process, which is not limited by the embodiments of the present invention. Figure 2 As shown, the automated stress testing method for the server interface performance may include the following operations:

[0093] 101. Determine the interface to be tested that needs stress testing, and determine the stress testing use cases corresponding to the interface to be tested.

[0094] In an embodiment of the present invention, the interface to be tested that needs stress testing may be one or more. Optionally, the interface to be tested that needs stress testing may be determined from an existing interface library, or a new type of interface created may be used as the interface to be tested that needs stress testing. Further optionally, the stress testing case corresponding to the interface to be tested may be pre-set, that is, a unified stress testing case may be directly used without writing the corresponding stress testing code, or the corresponding stress testing case may be adaptively matched from the stress testing case library based on the interface parameters and / or stress testing requirements of the interface to be tested. For example, for a certain marketing activity scenario, when preparing to perform the first interface performance stress test, it is necessary to comb out the relevant stress testing interfaces and links. After the combing is completed, the link interface combing file under the marketing activity scenario can be saved to a visual automatic stress testing platform. Then, when encountering the same marketing activity scenario in the future, there is no need to repeat the combing, and the automatic stress testing can be directly realized through the platform.

[0095] 102. Perform a pre-stress test operation on the interface to be tested through the stress test case corresponding to the interface to be tested, obtain a pre-stress test result of the interface to be tested, and determine whether the pre-stress test result indicates that the pre-stress test of the interface to be tested is successful.

[0096] In an embodiment of the present invention, the pre-stress test operation may be performed once or multiple times. Optionally, the pre-stress test operation may be performed on the interface to be tested through the stress test case corresponding to the interface to be tested and based on the corresponding pre-stress test parameters, wherein the pre-stress test parameters may include the number of threads (which may simulate multiple users accessing the system at the same time), the number of loops (which may simulate the number of times each user accesses the system), the delay time (which may simulate the waiting time between each request), and the stress test duration, etc.

[0097] 103. When the judgment result is yes, a target stress testing operation is performed on the interface to be tested according to the target stress testing parameters for the stress testing, and a target stress testing result of the interface to be tested is obtained.

[0098] In an embodiment of the present invention, similarly, the target stress test operation may be performed once or multiple times until the threshold performance parameters of the interface to be tested are obtained. Optionally, the target stress test parameters include stress test duration parameters and / or stress test iteration number parameters. Further optionally, the target stress test result of the interface to be tested includes the stress test duration threshold and / or stress test iteration number threshold of the interface to be tested. Specifically, the target stress test result of the interface to be tested is used to indicate the interface performance parameters (such as interface capacity parameters, etc.) of the interface to be tested.

[0099] Furthermore, after obtaining the target stress test result (such as a stress test report) of the interface to be tested, the data written to the shadow library during the stress test process can be cleaned up, or the performance of the interface to be tested can be optimized based on the target stress test result.

[0100] For example, if Figure 1 As shown, Figure 1 The present invention discloses an automated stress testing architecture for server interface performance, wherein the automated stress testing process for server interface performance can be divided into four parts (each part including corresponding stress testing steps): clarifying the stress testing target (i.e., determining the interface to be tested), before stress testing (i.e., performing pre-stress testing on the interface to be tested), during stress testing (i.e., performing target stress testing on the interface to be tested), and after stress testing (i.e., evaluating and improving interface performance based on stress testing results).

[0101] It can be seen that the implementation of the embodiment of the present invention can intelligently determine the stress testing use cases of the interface to be tested that needs to be stress tested, and perform automated stress testing on the interface to be tested. In this way, the stress testing standards between the stress testing use cases of each interface can be unified, thereby improving the reliability and accuracy of the stress testing of the interface to be tested, thereby obtaining accurate interface stress testing results to ensure that the performance of the interface to be tested matches the corresponding marketing activity scenario and ensure the normal progress of the marketing activity; at the same time, through automated stress testing of interface performance, the traditional stress testing preparation process can be simplified, thereby improving the efficiency of stress testing of interface performance.

[0102] In an optional embodiment, determining the interface to be tested that needs stress testing in the above step 101 includes:

[0103] Determine the expected business scenario for determining the interface to be tested, and determine scenario information of the expected business scenario;

[0104] According to the scenario information of the expected business scenario, multiple expected calling interfaces required to be called in the expected business scenario are determined, and interface implementation function information of each expected calling interface is determined;

[0105] Determine the interface data flow direction of each expected calling interface according to the interface realization function information of each expected calling interface;

[0106] According to the interface data flow directions of all expected calling interfaces, all expected calling interfaces whose interface data flow directions are the preset data flow directions are determined from all expected calling interfaces as the interfaces to be tested that need stress testing.

[0107] In this optional embodiment, some external or internal http interfaces that are called and the links of stress testing sometimes need to be shielded. Optionally, the scenario information includes at least one of the expected marketing product information, expected product transaction mode information, expected cooperative merchant information, expected consumer online shopping habit information, expected online store marketing information and expected product marketing method information, such as expected marketing product type information, expected product online banking transaction mode, expected product third-party transaction mode (such as Alipay, WeChat payment), expected cooperative merchant qualification query, expected consumer online shopping browsing habit information, expected consumer online shopping product purchase information, expected consumer online shopping order information, expected online store transaction volume, etc.

[0108] For example, some third-party interfaces, such as SMS sending interface and payment interface, need to be shielded during stress testing to reduce the cost of external interface calls. Therefore, during full-link stress testing, it is necessary to route the links that access external interfaces and route the target services accessed by the interfaces to the mock server. Figure 6 As shown, Figure 6 The present invention discloses a flow chart of determining an interface to be tested according to an embodiment of the present invention, wherein the following steps are performed: intercepting the method of accessing the http interface by the application, rewriting the target address of the http access, and the interception can be implemented by intercepting the corresponding httpclient method by Java agent probe method to reduce the code intrusion into the application (the application generally sends http requests through interfaces such as Httpclient3, Httpclient4, and Okhttp, and the agent needs to intercept these interfaces); at the same time, intercepting the route for accessing the http interface Path requires a configurable method definition, and the configuration can be placed in the apollo configuration center (such as: / abc→http: / / host:port / bcd, wherein host:port can be the default yapi address and can be configured), wherein the agent can obtain the information of the Apollo configuration center through the Apollo api during initialization, and subscribe to update events; in addition, the data returned after accessing the mock interface can be cached (which can be implemented using the Guava tool and an expiration time can be set) to reduce the pressure on the mock server, wherein the mock server can be implemented using the yapi open source tool. More specifically, Figure 6 The update events in the main are real-time synchronization of configuration data on the apollo configuration center, such as the corresponding relationship configuration between the visited URL and the mock Url.

[0109] It can be seen that this optional embodiment can determine the interface to be stress tested from the expected calling interface in a targeted manner based on the determined expected business scenario. This is conducive to improving the reliability and accuracy of determining the interface to be tested, and thus helps to save the time and cost required for stress testing. At the same time, it is also conducive to ensuring the compatibility between the interface to be tested and the relevant marketing activity scenarios, thereby helping to comprehensively improve the effectiveness of stress testing of the interface to be tested.

[0110] In another optional embodiment, determining the stress test case corresponding to the interface to be tested in the above step 101 includes:

[0111] According to the scenario information of the expected business scenario, determine the scenario use case of the interface to be tested and determine the requirement information;

[0112] Determine the link use case of the interface to be tested and determine the requirement information according to the interface implementation function information of the interface to be tested and the corresponding interface data flow direction;

[0113] Determine the requirement information based on the scenario use cases of the interface to be tested and the link use cases, and determine the stress testing use cases corresponding to the interface to be tested.

[0114] In this optional embodiment, the stress testing link use case and the stress testing scenario use case of the interface to be tested are configured, and the relevant stress testing use case can be pre-configured, or it can be intelligently configured through a visual automatic stress testing platform (that is, the stress testing use case can be integrated into the automatic stress testing platform in advance so that it can be shared or called). Optionally, the scenario use case determination requirement information of the interface to be tested includes at least one of the interface assertion requirement information of the interface to be tested, the target scenario information of the expected business scenario to be extracted, and the scenario operating environment requirement information. At the same time, it can also include the parameter transfer dependency between the interfaces to be tested, wherein the target scenario information of the expected business scenario to be extracted can include online store homepage layout scenario information, account password login scenario information, flash sale marketing scenario information, group purchase marketing scenario information, bargaining marketing scenario information, etc., which can be screened and determined from the scenario information of the expected business scenario.

[0115] Further optionally, the link use case of the interface to be tested determines the requirement information including at least one of the link data source requirement information, link request method requirement information, link data destination requirement information and link operating environment requirement information of the interface to be tested, wherein the link operating environment requirement information includes Mock operating environment information. Specifically, when it is necessary to import a link, the visual automatic stress testing platform can support VTS plug-in recording, Postman, Swagger, HAR, and Jmeter file import.

[0116] Furthermore, after determining the stress testing use case corresponding to the interface to be tested, a scheduled task configuration can be performed for the stress testing link use case and / or the stress testing scenario use case, such as editing the execution time of the scheduled task through a cron expression, or defining it by generating an expression.

[0117] It can be seen that this optional embodiment can determine the corresponding use case determination requirement information based on the scenario information and related interface information, and determine the stress testing use case corresponding to the interface to be tested based on the use case determination requirement information. This is conducive to improving the reliability and accuracy of determining the requirement information for the relevant use cases, and further conducive to improving the reliability and accuracy of determining the stress testing use case corresponding to the interface to be tested, which is conducive to ensuring the reliability and accuracy of the stress testing of the interface to be tested during the actual stress testing process, so as to obtain accurate interface stress testing results.

[0118] In yet another optional embodiment, the above steps of determining the requirement information according to the scenario use case of the interface to be tested and the link use case to determine the requirement information, and determining the stress test use case corresponding to the interface to be tested, include:

[0119] Determine the interface parameters of the interface to be tested;

[0120] Determine the impact of the stress test case corresponding to the interface to be tested according to the interface parameters of the interface to be tested, and judge whether the impact of the stress test case is greater than or equal to the preset impact threshold;

[0121] When it is determined that the impact of the stress test case is greater than or equal to the impact threshold, the stress test case corresponding to the interface to be tested is determined according to the interface parameters of the interface to be tested, the requirement information of the scenario case determination, and the requirement information of the link case determination;

[0122] When it is determined that the impact determined by the stress testing use case is less than the impact threshold, the stress testing use case corresponding to the interface to be tested is determined according to the scenario use case determination requirement information and the link use case determination requirement information of the interface to be tested.

[0123] In this optional embodiment, when the interface parameters of the interface to be tested affect the accuracy of the determination of the stress test case, it is necessary to determine the stress test case in combination with the interface parameters of the interface to be tested. Optionally, the interface parameters of the interface to be tested include at least one of the interface state parameters, interface type parameters, interface working mode parameters, and interface protection parameters of the interface to be tested.

[0124] It can be seen that this optional embodiment can further combine the interface parameters of the interface to be tested to determine its corresponding stress testing use case. This is conducive to further improving the reliability and accuracy of determining the stress testing use case of the interface to be tested, and then to improving the reliability, accuracy and effectiveness of subsequent pre-stress testing operations on the interface to be tested through stress testing use cases, thereby facilitating the accurate implementation of the target stress testing operation of the interface to be tested.

[0125] Embodiment 2

[0126] See also Figure 3 , Figure 3 1 is a flow chart of an automated stress testing method for server interface performance disclosed in an embodiment of the present invention. Figure 3 The described automated stress testing method for server interface performance can be applied to server interface performance stress testing in various marketing activity scenarios, such as Double 11 activities, 618 promotion activities, etc., which is not limited by the embodiments of the present invention. Optionally, the method can be implemented by a server interface stress testing system (such as a visual automatic stress testing platform). The server interface stress testing system can be integrated in a server interface stress testing device, or it can be a local server or cloud server for processing the server interface stress testing process, which is not limited by the embodiments of the present invention. Figure 3 As shown, the automated stress testing method for the server interface performance may include the following operations:

[0127] 201. Determine the interface to be tested that needs stress testing, and determine the stress testing use case corresponding to the interface to be tested.

[0128] 202. According to the stress test case corresponding to the interface to be tested, determine the database that the interface to be tested needs to access, and create a shadow library that matches the database.

[0129] In the embodiment of the present invention, the database that the interface to be tested needs to access can be understood as the business database that is actually generated and that the interface needs to access. Further, before creating a shadow library that matches the database, the connection between the interface to be tested and the preset stress test monitoring module (such as vts-agent) is determined, and it is determined whether the connection indicates that the two are successfully connected. If so, the operation of creating a shadow library that matches the database is executed.

[0130] 203. The interface to be tested is called through the use case shadow traffic corresponding to the preset stress testing use case, so as to write the traffic data corresponding to the use case shadow traffic into the shadow library.

[0131] In the embodiment of the present invention, it should be noted that when the traffic data corresponding to the use case shadow traffic is written to the shadow library, the traffic data will not be written to the actually generated business database to ensure that the data in the business database is not contaminated and to achieve accurate data isolation.

[0132] 204. Obtain the first target situation of the flow data in the shadow library as the pre-stress test result of the interface to be tested, and determine whether the pre-stress test result indicates that the pre-stress test of the interface to be tested is successful.

[0133] In an embodiment of the present invention, whether the interface to be tested is successfully pre-stressed is determined by determining the flow data writing situation (such as whether the flow data is written correctly) and the server working situation (such as whether the operation of the central processing unit is too slow or whether the memory is large enough, etc.). Optionally, the first target situation of the flow data includes the first writing situation of the flow data and / or the first working situation of the corresponding server, wherein the first writing situation of the flow data includes the first writing error situation and / or the first writing omission situation of the flow data, and the first working situation of the server corresponding to the flow data includes at least one of the first operation situation of the central processing unit of the server, the first cache situation of the memory, the first reading and writing situation of the hard disk, and the first data transmission situation of the broadband. Furthermore, the acquisition of the first writing situation of the flow data can be achieved by checking the table data of the shadow library and by calling the shadow link interface.

[0134] 205. When the judgment result is yes, a target stress testing operation is performed on the interface to be tested according to the target stress testing parameters for the stress testing, and a target stress testing result of the interface to be tested is obtained.

[0135] In the embodiment of the present invention, for other descriptions of step 201 and step 205, please refer to the detailed description of step 101 and step 103 in the first embodiment, and the embodiment of the present invention will not be repeated.

[0136] It can be seen that the implementation of the embodiment of the present invention can automatically create the corresponding shadow library, call the interface to be tested and judge the pre-stress test of the interface to be tested. In this way, the cumbersome process of pre-stress testing of the interface to be tested can be simplified, thereby improving the efficiency of pre-stress testing of the interface to be tested. At the same time, the reliability and accuracy of the pre-stress testing results of the interface to be tested can also be improved, which is conducive to the smooth progress of subsequent target stress testing operations on the interface to be tested.

[0137] In an optional embodiment, the step 205 performs a target stress testing operation on the interface to be tested according to the target stress testing parameters for stress testing to obtain the target stress testing result of the interface to be tested, including:

[0138] According to the target stress testing parameters for stress testing and the use case shadow traffic corresponding to the preset stress testing use case, the interface to be tested is called to write the traffic data corresponding to the use case shadow traffic to the shadow library corresponding to the interface to be tested based on the target stress testing parameters;

[0139] Obtain the second target situation of the traffic data in the shadow library, and determine whether the second target situation is the preset stress test performance situation;

[0140] When it is determined that the second target situation is a stress test performance situation, the target stress test parameters are updated, and the above-mentioned operation of calling the interface to be tested based on the target stress test parameters for stress testing and the use case shadow flow corresponding to the preset stress test use case is triggered to write the flow data corresponding to the use case shadow flow to the shadow library corresponding to the interface to be tested based on the target stress test parameters;

[0141] When it is determined that the second target situation is not a stress test performance situation, the last target stress test parameter corresponding to the interface to be tested is obtained, and the target stress test result of the interface to be tested is determined according to the last target stress test parameter.

[0142] In this optional embodiment, optionally, the second target condition of the traffic data includes a second write condition of the traffic data and / or a second working condition of the corresponding server, wherein the second write condition of the traffic data includes a second write error condition and / or a second write omission condition of the traffic data, and the second working condition of the server corresponding to the traffic data includes at least one of a second computing condition of the server's central processing unit, a second cache condition of the memory, a second read and write condition of the hard disk, and a second data transmission condition of the broadband.

[0143] For example, when the stress test duration parameter is determined to be 10 seconds, the interface to be tested is called based on the stress test duration parameter and the use case shadow traffic corresponding to the stress test use case, and it is determined whether the traffic data written in the shadow library is accurate. If so, the stress test duration parameter is extended to 30 seconds, and the target stress test operation is repeatedly performed based on the stress test duration parameter, and it is determined whether the traffic data written in the shadow library is accurate. If so, the stress test duration parameter is continued to be extended and the target stress test operation is repeatedly performed until it is determined that the traffic data written in the shadow library is invalid, and the relevant stress test threshold parameters of the interface to be tested are determined according to the last target stress test parameter.

[0144] Furthermore, before performing a target stress testing operation on the interface to be tested according to the target stress testing parameters for stress testing and obtaining the target stress testing result of the interface to be tested, the method also includes: determining the historical calling situation of the interface to be tested, and based on the historical calling situation, judging whether it is necessary to perform a stress testing preheating operation on the interface to be tested, and if so, performing a stress testing preheating operation on the interface to be tested.

[0145] Specifically, when the number of calls to the interface to be tested is relatively small (such as a cold interface), a stress test warm-up operation needs to be performed on the interface to be tested.

[0146] It can be seen that this optional embodiment can automatically perform target stress testing operations on the interface to be tested based on the target stress testing parameters. In this way, the cumbersome process of target stress testing operations on the interface to be tested can be simplified, thereby improving the efficiency of target stress testing operations on the interface to be tested. At the same time, the reliability and accuracy of the target stress testing results of the interface to be tested can also be improved, which is conducive to improving the adaptability between the interface to be tested and the actual marketing activity scenario, so as to ensure the smooth progress of online marketing activities.

[0147] In another optional embodiment, determining whether the pre-stress test result in step 204 indicates that the pre-stress test of the interface to be tested is successful includes:

[0148] Determining target writing parameters of the flow data according to the first writing condition of the flow data;

[0149] Determine whether the target write parameter is greater than or equal to a preset write parameter threshold;

[0150] When it is determined that the target write parameter is greater than or equal to the write parameter threshold, determining the degree of influence on the work of the server according to the first working condition of the server corresponding to the traffic data;

[0151] Determine whether the absolute value of the work impact is less than or equal to a preset work impact threshold;

[0152] When it is determined that the work impact is less than or equal to the work impact threshold, determining the pre-stress test result indicates that the pre-stress test of the interface to be tested is successful.

[0153] In this optional embodiment, when it is determined that the traffic data can be written normally, it is determined whether the working condition of the server is negatively affected too much, such as the central processing unit is too slow to operate, the memory cache is seriously insufficient, etc. Optionally, the target writing parameters of the traffic data include the writing accuracy and / or writing completeness of the traffic data.

[0154] It can be seen that this optional embodiment can automatically determine whether the interface to be tested has been successfully pre-stress tested based on the determined target write parameters of the traffic data and the impact on the server's work. This is conducive to improving the reliability and accuracy of the pre-stress testing operation of the interface to be tested, and thus is conducive to the precise performance of subsequent target stress testing operations on the interface to be tested, thereby facilitating obtaining effective target stress testing results for the interface to be tested.

[0155] Embodiment 3

[0156] See also Figure 4 , Figure 4 Schematic diagram of the structure of an automatic stress test device for server interface performance disclosed in an embodiment of the present invention. Figure 4As shown, the automatic stress testing device for the server interface performance may include:

[0157] The first determination module 301 is used to determine the interface to be tested that needs stress testing;

[0158] The second determination module 302 is used to determine the stress test case corresponding to the interface to be tested;

[0159] The stress testing module 303 is used to perform a pre-stress testing operation on the interface to be tested through the stress testing use case corresponding to the interface to be tested, and obtain the pre-stress testing result of the interface to be tested;

[0160] A judgment module 304 is used to judge whether the pre-stress test result indicates that the pre-stress test of the interface to be tested is successful;

[0161] The stress testing module 303 is further configured to, when the judgment result of the judgment module 304 is yes, perform a target stress testing operation on the interface to be tested according to the target stress testing parameters for the stress testing, and obtain a target stress testing result of the interface to be tested.

[0162] In an embodiment of the present invention, the target stress testing parameters include a stress testing duration parameter and / or a stress testing iteration number parameter, the target stress testing result of the interface to be tested includes a stress testing duration threshold and / or a stress testing iteration number threshold of the interface to be tested, and the target stress testing result of the interface to be tested is used to indicate the interface performance parameters of the interface to be tested.

[0163] It can be seen that implementation Figure 4 The described automated stress testing device for server interface performance can intelligently determine stress testing use cases of the interface to be tested that needs stress testing, and perform automated stress testing on the interface to be tested. In this way, the stress testing standards between stress testing use cases of each interface can be unified, thereby improving the reliability and accuracy of the stress testing of the interface to be tested, thereby obtaining accurate interface stress testing results to ensure that the performance of the interface to be tested matches the corresponding marketing activity scenario and ensure the normal progress of the marketing activity; at the same time, through automated stress testing of interface performance, the traditional stress testing preparation process can be simplified, thereby improving the efficiency of stress testing of interface performance.

[0164] In an optional embodiment, the first determining module 301 determines the interface to be tested that needs stress testing in the following manner:

[0165] Determine the expected business scenario for determining the interface to be tested, and determine scenario information of the expected business scenario;

[0166] According to the scenario information of the expected business scenario, multiple expected calling interfaces required to be called in the expected business scenario are determined, and interface implementation function information of each expected calling interface is determined;

[0167] Determine the interface data flow direction of each expected calling interface according to the interface realization function information of each expected calling interface;

[0168] According to the interface data flow directions of all expected calling interfaces, all expected calling interfaces whose interface data flow directions are the preset data flow directions are determined from all expected calling interfaces as the interfaces to be tested that need stress testing.

[0169] In this optional embodiment, the scenario information includes at least one of expected marketing product information, expected product transaction model information, expected cooperating merchant information, expected consumer online shopping habit information, expected online store marketing situation and expected product marketing method information.

[0170] It can be seen that implementation Figure 4 The described automated stress testing device for server interface performance can, based on the determined expected business scenarios, specifically determine the interface to be stress tested from the expected calling interface. This is conducive to improving the reliability and accuracy of determining the interface to be tested, thereby helping to save the time and cost required for stress testing. At the same time, it is also conducive to ensuring the compatibility between the interface to be tested and the relevant marketing activity scenarios, thereby helping to comprehensively improve the effectiveness of stress testing of the interface to be tested.

[0171] In another optional embodiment, the second determination module 302 determines the stress test case corresponding to the interface to be tested in the following manner:

[0172] According to the scenario information of the expected business scenario, determine the scenario use case of the interface to be tested and determine the requirement information;

[0173] Determine the link use case of the interface to be tested and determine the requirement information according to the interface implementation function information of the interface to be tested and the corresponding interface data flow direction;

[0174] Determine the requirement information based on the scenario use cases of the interface to be tested and the link use cases, and determine the stress testing use cases corresponding to the interface to be tested.

[0175] In this optional embodiment, the scenario use case determination requirement information of the interface to be tested includes at least one of the interface assertion requirement information of the interface to be tested, the target scenario information of the expected business scenario to be extracted, and the scenario operating environment requirement information; the link use case determination requirement information of the interface to be tested includes at least one of the link data source requirement information, link request method requirement information, link data destination requirement information, and link operating environment requirement information of the interface to be tested; the stress testing use case includes a stress testing scenario use case and a stress testing link use case.

[0176] It can be seen that implementation Figure 4The described automated stress testing device for server interface performance can determine the corresponding use case determination requirement information based on scenario information and related interface information, and determine the stress testing use case corresponding to the interface to be tested based on the use case determination requirement information. This is conducive to improving the reliability and accuracy of determining the requirement information for the relevant use cases, and further conducive to improving the reliability and accuracy of determining the stress testing use cases corresponding to the interface to be tested, which is conducive to ensuring the reliability and accuracy of the stress testing of the interface to be tested during the actual stress testing process, so as to obtain accurate interface stress testing results.

[0177] In another optional embodiment, the stress testing module 303 performs a pre-stress testing operation on the interface to be tested through the stress testing case corresponding to the interface to be tested, and obtains the pre-stress testing result of the interface to be tested in the following manner:

[0178] According to the stress test cases corresponding to the interface to be tested, determine the database that the interface to be tested needs to access, and create a shadow library that matches the database;

[0179] The interface to be tested is called through the use case shadow traffic corresponding to the preset stress test use case to write the traffic data corresponding to the use case shadow traffic into the shadow library;

[0180] Obtain the first target situation of the traffic data in the shadow library as the pre-stress test result of the interface to be tested.

[0181] In this optional embodiment, the first target condition of the traffic data includes the first writing condition of the traffic data and / or the first working condition of the corresponding server, the first writing condition of the traffic data includes the first writing error condition and / or the first writing omission condition of the traffic data, and the first working condition of the server corresponding to the traffic data includes at least one of the first computing condition of the server's central processing unit, the first cache condition of the memory, the first reading and writing condition of the hard disk, and the first data transmission condition of the broadband.

[0182] It can be seen that implementation Figure 4 The described automated stress testing device for server interface performance can automatically create a corresponding shadow library, call the interface to be tested, and perform pre-stress testing on the interface to be tested. In this way, the cumbersome process of pre-stress testing on the interface to be tested can be simplified, thereby improving the efficiency of pre-stress testing on the interface to be tested. At the same time, the reliability and accuracy of the pre-stress testing results of the interface to be tested can also be improved, thereby facilitating the smooth implementation of subsequent target stress testing operations on the interface to be tested.

[0183] In another optional embodiment, the stress testing module 303 performs a target stress testing operation on the interface to be tested according to the target stress testing parameters for stress testing, and obtains the target stress testing result of the interface to be tested in the following manner:

[0184] According to the target stress testing parameters for stress testing and the use case shadow traffic corresponding to the preset stress testing use case, the interface to be tested is called to write the traffic data corresponding to the use case shadow traffic to the shadow library corresponding to the interface to be tested based on the target stress testing parameters;

[0185] Obtain the second target situation of the traffic data in the shadow library, and determine whether the second target situation is the preset stress test performance situation;

[0186] When it is determined that the second target situation is a stress testing performance situation, the target stress testing parameters are updated, and the operation of calling the interface to be tested based on the target stress testing parameters for stress testing and the use case shadow traffic corresponding to the preset stress testing use case is triggered, so as to write the traffic data corresponding to the use case shadow traffic to the shadow library corresponding to the interface to be tested based on the target stress testing parameters;

[0187] When it is determined that the second target situation is not a stress test performance situation, the last target stress test parameter corresponding to the interface to be tested is obtained, and the target stress test result of the interface to be tested is determined according to the last target stress test parameter.

[0188] In this optional embodiment, the second target condition of the traffic data includes the second writing condition of the traffic data and / or the second working condition of the corresponding server, the second writing condition of the traffic data includes the second writing error condition and / or the second writing omission condition of the traffic data, and the second working condition of the server corresponding to the traffic data includes at least one of the second computing condition of the server's central processing unit, the second cache condition of the memory, the second read and write condition of the hard disk, and the second data transmission condition of the broadband.

[0189] It can be seen that implementation Figure 4 The described automated stress testing device for server interface performance can automatically perform target stress testing operations on the interface to be tested based on target stress testing parameters. In this way, the cumbersome process of target stress testing operations on the interface to be tested can be simplified, thereby improving the efficiency of target stress testing operations on the interface to be tested. At the same time, the reliability and accuracy of the target stress testing results of the interface to be tested can also be improved, which is conducive to improving the adaptability between the interface to be tested and the actual marketing activity scenario, so as to ensure the smooth progress of online marketing activities.

[0190] In another optional embodiment, the second determination module 302 determines the requirement information according to the scenario use case of the interface to be tested and the link use case to determine the requirement information, and determines the stress test use case corresponding to the interface to be tested in the following manner:

[0191] Determine the interface parameters of the interface to be tested;

[0192] Determine the impact of the stress test case corresponding to the interface to be tested according to the interface parameters of the interface to be tested, and judge whether the impact of the stress test case is greater than or equal to the preset impact threshold;

[0193] When it is determined that the impact of the stress test case is greater than or equal to the impact threshold, the stress test case corresponding to the interface to be tested is determined according to the interface parameters of the interface to be tested, the requirement information of the scenario case determination, and the requirement information of the link case determination;

[0194] When it is determined that the impact determined by the stress testing use case is less than the impact threshold, the stress testing use case corresponding to the interface to be tested is determined according to the scenario use case determination requirement information and the link use case determination requirement information of the interface to be tested.

[0195] In this optional embodiment, the interface parameters of the interface to be tested include at least one of an interface state parameter, an interface type parameter, an interface working mode parameter, and an interface protection parameter of the interface to be tested.

[0196] It can be seen that implementation Figure 4 The described automated stress testing device for server interface performance can further determine the corresponding stress testing use case in combination with the interface parameters of the interface to be tested. This is conducive to further improving the reliability and accuracy of determining the stress testing use case for the interface to be tested, and further conducive to improving the reliability, accuracy and effectiveness of subsequent pre-stress testing operations on the interface to be tested through stress testing use cases, thereby facilitating the accurate implementation of the target stress testing operation of the interface to be tested.

[0197] In another optional embodiment, the determination module 304 determines whether the pre-stress test result indicates that the pre-stress test of the interface to be tested is successful in the following manner:

[0198] Determining target writing parameters of the flow data according to the first writing condition of the flow data;

[0199] Determine whether the target write parameter is greater than or equal to a preset write parameter threshold;

[0200] When it is determined that the target write parameter is greater than or equal to the write parameter threshold, determining the degree of influence on the work of the server according to the first working condition of the server corresponding to the traffic data;

[0201] Determine whether the absolute value of the work impact is less than or equal to a preset work impact threshold;

[0202] When it is determined that the work impact is less than or equal to the work impact threshold, determining the pre-stress test result indicates that the pre-stress test of the interface to be tested is successful.

[0203] In this optional embodiment, the target writing parameter of the traffic data includes the writing accuracy and / or writing completeness of the traffic data.

[0204] It can be seen that implementation Figure 4 The described automated stress testing device for server interface performance can automatically determine whether the interface to be tested has been pre-stress tested successfully based on the determined target write parameters of the traffic data and the degree of impact on the server's work. This is conducive to improving the reliability and accuracy of the pre-stress testing operation of the interface to be tested, and is further conducive to the precise performance of subsequent target stress testing operations on the interface to be tested, thereby facilitating obtaining effective target stress testing results for the interface to be tested.

[0205] Embodiment 4

[0206] See also Figure 5 , Figure 5 FIG. 1 is a schematic diagram of the structure of another automatic stress testing device for server interface performance disclosed in an embodiment of the present invention. Figure 5 As shown, the automatic stress testing device for the server interface performance may include:

[0207] A memory 401 storing executable program codes;

[0208] a processor 402 coupled to the memory 401;

[0209] The processor 402 calls the executable program code stored in the memory 401 to execute the steps in the method for automatic stress testing of server interface performance described in the first embodiment of the present invention or the second embodiment of the present invention.

[0210] Embodiment 5

[0211] An embodiment of the present invention discloses a computer storage medium storing computer instructions. When the computer instructions are called, they are used to execute the steps of the automated stress testing method for server interface performance described in Embodiment 1 or Embodiment 2 of the present invention.

[0212] Embodiment 6

[0213] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps in the automated stress testing method for server interface performance described in Embodiment 1 or Embodiment 2.

[0214] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0215] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0216] Finally, it should be noted that the method and device for automated stress testing of server interface performance disclosed in the embodiment of the present invention disclose only the preferred embodiments of the present invention, which are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. An automated stress testing method for server interface performance, characterized in that: The method comprises: Determine the interface to be tested that needs stress testing, and determine the stress testing use case corresponding to the interface to be tested; Perform a pre-stress test operation on the interface to be tested through the stress test case corresponding to the interface to be tested, obtain a pre-stress test result of the interface to be tested, and determine whether the pre-stress test result indicates that the pre-stress test on the interface to be tested is successful; When the judgment result is yes, the target stress testing operation is performed on the interface to be tested according to the target stress testing parameters for stress testing to obtain the target stress testing result of the interface to be tested; the target stress testing parameters include a stress testing duration parameter and / or a stress testing iteration number parameter, and the target stress testing result of the interface to be tested includes a stress testing duration threshold and / or a stress testing iteration number threshold of the interface to be tested, and the target stress testing result of the interface to be tested is used to indicate the interface performance parameters of the interface to be tested.

2. The automated stress testing method for server interface performance according to claim 1, characterized in that: The step of determining the interface to be tested that needs stress testing includes: Determine the expected business scenario for determining the interface to be tested, and determine the scenario information of the expected business scenario; the scenario information includes at least one of expected marketing product information, expected product transaction mode information, expected cooperative merchant information, expected consumer online shopping habit information, expected online store marketing situation, and expected product marketing method information; Determine, according to the scenario information of the expected business scenario, a plurality of expected calling interfaces required to be called in the expected business scenario, and determine interface implementation function information of each of the expected calling interfaces; Determining the interface data flow direction of each of the expected calling interfaces according to the interface realization function information of each of the expected calling interfaces; According to the interface data flow directions of all the expected calling interfaces, all the expected calling interfaces whose interface data flow directions are the preset data flow directions are determined from all the expected calling interfaces as the interfaces to be tested that need stress testing.

3. The automated stress testing method for server interface performance according to claim 2, characterized in that: The determining of the stress test case corresponding to the interface to be tested includes: Determine the scenario use case determination requirement information of the interface to be tested according to the scenario information of the expected business scenario; the scenario use case determination requirement information of the interface to be tested includes at least one of the interface assertion requirement information of the interface to be tested, the target scenario information of the expected business scenario to be extracted, and the scenario operation environment requirement information; Determine the link use case determination requirement information of the interface to be tested according to the interface implementation function information of the interface to be tested and the corresponding interface data flow direction; the link use case determination requirement information of the interface to be tested includes at least one of the link data source requirement information, link request mode requirement information, link data destination requirement information and link operation environment requirement information of the interface to be tested; Determine the requirement information according to the scenario use case of the interface to be tested and the requirement information according to the link use case, and determine the stress testing use case corresponding to the interface to be tested; the stress testing use case includes a stress testing scenario use case and a stress testing link use case.

4. The automated stress testing method for server interface performance according to any one of claims 1 to 3, characterized in that: The pre-stress test operation is performed on the interface to be tested through the stress test case corresponding to the interface to be tested to obtain the pre-stress test result of the interface to be tested, including: According to the stress test case corresponding to the interface to be tested, determine the database that the interface to be tested needs to access, and create a shadow library matching the database; The interface to be tested is called by using the preset use case shadow traffic corresponding to the stress testing use case, so as to write the traffic data corresponding to the use case shadow traffic into the shadow library; Obtain a first target condition of the flow data in the shadow library as a pre-stress test result of the interface to be tested; the first target condition of the flow data includes a first write condition of the flow data and / or a first working condition of a corresponding server, the first write condition of the flow data includes a first write error condition and / or a first write omission condition of the flow data, and the first working condition of the server corresponding to the flow data includes at least one of a first computing condition of a central processing unit of the server, a first cache condition of a memory, a first read / write condition of a hard disk, and a first data transmission condition of a broadband.

5. The automated stress testing method for server interface performance according to claim 4, characterized in that: The step of performing a target stress testing operation on the interface to be tested according to the target stress testing parameters for stress testing to obtain a target stress testing result of the interface to be tested includes: According to the target stress testing parameters for stress testing and the preset use case shadow traffic corresponding to the stress testing use case, the interface to be tested is called to write the traffic data corresponding to the use case shadow traffic to the shadow library corresponding to the interface to be tested based on the target stress testing parameters; Obtaining a second target condition of the flow data in the shadow library, and determining whether the second target condition is a preset stress test performance condition; the second target condition of the flow data includes a second write condition of the flow data and / or a second working condition of the corresponding server, the second write condition of the flow data includes a second write error condition and / or a second write omission condition of the flow data, and the second working condition of the server corresponding to the flow data includes at least one of a second computing condition of the central processing unit of the server, a second cache condition of the memory, a second read-write condition of the hard disk, and a second data transmission condition of the broadband; When it is determined that the second target situation is the stress testing performance situation, the target stress testing parameters are updated, and the operation of calling the interface to be tested according to the target stress testing parameters for stress testing and the preset use case shadow traffic corresponding to the stress testing use case is triggered, so as to write the traffic data corresponding to the use case shadow traffic to the shadow library corresponding to the interface to be tested based on the target stress testing parameters; When it is determined that the second target condition is not the stress test performance condition, the last target stress test parameter corresponding to the interface to be tested is obtained, and the target stress test result of the interface to be tested is determined according to the last target stress test parameter.

6. The automated stress testing method for server interface performance according to claim 3, characterized in that: The determining of requirement information according to the scenario use case of the interface to be tested and the link use case to determine requirement information, and determining the stress test use case corresponding to the interface to be tested, includes: Determine the interface parameters of the interface to be tested; the interface parameters of the interface to be tested include at least one of the interface state parameters, interface type parameters, interface working mode parameters and interface protection parameters of the interface to be tested; Determine the impact of the stress test case corresponding to the interface to be tested according to the interface parameters of the interface to be tested, and judge whether the impact of the stress test case is greater than or equal to a preset impact threshold; When it is determined that the impact determined by the stress testing use case is greater than or equal to the impact threshold, determining the stress testing use case corresponding to the interface to be tested according to the interface parameters of the interface to be tested, the requirement information determined by the scenario use case, and the requirement information determined by the link use case; When it is determined that the impact determined by the stress testing use case is less than the impact threshold, the stress testing use case corresponding to the interface to be tested is determined according to the scenario use case determination requirement information of the interface to be tested and the link use case determination requirement information.

7. The automated stress testing method for server interface performance according to claim 4, characterized in that: The determining whether the pre-stress test result indicates that the pre-stress test on the interface to be tested is successful includes: Determining target writing parameters of the traffic data according to the first writing condition of the traffic data; the target writing parameters of the traffic data include writing accuracy and / or writing completeness of the traffic data; Determining whether the target write parameter is greater than or equal to a preset write parameter threshold; When it is determined that the target write parameter is greater than or equal to the write parameter threshold, determining the degree of influence on the operation of the server according to a first operation condition of the server corresponding to the traffic data; Determining whether the absolute value of the work influence is less than or equal to a preset work influence threshold; When it is determined that the work impact is less than or equal to the work impact threshold, determining the pre-stress test result indicates that the pre-stress test on the interface to be tested is successful.

8. An automated stress testing device for server interface performance, characterized in that: The device comprises: The first determination module is used to determine the interface to be tested that needs stress testing; A second determination module is used to determine the stress test case corresponding to the interface to be tested; A stress testing module, used to perform a pre-stress testing operation on the interface to be tested through a stress testing case corresponding to the interface to be tested, and obtain a pre-stress testing result of the interface to be tested; A judging module, used to judge whether the pre-stress test result indicates that the pre-stress test on the interface to be tested is successful; The stress testing module is further used to, when the judgment result of the judgment module is yes, perform a target stress testing operation on the interface to be tested according to the target stress testing parameters used for stress testing to obtain a target stress testing result of the interface to be tested; the target stress testing parameters include a stress testing duration parameter and / or a stress testing iteration number parameter, the target stress testing result of the interface to be tested includes a stress testing duration threshold and / or a stress testing iteration number threshold of the interface to be tested, and the target stress testing result of the interface to be tested is used to indicate the interface performance parameters of the interface to be tested.

9. An automated stress testing device for server interface performance, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the automated stress testing method for server interface performance as described in any one of claims 1-7.

10. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the automated stress testing method for server interface performance as described in any one of claims 1-7.