Performance test device and method, electronic equipment, storage medium and program product

Through the modular design of the performance testing device, the full process automation from script acquisition to result management is achieved, and the problems of low testing efficiency and high resource consumption in the existing technology are solved, and the testing efficiency and resource utilization are improved.

CN120492348APending Publication Date: 2025-08-15AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510621740.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-14
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The existing performance testing tools are inefficient in testing, high environmental construction and maintenance costs, and cannot persist in saving debugging results, and consume a lot of resources.

Method used

It provides a performance testing device, including script management module, script testing module, script execution module, result collection module and debugging record management module, to realize the automation and efficient management of the entire process from script acquisition, test execution to result management, and to parse and adjust the test hash tree through script analysis and adjustment, optimize resource utilization and reduce environmental dependence.

Benefits of technology

Improves the efficiency of performance testing, reduces environmental dependence and resource consumption, and provides an efficient, reliable and easy-to-manage performance testing solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492348A_ABST
    Figure CN120492348A_ABST
Patent Text Reader

Abstract

The invention provides a performance testing device and method, electronic equipment, a storage medium and a program product. Relates to the technical field of performance testing. The device comprises a script management module, a script test module, a script execution module, a result acquisition module and a debugging record management module which are connected through interfaces, the script management module is used for acquiring a performance test script and managing the performance test script; the script test module is used for calling a target performance test script in response to the debugging instruction to obtain a test hash tree, and adjusting the test hash tree to obtain an adjusted test hash tree; the script execution module is used for sending a debugging test request to the server to be tested according to the adjusted test hash tree and receiving a script test result; the result acquisition module is used for monitoring a debugging result and transmitting the debugging result to the debugging record management module; and the debugging record management module is used for managing and storing debugging results. According to the invention, the effect of improving the performance test efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of performance testing, and in particular to a performance testing device, method, electronic device, storage medium, and program product. Background Art

[0002] The main goal of performance testing is to evaluate the performance indicators of an application under specific load conditions to ensure that the application can meet the performance requirements of users in different usage scenarios.

[0003] In the related art, performance testing tools have the problem of low testing efficiency.

[0004] Based on this, a performance testing solution with high efficiency and good effect is proposed. Summary of the Invention

[0005] The present application provides a performance testing device, method, electronic device, storage medium and program product to achieve the effect of improving the efficiency of performance testing.

[0006] In a first aspect, the present application provides a performance testing device, comprising: a script management module, a script testing module, a script execution module, a result collection module, and a debugging record management module connected via an interface;

[0007] Script management module, used to obtain and manage performance test scripts;

[0008] a script testing module, configured to call a target performance test script from the script management module in response to a debugging instruction, obtain a test hash tree based on parsing the target performance test script, and adjust the test hash tree to obtain an adjusted test hash tree;

[0009] a script execution module, configured to generate a debugging test request according to the adjusted test hash tree, send the debugging test request to the server to be tested, receive a script test result returned by the server to be tested, and generate an error log when the script test result includes error information;

[0010] A result collection module is used to monitor the debugging results of the script execution module and pass the debugging results to the debugging record management module; wherein the debugging results include script test results, error logs and target performance test scripts;

[0011] The debugging record management module is used to manage and store debugging results.

[0012] In one possible implementation, the script management module includes an acquisition unit and a management unit;

[0013] An acquisition unit is used to acquire a performance test script based on a file uploaded by a user, or a performance test script input by a user in a script writing page; and transmit the performance test script to a script management unit;

[0014] The management unit is used to respond to the management instruction of the performance test script and manage the performance test script; or, respond to the calling instruction of the script parsing module and send the performance test script to the script parsing module.

[0015] In one possible implementation, the script testing module includes a script parsing unit, a script detection unit, and a resource control unit;

[0016] A script parsing unit, configured to call a target performance test script from a script management module in response to a debugging instruction, and parse the target performance test script to obtain a test hash tree;

[0017] A script detection unit is used to detect the test hash tree and obtain the corresponding detection results;

[0018] The resource control unit is used to adjust the parameters in the test hash tree according to the detection result of the script detection unit to obtain an adjusted test hash tree.

[0019] In one possible implementation, the script detection unit is specifically configured to:

[0020] Get the number of loops of the loop controller component node and the number of users of the thread group component node in the test hash tree;

[0021] Determining whether the number of cycles meets a preset cycle requirement, and / or determining whether the number of users meets a preset user number requirement;

[0022] The detection result is obtained based on the judgment result corresponding to the number of cycles and the judgment result corresponding to the number of users.

[0023] In a possible implementation, the script execution module includes: a generating unit, a sending unit, and a receiving unit;

