Test requirement identification method, device, electronic device and storage medium

By analyzing the operation information when the interface is called and predicting the interface status, identifying the stress testing requirements of the system interface, the problem of subjective judgment of interface pressure testing in the existing technology is solved, and timely performance optimization and pressure point recognition are achieved.

CN113626340BActive Publication Date: 2024-12-03BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110994587.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-27
Publication Date
2024-12-03
Estimated Expiration
2041-08-27

AI Technical Summary

Technical Problem

Existing interface stress tests often rely on the developers' subjective judgment and cannot guarantee timeliness, resulting in the system being unable to identify and optimize in time when facing access pressure and performance problems.

Method used

By obtaining the running information generated when the target interface is called, analyzing its running trend, and predicting the operating status of the interface based on the pre-built state detection model, determining whether it has stress testing requirements, and then identifying the stress testing requirements of the system interface.

Benefits of technology

It realizes accurate identification of stress testing requirements for the system interface, identify performance pressure points as early as possible, and perform performance optimization to prevent pressure problems in the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113626340B_ABST
    Figure CN113626340B_ABST
Patent Text Reader

Abstract

The present invention provides a test requirement identification method, device, electronic device and storage medium, which can be applied to the field of artificial intelligence or finance. For a target interface, the first operation information generated when it is called is analyzed to obtain its operation trend, and the operation status of the target interface is predicted based on the operation trend, and the operation status is used to determine whether the target interface has the need for stress testing. Based on the present invention, the stress test requirements of the system interface can be accurately identified, so as to identify the performance pressure points as early as possible, and optimize the performance to prevent the system from having stress problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and more specifically, to a test requirement identification method, device, electronic device and storage medium. Background Art

[0002] During system development and operation, we often face access pressure and performance issues, which requires stress testing of the interface.

[0003] However, currently, the stress test of the interface is often conducted by the developer based on the customer's needs and subjective judgment, which obviously cannot guarantee the timeliness of the stress test. Summary of the invention

[0004] In view of this, in order to solve the above problems, the present invention provides a test requirement identification method, device, electronic device and storage medium, and the technical solution is as follows:

[0005] A test requirement identification method, the method comprising:

[0006] Acquire first operation information generated when the target interface is called;

[0007] Analyzing the first operation information to obtain an operation trend of the target interface;

[0008] The operating status of the target interface is predicted based on the operating trend of the target interface, and the operating status can indicate whether the target interface meets the requirement of stress testing.

[0009] Preferably, the obtaining of the first operation information generated when the target interface is called includes:

[0010] Obtaining request parameters for calling the target interface; and / or

[0011] Get the hardware parameters of the target interface when it is called.

[0012] Preferably, the request parameters include one or more of request issuance time, request response time and request daily call volume, and the hardware parameters include one or more of CPU usage and memory usage;

[0013] Correspondingly, analyzing the first operation information to obtain the operation trend of the target interface includes:

[0014] In the case where the request parameter includes the request sending time, calculating the daily peak value of the target interface for multiple consecutive days according to the request sending time;

[0015] In the case where the request parameter includes the request response time, calculating the daily response time change trend of the target interface for multiple consecutive days according to the request response time;

[0016] In the case where the request parameter includes the requested daily call volume, calculating the daily call volume change trend of the target interface for multiple consecutive days according to the requested daily call volume;

[0017] In a case where the hardware parameter includes the CPU usage rate, calculating a daily CPU usage rate change trend of the target interface for multiple consecutive days according to the CPU usage rate;

[0018] In a case where the hardware parameters include the memory usage rate, a daily memory usage rate change trend of the target interface for a plurality of consecutive days is calculated according to the memory usage rate.

[0019] Preferably, predicting the operating state of the target interface based on the operating trend of the target interface includes:

[0020] Retrieving a pre-built status detection model, wherein the status detection model is obtained by training a basic network model with the operation trend of the configured interface as a training sample and with the goal of making the operation status prediction result of the training sample close to the operation status annotation result of the training sample;

[0021] The operation trend of the target interface is input into the state detection module to obtain the operation state of the target interface output by the state detection model.

[0022] Preferably, the method further comprises:

[0023] When the target interface meets the requirement of stress testing, obtaining second operation information of the system where the target interface is located;

[0024] analyzing the second operation information to obtain an operation trend of the system;

[0025] Based on the operation trend of the target interface and the operation trend of the system, the hardware resources required for the operation of the target interface are predicted.

