Interface performance test method, device, equipment and storage medium

By prioritizing API calls and response times, and combining this with a modified API list, performance test scripts are automatically generated and executed. This solves the problem of intensive manual operations in traditional API performance testing and achieves highly efficient API performance testing.

CN120950414BActive Publication Date: 2026-01-09中邮消费金融有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511469689.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-15
Publication Date
2026-01-09
Estimated Expiration
2045-10-15

AI Technical Summary

Technical Problem

Traditional interface performance testing processes involve numerous manual steps, resulting in low efficiency and making it difficult to achieve automated and effective interface performance testing.

Method used

By determining performance priority scores based on the initial API call volume and response time, and combining this with the list of modified APIs, performance test scripts are automatically generated, tested in a performance testing environment, and a final report is generated.

Benefits of technology

It enables precise location and automated testing of high-frequency, high-latency, and high-value interfaces, generating accurate performance test reports and improving testing efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120950414B_ABST
    Figure CN120950414B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of software testing, and discloses an interface performance test method, device, equipment and storage medium. According to the performance priority score and the changed interface list, the target interface needing performance test is determined, the high-frequency, high-delay and high-value target interface can be accurately positioned, then the performance test script corresponding to the target interface is automatically generated according to the structured data corresponding to the target interface and the preset script template, and the performance test of the target interface is carried out in the performance test environment based on the performance test script, so that the performance test of the target interface can be automatically and effectively carried out, and the final performance test report is generated.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of software testing, and particularly relates to an interface performance test method and device, equipment and a storage medium. BACKGROUND

[0002] Performance test is an important part of software testing. The traditional performance test process is as follows: 1) a project manager determines whether a performance test needs to be performed on a version to be tested according to the familiarity with the system and the understanding of online access volume, in combination with version change points; 2) a performance tester understands the performance test range with a developer or the project manager, determines a performance test strategy, and formulates a performance test scheme; 3) the performance tester performs configuration modification, SQL script execution, and version packaging and deployment; 4) the performance tester writes a performance test scene script according to the performance test scheme, determines a parameterized field, and debugs the script; 5) the performance tester adjusts different concurrency numbers to perform the performance test, and manually collects performance test indexes, server resource indexes, and database resource indexes; 6) the performance tester summarizes data and writes a performance test report; 7) if there is a performance problem, the performance tester assists the developer in troubleshooting the performance problem and in repairing the performance problem; 8) the performance tester retests and verifies whether the problem is solved; and 9) the performance tester generates a final performance test report. However, the following pain points usually exist: manual operation links are intensive, including script development, index collection, report generation, and problem troubleshooting, and the like. Therefore, how to automatically and effectively perform interface performance test becomes a problem to be solved. SUMMARY

[0003] The main purpose of the present application is to provide an interface performance test method, device, equipment and storage medium, which aims to solve the technical problem of how to automatically and effectively perform interface performance test.

[0004] To achieve the above purpose, the present application provides an interface performance test method, which comprises the following steps:

[0005] determining a performance priority score corresponding to the initial interface according to the daily interface call volume and the daily interface response time corresponding to the initial interface;

[0006] determining a target interface that needs to be tested for performance according to the performance priority score and the list of changed interfaces;

[0007] generating a performance test script corresponding to the target interface according to the structured data corresponding to the target interface and a preset script template;

[0008] performing performance test on the target interface in a performance test environment based on the performance test script, and obtaining a performance test result.

[0009] Optionally, the performance priority score corresponding to the initial interface is determined according to the daily interface level call quantity and the daily interface level response time corresponding to the initial interface, and the performance priority score corresponding to the initial interface is determined according to the daily interface level call quantity and the daily interface level response time corresponding to the initial interface, comprising:

[0010] The daily interface level average response time is calculated according to the daily interface level response time corresponding to the initial interface.

[0011] If the initial interface belongs to an online interface, the performance priority score corresponding to the initial interface is determined according to the daily interface level call quantity, the daily interface level average response time, the system criticality score and the system stability rate.

[0012] If the initial interface does not belong to an online interface, the performance priority score corresponding to the initial interface is determined according to the system criticality score and the system stability rate.

[0013] Optionally, the target interface that needs to be tested for performance is determined according to the performance priority score and the changed interface list, and the target interface that needs to be tested for performance is determined according to the performance priority score and the changed interface list, comprising:

[0014] The changed file is extracted from the code change record file, and the changed type corresponding to the changed file is determined.

[0015] The changed name is determined according to the changed type, and the changed interface list is determined according to the changed name.

[0016] The performance test level is determined according to the performance priority score, and the interface of the emergency level and the interface of the high level are selected from the initial interface according to the performance test level.

[0017] If the interface of the emergency level and the interface of the high level are in the changed interface list, the interface of the emergency level and the interface of the high level are taken as the target interface that needs to be tested for performance.

[0018] Optionally, the performance test script corresponding to the target interface is generated according to the structured data corresponding to the target interface and the preset script template, and the performance test script corresponding to the target interface is generated according to the structured data corresponding to the target interface and the preset script template, comprising:

[0019] The interface parameterization strategy is determined according to the interface type corresponding to the target interface.

[0020] The interface parameterization is performed on the target interface according to the interface parameterization strategy, and the structured data is determined according to the obtained parameterization information.

[0021] The preset script template is determined according to the interface type, and the performance test script corresponding to the target interface is generated according to the structured data and the preset script template.

[0022] Optionally, the interface parameterization of the target interface according to the interface parameterization strategy, and determining the structured data according to the obtained parameterization information, comprise:

[0023] mapping relationship between the application name and the IP port is constructed;

[0024] interface basic information corresponding to the target interface, request data, and interface response data are obtained;

[0025] the target interface is interface parameterized according to the interface parameterization strategy, pre-configured parameterization field, and parameterization function, and parameterization information is obtained;

[0026] the mapping relationship, the interface basic information, the request data, the interface response data, and the parameterization information are taken as structured data.

[0027] Optionally, the performance test of the target interface based on the performance test script in the performance test environment is performed, and performance test results are obtained, which comprise:

[0028] in the case of the performance test of the target interface based on the performance test script in the performance test environment, the stress test transaction per second and the stress test response time of the target interface are obtained;

[0029] if the target interface has a corresponding performance test baseline, the baseline transaction per second and the baseline response time in the performance test baseline are obtained;