[0024] a generation unit, configured to generate a debugging test request according to a sampler in the adjusted test hash tree;

[0025] The sending unit is used to send the debugging test request to the server to be tested through the network or a preset communication method;

[0026] The receiving unit is used to receive the script test result returned by the server to be tested, and generate an error log when the script test result includes error information; or to generate an error log when the preset waiting time is reached and the script test result is not received.

[0027] In one possible implementation, the debugging record management module includes: a storage unit and a management unit;

[0028] The management unit is used to receive the debugging results transmitted by the result collection module and send them to the storage unit;

[0029] A storage unit, used for storing debugging results;

[0030] The management unit is further configured to receive a debugging result access request from the client, and in response to the debugging result access request, obtain the debugging result from the storage unit and send the result to the client.

[0031] In a second aspect, the present application provides a performance testing method, applied to an electronic device connected to a performance testing device obtained by executing the first aspect and / or various possible implementations of the first aspect, the performance testing method comprising:

[0032] Displaying the main structure and functions of the performance test device on the screen of the electronic device;

[0033] Based on human-computer interaction, obtain operating instructions of the performance test device, where the operating instructions include managing test plans, inputting test plans, and executing test plans;

[0034] Execute the operating instructions according to the main structure of the performance test device and the operating instructions of the performance test device.

[0035] In a third aspect, the present application provides an electronic device, comprising: a memory, a processor;

[0036] Memory stores computer-executable instructions;

[0037] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0038] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above first aspect and / or various possible implementations of the first aspect.

[0039] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementations of the first aspect.

[0040] The performance testing device, method, electronic device, storage medium and program product provided by the present application efficiently manage the performance testing script through the script management module, quickly locate and call the required target performance testing script, and improve the efficiency of the test. The script testing module responds to the debugging instructions, parses the target performance testing script and flexibly adjusts the test hash tree, thereby enhancing the adaptability and flexibility of the performance test. The script execution module generates a debugging test request based on the adjusted test hash tree, interacts with the server to be tested, and receives the script test results, ensuring the accurate sending of the debugging test request and the timely receipt of the script test results, thereby improving the execution efficiency of the test. The result acquisition module is responsible for monitoring the debugging results of the script execution module and passing these results to the debugging record management module, while the debugging record management module is responsible for managing and storing the debugging results. Through the synergistic effect of the result acquisition module and the debugging record management module, it is convenient for developers to quickly locate problems and make improvements, thereby improving the efficiency of performance testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0042] Figure 1 A schematic diagram of an application scenario of the performance testing device provided in an embodiment of the present application;

[0043] Figure 2 A schematic diagram of the structure of a performance testing device provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of a performance testing method according to an embodiment of the present invention;

[0045] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0046] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0047] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0048] JMeter is an open-source performance testing tool primarily used for performance and functional testing. It supports multiple protocols, including Hypertext Transfer Protocol (HTTP), Hypertext Transfer Protocol Secure (HTTPS), and Java Database Connectivity (JDBC). It can simulate concurrent user requests to the server under test, thereby evaluating the server's performance and stability.

[0049] In the prior art, most performance testing tools are desktop applications. Related technology 1 proposes an automated testing method and related equipment for interface performance. By configuring the relevant information of the front-end page and executing the test; obtaining the request parameters and querying the database to obtain the interface list information and parameterized files, the files are transferred to the performance testing server through the Secure File Transfer Protocol (SFTP); the thread number parameters are divided into arrays and multiple JMeter files are constructed and saved locally; a shell file for JMeter stress testing and cleaning results is constructed; the performance testing server is connected through SFTP and hash (Signature HaSH blobs, SSH), and the shell file is authorized and executed for stress testing; the report data file is obtained from the performance server and stored in the database; the monitoring interface is requested to obtain the monitoring data and store it in the database, and the shell file for cleaning the file is executed; the local files are cleaned and the test result report and monitoring details are displayed on the front-end page. There are problems such as the inability to persist the debugging results and the high cost of environment construction and maintenance, which leads to the consumption of more resources during performance testing and low test efficiency.

[0050] The performance testing device provided in the embodiment of the present application realizes full-process automation and efficient management from script acquisition, test execution to result management through the script management module, script testing module, script execution module, result collection module and debugging record management module connected by interfaces. It not only improves test efficiency and reduces environmental dependence, but also optimizes resource utilization, providing an efficient, reliable and easy-to-manage performance testing device.

[0051] Figure 1 Schematic diagram of the application scenario of the performance testing device provided in the embodiment of this application. Figure 1 As shown, the specific application scenario of this application includes: user 11, performance testing device 12 and server to be tested 13, wherein:

[0052] User 11 inputs a performance test script and debugging instructions into performance test device 12 through its interactive interface. Performance test device 12 receives the performance test script and debugging instructions input by user 11. Performance test device 12 responds to the debugging instructions and performs a performance test on server 13 under test according to the performance test script.

[0053] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0054] Figure 2 This is a schematic diagram of the device structure of the performance testing device provided in the embodiment of the present application. Figure 2 As shown, the performance testing device 20 includes: a script management module 201, a script testing module 202, a script execution module 203, a result collection module 204, and a debugging record management module 205 connected through an interface. Specifically, the script management module 201 is used to obtain and manage performance test scripts; the script testing module 202 is used to call the target performance test script from the script management module 201 in response to a debugging instruction, obtain a test hash tree based on the parsing of the target performance test script, and adjust the test hash tree to obtain an adjusted test hash tree; the script execution module 203 is used to generate a debugging test request based on the adjusted test hash tree, send the debugging test request to the server to be tested, receive the script test result returned by the server to be tested, and generate an error log when the script test result includes error information; the result collection module 204 is used to monitor the debugging results of the script execution module 203 and pass the debugging results to the debugging record management module 205; wherein the debugging results include script test results, error logs, and the target performance test script; the debugging record management module 205 is used to manage and store the debugging results.

[0055] Performance testing is a type of software testing designed to evaluate an application's response time, stability, resource consumption, and scalability under a specific load. In the performance testing device, the script management module 201, script testing module 202, script execution module 203, result collection module 204, and debug log management module 205 collaborate to complete the performance testing task. The following details the functions of each module in the performance testing device and how it interacts with other modules.

[0056] The script management module 201 is a fundamental component of the performance testing device, primarily responsible for acquiring and managing performance testing scripts. The script management module 201 can retrieve performance testing scripts from locations such as the local file system, database, or network storage. Performance testing scripts can simulate user code for operating the server under test, allowing load testing of the software system according to predetermined parameters. Predetermined parameters include possible request information and environmental information. Optionally, the predetermined parameters include parameters such as the number of concurrent users and / or request frequency. For example, when the server under test is a website, the performance testing script can simulate various user behaviors and operations to comprehensively evaluate the website's performance. Optionally, the performance testing script can simulate basic operations such as multiple users simultaneously browsing a page, adding to favorites, and viewing favorites. The performance testing script can also simulate user logins and logouts to test the performance of the user authentication system under high concurrency conditions. The performance testing script can also simulate user searches, including entering keywords, selecting filter criteria, and viewing search results, as well as simulating users viewing search pages to test page loading performance. Using performance testing scripts, the performance of the server under test can be comprehensively evaluated in specific scenarios, helping the development team identify and resolve potential performance issues.

[0057] The script management module 201 is also responsible for managing the performance test scripts, where management includes storage, classification, and version control. The script management module 201 can classify and store the performance test scripts according to the functions of the performance test scripts. At the same time, the script management module 201 can also record the version number and script identification information of the performance test script, which is convenient for testers to trace back and update the performance test scripts. Exemplarily, the script management module 201 can download the performance test scripts from the script repository; and classify and store the performance test scripts according to preset classifications. Optionally, the script management module 201 also manages the performance test scripts by adding performance test scripts, modifying performance test scripts, deleting performance test scripts, and querying performance test scripts.

[0058] The script testing module 202 is primarily responsible for responding to debug commands and processing performance test scripts. Upon receiving a debug command, the script testing module 202 requests the target performance test script from the script management module 201 based on the script identification information of the target performance test script in the debug command. The debug command specifies that the performance testing device use the target performance test script for performance testing.

[0059] After the script testing module 202 obtains the target performance test script, the script testing module 202 analyzes the structure and test plan of the target performance test script, extracts the test elements in the test plan and constructs a test hash tree. The test hash tree is a data structure used to organize and store the data structure of the test plan elements. The test hash tree is similar to a tree structure. The nodes of the test hash tree represent different test elements, and the execution order and dependency relationship between the test elements are represented by the hierarchical relationship of the test hash tree. For example, if the login request is taken as node A and the query data request is taken as node B. Then node A should be the parent node of node B, that is, the login request is executed and the subsequent query data request can be executed only after the login request is successfully executed. Optionally, each parent node in the test hash tree can have multiple child nodes.

[0060] A debugging instruction is a command issued by a user or an automated system to start a debugging process. For example, if the target performance test script includes multiple requests and / or assertions, the script testing module 202 constructs a tree using each request and / or assertion as a node to obtain a test hash tree.

