Interface performance pressure measurement method and device, electronic equipment and storage medium

By analyzing the interface request data to determine the target request template and logic parameters, a pressure test script is generated, which solves the problem of parameter update lag and pressure test distortion in the interface performance pressure test, and achieves efficient and accurate pressure test.

CN119645852APending Publication Date: 2025-03-18NANJING LINGXING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411715604.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The prior art has problems with parameter update lag and pressure measurement distortion in interface performance pressure measurement, resulting in frequent maintenance scripts and large amount of manpower investment.

Method used

By obtaining the request data to be parsed for the target interface, analyzing its key-value pairs to obtain the data analysis results, determining the target request template and target logic parameters, and generating a target pressure test script based on these parameters to achieve interface performance pressure test.

Benefits of technology

Ensure the accuracy and timeliness of pressure test scripts, solve the problems of parameter update lag and pressure test distortion, and reduce manpower investment and script maintenance frequency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645852A_ABST
    Figure CN119645852A_ABST
Patent Text Reader

Abstract

The invention discloses an interface performance pressure measurement method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining to-be-analyzed request data of a target interface, and analyzing a key value pair of the to-be-analyzed request data to obtain a data analysis result; determining a target request template and a target logic parameter according to the data analysis result; and generating a target pressure measurement script according to the target request template and the target logic parameter, and performing interface performance pressure measurement on the target interface according to the target pressure measurement script. According to the technical scheme, the target pressure measurement script can be dynamically generated in real time through the target request template and the target logic parameter determined according to the data analysis result, the real-time performance of parameter updating is effectively guaranteed, interface performance pressure measurement is conducted on the target interface according to the target pressure measurement script, and the problems of parameter updating lagging and pressure measurement distortion are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] For the same interface, there are often multiple formats of request parameters, among which the core logic parameters often determine the call link of the entire interface and the triggered business logic, thus affecting the traffic model of the entire cluster. Therefore, constructing parameters that are more in line with the actual request traffic has a crucial impact on the quality of stress testing.

[0003] At present, in the face of the massive amount of interface data received by the interface and the high frequency of changes in the interface data, the interface data is generally manually constructed with parameters, and a fixed request template is used to generate scripts. Therefore, a large amount of manpower is required to construct parameters for the changing interface data according to the fixed request template, and further regenerate the script. However, the above situation will lead to the need for frequent script maintenance and a large amount of manpower, further aggravating the problem of parameter update lag and stress test distortion. Summary of the invention

[0004] The present invention provides an interface performance stress testing method, device, electronic device and storage medium to solve the problems of parameter update lag and stress testing distortion.

[0005] According to one aspect of the present invention, a method for stress testing interface performance is provided, the method comprising:

[0006] Obtain the request data to be parsed of the target interface, and parse the key-value pairs of the request data to be parsed to obtain the data parsing result;

[0007] Determine a target request template and target logic parameters according to the data analysis result;

[0008] A target stress testing script is generated according to the target request template and the target logical parameters, so as to perform interface performance stress testing on the target interface according to the target stress testing script.

[0009] According to another aspect of the present invention, there is provided an interface performance stress testing device, the device comprising:

[0010] A data acquisition module is used to acquire the request data to be parsed of the target interface, and parse the key-value pairs of the request data to be parsed to obtain the data parsing result;

[0011] A template determination module, used to determine a target request template and target logic parameters according to the data analysis result;

[0012] The test module is used to generate a target stress testing script according to the target request template and the target logical parameters, so as to perform interface performance stress testing on the target interface according to the target stress testing script.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the interface performance stress testing method described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the interface performance stress testing method described in any embodiment of the present invention when executed.

[0018] The technical solution of the embodiment of the present invention obtains the request data to be parsed of the target interface, parses the key-value pairs of the request data to be parsed to obtain the data parsing results, and accurately obtains the data parsing results, and further determines the target request template and the target logic parameters according to the data parsing results, effectively ensuring the factual determination of the target request template and the target logic parameters, and further generates a target stress testing script according to the target request template and the target logic parameters, ensuring the accuracy and timeliness of the stress testing script, so as to perform interface performance stress testing on the target interface according to the target stress testing script, and solve the problems of parameter update lag and stress testing distortion.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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.

[0021] Figure 1 is a flow chart of an interface performance stress testing method provided according to an embodiment of the present invention;

[0022] Figure 2 is a flowchart of another interface performance stress testing method provided according to an embodiment of the present invention;

[0023] Figure 3 is a flowchart of another interface performance stress testing method provided according to an embodiment of the present invention;

[0024] Figure 4 is a schematic diagram of the structure of an interface performance stress testing device provided according to an embodiment of the present invention;

[0025] Figure 5 It is a structural schematic diagram of an electronic device implementing the interface performance stress testing method of the embodiment of the present invention provided according to the embodiment of the present invention. DETAILED DESCRIPTION

[0026] 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 should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first", "second", "target", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] Embodiment 1

[0029] Figure 1 A flowchart of an interface performance stress testing method provided in an embodiment of the present invention. This embodiment is applicable to the situation of stress testing the performance of an interface. The method can be executed by an interface performance stress testing device. The interface performance stress testing device can be implemented in the form of hardware and / or software. The interface performance stress testing device can be configured in any electronic device with network communication function.

[0030] like Figure 1As shown, the interface performance stress testing method of the present invention includes the following process:

[0031] S110 , obtaining the request data to be parsed of the target interface, and parsing the key-value pairs of the request data to be parsed to obtain a data parsing result.

[0032] The request data to be parsed can be understood as request data for which the target interface has changed in the production environment. The data parsing result can be understood as data that facilitates the generation of a request template.