[0026] A test requirement identification device, the device comprising:

[0027] An information acquisition module, used to acquire first operation information generated when the target interface is called;

[0028] A trend analysis module, configured to analyze the first operation information to obtain an operation trend of the target interface;

[0029] The state prediction module is used to predict the operation state of the target interface based on the operation trend of the target interface, and the operation state can indicate whether the target interface meets the requirements of stress testing.

[0030] Preferably, the state prediction module is specifically used for:

[0031] Recall a pre-built status detection model, which is obtained by training a basic network model with the operating trend of a configured interface as a training sample and with the goal of making the operating status prediction result of the training sample close to the operating status annotation result of the training sample; input the operating trend of the target interface into the status detection module to obtain the operating status of the target interface output by the status detection model.

[0032] Preferably, the device further comprises:

[0033] The hardware prediction module is used to obtain the second operation information of the system where the target interface is located when the target interface has the need for stress testing; analyze the second operation information to obtain the operation trend of the system; and predict the hardware resources required for the operation of the target interface based on the operation trend of the target interface and the operation trend of the system.

[0034] An electronic device comprises: at least one memory and at least one processor; the memory stores a program, the processor calls the program stored in the memory, and the program is used to implement the test requirement identification method.

[0035] A storage medium stores computer executable instructions, wherein the computer executable instructions are used to execute the test requirement identification method.

[0036] Compared with the prior art, the present invention has the following beneficial effects:

[0037] The present invention provides a test requirement identification method, device, electronic device and storage medium. For a target interface, the first operation information generated when the target interface is called is analyzed to obtain its operation trend, and the operation status of the target interface is predicted based on the operation trend, and the operation status is used to determine whether the target interface has the requirement for stress testing. Based on the present invention, the stress test requirement of the system interface can be accurately identified, so as to identify the performance pressure point as early as possible, and optimize the performance to prevent the system from having stress problems. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] Figure 1 A method flow chart of a test requirement identification method provided by an embodiment of the present invention;

[0040] Figure 2 Another method flow chart of the test requirement identification method provided by an embodiment of the present invention;

[0041] Figure 3 A flowchart of another method of the test requirement identification method provided by an embodiment of the present invention;

[0042] Figure 4 A schematic diagram of the structure of a test requirement identification device provided in an embodiment of the present invention;

[0043] Figure 5 Another structural schematic diagram of the test requirement identification device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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.

[0045] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0046] The present invention provides a method for identifying test requirements. Figure 1 As shown, the following steps are included:

[0047] S10, obtaining first operation information generated when the target interface is called.

[0048] In an embodiment of the present invention, the target interface is an interface for testing requirement identification. During the software development process, the interface call situation can be tracked by writing code to record the operation information generated by the target interface being called, that is, the first operation information.

[0049] In addition, the first operation information is the operation information of the target interface when the target interface is called by the front-end page of the system or a third-party system. Taking the front-end page as an example, when it calls the target interface, it will send a request to the target interface, and the target interface will respond based on the request and return corresponding information to the front-end page. Therefore, when the target interface is called once, a set of request parameters can be generated, so that based on the request parameters of the target interface being called, the daily call volume and other parameters of the target interface being called by the front-end page / third-party system can be obtained.

[0050] In this regard, the first operation information may include the request parameters of the target interface being called. The request parameters of any one dimension of the request sending time, request response time, and request daily call volume can be obtained through tracking.

[0051] Of course, in order to improve the diversity of information in the first operation information and ensure the accuracy of subsequent state prediction, in an embodiment of the present invention, the first operation information may also include hardware parameters when the target interface is called, and the hardware parameters include one or more of CPU usage and memory usage.

[0052] S20: Analyze the first operation information to obtain the operation trend of the target interface.

[0053] In the embodiment of the present invention, by writing a script or an application program, the first operation information of the target interface of the application layer can be counted item by item and analyzed in real time.

[0054] For the request sending time in the request parameters, since it represents the time when the front-end page / third-party system sends the request to the target interface, the daily peak value of the target interface can be calculated by counting the request sending time of different requests. Thus, the daily peak value of each day within multiple consecutive days as the statistical period can be obtained.

[0055] For the request response time in the request parameters, since it represents the time taken by the target interface to return information after receiving the request sent downward by the front-end page / third-party system, the daily response time change trend of the target interface can be calculated by counting the request response time of different requests, so as to determine the responsiveness of the target interface, and thus obtain the daily response time change trend within multiple consecutive days as the statistical period.