[0061] Furthermore, the script testing module 202 can also adjust the test hash tree to obtain an adjusted test hash tree. Adjusting the test hash tree includes adjusting modification request parameters of the test hash tree, changing the execution order of test elements in the test hash tree, and other operations. For example, based on the current state of the performance testing device, the concurrency of the thread group in the test hash tree or the request path of the server to be tested is adjusted.

[0062] The debug test request is a request message generated by the script execution module 203 and sent to the server to be tested. The debug test request is constructed based on the adjusted test hash tree and includes information such as request parameters and / or request headers defined in the test script. Optionally, if the test hash tree is not adjusted, the debug request message can also be constructed based on the unadjusted test hash tree. For example, if the debug test request is used to simulate a user login request, the debug test request will include login parameters such as a user name and password, and will be sent to the server to be tested in the format of the communication protocol required by the server to be tested.

[0063] The script execution module 203 is a key component of the performance testing device. It can construct a debugging test request that meets the communication protocol requirements of the server to be tested based on the test hash tree and send the debugging test request to the server to be tested via the communication network. The script execution module 203 is also responsible for receiving the script test results returned by the server to be tested and generating an error log if the script test results include error information. The script test results include information such as the status code, response header, and / or response body; the error log records detailed information such as the time, location, and / or cause of the error. Exemplarily, if the communication protocol required by the server to be tested is HTTP, the script execution module 203 sets an HTTP debugging test request based on the node information in the test hash tree and sends the HTTP debugging test request to the server to be tested via the communication network. The HTTP debugging test request includes a request method, a request uniform resource locator (URL), a request header, and a request body. The HTTP debugging test request is then sent to the server to be tested using the Transmission Control Protocol / Internet Protocol (TCP / IP) protocol stack. After sending the HTTP debugging test request, the script execution module 203 receives the script test result returned by the server to be tested. If the script test result returned by the server includes a "404 page not found" error, the script execution module 203 generates a "404 page not found" error log.

[0064] The result collection module 204 is primarily responsible for monitoring the debugging results of the script execution module 203 and transmitting the debugging results to the debugging record management module 205. The debugging record management module 205 is primarily responsible for managing and storing the debugging results. The debugging record management module 205 can store the received debugging results to facilitate subsequent query and analysis. The debugging record management module 205 optionally stores the debugging results in a database.

[0065] The performance testing device provided by the embodiment of the present application manages the performance testing script through the script management module, which is convenient for quickly locating and calling the required target performance testing script, thereby improving the preparation efficiency of the test. The script test module responds to the debugging instruction, calls the target script from the script management module, parses and flexibly adjusts the test hash tree, and enhances the adaptability and flexibility of the performance test. The script execution module generates a debugging test request according to the adjusted test hash tree, interacts with the server to be tested, and receives the script test results, thereby ensuring the accurate sending of the debugging test request and the timely receipt of the script test results, thereby improving the execution efficiency of the test. The result acquisition module is responsible for monitoring the debugging results of the script execution module and passing the debugging results to the debugging record management module, while the debugging record management module manages and stores these debugging results. Through the synergy between different modules in the performance testing device, it is convenient to modify and manage the performance testing script, and execute the debugging instruction, thereby improving the efficiency of the performance test.

[0066] In one possible implementation, the performance testing device is deployed on a cloud platform. Deployment on a cloud platform can further enhance the flexibility and scalability of performance testing device deployment. The cloud platform provides powerful computing resources and storage capabilities, enabling it to support large-scale performance testing tasks while reducing the configuration and maintenance workload for users in local environments. Through the cloud platform, users can access performance testing tools anytime, anywhere to configure, execute, and view test results, greatly improving the convenience and efficiency of testing. Furthermore, the cloud platform's elastic scalability can automatically adjust resource allocation based on testing requirements, ensuring the efficiency and stability of the testing process.

[0067] In one possible implementation, the script management module 201 includes an acquisition unit and a management unit; the acquisition unit is used to acquire a performance test script based on a file uploaded by a user, or a performance test script entered by a user in a script writing page; and pass the performance test script to the script management unit; the management unit is used to respond to management instructions for the performance test script and manage the performance test script; or, in response to a call instruction of the script parsing module, send the performance test script to the script parsing module.

[0068] The main function of the acquisition unit is to acquire the performance test script based on the file uploaded by the user or the performance test script entered by the user in the script writing page. Specifically, the user can provide the script in a variety of ways. The user can upload a pre-written script file to the acquisition unit, and the acquisition unit will read the script file content and extract the performance test script; the user can also directly fill in the sampler, logic controller, pre-processor, post-processor, timer, configuration element and other component information online in the front-end page of the performance testing device, and the acquisition unit will generate a performance test script based on the component information entered by the user. Optionally, the user can upload a pre-written script file in the Extensible Markup Language (JMeter XML, JMX) format to the acquisition unit, and the acquisition unit will read the script file in the JMX format and extract the performance test script. Optionally, the pre-written JMX format script file is uploaded to the acquisition unit in JSON format.