[0033] Specifically, obtaining the request data to be parsed of the target interface includes: obtaining interface request data corresponding to the target interface within a preset time period, and determining the interface request data in the interface request data that meets the preset recording request rules as the request data to be parsed. The preset recording request rules include rules for recording requests according to a preset mode, and the preset mode may include one of full recording, whitelist mode, and blacklist mode.

[0034] Further, the request data to be parsed is forwarded to the parsing module to parse the key-value pairs of the request data to be parsed to obtain the data parsing result. Wherein, forwarding the request data to be parsed to the parsing module includes: forwarding the request data to be parsed to the parsing module in the form of a message queue to parse the key-value pairs of the request data to be parsed to obtain the data parsing result.

[0035] In this implementation, optionally, parsing the key-value pairs of the request data to be parsed to obtain the data parsing results includes: if the request data format of the request data to be parsed is a path parameter format, converting the request data to be parsed into data in a preset format one layer deep, and parsing the key-value pairs of the converted request data to be parsed to obtain the data parsing results; if the request data format of the request data to be parsed is a preset format, parsing the key-value pairs of the request data to be parsed to obtain the data parsing results.

[0036] The path parameter format can be understood as the format passed in the URL path, such as / users / {user_id}.

[0037] For example, taking the path parameter format as key-value format and the preset format as json format as an example, if the request data format of the request data to be parsed is key-value format, the request data to be parsed is converted into data in json format one layer deep, and the key-value pairs of the converted request data to be parsed are parsed to obtain the data parsing result; if the request data format of the request data to be parsed is json format, the key-value pairs of the request data to be parsed are parsed to obtain the data parsing result.

[0038] The technical solution of this embodiment converts the request data format of the request data to be parsed into a unified preset format to facilitate subsequent processing and analysis of the request data to be parsed.

[0039] In this implementation, optionally, parsing the key-value pairs of the request data to be parsed to obtain the data parsing results includes steps A1-A2:

[0040] Step A1: perform basic analysis on the key-value pairs of the request data to be analyzed, and determine the data type of the value of each key-value pair.

[0041] Specifically, basic parsing can be understood as parsing the basic information of the key value, which can include the key name of the key-value pair, the current level of the key-value pair's value, the full path of the key-value pair, the value of the key-value pair, and the data type of the key-value pair's value. Data types can be divided into basic types and complex types. Basic types can be understood as basic data types whose current level of the key-value pair's value is 1 layer, that is, the basic type contains a basic data object. Complex types can be understood as complex data types whose current level of the key-value pair's value is greater than 1 layer, that is, the data type in the complex type is composed of multiple basic data objects, such as complex types can include object types (json Object type) and array types (json Array type).

[0042] By performing basic parsing on the key-value pairs of the request data to be parsed, the data type of the value of each key-value pair can be obtained, so as to determine whether the key-value pair needs to be further parsed according to the complexity of the data type. That is, if the data type is a basic type, the key-value pair does not need to be further parsed, and if the data type is a complex type, the key-value pair needs to be further parsed.

[0043] Step A2: If the data type is an object type, the parsing function is recursively called to perform parsing at a preset parsing depth to obtain a data parsing result.

[0044] Specifically, the preset parsing depth can be understood as a preset level at which the key-value pair needs to be parsed. The preset parsing depth can be a preset parsing depth that is less than the current level of the current key-value pair, or it can be a parsing depth that is equal to the current level of the current key-value pair. For example, the default preset parsing depth can be 3.

[0045] Step A3: If the data type is an array type, determine the data object type of the first data object of the value of the key-value pair; if the data object type is an object type, recursively call the parsing function to perform one layer of parsing depth to obtain the data parsing result; if the data object type is a preset type, no further parsing is performed.

[0046] The preset type can be a basic type or a list object.

[0047] Specifically, the data object types of the data objects contained in the key-value pairs of general array types are all consistent, so the first object in the array is parsed by default. The data object type of the first data object of the value of the key-value pair is further determined, so as to accurately determine whether the current key-value pair needs to be parsed according to the complexity of the data object type.

[0048] For example, if the data object of the first object is a basic type or a list object, no further parsing is performed; if the first object is an object type (json Object), parsing is performed according to the object type (json Object) in step A2, and the preset parsing depth is 1 layer. In addition, the inserted parsing record can contain two additional attributes: array value type and array length.

[0049] The technical solution of this embodiment performs basic analysis on the key-value pairs of the request data to be analyzed, and determines the data type of the value of each key-value pair; so as to accurately determine the parsing method of the key-value pairs according to the complexity of the data type, so as to achieve accurate analysis of each key-value pair and obtain more accurate data analysis results.

[0050] S120: Determine a target request template and target logic parameters according to the data analysis result.

[0051] Among them, the target request template can be understood as a template that stores information about request parameters for generating a target stress testing script and parameters that affect the target stress testing script in a production environment, so that the target stress testing script can be dynamically adjusted according to the target request template to achieve decoupling of the target request template and the target stress testing script.

[0052] Specifically, if there is a first preset association relationship between the characteristic parameters of the data analysis result and the target request template, the data analysis result is obtained, the characteristic parameters of the data analysis result are determined, and the target request template is determined according to the characteristic parameters of the data analysis result and the preset association relationship. Further, if the target request template includes a logic parameter extraction rule, the target logic parameter is extracted from the data analysis result according to the logic parameter extraction rule.

[0053] S130. Generate a target stress testing script according to the target request template and the target logic parameters, so as to perform interface performance stress testing on the target interface according to the target stress testing script.