[0030] in the case that the stress test transaction per second is greater than or equal to the baseline transaction per second, and the stress test response time is less than or equal to the baseline response time, it is determined that the performance test result is test passed.

[0031] Optionally, after the stress test transaction per second and the stress test response time of the target interface are obtained in the case of the performance test of the target interface based on the performance test script in the performance test environment, the following further comprises:

[0032] if the target interface does not have a corresponding performance test baseline, the production environment transaction per second and the production environment response time of the target interface in the production environment are obtained;

[0033] in the case that the stress test transaction per second is greater than or equal to the production environment transaction per second, and the stress test response time is less than or equal to the production environment response time, it is determined that the performance test result is test passed.

[0034] In addition, in order to achieve the above-mentioned purpose, the application further provides an interface performance test device, the interface performance test device comprises:

[0035] a priority determination module configured to determine a performance priority score corresponding to the initial interface according to the daily interface call volume and the daily interface response time corresponding to the initial interface;

[0036] an interface determination module configured to determine a target interface requiring performance testing according to the performance priority score and the list of modified interfaces;

[0037] a script generation module configured to generate a performance testing script corresponding to the target interface according to the structured data corresponding to the target interface and a preset script template;

[0038] a performance testing module configured to perform performance testing on the target interface in a performance testing environment based on the performance testing script, and obtain a performance testing result.

[0039] In addition, to achieve the above object, the present application further provides an interface performance testing device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the interface performance testing method as described above.

[0040] In addition, to achieve the above object, the present application further provides a storage medium, which is a computer readable storage medium, and the storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the interface performance testing method as described above.

[0041] According to the present application, the performance priority score corresponding to the initial interface is determined according to the daily interface call volume and the daily interface response time corresponding to the initial interface, then the target interface requiring performance testing is determined according to the performance priority score and the list of modified interfaces, then the performance testing script corresponding to the target interface is generated according to the structured data corresponding to the target interface and the preset script template, and then the performance testing on the target interface in the performance testing environment is performed based on the performance testing script to obtain the performance testing result. The target interface requiring performance testing is determined according to the performance priority score and the list of modified interfaces, which can accurately locate the target interface with high frequency, high delay and high value, and then the performance testing script corresponding to the target interface is automatically generated according to the structured data corresponding to the target interface and the preset script template, and then the performance testing on the target interface in the performance testing environment is performed based on the performance testing script, so that the performance testing on the target interface can be automatically and effectively performed, and the final performance testing report can be generated. BRIEF DESCRIPTION OF DRAWINGS

[0042] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the drawings can also provide further understanding of the prior art for those of ordinary skill in the art without any creative effort.

[0044] Figure 1 The flowchart of the first embodiment of the interface performance test method of the present application;

[0045] Figure 2 The structural framework diagram of the interface performance test system of the first embodiment of the interface performance test method of the present application;

[0046] Figure 3 The flowchart of obtaining the modified interface list of the first embodiment of the interface performance test method of the present application;

[0047] Figure 4 The flowchart of determining the target interface of the first embodiment of the interface performance test method of the present application;

[0048] Figure 5 The flowchart of the second embodiment of the interface performance test method of the present application;

[0049] Figure 6 The flowchart of generating the performance test script of the first embodiment of the interface performance test method of the present application;

[0050] Figure 7 The flowchart of the third embodiment of the interface performance test method of the present application;

[0051] Figure 8 The flowchart of the performance test of the first embodiment of the interface performance test method of the present application;

[0052] Figure 9 The structural block diagram of the first embodiment of the interface performance test device of the present application;

[0053] Figure 10 The structural diagram of the interface performance test device of the hardware running environment involved in the embodiment of the present application.

[0054] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION

[0055] It should be understood that the specific embodiments described herein are merely intended to explain the technical solutions of the present application, and not to limit the present application.

[0056] For better understanding of the technical solutions of the present application, the following will be described in detail in combination with the drawings of the specification and specific embodiments.

[0057] It should be noted that the execution subject of the present application can be a computing service device with software testing and performance testing functions, for example, a computer.

[0058] Based on this, the present application provides an interface performance testing method, referring to Figure 1 , Figure 1 The flowchart of the first embodiment of the interface performance testing method of the present application is shown in the figure.

[0059] In this embodiment, the interface performance testing method comprises the following steps:

[0060] Step S10: Determine the performance priority score corresponding to the initial interface according to the interface daily call volume and interface daily response time corresponding to the initial interface.

[0061] It can be understood that, referring to Figure 2 , Figure 2 The structural framework diagram of the interface performance testing system of an embodiment of the interface performance testing method of the present application is shown in the figure. Figure 2 In order to realize automatic interface performance testing, an interface performance testing system is proposed, which adopts a hierarchical design mode and a modular testing framework, including an application layer, a service layer and a storage layer. The application layer, as the core interactive interface of the interface performance testing system, contains the following six functional modules, forming a complete performance testing closed-loop management system. The performance testing requirement recommendation module intelligently recommends interfaces requiring performance testing based on code change analysis, production environment access volume, business priority and system stability; the performance testing scheme display module automatically generates a performance testing scheme including testing purposes, scene description and performance index requirements according to the intelligently recommended performance testing interfaces, requirement information and production environment transaction per second (TPS) indicators, and supports manual editing and supplement; the performance testing scene viewing and editing module displays the arranged performance testing scene, and the main information includes parameterized settings, uniform resource locator (URL), messages and assertions; the performance testing execution module schedules and executes the performance testing of the scenes within the scope of this performance testing, and monitors server resources and database resources through Grafana tools + Promethus tools during the execution process, and each execution produces an execution record. When all the scenes are executed, the performance testing conclusion is intelligently generated, and combined with the performance testing scheme and the performance testing execution record, the performance testing report of the requirement is finally generated.