[0069] The management unit can respond to management instructions for the performance test script and manage the performance test script. Management operations include: storage, classification and version control. Through storage, the acquired performance test script is stored in the performance test device for easy subsequent call. Through classification, the functions of the performance test script are classified and stored to facilitate user search and use. Optionally, management operations also include version control. Through version control, the version information of the performance test script is recorded, and version backtracking and update operations of the performance test script are supported to ensure the traceability and maintainability of the script. The management unit is also responsible for responding to the call instructions of the script parsing module and sending the performance test script to the script parsing module.

[0070] The acquisition unit enables the performance testing device to flexibly acquire user-provided scripts, allowing users to choose the method for providing performance testing scripts based on their needs and preferences. The management unit ensures orderly storage and management of performance testing scripts, improving script maintainability and traceability through classification and version control. The script management module improves script management efficiency and provides reliable support for subsequent performance testing.

[0071] In one possible implementation, the performance testing device creates a debugging task upon receiving a debugging instruction. The performance testing device maintains an internal thread pool, which manages and allocates resources to execute debugging tasks. Threads in the thread pool can be in two states: idle and active.

[0072] When the performance test device creates a debugging task, it checks whether there are idle threads in the thread pool. If there are idle threads, they will immediately receive and respond to the debugging instructions corresponding to the debugging task. If all threads in the thread pool are in a working state and no idle threads are available, the debugging task will be stored in a waiting queue. The waiting queue is a first-in, first-out queue used to temporarily store tasks that cannot be executed. Once a thread in the thread pool completes its current task and returns to an idle state, it will obtain the next task debugging task from the waiting queue and respond to the debugging instructions corresponding to the debugging task. The thread pool setting ensures the continuous processing of debugging tasks, improving the resource utilization and task processing efficiency of the performance test device.

[0073] In one possible implementation, the script testing module 202 includes a script parsing unit, a script detection unit, and a resource control unit; the script parsing unit is used to call the target performance test script from the script management module 201 in response to a debugging instruction, and parse the target performance test script to obtain a test hash tree; the script detection unit is used to detect the test hash tree to obtain a corresponding detection result; the resource control unit is used to adjust the parameters in the test hash tree according to the detection result of the script detection unit to obtain an adjusted test hash tree.

[0074] The script parsing unit parses the target performance test script, including reading the target performance test script, extracting test elements from the target performance test script, and constructing a test hash tree based on the test elements. The script parsing unit converts complex script content into a structured test hash tree, improving the efficiency and accuracy of target performance test script processing.

[0075] Exemplarily, the script parsing unit receives a performance test script transmitted in JSON format and converts the performance test script transmitted in JSON format into a performance test script in JMX format. The script parsing unit reads the performance test script in JMX format, extracts test elements in the performance test script in JMX format, and constructs a test hash tree based on the test elements.

[0076] The script detection unit is responsible for testing the test hash tree and evaluating the performance test script by assessing its correctness and completeness. The test hash tree may be tested for, but is not limited to, syntax errors, logic issues, and / or resource dependencies. The script detection unit can also generate a detailed test report based on the test hash tree. The test report describes any issues found in the test hash tree. The script detection unit can quickly identify issues in the test hash tree, reducing the workload of manual review. Furthermore, the test results provide a scientific basis for adjustments to the resource control unit.

[0077] The resource control unit adjusts the parameters in the test hash tree based on the test results of the script detection unit. These adjustments may include modifying request parameters, adjusting the execution order, optimizing resource allocation, and so on. By adjusting the test hash tree through the resource control unit, the accuracy and efficiency of the test can be improved.

[0078] The script testing module realizes efficient preprocessing of performance test scripts through the collaborative work of the script parsing unit, the script detection unit and the resource control unit, thereby improving the flexibility and adaptability of the performance testing device.

[0079] In one possible implementation, the script detection unit is specifically used to: obtain the number of loops of the loop controller component node and the number of users of the thread group component node in the test hash tree; determine whether the number of loops meets the preset loop requirements, and / or determine whether the number of users meets the preset user quantity requirements; and obtain a detection result based on the judgment result corresponding to the number of loops and the judgment result corresponding to the number of users.