[0054] Specifically, there is a second preset association relationship between the target request template and the reference stress testing script, and the reference stress testing script is the basic architecture of the target stress testing script. After obtaining the target request template, a reference stress testing script can be generated according to the target request template and the second preset association relationship, and the reference stress testing script is further adjusted based on the target logical parameters to generate a target stress testing script, so as to perform interface performance stress testing on the target interface according to the target stress testing script.

[0055] In this embodiment, the target request template includes the effective state and the hit count. A target stress test script is generated according to the target request template and the target logic parameters, so as to perform interface performance stress test on the target interface according to the target stress test script, including steps B1-B3:

[0056] Step B1: Determine to test the target interface, and then determine the effective state and hit count of the target request template.

[0057] The effective state can be used to describe the validity of the target request template, and the effective states include pending confirmation, expired, and effective. The hit count can be understood as the number of times the target request template is determined, that is, regardless of whether the effective state of the request template is valid, each time the target request template is determined, the hit count of the target request template is increased by 1.

[0058] Furthermore, the request template library stores request templates of different interfaces, and each request template will correspond to the number of hits. The effective state of the request template can be further adjusted according to the number of hits. Specifically, the hit ratio can be understood as being determined according to the number of hits of each request template. If the hit state of the request template is pending confirmation or expired, when the number of hits of the request template reaches the first preset number or the hit ratio of the request template reaches the first preset ratio, the hit state of the request template can be adjusted to effective; if the hit state of the request template is effective, when the number of hits of the request template is less than the second preset number or the hit ratio of the request template is less than the second preset ratio, the hit state of the request template can be adjusted to pending confirmation or expired. That is, the dynamic adjustment of the effective state of the request template is realized to ensure that the adjustment of the changing parameters of the current production environment can be accurately reflected.

[0059] Step B2: If the effective status is pending confirmation or expired, the target request template is not used to test the target interface.

[0060] Specifically, "pending confirmation" requires manual confirmation. If it is manually confirmed, the target request template can be used to test the target interface. If it is not manually confirmed or confirmed to be cancelled, the target request template will not be used to test the target interface. If the effective state is invalid, it means that the target request template has little impact on the stress test of the target interface in the current production environment, and it is not necessary to use the target request template to test the target interface.

[0061] Step B3: If the effective state is effective, the thread ratio of each target request template is determined according to the number of hits of each target request template, and the concurrency number of each target request template is determined according to the thread ratio.

[0062] For example, the target request templates in effect include target request template A, target request template B, and target request template C. The hit times of target request template A, target request template B, and target request template C are respectively the first number a, the second number b, and the third number c, then the thread proportions of target request template A, target request template B, and target request template C are respectively a / (a+b+c), b / (a+b+c), and c / (a+b+c), and the concurrency numbers of target request template A, target request template B, and target request template C can be a / (a+b+c), b / (a+b+c), and c / (a+b+c). Wherein, the value result of the ratio is a positive integer.

[0063] The technical solution of this embodiment determines the effective state and hit count of the target template information by testing the target interface; the parameters required for stress testing the target interface in the current production environment are judged in real time by the effective state of the target template information, so as to accurately determine and truly reflect the parameters required for stress testing in the current production environment, and ensure the stability of stress testing. Furthermore, if the effective state is effective, the thread ratio of each target request template is determined according to the hit count of each target request template, and the concurrent number of each target request template is determined according to the thread ratio, so as to clearly know the number of each thread and avoid affecting the effect of stress testing due to a small number of threads.

[0064] In this embodiment, optionally, the target request template includes a basic request body. After determining the concurrency number of each target request template according to the thread ratio, the method includes: generating a target stress testing script according to the basic request body and target logical parameters, so as to perform interface performance stress testing on the target interface according to the target stress testing script.

[0065] Specifically, the reference stress testing script is the basic architecture of the target stress testing script. The reference stress testing script is generated according to the basic request body. After the concurrency of each target request template is determined according to the thread ratio, the logical parameters corresponding to the reference stress testing script are further replaced with the target logical parameters, and the entity parameters corresponding to the reference stress testing script are replaced with the target entity parameters. The target entity parameters are target entity parameters extracted from the request data to be parsed according to the target request template. This embodiment realizes the dynamic acquisition of request parameters in the stress testing script, realizes the clear and transparent perception of the proportion of various parameters, and automatically replaces each parameter in the stress testing script without manual analysis of the parameter type.

[0066] For example, take the most common stress testing tool jmeter as an example. In the current common stress testing method, since parameters cannot be directly used across environments and too large request parameters will cause service memory overflow and cannot be executed, it is necessary to define a fixed request body for the stress testing script and parameterize the parameters that need to be replaced. However, currently, the request parameters are manually analyzed to obtain the parameters that need to be parameterized in the entire stress testing request, and then the script is written. The content of the script request body is fixed and cannot be changed dynamically. This method leads to the problem of low efficiency due to the need to modify a large number of scripts after the parameters are changed. At the same time, because the parameterization process requires manual analysis of the parameter type, it requires a lot of manpower investment. Therefore, how to efficiently and quickly align with the actual request parameters in production is a pain point in daily stress testing work.

[0067] The present invention can effectively solve this pain point problem when using jmeter for stress testing. First, according to the target request template, the reference stress testing script (request body template) is matched with the basic request body, and the corresponding number of thread groups is generated according to the number of templates of different types. The concurrent number of the corresponding thread group is generated according to the number of hits of the target request template, and the logical parameters and entity parameters are respectively exported according to the target request template to generate the logical parameter file and the entity parameter file (csv file); then, in the setup thread, by reading the reference stress testing script (request body template) required for this time, and setting it as the request body data, finally, sending a request and replacing the logical parameters and entity parameters in the reference stress testing script based on the parameter file. Thereby effectively reducing the size of the parameter file, avoiding the problem of being unable to execute due to the large size of the parameter file, effectively improving the number of parameters, and accurately simulating the production flow ratio at the same time, achieving a more realistic stress testing effect.