[0062] The service layer provides the required capabilities for the application layer, mainly involving seven systems: Application Performance Management (APM) system, interface management platform, Structured Query Language (SQL) management platform, configuration center, Information Technology (IT) management platform, performance management platform, and performance testing platform. These seven systems work together to build a complete process loop from production traffic acquisition to performance testing report, achieving continuous optimization of system stability and throughput. 1) The APM system mainly completes production environment link tracking and traffic monitoring, providing data basis for measuring interface performance priority score; 2) The interface management platform calculates the performance priority score of each interface based on production traffic, and the interface information module is the main data source for automatically generating performance testing scenario scripts. The precise positioning code change module intelligently analyzes the test code based on the test information, generates a list of changed interfaces for the test version by reverse tracing the call relationship; 3) The SQL management platform is mainly responsible for the management of database instances of each application, and realizes the automatic execution and traceability of SQL changes; 4) The configuration center realizes the differentiated management of different applications in different environments. When a version is deployed to a certain environment, it involves middleware addresses and some parameters that differ due to environmental differences. During version deployment, automatic replacement is realized; 5) The IT management platform realizes the management of requirements and research and development, and is used to calculate the two dimensions of performance testing priority: system level and online problem management. The interface management platform interacts with the IT management platform to obtain relevant information; 6) The performance management platform completes the overall process of building CICD. After the version is tested, it automatically mirrors the build and calls the SQL management platform to execute the SQL statements of the version, calls the configuration center to modify the configuration file, and then automatically deploys the image to the container cloud server. After successful execution, it notifies the interface management platform for code analysis to identify the list of changed interfaces; 7) The performance testing platform integrates demand information, version information, and high-priority interfaces changed in the current version in the performance testing demand recommendation module, and intelligently recommends performance testing demands. It automatically generates performance testing schemes containing high-priority performance testing interfaces, and supports adjustment. After the scheme is determined, it calls the interface management platform to obtain message information, URL information, assertion information, and parameterized content based on the selected interfaces, and automatically generates performance testing scenario scripts. After a single execution, it is executed through a timing task. During the execution process, the application server and database server resources are obtained, and finally the TPS, response time, correctness, and server resource information of each interface are summarized to generate a performance testing report.The intelligent generation module for performance test conclusions is mainly responsible for determining the performance test conclusions based on three aspects: accuracy, comparison of actual TPS value, average response time with expected values ​​in the production environment, and whether the fluctuation range is within an acceptable range.

[0063] 3. The foundational layer provides the underlying support for the entire architecture, responsible for providing the most basic operating environment, resource management, and technical capabilities. This primarily includes Prometheus and Grafana tools for monitoring server resource information during load testing; Skywalking for link tracing and traffic data collection; and Feiyou notifications to notify relevant personnel of performance test failures and successes for timely handling and review. Image repositories, version control systems, and container clouds handle image building and deployment. Databases ensure data persistence. A load generator simulates high-concurrency scenarios by generating high loads.

[0064] Furthermore, in order to accurately calculate the performance priority score corresponding to the initial interface, in this embodiment, step S10 includes: calculating the daily average response time of the interface based on the daily response time of the interface corresponding to the initial interface; if the initial interface is an online interface, then determining the performance priority score corresponding to the initial interface based on the daily call volume of the interface, the daily average response time of the interface, the system criticality score, and the system stability rate; if the initial interface is not an online interface, then determining the performance priority score corresponding to the initial interface based on the system criticality score and the system stability rate.

[0065] It should be understood that the APM system obtains the daily call volume (T-1) of online interfaces, where T-1 represents the previous day. Examples include the total number of HTTP interface calls on T-1, the total number of Dubbo interface calls on T-1, and the total number of times an application consumes a specific Kafka entity. The daily call volume is one dimension influencing performance test priority scores; without considering other factors, a higher call volume results in a higher performance test priority. The APM system also obtains the average response time of online interfaces on day T-1. The system averages the response times of all interfaces on day T-1 as the daily average response time, used to measure the speed of online interface responses.

[0066] It can be understood that the interface quantifiable performance test priority score and level. Generally, the performance test priority of the interface with high call volume and high response time is more urgent; the performance test priority of the interface with high call volume and low response time is higher; the performance test priority of the interface with low call volume and high response time is medium; the performance test priority of the interface with low call volume and low response time is lower, which can be temporarily ignored. Based on the above overall idea, the embodiment proposes a calculation method of interface quantifiable performance test priority score, which considers the call volume and response time, and considers the system criticality and system online performance problem frequency. The system criticality score is used to reflect the importance of a certain system to business operation. Once the performance problem of the system with high criticality occurs, it may cause serious business loss (such as income decline, customer loss, compliance risk, etc.). According to the business criticality, the system level is divided into three levels, each level corresponds to a score, which is used for interface performance test priority score calculation. The higher the score, the more important the system, and the relatively higher the performance test priority score. The system stability is measured by the frequency of online performance problems. The lower the frequency of performance problems, the higher the stability of the production environment, and the relatively lower the performance test priority score. The higher the frequency of performance problems, the lower the stability of the system, and the relatively higher the performance test priority score. The system stability is defined as follows: system stability = system online performance problem number / online total performance problem number. The call volume and response time of the online interface are volatile, which causes the performance test priority to be dynamic. The online call volume and other indicators need to be synchronized regularly, and the performance priority score is dynamically adjusted according to the definition to ensure the timeliness of the performance priority score.

[0067] In a specific implementation, if the initial interface belongs to an online interface, the performance priority score can be calculated by the following formula:

[0068]

[0069] In the formula, the interface call weight, response time weight, system criticality weight, and system stability weight can be dynamically adjusted according to the emphasis, for example, the enterprise is sensitive to the call volume, and the weights can be set as 0.4, 0.3, 0.2, and 0.1 respectively.

[0070] In the formula, the call volume weight is The call quantity normalization result is in [0%, 100%], directly reflecting the relative relationship between the interface flow and the maximum load of the system. When the call quantity normalization result tends to 100%, it is indicated that the call quantity of the interface is close to the peak value of the interface call quantity of the system, and the performance test priority is increased; when the call quantity normalization result tends to 0, it is indicated that the call quantity of the interface is low, and the performance test priority is decreased.

[0071] In the formula, the call quantity of the interface is divided by the maximum call quantity of the system. The response time normalization is based on different system levels, and the response time of a first-level system is relatively low, and the response time tolerance of a third-level system is strong. Based on this principle, the response time of different system levels is determined. When the response time normalization is greater than 100%, there is performance degradation, and the performance priority score is increased; when the response time normalization is less than 100%, it is better than the reference value, and the performance priority score is decreased.

[0072] In addition, if the initial interface does not belong to the online interface, that is, for the newly added interface that has not been put online, there is no online call quantity and interface average response time index, and the performance priority score can be calculated by the following formula:

[0073]

[0074] Step S20: determining the target interface that needs to be tested according to the performance priority score and the changed interface list.