[0080] Obtain a test hash tree, detect whether the test hash tree contains a loop controller component node, and when the loop controller component node exists, obtain the number of loops of the loop controller component node in the test hash tree, determine whether the number of loops meets the preset loop requirement, and obtain a judgment result corresponding to the number of loops. The judgment result corresponding to the number of loops includes a super loop range and a loop condition. For example, if the preset loop requirement is that the number of loops is less than or equal to 50, when the number of loops of the loop controller component node in the test hash tree is 50, it is determined that the number of loops does not meet the preset loop requirement, and the judgment result corresponding to the number of loops is a super loop range. If the preset loop requirement is that the number of loops is less than or equal to 30, when the number of loops of the loop controller component node in the test hash tree is 5, it is determined that the number of loops meets the preset loop requirement, and the judgment result corresponding to the number of loops is that the loop condition is met.

[0081] Thread groups are used to simulate concurrent user behavior. Typically, thread groups define the attributes and behaviors of a group of virtual users, helping testers create and manage stress tests. A test hash tree is obtained, and a check is performed to determine whether the test hash tree contains a thread group component node. If the thread group component node exists, the number of users in the thread group component node in the test hash tree is obtained, and a determination is made as to whether the number of users meets the preset user number requirement. A determination result corresponding to the number of users is obtained. The determination result for the number of users includes exceeding the number range and satisfying the number condition. For example, if the preset user number requirement is 10, and the number of users in the thread group component node in the test hash tree is 5, the user number is determined to meet the preset user number requirement, and determining whether the user number meets the preset user number requirement is considered to satisfy the number condition. For example, if the preset user number requirement is 5, and the number of users in the thread group component node in the test hash tree is 8, the user number is determined to not meet the preset user number requirement, and determining whether the user number meets the preset user number requirement is considered to exceed the number range. A test result is obtained based on the determination result corresponding to the number of loops and the determination result corresponding to the number of users.

[0082] Accordingly, the resource control unit is configured to adjust the parameters in the test hash tree according to the detection result of the script detection unit to obtain an adjusted test hash tree, further comprising:

[0083] If the test results contain a judgment result corresponding to the number of cycles, and the judgment result is in the super-cycle range, the number of cycles is adjusted to meet the preset cycle requirement. For example, if the test results contain a judgment result corresponding to the number of cycles, and the judgment result is in the super-cycle range, and the preset cycle requirement is that the number of cycles is less than or equal to 50, the number of cycles can be adjusted to 30 to meet the preset cycle requirement; the number of cycles can also be adjusted to 45 to meet the preset cycle requirement; and the number of cycles can also be adjusted to 50 to meet the preset cycle requirement.

[0084] If the detection result contains a judgment result corresponding to the number of users, and the judgment result is that the number exceeds the range, the number of users is adjusted to meet the preset user number requirement. For example, if the detection result contains a judgment result corresponding to the number of users, and the judgment result is that the number exceeds the range, and the preset user number requirement is that the number of users is less than or equal to 5, the preset user number requirement can be met by adjusting the number of users to 1; the preset user number requirement can also be met by adjusting the number of users to 5; and the preset user number requirement can also be met by adjusting the number of users to 4.

[0085] The resource control unit adjusts the parameters in the test hash tree according to the detection results of the script detection unit, reducing the cloud resources occupied during performance test script debugging to achieve cloud debugging resource control.

[0086] In one possible implementation, the script execution module 203 includes: a generation unit, a sending unit, and a receiving unit; the generation unit is used to generate a debugging test request based on the sampler in the adjusted test hash tree; the sending unit is used to send the debugging test request to the server to be tested via a network or a preset communication method; the receiving unit is used to receive the script test result returned by the server to be tested, and generate an error log when the script test result includes error information; or, to generate an error log when the preset waiting time is reached and the script test result is not received.

[0087] The generation unit can generate a debugging test request based on the sampler in the adjusted test hash tree. The sampler is a node in the test hash tree, which is used to define a specific test request. The sampler simulates the interaction between the user and the server to be tested, sends various types of test requests, and collects the response of the server to be tested. The generation unit will construct a debugging test request that complies with the protocol based on the configuration information of the sampler. Optionally, the configuration information includes: request method, URL, request header, and request body. The sending unit can send the debugging test request to the server to be tested through the network or a preset communication method. The sending unit supports multiple communication protocols to ensure that the test request can reach the server to be tested correctly. The receiving unit can receive the script test results returned by the server to be tested. If the script test result contains error information, the receiving unit will generate an error log.

[0088] If the script test result is not received within the preset waiting time, the receiving unit will also generate an error log. Optionally, the preset waiting time can be a time period or a time point. Exemplarily, when the preset waiting time is a time period, the preset waiting time can be any value that can represent time, such as 1 second, 5 seconds, 1 minute, 2.5 minutes or 1 hour. If the preset waiting time is 5 seconds, when the debugging test request is issued, no script test result is received within 5 seconds, and an error log is generated. When the preset waiting time is a time point, it can be 15:23 on May 13, 2025 or other specific time points. If the preset waiting time is 15:23 on May 13, 2025, when no script test result is received after 15:23 on May 13, 2025, an error log is generated.