[0068] In this embodiment of the present invention, the storage of parameters is no longer conventional full storage, but a request template is introduced to realize on-demand storage of real production request parameters, which avoids the leakage of sensitive information and can effectively reduce the cost of parameter storage, thereby realizing parameter storage for longer periods of time and more interfaces, and ensuring the richness and diversity of stress testing parameters. In addition, the present invention can dynamically generate concurrent quantity, request body and other contents, realize the decoupling of scripts and request parameters, and when parameters change, they can be automatically adjusted without manual intervention, intelligently identify and process different test scenarios and requirements, simplify the preparation of performance testing, effectively ensure the real-time nature of parameter updates, and ensure the efficiency and reliability of the test process.

[0069] The technical solution of the embodiment of the present invention obtains the request data to be parsed of the target interface, parses the key-value pairs of the request data to be parsed to obtain the data parsing results, and accurately obtains the data parsing results, and further determines the target request template and the target logic parameters according to the data parsing results, effectively ensuring the factual determination of the target request template and the target logic parameters, and further generates a target stress testing script according to the target request template and the target logic parameters, ensuring the accuracy and timeliness of the stress testing script, so as to perform interface performance stress testing on the target interface according to the target stress testing script, and solve the problems of parameter update lag and stress testing distortion.

[0070] Embodiment 2

[0071] Figure 2 This is a flow chart of another interface performance stress testing method provided by an embodiment of the present invention. The technical solution of this embodiment further optimizes the process of S120 in the above embodiment on the basis of the above embodiment. This embodiment can be combined with various optional solutions in one or more of the above embodiments.

[0072] like Figure 2 As shown, the interface performance stress testing method of the present invention includes the following process:

[0073] S210: Obtain the request data to be parsed of the target interface, and parse the key-value pairs of the request data to be parsed to obtain data parsing results.

[0074] S220, determining whether there is a target request template matching the data parsing result in the request template library; the request template library is used to store templates corresponding to different interfaces for generating stress testing scripts.

[0075] Among them, the request template library is used to store templates for generating stress testing scripts corresponding to different interfaces, that is, different interfaces correspond to different request templates, and different interfaces correspond to different data parsing results. The target request template corresponds to the target interface, that is, the data parsing result corresponding to the target interface has a certain correlation with the target request template. It can be determined from the request template whether there is a target request template that matches the data parsing result.

[0076] Specifically, the target characteristic parameters of the data analysis result are obtained, and the target characteristic parameters are compared with the template characteristic parameters in the request template in the request template library, and it is determined whether there is a target request template matching the data analysis result in the request template according to the comparison result. Furthermore, if the target characteristic parameters and the template characteristic parameters meet the preset conditions, the request template corresponding to the template characteristic parameters meeting the preset conditions is used as the target request template matching the data analysis result; if the target characteristic parameters and the template characteristic parameters do not meet the preset conditions, it means that there is no target request template matching the data analysis result in the request template library.

[0077] In this embodiment, optionally, the target request template includes a preset matching rule and request path information, the preset matching rule is used to describe the association relationship between the data parsing result and the target request template, and the request path information is used to indicate the interface link corresponding to the target request template. Accordingly, determining whether there is a target request template matching the data parsing result in the request template library includes steps C1-C3:

[0078] Step C1: Determine whether the data analysis result satisfies the preset matching rule of the target request template, and whether the request path information matches the target path information corresponding to the data analysis result.

[0079] Among them, the target path information can be understood as the interface link of the target interface; the interface link can be understood as the address of the identification and positioning data parsing result, for example, such as the URL address. When sending a request, the URL specifies the target location of the request, including information such as the server address, port, path, and possible query parameters.

[0080] Specifically, the preset matching rule is used to describe the association relationship between the data parsing result and the target request template, and the request path information is used to indicate the interface link corresponding to the target request template. By determining whether the request path information matches the target path information corresponding to the data parsing result, it can be determined whether it is the target request template of the same interface link. Further, by determining whether the data parsing result satisfies the preset matching rule of the target request template, it can be accurately determined whether there is a target request template matching the data parsing result in the request template library.

[0081] In this embodiment, optionally, the preset matching rule includes a preset verification rule, and the preset verification rule is used to limit the range of the parameter information to be verified in the data analysis result. Accordingly, determining whether the data analysis result meets the preset matching rule of the target request template includes: obtaining the corresponding target parameter information to be verified in the data analysis result; if the target parameter information to be verified meets the preset verification rule, then determining that the data analysis result meets the preset matching rule of the target request template, otherwise, determining that the data analysis result does not meet the preset matching rule of the target request template.

[0082] Specifically, the parameter information to be verified can be understood as data in the data analysis results that have a preset degree of influence on the generation of the target stress testing script, including but not limited to data types, values, operation logic, etc. The preset verification rules are used to limit the scope of the parameter information to be verified in the data analysis results. For example, the scope of the parameter information to be verified can be understood as the judgment rules of the data type, whether the values ​​are equal, whether the values ​​exceed the preset range, whether it is the judgment of the preset operation logic, etc.

[0083] In this embodiment, the target parameter information to be verified is the parameter information to be verified in the data analysis result. After obtaining the corresponding target parameter information to be verified in the data analysis result, it is determined whether the target parameter information to be verified complies with the preset verification rules to accurately determine whether the data analysis result satisfies the preset matching rules of the target request template, thereby avoiding the accuracy of determining the target request template that matches the data analysis result due to erroneous judgment on whether the data analysis result satisfies the preset matching rules of the target request template.