[0075] Further, in order to obtain the target interface with high frequency, high delay and high value, in the embodiment, the step S20 includes: extracting a changed file from a code change record file, and determining a changed type corresponding to the changed file; determining a changed name according to the changed type, and determining a changed interface list according to the changed name; determining a performance test level according to the performance priority score, and selecting an interface of an emergency level and an interface of a high level from the initial interface according to the performance test level; if the interface of the emergency level and the interface of the high level are in the changed interface list, the interface of the emergency level and the interface of the high level are taken as the target interface that needs to be tested.

[0076] It should be understood that the above description refers to Figure 3 , Figure 3 The flowchart for obtaining the changed interface list of the interface performance test method of the embodiment is shown in FIG. 2. Figure 3As shown, each Git Commit record, i.e. code change record file, of the requirement branch can be traversed first, and the modified files are extracted from these files, and then according to the modification record, the modification in the file is analyzed through AST (Abstract Syntax Tree), so as to determine the modification type of the modified file, and to determine whether the modification is a scheduled task, whether the modification is a Kafka Consumer, and whether the modification is a Controller layer. The Controller layer is a very important request entry and scheduling center in software development, especially in the MVC (Model-View-Controller) architecture or modern backend service. If it is a scheduled task or a Kafka Consumer or a Controller layer, the modification name can be determined, including the scheduled task name, the Kafka consumption topic name, and the interface name. Otherwise, the caller is reversely searched. If there is no reverse caller, the modification of the file is exited, and the modification will not be included in the modification interface list. Whether it is a scheduled task, a Kafka Consumer, or a Controller layer can be determined in a loop until the exit condition is reached, and finally the modification interface list of the requirement is generated.

[0077] It can be understood that the performance test level can be determined according to the performance priority score. Specifically, if the interface has one or more characteristics of high traffic, high delay / high error rate, and core business, the performance priority score is likely to be ≥ 90, and the performance test level is defined as P0 (urgent); if the interface has high traffic but performance meets the standard, or medium traffic, and the system stability rate is low, the performance test priority score is likely to be between 80 and 90, and the performance test level is defined as P1 (high); if the interface has low traffic but high response time, and the system level is low, the performance test priority score is likely to be between 70 and 80, and the performance test level is defined as P2 (medium); otherwise, when the performance test priority score < 70, the performance test level is defined as P3 (no need to handle immediately). If the offline call volume of the interface is less than 0, the performance test priority score interval needs to be adjusted to correspond to different performance test levels.

[0078] In a specific implementation, refer to Figure 4 , Figure 4 The flowchart for determining the target interface of an embodiment of the interface performance test method of the present application is as follows Figure 4As shown, the APM synchronously collects traffic data and response time data in the production environment to the interface management platform. The interface management platform calculates the performance priority score of each initial interface according to the weighting method, and divides the different scores into four performance test levels: urgent, high, medium, and low. Considering the dynamic changes of production traffic, the interface management platform recalculates the priority level of each interface every day to ensure timeliness. After the performance management platform triggers the test, it calls the SQL management platform to execute SQL, calls the configuration management center to synchronize the configuration, automatically deploys the image to the stress testing environment, and notifies the interface management platform. The interface management platform will obtain Git commit records and other information, reversely locate the call chain through static code analysis, accurately identify the modified interface list of the version change, and recommend the interfaces with high performance test levels in the modified interface list for performance testing.

[0079] Step S30: generating the performance test script corresponding to the target interface according to the structured data corresponding to the target interface and the preset script template.

[0080] It can be understood that the embodiment provides a performance test scheme automatic generation method, which automatically generates a performance test scheme containing performance test purposes, test strategies (including scene description, interface name, protocol, performance test reason, and expected index), and monitoring focus, intelligently recommends target interfaces that need to be tested for performance, and provides quantifiable basis for performance test requirements. To achieve the above purpose, the following technical solutions are provided: 1. Performance test purpose: determine the stress test purpose of the current version according to the version requirement description and the Git commit description. 2. Test strategy: the performance test scene includes interfaces with urgent and high performance test priority; the interface definition and protocol information can be obtained from the interface management platform, and the reason for recommending performance test describes how to calculate the performance test priority according to the online call volume, online average response time, system criticality, and system stability, giving people an intuitive understanding. 3. Performance test expected reference value: it is generally difficult to give an absolute passing standard in performance test, and performance test passing generally needs to be combined with actual traffic and business usage scenarios. In this scheme, the reference value for reaching the standard is given by comparing the TPS and response time in the stress testing environment with the TPS and response time in the online environment.

[0081] It should be understood that, in order to realize the automation of performance test, the conversion from performance test scheme to performance test script can be performed, the high-priority performance test interface is given in the performance test scheme, it is judged whether the performance test scene script of the interface exists according to the interface name, if the script exists, the script is bound to the performance test case, and the performance test case is associated with the performance test plan; if the script does not exist, the performance test scene script is automatically created. The script automatic generation engine realizes efficient and standardized automatic generation of performance test scripts by combining structured data with preset script templates.

[0082] Step S40: performing performance test on the target interface in the performance test environment based on the performance test script, and obtaining performance test result.

[0083] It can be understood that the embodiment provides a method for automatic deployment of a performance test environment. Traditional performance test environment deployment usually needs manual synchronization configuration, SQL execution, and image building and deployment. Performance test environment preparation is an important link for performance test, and the degree of automation directly affects whether the whole process of performance test can be automated. After automatic synchronization configuration to the configuration management platform and automatic SQL execution by the SQL management platform, the embodiment performs image building and deployment, and completes automatic deployment of the performance test environment. In order to achieve the above purpose, the following technical solutions are provided:

[0084] 1. Automatic execution of configuration change. The configurations of all environments are uniformly managed by a configuration center, the configuration center abstracts and manages information related to the environment, such as database address, password, application address, component address, and key, according to system and environment, parameterized configuration is used in configuration file change, different values are extracted according to parameter name in different environments. For changes that are not parameterized, each environment is not differentiated and a fixed value is used. Configuration file change includes three types: addition, deletion, and modification. The type of configuration change is determined according to the file name. The new configuration is added to the original configuration file; the key value of the original configuration file is found and the corresponding configuration of the key is deleted for the deletion configuration; the key value in the original configuration file is found and the corresponding value is modified for the modification configuration. Key-Value is a key-value pair.