[0089] In one possible implementation, the debugging record management module 205 includes: a storage unit and a management unit; the management unit is used to receive the debugging results transmitted by the result collection module 204 and send them to the storage unit; the storage unit is used to store the debugging results; the management unit is also used to receive a debugging result access request from the client, and in response to the debugging result access request, obtain the debugging results from the storage unit and send them to the client.

[0090] The storage unit usually uses a database or other persistent storage mechanism to store the debugging results to ensure the integrity and traceability of the data. The user can view and delete the debugging results corresponding to the historical debugging records through the debugging record management module 205.

[0091] In one possible implementation, the performance testing device supports simultaneous access by multiple users and allows multiple performance tests to be executed simultaneously. When there are multiple users in the performance testing device, performance testing script information can be shared between the multiple users, and multiple users can access and edit the performance testing script at the same time. Optionally, there is no limit on the number of users in the multiple users, and the multiple users can be 10 users, 33 users, or 80 users. Exemplarily, when there are user A and user B in the performance testing device, and user A and user B belong to the same performance testing team, user A and user B can access and edit the performance testing script at the same time. Optionally, user A and user B can access and edit the performance testing script under user A's account at the same time; user A and user B can also access and edit the performance testing script under user B's account at the same time.

[0092] Figure 3 The following is a flow chart of the performance testing method provided in the embodiment of the present application. Figure 3 As shown, this method is applied to connect to Figure 2 Example or Figure 2 The electronic device of the performance testing device corresponding to any possible implementation manner of the embodiment includes:

[0093] S301. Display the main structure and functions of the performance testing device on the screen of the electronic device.

[0094] The user opens the performance test application or interface on the electronic device. The electronic device loads and displays the main structure and functions of the performance test device. The user can browse and understand the functions of different modules in the performance test device through operations such as clicking and sliding.

[0095] S302: Based on human-computer interaction, obtain operation instructions of the performance testing device, where the operation instructions include managing a test plan, inputting a test plan, and executing a test plan.

[0096] The user interacts with the performance test device through an electronic device. The user sets operation instructions through the electronic device, including input instructions and selection operation instructions. The operation instructions are used to control the performance test device to perform corresponding operations.

[0097] S303: Execute the operation instruction according to the main structure of the performance test device and the operation instruction of the performance test device.

[0098] The performance test device analyzes the operation instructions input by the user, determines the user's specific operation requirements, and executes the operation corresponding to the operation instruction according to the main structure of the performance test device.

[0099] The embodiments of the present application provide a performance testing method, which significantly improves the user experience and testing efficiency of performance testing through the intuitive interface display, flexible interaction mode and efficient instruction execution mechanism of the electronic device, and provides strong support for the efficient and accurate execution of performance testing.

[0100] The performance testing device provided in the embodiments of the present application has at least the following advantages:

[0101] 1. Improve the traceability and efficiency of debugging results.

[0102] First, users can filter and view historical debugging records by time, including script debugging results, error logs, and script snapshot information, enabling backtracking of debugging results. This allows users to quickly identify and resolve potential issues, reducing troubleshooting time. Second, by converting script content into JSON format and transmitting it to the server under test via HTTP requests, multiple disk I / O operations for file downloads and uploads are avoided, significantly improving the efficiency of performance test execution. Subsequently, the detection and resource control modules adjust and optimize the parameters of the performance test script, further reducing the consumption of server and network resources in the performance test device.

[0103] 2. Facilitate team collaboration.

[0104] The script management module supports multiple team members to access and edit scripts at the same time, facilitates team collaboration and feedback, realizes team-level management of scripts, ensures the consistency of performance test scripts, and implements version control on performance test scripts to improve the work efficiency of performance testing.

[0105] 3. Easy to use.

[0106] First, users do not need to configure a local test environment or install the corresponding application for the performance test device. Instead, they can directly access the functions provided by the performance test device through a browser. The performance test device is not restricted to a specific environment or device, which reduces the complexity of environment configuration and lowers user costs. Second, the online debugging function provided by the script testing module in the performance test device allows users to modify and test scripts in real time, providing rapid feedback and adjusting test parameters, further improving the convenience and efficiency of debugging.

[0107] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 4As shown, the electronic device 40 provided in this embodiment includes: at least one processor 401 and a memory 402. Optionally, the device 40 further includes a communication component 403. The processor 401, the memory 402 and the communication component 403 are connected via a bus 404.

[0108] In a specific implementation process, at least one processor 401 executes the computer-executable instructions stored in the memory 402, so that the at least one processor 401 performs the above method.