[0084] Step C2: If the data parsing result satisfies the preset matching rule of the target request template, and the request path information matches the target path information corresponding to the data parsing result, it is determined that there is a target request template matching the data parsing result in the request template library.

[0085] Step C3: If the data parsing result does not satisfy the preset matching rule of the target request template, and the request path information does not match the target path information corresponding to the data parsing result, it is determined that there is no target request template matching the data parsing result in the request template library.

[0086] The technical solution of this embodiment determines whether the data parsing result meets the preset matching rules of the target request template and whether the request path information matches the target path information corresponding to the data parsing result, so as to accurately determine whether there is a target request template matching the data parsing result in the request template library. At the same time, the above-mentioned judgment method can monitor the matching relationship in real time, that is, it can quickly determine whether there is a target request template matching the data parsing result, reduce the timeliness of changing parameters obtained by manual analysis of data parsing results, and ensure that the system can reflect the latest status at any time, which not only improves the response speed of the system, but also greatly reduces the risks caused by parameter lag.

[0087] S230: If it exists, the template in the request template library that matches the data parsing result is used as the target request template, and the target logic parameters are generated according to the target request template and the data parsing result.

[0088] Specifically, the target request template includes a logic parameter extraction rule, and the target logic parameters are extracted from the data parsing result according to the logic parameter extraction rule, so as to generate a target stress testing script according to the target request template and the target logic parameters.

[0089] S240: If it does not exist, generate a target request template and target logic parameters according to the data analysis result.

[0090] Specifically, if there is no target request template matching the data parsing result in the request template library, it means that the target interface has received data in a new request format, and it is necessary to generate a target request template and target logic parameters according to the data parsing result.

[0091] S250: Generate a target stress testing script according to the target template information and the target logic parameters, so as to perform interface performance stress testing on the target interface according to the target stress testing script.

[0092] The technical solution of the embodiment of the present invention obtains the request data to be parsed of the target interface, parses the key-value pairs of the request data to be parsed to obtain the data parsing result, and further determines whether there is a target request template matching the data parsing result in the request template library, so as to accurately determine whether to call the target request template from the request template library or generate the target request template and target logical parameters according to the data parsing result, thereby realizing on-demand storage of real request parameters of the generation environment by introducing accurate request template storage, realizing parameter storage for longer periods of time and more interfaces, and ensuring the richness and diversity of stress testing parameters.

[0093] Embodiment 3

[0094] Figure 3 This is a flow chart of another interface performance stress testing method provided by an embodiment of the present invention. The technical solution of this embodiment is based on the above embodiment. If there is no target request template matching the data parsing result in the request template library in the above embodiment, the target request template and target logic parameters are generated according to the data parsing result. This embodiment can be combined with each optional solution in one or more of the above embodiments.

[0095] like Figure 3 As shown, the method includes:

[0096] S310: Obtain the request data to be parsed of the target interface, and parse the key-value pairs of the request data to be parsed to obtain data parsing results.

[0097] S320, determining whether there is a target request template matching the data parsing result in the request template library; the request template library is used to store templates corresponding to different interfaces for generating stress testing scripts.

[0098] S330. If it does not exist, generate a target request template and target logical parameters according to the data parsing results; the data parsing results include the key name of the key-value pair, the path information of the key-value pair and the data type of the value of the key-value pair; the target request template includes the request path information, preset matching rules, logical parameter extraction rules and the basic request body; the preset matching rules include the key name of the key-value pair, the path information of the key-value pair and the preset verification rules.

[0099] Specifically, generating a target request template according to the data analysis result includes steps D1-D5:

[0100] Step D1: Use the target path information corresponding to the data analysis result as the request path information.

[0101] In addition, the target request template also includes an effective state, and the effective state can be determined as pending confirmation or in effect according to the target path information corresponding to the data analysis result and the importance of the service corresponding to the data analysis result.

[0102] Step D2: extract the key name of the key-value pair and the path information of the key-value pair from the data analysis result to generate the key name of the key-value pair and the path information of the key-value pair in the preset matching rule.

[0103] Step D3, obtain the preset editing rules, and determine the preset verification rules of the target request template according to the data type of the key-value pair value in the data parsing result, the value of the key-value pair and the preset editing rules; the preset editing rules are used to describe the data type of the key-value pair value in the data parsing result and the matching relationship between the key-value pair value and the preset verification rules.

[0104] Specifically, the preset editing rules may include but are not limited to setting the effective scope, matching objects, matching mode, and verification logic; further, based on the data type of the key-value pairs in the data parsing results and the value of the key-value pairs combined with the settings of the effective scope, matching objects, matching mode and verification logic in the preset editing rules, the preset verification rules for the target request template are generated.

[0105] Example: Preset validation rule: type type preset validation rule 1: effective scope is global; configuration details are: matching object is key, matching mode can contain "type", and validation logic is to verify whether it matches. type type preset validation rule 2: effective scope is pay-ceneter service; configuration details are: matching object is value, matching mode can be data type is number, and validation logic can be to verify whether the range is 0-100.

[0106] Step D4, obtaining parameter determination rules, and determining the parameter type of each key-value pair in the data analysis result according to the parameter determination rules; the parameter determination rules are rules that limit the parameter type of the key-value pair to a preset parameter.

[0107] The parameter determination rule is set according to the key name and / or the value of the key-value pair; the parameter type can be divided into three categories, including logical parameters, entity parameters and ignorable parameters. For example, the logical parameter can be type type, coordinate point, etc.; the entity parameter can be the basic information and order information of the user authorization, etc., and the ignorable parameter can be a parameter that has no effect on the request execution logic, such as description information.