[0085] 2. Automatic execution of SQL changes. The overall process of automatic execution of SQL changes is as follows: (1) Each system uniformly agrees on the naming rules and paths of SQL files. The SQL management platform obtains the SQL execution file from the corresponding directory according to the agreement. The execution of SQL with dependent order is controlled by the SQL file naming agreement, such as 01.sql, 02.sql, etc. (2) The SQL management platform manages the database information of different systems in each environment. According to the deployed environment, system, etc., it determines on which database instance to execute. (3) The SQL management platform handles some abnormal processes, such as duplicate data insertion, duplicate index addition, etc. The SQL management platform will do corresponding processing, such as judging whether the existing record and the record to be inserted are completely consistent. If they are completely consistent, the insertion is considered successful. Otherwise, the original record is deleted and re-inserted to ensure that the SQL execution is successful and is the record submitted this time. (4) Supports automatic retry and idempotent operations to ensure the transactional nature of SQL file execution: If a file contains multiple SQL statements, some of which succeed and some fail, it will automatically retry, and the successful statements will not be executed again. If it still fails after N retries, the successfully executed statements in the file will be rolled back to ensure the transactional nature of SQL file execution.

[0086] 3. Continuous integration and deployment are completed through CI (Continuous Integration) / CD (Continuous Deployment). When a version is submitted for testing, an image is automatically built and the version is deployed to the performance testing environment. An environment availability check is performed using a probe; if the environment is unavailable after deployment, the relevant personnel are notified to intervene; otherwise, no notification is given.

[0087] In practice, the target interface can be tested in a performance testing environment based on the performance test script to obtain the performance test results, i.e., generate a performance test report, and determine whether the target interface test has passed.

[0088] The embodiment determines a performance priority score corresponding to the initial interface according to the interface daily call quantity and the interface daily response time corresponding to the initial interface, then determines a target interface that needs to be tested in performance according to the performance priority score and the changed interface list, then generates a performance test script corresponding to the target interface according to the structured data corresponding to the target interface and a preset script template, and performs performance test on the target interface in a performance test environment based on the performance test script to obtain a performance test result. The embodiment can accurately locate the target interface with high frequency, high delay and high value according to the performance priority score and the changed interface list, and then automatically generate the performance test script corresponding to the target interface according to the structured data corresponding to the target interface and the preset script template, and perform performance test on the target interface in the performance test environment based on the performance test script, so that the performance test on the target interface can be automatically and effectively performed, and a final performance test report can be generated.

[0089] Reference Figure 5 , Figure 5 FIG. 2 is a flowchart of a second embodiment of the interface performance test method.

[0090] Based on the above first embodiment, in the embodiment, the step S30 comprises:

[0091] Step S301: determining an interface parameterization strategy according to the interface type corresponding to the target interface.

[0092] It can be understood that the interface parameterization strategy is also different for different types of target interfaces, and the interface type can include an added interface, a query interface, an updated interface, and the like.

[0093] In a specific implementation, for parameterization of the added interface: the fields in the message are obtained from the interface management platform, and are replaced using parameterization functions, such as an ID card function, a mobile phone number function, and a bank card function. For parameterization of the query interface: the interface management platform is responsible for uniformly managing the source data table of the interface input parameter, such as the input parameter “ID number IDNO” corresponding to the “idno” field of the “userinfo table”, so that the parameterization mode of the field in the automatically generated script is to take data from the database: select idno from userinfo, so as to ensure that the logical flow of the interface can be correctly passed through and will not be abnormally exited due to parameter verification. For parameterization of the updated interface: the parameterization of the updated interface is the same as that of the query interface, and it is necessary to ensure that the data record exists, and the same parameterization mode of taking data from the database is adopted.

[0094] Step S302: performing interface parameterization on the target interface according to the interface parameterization strategy, and determining structured data according to the obtained parameterization information.

[0095] Furthermore, in order to effectively obtain structured data, in this embodiment, step S302 includes: constructing a mapping relationship between application name and IP port; obtaining basic interface information, request data, and interface response data corresponding to the target interface; parameterizing the target interface according to the interface parameterization strategy, pre-configured parameterization fields, and parameterization functions to obtain parameterization information; and using the mapping relationship, the basic interface information, the request data, the interface response data, and the parameterization information as structured data.

[0096] It should be understood that, referring to Figure 6 , Figure 6 This is a schematic diagram illustrating the process of generating a performance test script according to an embodiment of the interface performance testing method of this application. Figure 6 As shown, several types of structured data can be obtained first, including: obtaining the IP port of the interface performance environment based on the application name, i.e., establishing a mapping relationship between the application name and the IP port; obtaining basic interface information, request data, and interface response data from the interface management platform, including interface information description, interface URL, interface message, POST / Get / Put methods, interface message parameters, request headers, and return examples, etc. Through the return message description, interface assertions are generated to ensure the correctness of interface execution. Commonly used management fields and parameterized functions for performance testing can also be configured, such as ID card number, mobile phone number, bank card number, and customer number.

[0097] Understandably, for new interface types, the parameterized fields in the message are obtained from the interface management platform and replaced with parameterized functions; for query interface types, the database query statement corresponding to the field is obtained from the interface management platform and parameterized by retrieving data from the database; for update interface types, the database query statement corresponding to the field is obtained from the interface management platform and parameterized by retrieving data from the database.

[0098] In a specific implementation, the database monitoring: according to the interface to be tested, the application ID is obtained from the interface management platform; according to the application ID, the database connection information is queried from the SQL management platform. The database information placeholder is left in the template, and the placeholder is replaced with the database connection information when the script is generated. From the beginning of the stress test, the database monitoring information is obtained through grafana+promethus. The application server monitoring: according to the interface to be tested, the application ID is obtained from the interface management platform. The same as the database monitoring, the application server information placeholder is left in the template, and the application monitoring template is pre-configured in the grafana. The application server resources in the period from the beginning of the stress test to the end of the stress test are monitored. That is, the database information of the system is obtained from the SQL management platform, which is used to monitor the database server. The performance environment namespace of the system is obtained from the performance management platform, which is used to monitor the application server. Finally, the mapping relationship, interface basic information, request data, interface response data, parameterized information, system database information, and performance environment namespace of the system are collectively used as structured data.

[0099] Step S303: determining a preset script template according to the interface type, and generating the performance test script corresponding to the target interface according to the structured data and the preset script template.