[0056] As for the daily call volume in the request parameter, since it represents the total number of requests sent by the target interface in response to the front-end page / third-party system in one day, the daily call volume of the target interface to the front-end page / third-party system can be counted to calculate the trend of the daily call volume of the target interface for multiple consecutive days. Of course, multiple consecutive days are the statistical period.

[0057] For the CPU usage rate in the hardware parameters, since it represents the status of the CPU (Central Processing Unit) in the server occupied by the system (when the target interface responds to the request), the daily CPU usage rate change trend of the target interface can be calculated by counting the CPU usage rate at different times, thereby obtaining the daily CPU usage rate change trend within multiple consecutive days as the statistical period.

[0058] For the memory usage rate in the hardware parameters, since it represents the state of the memory occupied by the system in the server (when the target interface responds to the request), the daily memory usage rate change trend of the target interface can be calculated by counting the memory usage rate at different times, thereby obtaining the daily memory usage rate change trend within multiple consecutive days as the statistical period.

[0059] S30, predicting the operating status of the target interface based on the operating trend of the target interface, where the operating status can indicate whether the target interface meets the requirements of stress testing.

[0060] In an embodiment of the present invention, the operating state of the target interface may include three operating states: a normal system operating state, an abnormal system operating state, and a stress test requirement state where the operating degree is between the two. For the above three operating states, rules for operating trends may be set respectively. When the operating trend of the target interface satisfies the rules under a certain operating state, it can be determined that the target interface enters the corresponding operating state. When the target interface enters the stress test requirement state, it is determined that the target interface meets the stress test requirement.

[0061] In the specific implementation process, the constructed state detection model can be used to identify the stress test requirements of the target interface, and the necessity of stress testing can be more objectively concluded. It can identify stress points more accurately and timely, and help the system to carry out optimization in advance.

[0062] See also Figure 2 In the method flow chart shown in FIG. 1 , step S30 “predicting the operating state of the target interface based on the operating trend of the target interface” may adopt the following steps:

[0063] S301, retrieve a pre-built status detection model, where the status detection model is obtained by training a basic network model using the operating trends of configured interfaces as training samples and aiming to make the operating status prediction results of the training samples close to the operating status annotation results of the training samples.

[0064] In the embodiment of the present invention, machine learning technology can be used to construct a state detection model. When training the state detection model, the operation trend of the configured interface can be used as a training sample, and the training sample is labeled with the corresponding operation state. The basic network model is iterated for multiple training until the loss function value or the number of iterations of the basic network model meets the end condition. At this time, the basic network model as a state detection model has the ability to predict the operation state of the training sample to be close to the operation state labeling result.

[0065] S302: Input the operation trend of the target interface to the state detection module to obtain the operation state of the target interface output by the state detection model.

[0066] In the embodiment of the present invention, the operation trend of the target interface is used as the input of the state detection module, so as to obtain the operation state of the target interface output by the state detection module.

[0067] In some other embodiments, in order to obtain hardware resource expansion suggestions for the target interface, the embodiments of the present invention Figure 1 Based on the above, the method also includes the following steps, the method flow chart is as follows Figure 3 As shown:

[0068] S40, when the target interface meets the requirement of stress testing, obtaining second operation information of the system where the target interface is located.

[0069] In an embodiment of the present invention, if the target interface has a stress test requirement, then in order to further implement the stress test on the target interface, it is necessary to expand the hardware resources of the system, such as expanding the processor from 4 cores to 6 cores, or expanding the memory several times.

[0070] The second operation information of the system where the target interface is located is obtained by counting the operation information generated by calling each interface under the system, and the second operation information may include the daily call volume of requests. Of course, the second operation information may also include other information, which is not limited in the embodiment of the present invention.

[0071] S50: Analyze the second operation information to obtain the operation trend of the system.

[0072] Continuing with the example of the second operating information including the daily request call volume, by counting the daily request call volumes of different interfaces under the system, the total daily request call volume of the system can be calculated, thereby obtaining the change trend of the total daily request call volume for multiple consecutive days as the statistical period.

[0073] S60: predicting hardware resources required for the target interface to operate based on the operating trend of the target interface and the operating trend of the system.