[0108] In addition, since entity parameters are closely related to the cluster environment or are dynamically generated, and ignorable parameters do not affect the execution link, only logical parameters need to be extracted.

[0109] Step D5: Generate logical parameter extraction rules and basic request body according to the parameter type of the key-value pair and the data parsing result.

[0110] Specifically, the data parsing result is traversed according to the parameter type of the key-value pair, a logic parameter extraction rule is generated according to the acquired logic parameters, and a basic request body is generated according to the data of each parameter type extracted from the data parsing result.

[0111] Optionally, based on the parameter type of the key-value pair and the data parsing result, a logical parameter extraction rule and a basic request body are generated, including: if the key-value pair in the data parsing result does not match the parameter determination rule, the parameter type of the key-value pair in the data parsing result is a logical parameter, and a logical parameter extraction rule is set based on the logical parameter; based on the parameter type of the key-value pair in the data parsing result, the data parsing result is changed, and the changed data parsing result is used as the basic request body.

[0112] Specifically, the parameter determination rule can be set by string matching or regular expression matching, and the parameter type can be set as an entity parameter or an ignorable parameter. That is, if the key-value pair in the data parsing result matches the parameter determination rule, the parameter type is an entity parameter or an ignorable parameter, and the specific parameter type is further determined according to the matching relationship set by string matching or regular expression matching for the entity parameter or ignorable parameter in the parameter determination rule.

[0113] For example, if the key name of the key-value pair contains orderId, it is determined to be an entity parameter. If the value of the key-value pair satisfies the expression ^1[3-9]\d{1})\d{4}(\d{4})[^\\d]', that is, the mobile phone number, it is determined to be an entity parameter. If the key name is desc, it is determined to be an ignorable parameter.

[0114] Furthermore, setting a logical parameter extraction rule according to the logical parameter includes: if the parameter type is a logical parameter, setting a logical parameter extraction rule, for example, generating an extraction path in the jsonPath format according to the complete path corresponding to the logical parameter, such as: ["$.name":"name"], and replacing the value corresponding to the parameter in the request json object with a variable, and the variable name defaults to the field name.

[0115] According to the parameter type of the key-value pair in the data parsing result, the data parsing result is changed, and the changed data parsing result is used as the basic request body: if the parameter type is an entity parameter, it is only replaced with a variable, and the variable name is set according to the parameter determination rule. If the parameter type is an ignorable parameter, it is not processed.

[0116] After completing the traversal of the key-value pairs of the data parsing result parameter type, the JSON object for parameter replacement is the basic request body.

[0117] S340: Generate a target stress testing script according to the target template information and the target logic parameters, so as to perform interface performance stress testing on the target interface according to the target stress testing script.

[0118] The technical solution of this embodiment obtains the request data to be parsed of the target interface, and parses the key-value pairs of the request data to be parsed to obtain the data parsing results. If it is determined that there is no target request template matching the data parsing result in the request template library, then the target request template and target logical parameters are generated according to the data parsing result; because the data parsing result includes the key name of the key-value pair, the path information of the key-value pair, and the data type of the value of the key-value pair; the target request template includes the request path information, the preset matching rules, the logical parameter extraction rules, and the basic request body; the preset matching rules include the key name of the key-value pair, the path information of the key-value pair, and the preset verification rules, which realizes the rapid and accurate automatic generation of the target request template, that is, when the parameters change, they can be automatically adjusted without manual intervention, reducing the lag of parameter acquisition caused by manual analysis of parameters, effectively ensuring the real-time nature of parameter updates, and further generating a target stress test script according to the target template information and the target logical parameters, so as to perform interface performance stress test on the target interface according to the target stress test script, and ensure the efficiency and reliability of the test process.

[0119] Embodiment 4

[0120] Figure 4 This is a schematic diagram of the structure of an interface performance stress test device provided by an embodiment of the present invention. This embodiment is applicable to the case where the performance of an interface is stress tested. The interface performance stress test device can be implemented in the form of hardware and / or software. The interface performance stress test device can be configured in any electronic device with network communication function. Figure 4 As shown, the interface performance stress testing device of the present invention includes:

[0121] The data acquisition module 410 is used to acquire the request data to be parsed of the target interface, and parse the key-value pairs of the request data to be parsed to obtain the data parsing result;

[0122] A template determination module 420, configured to determine a target request template and target logic parameters according to the data analysis result;

[0123] The testing module 430 is used to generate a target stress testing script according to the target request template and the target logical parameters, so as to perform interface performance stress testing on the target interface according to the target stress testing script.

[0124] Based on the above embodiment, optionally, the template determination module includes:

[0125] A first judgment unit is used to determine whether there is a target request template matching the data parsing result in a request template library; the request template library is used to store templates corresponding to different interfaces for generating stress testing scripts;

[0126] A generating unit is used to generate a target request template and target logic parameters according to the data parsing result if they do not exist.

[0127] On the basis of the above embodiment, optionally, the data acquisition module includes a first parsing unit and a second parsing unit. The first parsing unit is used to convert the request data to be parsed into data in a preset format one layer deep if the request data format of the request data to be parsed is a path parameter format, and parse the key-value pairs of the converted request data to be parsed to obtain a data parsing result; the second parsing unit is used to parse the key-value pairs of the request data to be parsed to obtain a data parsing result if the request data format of the request data to be parsed is a preset format.