[0100] It should be understood that the embodiment can first determine a preset script template according to the interface type, and select the template to be rendered according to the interface type, such as an HTTP interface, and automatically select an HTTP template. Then, according to the structured data, the preset script template is rendered, and the script automatic generation engine generates an executable performance test script according to the template. Specifically, the placeholders in the template can be replaced according to various information, and finally a Gatling stress test script supporting series connection and parallelism is generated, which includes interface definition, scene definition and other modules. Gatling is a powerful open source load test tool.

[0101] The embodiment determines an interface parameterization strategy according to the interface type corresponding to the target interface, then performs interface parameterization on the target interface according to the interface parameterization strategy, determines the structured data according to the obtained parameterized information, determines a preset script template according to the interface type, and generates the performance test script corresponding to the target interface according to the structured data and the preset script template. The embodiment performs interface parameterization on the target interface according to the interface parameterization strategy, determines the structured data according to the obtained parameterized information, can automatically obtain the data required by the performance test script, and generates the performance test script corresponding to the target interface according to the structured data and the preset script template, can render the preset script template according to the structured data, and obtain the performance test script corresponding to the target interface.

[0102] Reference Figure 7 , Figure 7A flowchart of a third embodiment of the interface performance test method of the present application.

[0103] Based on the above embodiments, in the present embodiment, the step S40 comprises:

[0104] Step S401: In the case of performing performance test on the target interface based on the performance test script in the performance test environment, acquiring the stress test transaction per second and the stress test response time of the target interface.

[0105] It can be understood that before formal concurrent stress test, all scenarios involved in the performance test plan are debugged first, if all assertions are successful, formal stress test is performed on each scenario according to the preset concurrency and concurrency duration; if there is a scenario whose assertion is unsuccessful, the corresponding performance tester is notified to intervene to investigate the reason for the failure of the script execution through the flymail. The corresponding measured system namespace is monitored through Promethus+Grafana, and the server CPU and memory indicators in the performance test process are collected to provide data for subsequent performance test report generation.

[0106] Step S402: If the target interface has a corresponding performance test baseline, acquiring the baseline transaction per second and the baseline response time in the performance test baseline.

[0107] It should be understood that the baseline transaction per second and the baseline response time in the performance test baseline, the baseline transaction per second and the baseline response time can be pre-set, or can be determined according to the call peak value, and each interface is aggregated at a minute level to take the maximum value, i.e. the minute-level call peak value, which is used to evaluate the maximum access amount within each minute.

[0108] Further, in order to obtain the performance test result under the condition that the target interface does not have a corresponding performance test baseline, in the present embodiment, after the step S401, it further comprises: if the target interface does not have a corresponding performance test baseline, acquiring the production environment transaction per second and the production environment response time of the target interface in the production environment; in the case that the stress test transaction per second is greater than or equal to the production environment transaction per second, and the stress test response time is less than or equal to the production environment response time, determining that the performance test result is test passed.

[0109] Step S403: In the case that the stress test transaction per second is greater than or equal to the baseline transaction per second, and the stress test response time is less than or equal to the baseline response time, determining that the performance test result is test passed.

[0110] It can be understood that, with reference to Figure 8 , Figure 8This is a schematic diagram of the performance testing process of an embodiment of the interface performance testing method of this application. First, the performance test indicators TPS and response time of the stress test environment can be obtained through the performance testing platform, that is, the number of transactions per second and the response time of the stress test. The performance test baseline of the interface can be obtained. Then, it is determined whether the target interface has a performance test baseline with the same number of concurrent requests in this stress test. If the target interface has a corresponding performance test baseline, the stress test TPS, response time and performance test baseline are compared. If the number of transactions per second in the stress test is greater than or equal to the number of transactions per second in the baseline and the stress test response time is less than or equal to the response time in the baseline, it is said that the interface has a 100% success rate and the performance test result is determined to be a pass. In all other cases, the test fails and the reason for failure is given.

[0111] In practical implementation, if the target interface does not have a performance test baseline with the same concurrency in this load test (i.e., the target interface does not have a corresponding performance test baseline), the TPS and response time of the interface in the production environment for day N-1 are obtained from the interface management platform. Specifically, the production environment's transactions per second and response time for the target interface on the previous day are obtained. If the load test's transactions per second are greater than or equal to the production environment's transactions per second, and the load test's response time is less than or equal to the production environment's response time, the performance test result is considered a pass. Otherwise, the test is considered a fail, and the reason for the failure is given. Furthermore, due to factors such as machine resources, deployment structure, and the diversity of scenarios, the load test data may deviate from the production data. If the load test TPS is lower than the production value, the cause needs to be manually analyzed, such as network latency, middleware configuration, or differences in test data. If it is determined that the issue is due to hardware factors rather than the program itself, the scenario can be manually adjusted to meet the target.

[0112] This embodiment, when performing performance testing on a target interface in a performance testing environment based on a performance testing script, obtains the number of transactions per second (TPS) and the response time of the target interface under load testing. If a corresponding performance testing baseline exists for the target interface, the baseline TPS and response time are obtained. If the TPS is greater than or equal to the baseline TPS and the response time is less than or equal to the baseline response time, the performance test result is determined to be a pass. This embodiment, by determining that the TPS is greater than or equal to the baseline TPS and the response time is less than or equal to the baseline response time, provides a preliminary conclusion on the performance testing of the target interface.

[0113] Reference Figure 9 , Figure 9 This is a structural block diagram of the first embodiment of the interface performance testing device of this application.

[0114] like Figure 9 As shown, the interface performance testing apparatus proposed in this application includes:

[0115] a priority determination module 10 configured to determine a performance priority score corresponding to the initial interface according to the daily interface call volume and the daily interface response time corresponding to the initial interface;

[0116] an interface determination module 20 configured to determine a target interface requiring performance testing according to the performance priority score and the list of changed interfaces;

[0117] a script generation module 30 configured to generate a performance testing script corresponding to the target interface according to the structured data corresponding to the target interface and a preset script template;

[0118] a performance testing module 40 configured to perform performance testing on the target interface in a performance testing environment based on the performance testing script, and obtain a performance testing result.

[0119] The embodiment determines a performance priority score corresponding to an initial interface according to a daily interface call volume and a daily interface response time corresponding to the initial interface, and then determines a target interface requiring performance testing according to the performance priority score and a list of changed interfaces. Then, a performance testing script corresponding to the target interface is generated according to structured data corresponding to the target interface and a preset script template. Finally, performance testing is performed on the target interface in a performance testing environment based on the performance testing script, and a performance testing result is obtained. The embodiment can accurately locate a target interface with high frequency, high latency and high value according to the performance priority score and the list of changed interfaces, and then automatically generate a performance testing script corresponding to the target interface according to the structured data corresponding to the target interface and the preset script template. Then, performance testing is performed on the target interface in the performance testing environment based on the performance testing script, so that the target interface can be automatically and effectively tested for performance, and a final performance testing report can be generated.