[0109] The specific implementation process of the processor 401 can be found in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here in this embodiment.

[0110] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), etc. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.

[0111] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory.

[0112] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be divided into address buses, data buses, control buses, etc. For ease of presentation, the buses in the drawings of the embodiments of the present application are not limited to just one bus or just one type of bus.

[0113] An embodiment of the present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0114] An embodiment of the present application further provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed, any of the above methods is implemented.

[0115] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0116] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist in a device as discrete components.

[0117] The division of units is merely a logical functional division; actual implementations may employ alternative divisions, such as combining or integrating multiple units or components into another system, or omitting or disabling certain features. Furthermore, any direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units, either through an interface, electrical, mechanical, or other means.

[0118] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0119] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0120] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other media that can store program code.

[0121] Those skilled in the art will appreciate that all or part of the steps in the above-described method embodiments can be implemented using hardware associated with program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0122] Finally, it should be noted that those skilled in the art will readily identify other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art not disclosed herein. The present invention is not limited to the precise structure described above and illustrated in the accompanying drawings, and various modifications and variations may be made without departing from the scope thereof. The scope of the present invention is limited solely by the appended claims.

Claims

1. A performance testing device, characterized in that: include: Script management module, script testing module, script execution module, result collection module and debugging record management module connected through interfaces; The script management module is used to obtain performance test scripts and manage the performance test scripts; The script testing module is configured to call a target performance test script from the script management module in response to a debugging instruction, obtain a test hash tree based on parsing the target performance test script, and adjust the test hash tree to obtain an adjusted test hash tree; The script execution module is configured to generate a debugging test request according to the adjusted test hash tree, send the debugging test request to the server to be tested, receive a script test result returned by the server to be tested, and generate an error log when the script test result includes error information; The result collection module is used to monitor the debugging results of the script execution module and pass the debugging results to the debugging record management module; wherein the debugging results include the script test results, the error log and the target performance test script; The debugging record management module is used to manage and store the debugging results.

2. The device according to claim 1, characterized in that The script management module includes an acquisition unit and a management unit; The acquiring unit is configured to acquire the performance test script according to a file uploaded by a user, or according to the performance test script input by the user in a script writing page; and passing the performance test script to the script management unit; The management unit is configured to respond to a management instruction for the performance test script and manage the performance test script; Alternatively, in response to a calling instruction of the script parsing module, the performance test script is sent to the script parsing module.

3. The device according to claim 1, characterized in that The script testing module includes a script parsing unit, a script detection unit and a resource control unit; The script parsing unit is configured to call the target performance test script from the script management module in response to the debugging instruction, and parse the target performance test script to obtain the test hash tree; The script detection unit is used to detect the test hash tree and obtain a corresponding detection result; The resource control unit is configured to adjust parameters in the test hash tree according to the detection result of the script detection unit to obtain the adjusted test hash tree.

4. The device according to claim 3, characterized in that The script detection unit is specifically used for: Obtaining the number of loops of the loop controller component node and the number of users of the thread group component node in the test hash tree; Determining whether the number of cycles meets a preset cycle requirement, and / or determining whether the number of users meets a preset user number requirement; The detection result is obtained according to the judgment result corresponding to the number of cycles and the judgment result corresponding to the number of users.

5. The device according to claim 1, characterized in that The script execution module includes: a generating unit, a sending unit and a receiving unit; The generating unit is configured to generate the debugging test request according to the sampler in the adjusted test hash tree; The sending unit is used to send the debugging test request to the server to be tested through a network or a preset communication method; The receiving unit is configured to receive the script test result returned by the server to be tested, and to generate the error log when the script test result includes error information; or to generate the error log when a preset waiting time is reached and the script test result is not received.

6. The device according to claim 1, characterized in that The debugging record management module includes: a storage unit and a management unit; The management unit is configured to receive the debugging result transmitted by the result acquisition module and send the result to the storage unit; The storage unit is used to store the debugging result; The management unit is further configured to receive a debugging result access request from a client, and in response to the debugging result access request, obtain the debugging result from the storage unit and send the result to the client.

7. A performance testing method, characterized in that: include: Applicable to an electronic device connected to a performance testing device according to any one of claims 1 to 6, the performance testing method comprising: Displaying the main structure and functions of the performance testing device on the screen of the electronic device; Based on human-computer interaction, obtaining operation instructions of the performance testing device, wherein the operation instructions include managing a test plan, inputting a test plan, and executing a test plan; According to the main structure of the performance test device and the operation instruction of the performance test device, the operation instruction is executed.

8. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed.

10. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 6 when the computer program is executed.