[0074] In an embodiment of the present invention, a resource calculation model can be constructed using machine learning technology, and the hardware resources required for the operation of the target interface can be predicted through the resource calculation model, so as to provide the system with more appropriate resource expansion suggestions. When training the resource calculation model, the operation trend of the configured interface and the operation trend of the configured system can be used as training samples. The training samples are labeled with corresponding hardware resources, and the basic network model is trained for multiple iterations until the loss function value or the number of iterations of the basic network model meets the end condition. The training is terminated. At this time, the basic network model as a resource calculation model has the ability to make the hardware resource prediction results of the training samples close to the hardware resource annotation results. It should be noted that the basic network model of the resource calculation model can be the same as or different from the basic network model of the state detection model, and the embodiment of the present invention does not limit this.

[0075] The test requirement identification method provided by the embodiment of the present invention obtains the operation trend of the target interface by analyzing the first operation information generated when the target interface is called, predicts the operation status of the target interface based on the operation trend, and determines whether the target interface has the demand for stress testing based on the operation status. Based on the present invention, the stress test requirements of the system interface can be accurately identified, so as to identify the performance pressure points as early as possible, and optimize the performance to prevent the system from having stress problems.

[0076] Based on the test requirement identification method provided in the above embodiment, an embodiment of the present invention provides a device for executing the test requirement identification method. The structural diagram of the device is shown in FIG. Figure 4 As shown, including:

[0077] The information acquisition module 10 is used to acquire the first operation information generated when the target interface is called.

[0078] The trend analysis module 20 is used to analyze the first operation information to obtain the operation trend of the target interface.

[0079] The state prediction module 30 is used to predict the operation state of the target interface based on the operation trend of the target interface. The operation state can indicate whether the target interface meets the requirements of stress testing.

[0080] Optionally, the information acquisition module 10 is specifically used for:

[0081] Get the request parameters of the target interface being called; and / or

[0082] Get the hardware parameters when the target interface is called.

[0083] Optionally, the request parameters include one or more of request issuance time, request response time, and request daily call volume, and the hardware parameters include one or more of CPU usage and memory usage;

[0084] Accordingly, the trend analysis module 20 is specifically used for:

[0085] When the request parameters include the request sending time, the daily peak value of the target interface for multiple consecutive days is calculated based on the request sending time; when the request parameters include the request response time, the daily response time change trend of the target interface for multiple consecutive days is calculated based on the request response time; when the request parameters include the daily request call volume, the daily call volume change trend of the target interface for multiple consecutive days is calculated based on the daily request call volume; when the hardware parameters include the CPU usage, the daily CPU usage change trend of the target interface for multiple consecutive days is calculated based on the CPU usage; when the hardware parameters include the memory usage, the daily memory usage change trend of the target interface for multiple consecutive days is calculated based on the memory usage.

[0086] Optionally, the state prediction module 30 is specifically used for:

[0087] A pre-built status detection model is retrieved. The status detection model is obtained by training a basic network model using the operating trends of configured interfaces as training samples and aiming to make the operating status prediction results of the training samples close to the operating status annotation results of the training samples. The operating trend of the target interface is input into the status detection module to obtain the operating status of the target interface output by the status detection model.

[0088] See also Figure 5 As shown in the structural diagram, the test requirement identification device also includes:

[0089] The hardware prediction module 40 is used to obtain the second operation information of the system where the target interface is located when the target interface has the need for stress testing; analyze the second operation information to obtain the operation trend of the system; and predict the hardware resources required for the operation of the target interface based on the operation trend of the target interface and the operation trend of the system.

[0090] It should be noted that the detailed functions of each module in the embodiment of the present invention can be found in the corresponding disclosed part of the above-mentioned test requirement identification method embodiment, and will not be repeated here.

[0091] Based on the test requirement identification method provided in the above embodiment, an embodiment of the present invention provides an electronic device, which includes: at least one memory and at least one processor; the memory stores a program, the processor calls the program stored in the memory, and the program is used to implement the test requirement identification method.

[0092] Based on the test requirement identification method provided in the above embodiment, an embodiment of the present invention provides a storage medium correspondingly, in which computer executable instructions are stored, and the computer executable instructions are used to execute the test requirement identification method.

[0093] It should be noted that the test requirement identification method, device, electronic device and storage medium provided by the present invention can be used in the field of artificial intelligence or finance. The above is only an example and does not limit the application field of the test requirement identification method, device, electronic device and storage medium provided by the present invention.