[0120] It should be noted that the above-described workflow is merely illustrative and does not limit the scope of protection of the present application. In actual applications, a person skilled in the art can select part or all of the above-described workflow to achieve the purpose of the embodiment, and the present application is not limited in this regard.

[0121] In addition, technical details not described in detail in the embodiment can be found in the interface performance testing method provided by any embodiment of the present application, and will not be described here.

[0122] Based on the first embodiment of the interface performance testing device described above, a second embodiment of the interface performance testing device of the present application is proposed.

[0123] In the embodiment, the priority determining module 10 is further configured to calculate an interface daily average response time according to an initial interface corresponding interface daily response time; if the initial interface belongs to an online interface, determine a performance priority score corresponding to the initial interface according to the interface daily call volume, the interface daily average response time, a system criticality score and a system stability rate; if the initial interface does not belong to an online interface, determine the performance priority score corresponding to the initial interface according to the system criticality score and the system stability rate.

[0124] Further, the interface determining module 20 is further configured to extract a changed file from a code change record file and determine a changed type corresponding to the changed file; determine a changed name according to the changed type and determine a changed interface list according to the changed name; determine a performance test level according to the performance priority score and select an interface of an emergency level and an interface of a high level from the initial interface according to the performance test level; if the interface of the emergency level and the interface of the high level are in the changed interface list, take the interface of the emergency level and the interface of the high level as target interfaces that need to be tested for performance.

[0125] Further, the script generating module 30 is further configured to determine an interface parameterization strategy according to an interface type corresponding to the target interface; perform interface parameterization on the target interface according to the interface parameterization strategy and determine structured data according to obtained parameterization information; determine a preset script template according to the interface type and generate a performance test script corresponding to the target interface according to the structured data and the preset script template.

[0126] Further, the script generating module 30 is further configured to construct a mapping relationship between an application name and an IP port; obtain interface basic information, request data and interface response data corresponding to the target interface; perform interface parameterization on the target interface according to the interface parameterization strategy, preconfigured parameterization fields and parameterization functions to obtain parameterization information; take the mapping relationship, the interface basic information, the request data, the interface response data and the parameterization information as structured data.

[0127] Further, the performance test module 40 is further configured to, in a case of performing performance test on the target interface in a performance test environment based on the performance test script, obtain a stress test transaction per second and a stress test response time of the target interface; if the target interface has a corresponding performance test baseline, obtain a baseline transaction per second and a baseline response time in the performance test baseline; in a case that the stress test transaction per second is greater than or equal to the baseline transaction per second and the stress test response time is less than or equal to the baseline response time, determine that a performance test result is test passed.

[0128] Further, the performance test module 40 is further configured to, if the target interface does not exist a corresponding performance test baseline, acquire a production environment transaction per second and a production environment response time of the target interface in a production environment; and determine that the performance test result is test passed, if the stress test transaction per second is greater than or equal to the production environment transaction per second and the stress test response time is less than or equal to the production environment response time.

[0129] Other embodiments or specific implementations of the interface performance test apparatus can refer to the above-mentioned method embodiments, and will not be described here.

[0130] The present application provides an interface performance test device, which comprises at least one processor and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the interface performance test method in the above-mentioned embodiment one.

[0131] Reference will be made to the following description of the embodiments of the present application, taken in conjunction with the accompanying drawings, in which Figure 10 which shows a structural diagram of an interface performance test device suitable for implementing the embodiments of the present application. The interface performance test device in the embodiments of the present application can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PADs (Portable Application Description), PMPs (Portable Media Player), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. Figure 10 The interface performance test device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present application.

[0132] As Figure 10As shown, the interface performance test device can include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. Various programs and data required for operation of the interface performance test device are also stored in the RAM 1004. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other by a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; the storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the interface performance test device to communicate wirelessly or by wire with other devices to exchange data. Although the interface performance test device having various systems is shown in the figure, it should be understood that all of the shown systems are not required to be implemented or possessed. More or fewer systems can be alternatively implemented or possessed.

[0133] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by a communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the methods of embodiments of the present disclosure are performed.

[0134] The interface performance test device provided by the present disclosure adopts the interface performance test method in the above embodiments, and can solve the technical problem of how to automatically and effectively perform interface performance test. Compared with the prior art, the interface performance test device provided by the present disclosure has the same beneficial effects as the interface performance test method provided by the above embodiments, and other technical features in the interface performance test device are the same as the features disclosed in the above embodiments, which will not be repeated here.

[0135] It should be understood that various aspects of the disclosure can be implemented in hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any appropriate manner in any one or more embodiments or examples.

[0136] The above description is merely illustrative of the application and is not intended to limit the scope of the application. Any modifications or equivalents of the application should be construed as falling within the scope of the application. The scope of the application should be determined by the appended claims.

[0137] The application provides a computer readable storage medium having stored thereon computer readable program instructions (i.e., a computer program) for performing the interface performance test method in the above embodiments.

[0138] The computer readable storage medium provided by the application may, for example, be a U disk, but is not limited to an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination thereof. More specific examples of the computer readable storage medium can include, but are not limited to, an electric connection having one or more conductive wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In the present embodiment, the computer readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer readable storage medium can be transmitted by any appropriate medium, including but not limited to an electric wire, an optical cable, an RF (Radio Frequency), etc., or any appropriate combination thereof.

[0139] The above computer readable storage medium can be included in the interface performance test device; or can exist separately and not be assembled into the interface performance test device.

[0140] The computer readable storage medium carries one or more programs, when the one or more programs are executed by the interface performance testing device, the interface performance testing device is caused to: determine a performance priority score corresponding to an initial interface according to an interface daily call volume and an interface daily response time corresponding to the initial interface; determine a target interface that needs to be tested in performance according to the performance priority score and a list of changed interfaces; generate a performance test script corresponding to the target interface according to structured data corresponding to the target interface and a preset script template; and perform performance testing on the target interface in a performance testing environment based on the performance test script, and obtain a performance testing result.