[0128] On the basis of the above embodiment, optionally, the second parsing unit is also used to perform basic parsing on the key-value pairs of the request data to be parsed, and determine the data type of the value of each key-value pair; if the data type is an object type, the parsing function is recursively called to perform parsing at a preset parsing depth to obtain a data parsing result; if the data type is an array type, the data object type of the first data object of the value of the key-value pair is determined; if the data object type is an object type, the parsing function is recursively called to perform parsing at one layer of parsing depth to obtain a data parsing result.

[0129] On the basis of the above embodiment, optionally, the target request template includes a preset matching rule and request path information, the preset matching rule is used to describe the association relationship between the data parsing result and the target request template, and the request path information is used to indicate the interface link corresponding to the target request template; accordingly, the first judgment unit includes a matching subunit, a first judging subunit and a second judging subunit; the matching subunit is used to determine whether the data parsing result satisfies the preset matching rule of the target request template, and whether the request path information matches the target path information corresponding to the data parsing result; the first judging subunit is used to determine whether there is a target request template matching the data parsing result in the request template library if the data parsing result satisfies the preset matching rule of the target request template and the request path information matches the target path information corresponding to the data parsing result; the second judging subunit is used to determine whether there is a target request template matching the data parsing result in the request template library if the data parsing result does not satisfy the preset matching rule of the target request template and the request path information does not match the target path information corresponding to the data parsing result.

[0130] On the basis of the above embodiment, optionally, the preset matching rule includes a preset verification rule, and the preset verification rule is used to limit the range of the parameter information to be verified in the data analysis result;

[0131] Correspondingly, the matching sub-unit is also used to: obtain the corresponding target parameter information to be verified in the data analysis result; if the target parameter information to be verified meets the preset verification rules, determine that the data analysis result meets the preset matching rules of the target request template, otherwise, determine that the data analysis result does not meet the preset matching rules of the target request template.

[0132] On the basis of the above embodiment, optionally, the data parsing result includes the key name of the key-value pair, the path information of the key-value pair and the data type of the value of the key-value pair; the target request template includes the request path information, the preset matching rule, the logic parameter extraction rule and the basic request body; the preset matching rule includes the key name of the key-value pair, the path information of the key-value pair and the preset verification rule;

[0133] Correspondingly, the generation unit includes a template generation subunit, which is used to use the target path information corresponding to the data parsing result as the request path information; extract the key name of the key-value pair and the path information of the key-value pair from the data parsing result to generate the key name of the key-value pair and the path information of the key-value pair in the preset matching rule; obtain the preset editing rule, and determine the preset verification rule of the target request template according to the data type of the value of the key-value pair in the data parsing result, the value of the key-value pair and the preset editing rule; the preset editing rule is used to describe the data type of the value of the key-value pair in the data parsing result and the matching relationship between the value of the key-value pair and the preset verification rule; obtain the parameter determination rule, and determine the parameter type of each key-value pair in the data parsing result according to the parameter determination rule; the parameter determination rule is a rule that limits the parameter type of the key-value pair to a preset parameter; according to the parameter type of the key-value pair and the data parsing result, generate a logical parameter extraction rule and a basic request body.

[0134] On the basis of the above embodiment, optionally, the template generation subunit is also used for, if the key-value pair in the data parsing result does not match the parameter determination rule, then the parameter type of the key-value pair in the data parsing result is a logical parameter, and a logical parameter extraction rule is set according to the logical parameter; according to the parameter type of the key-value pair in the data parsing result, the data parsing result is changed, and the changed data parsing result is used as the basic request body.

[0135] On the basis of the above embodiment, optionally, the first judgment subunit is further used to extract target logical parameters from the data parsing result according to logical parameter extraction rules, and generate a target stress testing script according to the target request template and the target logical parameters.

[0136] On the basis of the above embodiment, optionally, the target request template includes an effective status and a hit count, and the test module includes an information determination unit, a third judgment unit and a fourth judgment unit; the information determination unit is used to determine whether to test the target interface, and then determine the effective status and hit count of the target request template; the third judgment unit is used to not test the target interface if the effective status is pending confirmation or expired; the fourth judgment unit is used to determine the thread ratio of each target request template according to the hit count of each target request template if the effective status is in effect, and determine the concurrency number of each target request template according to the thread ratio.

[0137] On the basis of the above embodiment, optionally, the fourth judgment unit is further used to generate a target stress testing script according to the basic request body and the target logical parameters, so as to perform interface performance stress testing on the target interface according to the target stress testing script.

[0138] The interface performance stress testing device provided in the embodiment of the present invention can execute the interface performance stress testing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0139] Embodiment 5

[0140] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0141] Figure 5 A schematic diagram of the structure of an electronic device that can be used to implement the interface performance stress testing method of an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0142] like Figure 5As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0143] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0144] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the interface performance stress testing method.

[0145] In some embodiments, the interface performance stress test method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the interface performance stress test method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the interface performance stress test method in any other appropriate manner (e.g., by means of firmware).

[0146] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0147] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0148] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0149] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0150] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0151] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0152] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

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

Claims

1. A method for stress testing interface performance, characterized in that: The method comprises: Obtain the request data to be parsed of the target interface, and parse the key-value pairs of the request data to be parsed to obtain the data parsing result; Determine a target request template and target logic parameters according to the data analysis result; A target stress testing script is generated according to the target request template and the target logical parameters, so as to perform interface performance stress testing on the target interface according to the target stress testing script.

2. The method according to claim 1, characterized in that Determining a target request template and target logic parameters according to the data analysis result includes: Determine whether there is a target request template matching the data parsing result in a request template library; the request template library is used to store templates corresponding to different interfaces for generating stress testing scripts; If it does not exist, a target request template and target logic parameters are generated according to the data parsing result.