[0094] The above is a detailed introduction to a test requirement identification method, device, electronic device and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

[0095] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0096] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device that includes a series of elements is inherent to the elements, or also includes elements inherent to these processes, methods, articles or devices. In the absence of further restrictions, the elements defined by the sentence "including a..." do not exclude the presence of other identical elements in the process, method, article or device that includes the elements.

[0097] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A test requirement identification method, characterized in that: The method comprises: Acquire the first operation information generated by the target interface being called; the target interface is an interface for identifying test requirements, and the interface call situation is buried by writing code, and the operation information generated by the target interface being called is recorded in sequence; Analyzing the first operation information to obtain an operation trend of the target interface; Predicting the operating state of the target interface based on the operating trend of the target interface, the operating state can indicate whether the target interface has the need for stress testing, and the operating state of the target interface includes a normal system operating state, an abnormal system operating state, and a stress testing requirement state with an operating degree between the two; The predicting the operating state of the target interface based on the operating trend of the target interface includes: Retrieving a pre-built status detection model, wherein the status detection model is obtained by training a basic network model with the operation trend of the configured interface as a training sample and with the goal of making the operation status prediction result of the training sample close to the operation status annotation result of the training sample; Inputting the operation trend of the target interface into a state detection model to obtain the operation state of the target interface output by the state detection model; The method further comprises: When the target interface meets the requirement of stress testing, obtaining second operation information of the system where the target interface is located; analyzing the second operation information to obtain an operation trend of the system; Based on the operation trend of the target interface and the operation trend of the system, the hardware resources required for the operation of the target interface are predicted.

2. The method according to claim 1, characterized in that The obtaining of first operation information generated when the target interface is called includes: Obtaining request parameters for calling the target interface; and / or Get the hardware parameters of the target interface when it is called.

3. The method according to claim 2, characterized in that The request parameters include one or more of the request issuance time, the request response time and the request daily call volume, and the hardware parameters include one or more of the CPU usage rate and the memory usage rate; Correspondingly, analyzing the first operation information to obtain the operation trend of the target interface includes: In the case where the request parameter includes the request sending time, calculating the daily peak value of the target interface for multiple consecutive days according to the request sending time; In the case where the request parameter includes the request response time, calculating the daily response time change trend of the target interface for multiple consecutive days according to the request response time; In the case where the request parameter includes the requested daily call volume, calculating the daily call volume change trend of the target interface for multiple consecutive days according to the requested daily call volume; In a case where the hardware parameter includes the CPU usage rate, calculating a daily CPU usage rate change trend of the target interface for multiple consecutive days according to the CPU usage rate; In a case where the hardware parameters include the memory usage rate, a daily memory usage rate change trend of the target interface for a plurality of consecutive days is calculated according to the memory usage rate.

4. A test requirement identification device, characterized in that: The device comprises: An information acquisition module is used to acquire first operation information generated by calling a target interface; the target interface is an interface for identifying test requirements, and the interface call situation is buried by writing code to record the operation information generated by calling the target interface in sequence; A trend analysis module, configured to analyze the first operation information to obtain an operation trend of the target interface; A state prediction module, used for predicting the operation state of the target interface based on the operation trend of the target interface, wherein the operation state can indicate whether the target interface has the requirement of stress testing, and the operation state of the target interface includes a normal system operation state, an abnormal system operation state, and a stress testing requirement state with an operation degree between the two; The state prediction module is specifically used for: Retrieve a pre-built status detection model, wherein the status detection model is obtained by training a basic network model with the operation trend of a configured interface as a training sample and with the goal of making the operation status prediction result of the training sample close to the operation status annotation result of the training sample; input the operation trend of the target interface into the status detection model to obtain the operation status of the target interface output by the status detection model; The device also includes: The hardware prediction module is used to obtain the second operation information of the system where the target interface is located when the target interface has the need for stress testing; analyze the second operation information to obtain the operation trend of the system; and predict the hardware resources required for the operation of the target interface based on the operation trend of the target interface and the operation trend of the system.

5. An electronic device, characterized in that: The electronic device includes: at least one memory and at least one processor; the memory stores a program, the processor calls the program stored in the memory, and the program is used to implement the test requirement identification method described in any one of claims 1-3.

6. A storage medium, characterized in that: The storage medium stores computer executable instructions, and the computer executable instructions are used to execute the test requirement identification method described in any one of claims 1-3.