[0141] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Python, Java, Smalltalk, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0142] The flowchart and block diagrams in the drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart and block diagrams can represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks can sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations thereof, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or combinations of hardware and software.

[0143] The modules described in the embodiments of the present application can be implemented in the form of software or in the form of hardware. In some cases, the name of the module does not constitute a limitation on the module itself.

[0144] The readable storage medium provided by the present application is a computer readable storage medium, which stores computer readable program instructions (i.e. computer programs) for executing the interface performance test method described above, and can solve the technical problem of how to automatically and effectively perform interface performance test. Compared with the prior art, the computer readable storage medium provided by the present application has the same beneficial effects as the interface performance test method provided by the above-mentioned embodiments, and will not be described here.

[0145] The above only describes some embodiments of the present application, and does not limit the protection scope of the present application. Any equivalent structural transformation made by using the content of the present application specification and drawings, or direct / indirect application in other related technical fields is included in the protection scope of the present application.

Claims

1. A method of interface performance testing, characterized by, The interface performance test method comprises the following steps: According to the interface daily call quantity and the interface daily response time corresponding to the initial interface, a performance priority score corresponding to the initial interface is determined; According to the performance priority score and the changed interface list, a target interface that needs to be tested is determined; According to the structured data corresponding to the target interface and a preset script template, a performance test script corresponding to the target interface is generated; Based on the performance test script, performance test is performed on the target interface in a performance test environment, and a performance test result is obtained; According to the structured data corresponding to the target interface and a preset script template, a performance test script corresponding to the target interface is generated; According to the interface type corresponding to the target interface, an interface parameterization strategy is determined, and the interface type comprises an added interface, a queried interface and an updated interface; A mapping relationship between an application name and an IP port is constructed; Interface basic information, request data and interface response data corresponding to the target interface are obtained; According to the interface parameterization strategy, a parameterized field and a parameterized function pre-configured, interface parameterization is performed on the target interface, and parameterized information is obtained; The mapping relationship, the interface basic information, the request data, the interface response data and the parameterized information are taken as structured data; According to the interface type, a preset script template is determined, and according to the structured data and the preset script template, the performance test script corresponding to the target interface is generated; According to the performance priority score and the changed interface list, a target interface that needs to be tested is determined; From a code change record file, a changed file is extracted, and a changed type corresponding to the changed file is determined; According to the changed type, a changed name is determined, and according to the changed name, a changed interface list is determined; According to the performance priority score, a performance test level is determined, and according to the performance test level, an urgent level interface and a high level interface are selected from the initial interface; If the urgent level interface and the high level interface are in the changed interface list, the urgent level interface and the high level interface are taken as the target interface that needs to be tested.

2. The interface performance test method of claim 1, wherein, According to the interface daily call quantity and the interface daily response time corresponding to the initial interface, a performance priority score corresponding to the initial interface is determined; According to the interface daily response time corresponding to the initial interface, an interface daily average response time is calculated; If the initial interface belongs to an online interface, according to the interface daily call quantity, the interface daily average response time, a system criticality score and a system stability rate, a performance priority score corresponding to the initial interface is determined; If the initial interface does not belong to an online interface, according to the system criticality score and the system stability rate, a performance priority score corresponding to the initial interface is determined.

3. The interface performance test method of claim 1 or 2, wherein, Based on the performance test script, performance test is performed on the target interface in a performance test environment, and a performance test result is obtained; In a case of performing performance testing on the target interface based on the performance testing script in a performance testing environment, a stress test transaction per second and a stress test response time of the target interface are acquired; In a case where the target interface has a corresponding performance testing baseline, a baseline transaction per second and a baseline response time in the performance testing baseline are acquired; In a case where the stress test transaction per second is greater than or equal to the baseline transaction per second and the stress test response time is less than or equal to the baseline response time, it is determined that the performance testing result is test passed.

4. The interface performance test method of claim 3, wherein, In a case of performing performance testing on the target interface based on the performance testing script in a performance testing environment, a stress test transaction per second and a stress test response time of the target interface are acquired; In a case where the target interface has a corresponding performance testing baseline, a baseline transaction per second and a baseline response time in the performance testing baseline are acquired; In a case where the stress test transaction per second is greater than or equal to the baseline transaction per second and the stress test response time is less than or equal to the baseline response time, it is determined that the performance testing result is test passed.

5. An interface performance testing apparatus, characterized by, The interface performance testing apparatus comprises: a priority determination module configured to determine a performance priority score of an initial interface according to an interface daily call volume and an interface daily response time of the initial interface; an interface determination module configured to determine a target interface that needs to be tested for performance according to the performance priority score and a list of modified interfaces; a script generation module configured to generate a performance testing script corresponding to the target interface according to structured data corresponding to the target interface and a preset script template; a performance testing module configured to perform performance testing on the target interface in a performance testing environment based on the performance testing script, and obtain a performance testing result; The script generation module is further configured to determine an interface parameterization strategy according to an interface type of the target interface, the interface type comprising an added interface, a queried interface, and an updated interface; construct a mapping relationship between an application name and an IP port; acquire interface basic information, request data, and interface response data corresponding to the target interface; perform interface parameterization on the target interface according to the interface parameterization strategy, a parameterized field configured in advance, and a parameterized function, and obtain parameterized information; take the mapping relationship, the interface basic information, the request data, the interface response data, and the parameterized information as structured data; determine a preset script template according to the interface type, and generate the performance testing script corresponding to the target interface according to the structured data and the preset script template. The interface determination module is further configured to extract a change file from the code change record file, determine a change type corresponding to the change file, determine a change name according to the change type, determine a change interface list according to the change name, determine a performance test level according to the performance priority score, and select an emergency level interface and a high level interface from the initial interfaces according to the performance test level; and if the emergency level interface and the high level interface are in the change interface list, the emergency level interface and the high level interface are taken as target interfaces that need to be tested for performance.

6. An interface performance test apparatus characterized by comprising: The device comprises a memory, a processor, and a computer program stored on the memory and executable on the processor, and the computer program is configured to implement the steps of the interface performance test method according to any one of claims 1 to 4.

7. A storage medium, characterized by The storage medium is a computer readable storage medium, and the storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the interface performance test method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Interface performance test method and device

    CN114816956A

  • Multi-factor scoring strategy interface screening system, method and equipment

    CN115878438A

  • Baseline monitoring method and device, computer equipment and storage medium

    CN117033116A