3. The method according to claim 1, characterized in that Parsing the key-value pairs of the request data to be parsed to obtain data parsing results includes: If the request data format of the request data to be parsed is a path parameter format, converting the request data to be parsed into data of a preset format one layer deep, and parsing the key-value pairs of the converted request data to be parsed to obtain a data parsing result; If the request data format of the request data to be parsed is a preset format, the key-value pairs of the request data to be parsed are parsed to obtain a data parsing result.

4. The method according to claim 3, characterized in that Parsing the key-value pairs of the request data to be parsed to obtain data parsing results includes: Performing basic parsing on the key-value pairs of the request data to be parsed, and determining the data type of the value of each key-value pair; If the data type is an object type, the parsing function is recursively called to perform parsing at a preset parsing depth to obtain the data parsing result; If the data type is an array type, the data object type of the first data object of the value of the key-value pair is determined; if the data object type is an object type, the parsing function is recursively called to perform a layer of parsing depth to obtain a data parsing result.

5. The method according to claim 2, characterized in that: The target request template includes a preset matching rule and request path information, wherein the preset matching rule is used to describe the association relationship between the data parsing result and the target request template, and the request path information is used to indicate the interface link corresponding to the target request template; Accordingly, determining whether there is a target request template matching the data parsing result in the request template library includes: Determine whether the data parsing result satisfies a preset matching rule of the target request template, and whether the request path information matches the target path information corresponding to the data parsing result; If the data parsing result satisfies the preset matching rule of the target request template, and the request path information matches the target path information corresponding to the data parsing result, it is determined that there is a target request template matching the data parsing result in the request template library; If the data parsing result does not satisfy the preset matching rule of the target request template, and the request path information does not match the target path information corresponding to the data parsing result, it is determined that there is no target request template matching the data parsing result in the request template library.

6. The method according to claim 5, characterized in that The preset matching rule includes a preset verification rule, and the preset verification rule is used to limit the range of the parameter information to be verified in the data analysis result; Accordingly, determining whether the data parsing result satisfies the preset matching rule of the target request template includes: Obtaining the target parameter information to be verified corresponding to the data analysis result; If the target parameter information to be verified meets the preset verification rule, it is determined that the data analysis result meets the preset matching rule of the target request template; otherwise, it is determined that the data analysis result does not meet the preset matching rule of the target request template.

7. The method according to claim 2, characterized in that: The data parsing result includes the key name of the key-value pair, the path information of the key-value pair and the data type of the value of the key-value pair; the target request template includes the request path information, the preset matching rule, the logic parameter extraction rule and the basic request body; the preset matching rule includes the key name of the key-value pair, the path information of the key-value pair and the preset verification rule; Correspondingly, a target request template and target logic parameters are generated according to the data analysis result, including: Using the target path information corresponding to the data analysis result as the request path information; Extracting the key name of the key-value pair and the path information of the key-value pair from the data parsing result to generate the key name of the key-value pair and the path information of the key-value pair in the preset matching rule; Obtaining preset editing rules, and determining preset verification rules of the target request template according to the data type of the value of the key-value pair in the data parsing result, the value of the key-value pair and the preset editing rules; the preset editing rules are used to describe the data type of the value of the key-value pair in the data parsing result and the matching relationship between the value of the key-value pair and the preset verification rules; Obtaining a parameter determination rule, and determining the parameter type of each key-value pair in the data analysis result according to the parameter determination rule; the parameter determination rule is a rule that limits the parameter type of the key-value pair to a preset parameter; According to the parameter type of the key-value pair and the data parsing result, a logical parameter extraction rule and a basic request body are generated.

8. The method according to claim 7, characterized in that Generate a logical parameter extraction rule and a basic request body according to the parameter type of the key-value pair and the data parsing result, including: If the key-value pair in the data analysis result does not match the parameter determination rule, the parameter type of the key-value pair in the data analysis result is a logical parameter, and a logical parameter extraction rule is set according to the logical parameter; According to the parameter type of the key-value pair in the data parsing result, the data parsing result is changed, and the changed data parsing result is used as the basic request body.

9. The method according to claim 5, characterized in that The target request template includes a logic parameter extraction rule. After determining that there is a target request template matching the data parsing result in the request template library, the method further includes: The target logical parameters are extracted from the data parsing result according to the logical parameter extraction rules, and a target stress testing script is generated according to the target request template and the target logical parameters.

10. The method according to claim 1, characterized in that The target request template includes an effective state and a hit count, and a target stress test script is generated according to the target request template and the target logic parameter, so as to perform interface performance stress test on the target interface according to the target stress test script, including: Determine to test the target interface, then determine the validity status and hit count of the target request template; If the effective state is pending confirmation or expired, the target request template is not used to test the target interface; If the effective state is effective, the thread ratio of each target request template is determined according to the number of hits of each target request template, and the concurrency number of each target request template is determined according to the thread ratio.

11. The method according to claim 10, characterized in that The target request template includes a basic request body. After determining the concurrency number of each target request template according to the thread ratio, the method includes: A target stress testing script is generated according to the basic request body and the target logical parameters, so as to perform interface performance stress testing on the target interface according to the target stress testing script.

12. An interface performance stress testing device, characterized in that: The device comprises: A data acquisition module is used to acquire the request data to be parsed of the target interface, and parse the key-value pairs of the request data to be parsed to obtain the data parsing result; A template determination module, used to determine a target request template and target logic parameters according to the data analysis result; The test module is used to generate a target stress testing script according to the target request template and the target logical parameters, so as to perform interface performance stress testing on the target interface according to the target stress testing script.

13. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the interface performance stress testing method described in any one of claims 1-11.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the interface performance stress testing method according to any one of claims 1 to 11 when executed.