Software performance test method and device, equipment, storage medium and program product
By using test configuration recommendation models and dynamically adjusting resources in containerized environments, the problems of low efficiency and poor accuracy of traditional software performance testing are solved, and efficient and accurate performance testing is achieved.
Patent Information
- Application Number
- CN202510512433.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-08-01
AI Technical Summary
Traditional software performance testing methods are inefficient and poorly accurate, cannot meet multiple test needs to be run concurrently, and rely on manual settings to make mistakes prone.
The pre-trained test configuration recommendation model is adopted, and based on historical test configuration parameters and goals, a personalized test configuration set is automatically generated, and resources are dynamically adjusted through a containerized environment to monitor and optimize performance tests in real time.
Improves the efficiency and accuracy of software performance testing, and enables rapid generation of personalized configurations that meet the test objectives, ensuring test stability and accuracy under high concurrency and load fluctuations.
Smart Images

Figure CN120407414A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of digital engineering technology, and in particular, to a software performance testing method, apparatus, device, storage medium, and program product. Background Art
[0002] With the rapid development of cloud computing and microservice architectures, enterprises' performance requirements for applications are continuously increasing. Especially under conditions of high concurrency, large traffic, and complex loads, application performance is directly related to user experience and business success. Therefore, performance testing has gradually become a key step before system go-live.
[0003] Traditional performance testing methods generally rely on test scenario configurations in a fixed resource environment, and most only support a single type of test (such as stress testing or load testing), and cannot meet the requirements of concurrent operation of multiple test needs. At the same time, traditional methods usually rely on manual settings in test configuration, thus, the configuration efficiency is low, and it is prone to errors under changing load conditions, resulting in low efficiency and accuracy of software performance testing.
[0004] Therefore, how to improve the efficiency and accuracy of software performance testing has become an urgent problem to be solved. Summary of the Invention
[0005] Embodiments of the present application provide a software performance testing method, apparatus, device, storage medium, and program product, which can improve the efficiency and accuracy of software performance testing.
[0006] In a first aspect, embodiments of the present application provide a software performance testing method, which includes:
[0007] In response to a test instruction for the software to be tested, determine a performance test target for the software to be tested; the test instruction includes the performance test target;
[0008] Input the performance test target into a pre-trained test configuration recommendation model to obtain a test configuration set corresponding to the performance test target; the test configuration recommendation model is trained based on historical test configuration parameters corresponding to an object associated with the test instruction and historical test targets corresponding to the historical test configuration parameters;
[0009] Based on the performance test target, determine at least one test task, and generate a test script based on the test configuration set and the at least one test task;
[0010] Run the test script to obtain a performance test result for the software to be tested.
[0011] In one embodiment, the test script includes sub-test scripts corresponding to each test task; the method further includes: determining at least one container associated with each test task; determining the required resources of at least one container associated with each test task based on the test configuration set and at least one test task; allocating the required resources to each container to obtain multiple containers after resource allocation; running the test script to obtain the performance test results for the software to be tested, including: executing the sub-test scripts corresponding to each test task in each container after resource allocation, and monitoring the performance test data corresponding to each test task in real time; obtaining the performance test results for the software to be tested based on the performance test data corresponding to each test task monitored in real time.
[0012] In one embodiment, the method further includes: dynamically adjusting the number of containers associated with each test task based on the performance test data corresponding to each test task monitored in real time and a preset container adjustment rule.
[0013] In one embodiment, dynamically adjusting the number of containers associated with each test task based on the performance test data corresponding to each test task monitored in real time and a preset container adjustment rule includes: based on the performance test data corresponding to each test task monitored in real time, determining the resource utilization rate of each container in at least one container associated with each test task in real time; in the case where the resource utilization rates of all containers in the determined at least one container are greater than a first preset resource utilization rate threshold and less than a second preset resource utilization rate threshold, creating a new container, where the new container is used to execute some of the sub-test scripts in the sub-test scripts corresponding to at least one container; in the case where there is any container in the determined at least one container whose resource utilization rate is less than a third preset resource utilization rate threshold, allocating the sub-test script running in any container to other containers in the at least one container except any container for execution, and deleting any container; the third preset resource utilization rate threshold is less than the first preset resource utilization rate threshold.
[0014] In one embodiment, the method further includes: for each test task, obtaining the historical resource utilization rate of at least one container corresponding to the test task within a preset time period before the current moment; analyzing the historical resource utilization rate to obtain the resource utilization rate change trend of at least one container; dynamically adjusting the number of containers associated with the test task based on the resource utilization rate change trend of the container.
[0015] In one embodiment, the method further includes: constructing a performance test data set based on the performance test data corresponding to each test task monitored in real time and the historical performance test data; performing feature dimensionality reduction and denoising processing on the data in the performance test data set to obtain a low-dimensional feature vector corresponding to the performance test data set; inputting the low-dimensional feature vector into a pre-trained performance prediction model to obtain a performance prediction result for the software to be tested; and generating a performance optimization strategy for the software to be tested based on the performance prediction result.
[0016] In a second aspect, the present application provides a software performance test device, which includes:
[0017] A determination module, configured to determine a performance test target for the software to be tested in response to a test instruction for the software to be tested; the test instruction includes the performance test target;
[0018] A recommendation module, configured to input the performance test target into a pre-trained test configuration recommendation model to obtain a test configuration set corresponding to the performance test target; the test configuration recommendation model is trained based on the historical test configuration parameters corresponding to the object associated with the test instruction and the historical test targets corresponding to the historical test configuration parameters;
[0019] A determination and generation module, further configured to determine at least one test task based on the performance test target, and generate a test script based on the test configuration set and the at least one test task;
[0020] A processing module, configured to run the test script to obtain a performance test result for the software to be tested.
[0021] In a third aspect, the present application provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0022] Determine a performance test target for the software to be tested in response to a test instruction for the software to be tested; the test instruction includes the performance test target;
[0023] Input the performance test target into a pre-trained test configuration recommendation model to obtain a test configuration set corresponding to the performance test target; the test configuration recommendation model is trained based on the historical test configuration parameters corresponding to the object associated with the test instruction and the historical test targets corresponding to the historical test configuration parameters;
[0024] Determine at least one test task based on the performance test target, and generate a test script based on the test configuration set and the at least one test task;
[0025] Run the test script to obtain a performance test result for the software to be tested.
[0026] Fourthly, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0027] In response to a test instruction for the software to be tested, determine a performance test target for the software to be tested; the test instruction includes the performance test target;
[0028] Input the performance test target into a pre-trained test configuration recommendation model to obtain a test configuration set corresponding to the performance test target; the test configuration recommendation model is trained based on historical test configuration parameters corresponding to the object associated with the test instruction and historical test targets corresponding to the historical test configuration parameters;
[0029] Based on the performance test target, determine at least one test task, and generate a test script based on the test configuration set and the at least one test task;
[0030] Run the test script to obtain a performance test result for the software to be tested.
[0031] Fifthly, the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0032] In response to a test instruction for the software to be tested, determine a performance test target for the software to be tested; the test instruction includes the performance test target;
[0033] Input the performance test target into a pre-trained test configuration recommendation model to obtain a test configuration set corresponding to the performance test target; the test configuration recommendation model is trained based on historical test configuration parameters corresponding to the object associated with the test instruction and historical test targets corresponding to the historical test configuration parameters;
[0034] Based on the performance test target, determine at least one test task, and generate a test script based on the test configuration set and the at least one test task;
[0035] Run the test script to obtain a performance test result for the software to be tested.
[0036] The above software performance testing method, device, equipment, storage medium and program product, the computer equipment can respond to the test instruction for the software to be tested, and determine the performance testing objective for the software to be tested; the test instruction includes the performance testing objective; input the performance testing objective into the pre-trained test configuration recommendation model to obtain the test configuration set corresponding to the performance testing objective; the test configuration recommendation model is trained based on the historical test configuration parameters corresponding to the object associated with the test instruction and the historical test objectives corresponding to the historical test configuration parameters; based on the performance testing objective, determine at least one test task, and generate a test script based on the test configuration set and at least one test task; run the test script to obtain the performance testing result for the software to be tested. By adopting this method, since the test configuration recommendation model is trained based on the historical test configuration parameters corresponding to the object associated with the test instruction and the historical test objectives corresponding to the historical test configuration parameters, and the historical test configuration parameters include the configuration habits of the object (or called user) corresponding to the test instruction, therefore, the computer equipment uses the test configuration recommendation model to process the performance testing objective, and can quickly and accurately generate a personalized test parameter configuration set that meets the performance testing objective, thereby improving the efficiency and accuracy of software performance testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for the description in the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0038] Figure 1 It is a schematic diagram of an application scenario of a software performance testing method provided by an embodiment of the present application;
[0039] Figure 2 It is a schematic flowchart of a software performance testing method provided by an embodiment of the present application;
[0040] Figure 3 It is a schematic flowchart of another software performance testing method provided by an embodiment of the present application;
[0041] Figure 4 It is a schematic structural diagram of a software performance testing device provided by an embodiment of the present application;
[0042] Figure 5 It is a schematic structural diagram of another software performance testing device provided by an embodiment of the present application;
[0043] Figure 6 It is a schematic structural diagram of a computer device provided by an embodiment of the present application. Specific Embodiments
[0044] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] The application scenarios of the software performance testing method provided by the embodiments of the present application will be introduced below.
[0046] Please refer to Figure 1 , Figure 1 which is a schematic diagram of an application scenario of a software performance testing method provided by an embodiment of the present application. As Figure 1 shown, the software to be tested 101 is running in the computer device 100.
[0047] The computer device 100 can respond to a test instruction for the software to be tested 101, determine a performance test target for the software to be tested; the test instruction includes the performance test target; input the performance test target into a pre-trained test configuration recommendation model to obtain a test configuration set corresponding to the performance test target; the test configuration recommendation model is trained based on the historical test configuration parameters corresponding to the object associated with the test instruction and the historical test targets corresponding to the historical test configuration parameters; based on the performance test target, determine at least one test task, and generate a test script based on the test configuration set and the at least one test task; run the test script to obtain the performance test result for the software to be tested. By using this method, since the test configuration recommendation model is trained based on the historical test configuration parameters corresponding to the object associated with the test instruction and the historical test targets corresponding to the historical test configuration parameters, and the historical test configuration parameters include the configuration habits of the object (or called user) corresponding to the test instruction, therefore, the computer device uses the test configuration recommendation model to process the performance test target, and can quickly and accurately generate a personalized test parameter configuration set that meets the performance test target, thereby improving the efficiency and accuracy of software performance testing.
[0048] Optionally, the computer device 100 can be a terminal device or a server. Among them, the terminal device mentioned here can include but is not limited to: smart phones, tablet computers, laptop computers, desktop computers, smart watches, smart TVs, intelligent vehicle terminals, etc. The server mentioned here can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, etc.
[0049] Please refer to Figure 2 , Figure 2 which is a flowchart of a software performance testing method provided by an embodiment of the present application. This method can be performed by a computer device (for example,Figure 1 The computer device 100 in the embodiment is executed. Figure 2 As shown, the software performance testing method may include but is not limited to the following steps:
[0050] S201 : In response to a test instruction for the software to be tested, determine a performance test target for the software to be tested; the test instruction includes the performance test target.
[0051] In an optional implementation, the performance test objectives may include at least one of the following: stress testing, load testing, capacity testing, etc.
[0052] S202. Input the performance test target into a pre-trained test configuration recommendation model to obtain a test configuration set corresponding to the performance test target; the test configuration recommendation model is trained based on historical test configuration parameters corresponding to objects associated with test instructions and historical test targets corresponding to the historical test configuration parameters.
[0053] In an optional embodiment, the test configuration recommendation model can be determined by a computer device in the following manner: obtaining historical test configuration parameters corresponding to the object associated with the test instruction and historical test targets corresponding to the historical test configuration parameters; inputting the historical test targets into a pre-built initial test configuration recommendation model to obtain predicted test configuration parameters corresponding to the historical test targets; training the initial test configuration recommendation model in the direction of reducing the difference between the predicted test configuration parameters corresponding to the historical test targets and the historical test configuration parameters to obtain a test configuration recommendation model.
[0054] Optionally, the initial test configuration recommendation model may be constructed by the computer device based on a multilayer perceptron (MLP) model.
[0055] In an optional implementation, the test configuration set corresponding to the performance test objective may include, but is not limited to, parameters such as concurrency, request frequency, and load growth rate, as well as scheduling settings and exception handling strategies corresponding to the performance test objective. This ensures the stability and integrity of software performance testing under specific conditions.
[0056] In an optional implementation, the test configuration set corresponding to the performance test target may be recommended based on an initial test configuration set predetermined by the computer device.
[0057] In some embodiments, the initial test configuration set can be determined by a computer device in the following manner: based on the protocol type and test objectives set by an object (user) associated with the test instructions, an initial test configuration set is generated. Exemplarily, when the computer device is specified with test objectives by the user, it can initialize the ranges of configuration parameters corresponding to different test objectives to obtain the initial test configuration set. For example, if the test objective is a stress test, the computer device can initialize the ranges of parameters such as the number of concurrent users, request frequency, and load growth rate corresponding to the stress test to meet the basic requirements of the stress test.
[0058] Among them, the protocol type may include but is not limited to the HyperText Transfer Protocol (HTTP), the HyperText Transfer Protocol over Secure Socket Layer (HTTPS), and WebSocket (a protocol for full-duplex communication over a single Transmission Control Protocol (TCP) connection. It allows real-time communication between browsers and servers and can avoid the overhead of frequently establishing and disconnecting connections in real-time communication scenarios). The protocol type can determine the underlying communication mechanism and load characteristics, and the computer device can determine the connection parameters based on the protocol characteristics to ensure the accuracy of the test and the fit with the test objectives.
[0059] S203. Based on the performance test objectives, determine at least one test task, and based on the test configuration set and the at least one test task, generate a test script.
[0060] In an alternative implementation, when the computer device generates a test script based on the test configuration set and the at least one test task, it can define the process for each test task (such as the request sending frequency, the handling logic for abnormal situations, etc.) based on the parameter configuration items in the sub-test configuration set corresponding to each test task, and embed error detection and load regulation instructions. Then, based on the process definition corresponding to each test task and the embedded error detection and load regulation instructions, a test script is generated.
[0061] S204. Run the test script to obtain the performance test results for the software to be tested.
[0062] In an embodiment of the present application, the computer device can determine a performance test target for the software to be tested in response to a test instruction for the software to be tested; the test instruction includes the performance test target; input the performance test target into a pre-trained test configuration recommendation model to obtain a test configuration set corresponding to the performance test target; the test configuration recommendation model is trained based on the historical test configuration parameters corresponding to the object associated with the test instruction and the historical test targets corresponding to the historical test configuration parameters; based on the performance test target, determine at least one test task, and generate a test script based on the test configuration set and the at least one test task; run the test script to obtain the performance test result for the software to be tested. By adopting this method, since the test configuration recommendation model is trained based on the historical test configuration parameters corresponding to the object associated with the test instruction and the historical test targets corresponding to the historical test configuration parameters, and the historical test configuration parameters include the configuration habits of the object (or user) corresponding to the test instruction, the computer device uses the test configuration recommendation model to process the performance test target, and can quickly and accurately generate a personalized test parameter configuration set that meets the performance test target, thereby improving the efficiency and accuracy of software performance testing.
[0063] In an alternative embodiment, Figure 2 In the software performance test method shown, the test script includes sub-test scripts corresponding to each test task; the computer device can also determine at least one container associated with each test task; based on the test configuration set and the at least one test task, determine the required resources of at least one container associated with each test task; allocate the required resources to each container to obtain multiple containers after resource allocation. In this case, when the computer device runs the test script to obtain the performance test result for the software to be tested, it can execute the sub-test scripts corresponding to each test task in each container after resource allocation, and monitor the performance test data corresponding to each test task in real time; based on the performance test data corresponding to each test task monitored in real time, obtain the performance test result for the software to be tested.
[0064] In some embodiments, the required resources of each container in the at least one container can be determined by the computer device based on the concurrency number, request frequency, and load growth rate of the test task. Optionally, the required resources of each container can include, but are not limited to, the initial value of the usage amount of the central processing unit required by each container, the initial value of the memory usage amount, and the initial value of the network bandwidth.
[0065] In some embodiments, the computer device may call the resource request and limit configuration interface of Kubernetes (which may be abbreviated as K8S, an open-source system for managing containerized applications on multiple hosts in a cloud platform), and by defining the minimum and maximum limits of container resources, ensure the accuracy of resource allocation and prevent the impact of over-allocation of resources on the overall system performance.
[0066] In some embodiments, the computer device may automatically adapt to the load requirements of test tasks through a multi-layer architecture to ensure the reasonable utilization of resources. The multi-layer architecture may include an application layer, a scheduling layer, and a resource monitoring layer. Among them, the application layer may be used to execute test scripts, and each test request or instruction runs independently in a container, so that there is a high degree of isolation between different test tasks. Thus, performance bottlenecks caused by resource competition can be prevented. The scheduling layer may be used to achieve dynamic management of test instances through the load balancing function of Kubernetes. When the load fluctuates, the computer device can automatically allocate resources according to task priorities and load requirements, keeping the resources in an optimal allocation state at all times. The resource monitoring layer may be used to monitor the performance test data corresponding to each test task in real time, so that the computer device can automatically expand or reduce the number of containers associated with each test task based on the performance test data corresponding to each test task.
[0067] Optionally, the performance test data may include, but is not limited to, CPU usage, memory consumption, network latency, and response time, etc. CPU usage can be used to reflect the occupancy of computing resources; memory consumption can also be used to reflect the allocation and usage of memory resources; network latency can be used to reveal the stability of network communication performance; response time can be used to reflect the service quality of the system under different loads. By monitoring the above performance test data, the computer device can capture the performance changes of test tasks during execution, thereby providing a basis for subsequent data analysis.
[0068] Adopting this implementation method, by running test scripts in a containerized environment, the computer device can facilitate automatically expanding or reducing test instances according to the real-time load situation, thereby ensuring the continuity and stability of test tasks under high concurrency or load fluctuation conditions, and significantly improving the software performance testing ability in a cloud environment.
[0069] In an alternative implementation, the computer device may also dynamically adjust the number of containers associated with each test task based on the performance test data corresponding to each test task monitored in real time and preset container adjustment rules.
[0070] In some embodiments, the computer device dynamically adjusts the number of containers associated with each test task based on the performance test data corresponding to each test task monitored in real time and a preset container adjustment rule, which may include: based on the performance test data corresponding to each test task monitored in real time, determining in real time the resource utilization rate of each container in at least one container associated with each test task; in the case where the resource utilization rates of all containers in the determined at least one container are greater than a first preset resource utilization rate threshold and less than a second preset resource utilization rate threshold, creating a new container, where the new container is used to execute some sub-test scripts in the sub-test scripts corresponding to the at least one container; in the case where there is any container in the determined at least one container whose corresponding resource utilization rate is less than a third preset resource utilization rate threshold, allocating the sub-test script running in any container to other containers in the at least one container except any container for execution, and deleting any container; the third preset resource utilization rate threshold is less than the first preset resource utilization rate threshold.
[0071] Adopting this implementation manner, when the resource utilization rate of the container corresponding to the test task is greater than the set upper limit value, the computer device can create a new container to share the computing pressure of the container corresponding to the test task; when the resource utilization rate of the container corresponding to the test task is less than the lower limit value, the computer device can reduce the number of containers corresponding to the test task to optimize the resource utilization rate and reduce system overhead.
[0072] In an alternative implementation manner, the computer device can also obtain, for each test task, the historical resource utilization rate of at least one container corresponding to the test task within a preset time period before the current moment; analyze the historical resource utilization rate to obtain the resource utilization rate change trend of at least one container; and dynamically adjust the number of containers associated with the test task based on the resource utilization rate change trend of the container.
[0073] Adopting this implementation manner, the computer device expands or reduces the number of containers associated with the test task in advance based on the change trend of the resource utilization rate of the associated containers of the test task, which can avoid problems such as resource contention and scheduling delay caused by insufficient number of containers, or avoid problems of resource waste caused by excessive number of containers.
[0074] In an alternative embodiment, the computer device can also construct a performance test data set based on the performance test data corresponding to each test task monitored in real time and historical performance test data; perform feature dimensionality reduction and denoising processing on the data in the performance test data set to obtain a low-dimensional feature vector corresponding to the performance test data set; input the low-dimensional feature vector into a pre-trained performance prediction model to obtain a performance prediction result for the software to be tested; and generate a performance optimization strategy for the software to be tested based on the performance prediction result. In this way, compared with traditional performance test methods, there is no need to rely on monitoring tools during the data collection process, and in-depth analysis of real-time data can be performed, so as to accurately identify potential performance problems and generate a performance optimization strategy for the software to be tested. Furthermore, it can cope with dynamic loads and elastic resource requirements in the cloud-native environment.
[0075] Optionally, the performance test data may include, but is not limited to, CPU usage, memory consumption, network latency, and response time, etc. CPU usage can be used to reflect the occupancy degree of computing resources; memory consumption can also be used to reflect the allocation and usage status of memory resources; network latency can be used to reveal the stability of network communication performance; and response time can be used to reflect the service quality of the system under different loads.
[0076] In this embodiment, when the computer device performs feature dimensionality reduction and denoising processing on the performance test data in the performance test data set to obtain a low-dimensional feature vector corresponding to the performance test data set, it can perform data cleaning and normalization processing on each data in the performance test data set to obtain a processed performance test data set; and perform feature dimensionality reduction and denoising processing on each data in the processed performance test data set to obtain a low-dimensional feature vector corresponding to the performance test data set.
[0077] In some embodiments, when the computer device performs data cleaning and normalization processing on each data in the performance test data set to obtain a processed performance test data set, it can perform outlier detection and removal processing on each data in the performance test data set to obtain an initially processed performance test data set; and perform normalization processing on each data in the initially processed performance test data set to obtain a processed performance test data set.
[0078] Among them, when the computer device performs outlier detection and removal processing on each data in the performance test data set, it can use mean filtering and sliding window method to perform outlier detection and removal processing on each data in the performance test data set. In this way, by performing outlier detection and removal processing on each data in the performance test data set, the computer device can improve the accuracy of the data in the performance test data set. Among them, outliers are extreme values or missing values generated due to network fluctuations or sudden increases in instantaneous load, for example.
[0079] Among them, the computer device normalizes each data in the initially processed performance test dataset, which can scale the values of each data to the same range, such as the interval [0, 1] or [-1, 1], to eliminate the dimensional differences of different metrics, making the processed data more suitable for the processing requirements of subsequent deep learning models, thereby improving the accuracy of data analysis.
[0080] In this embodiment, the computer device performs feature dimensionality reduction and denoising processing on each data in the processed performance test dataset to obtain a low-dimensional feature vector corresponding to the performance test dataset. It can use the encoder included in the autoencoder model to perform feature dimensionality reduction and denoising processing on each data in the processed performance test dataset to obtain a low-dimensional feature vector corresponding to the performance test dataset.
[0081] Optionally, the autoencoder model can be obtained by the computer device in the following way: input the historical performance test data into the encoder in the pre-constructed initial autoencoder model for feature dimensionality reduction processing to obtain the low-dimensional features corresponding to the historical performance test data; input the low-dimensional features into the encoder in the pre-constructed initial autoencoder model for reconstruction processing to obtain the reconstructed performance test data; train the initial autoencoder model in the direction of reducing the difference between the historical performance test data and the reconstructed performance test data to obtain the autoencoder model.
[0082] That is to say, the initial autoencoder model includes two parts: an encoder and a decoder. The encoder is used to gradually extract features from multi-dimensional input data, and compress the data into a low-dimensional key feature representation through dimensionality reduction operations. During the encoding process, the model gradually removes redundant information and improves the feature representation ability by filtering out high-frequency noise, enabling the model to focus on capturing important features in the data. The decoder is used to restore the compressed low-dimensional features to a form close to the original data, ensuring that key information is not lost during the denoising process. The core of the autoencoder model lies in minimizing the reconstruction error between the decoder restoration result and the original data to ensure that the dimensionality-reduced data has high representativeness and provides an accurate feature basis for subsequent time series prediction.
[0083] In this embodiment, the performance prediction model pre-trained by the computer device can be a pre-trained Recurrent Neural Network (RNN) model. Among them, the RNN model includes an input layer, a hidden layer, and an output layer. The input layer receives the time series data after feature extraction and normalization processing, and passes it to the hidden layer step by step in time. The hidden layer is the core of the RNN model, and realizes the information transfer between time steps through recursive connections, so as to capture the time dependence in the data. Specifically, the state calculated by the neurons in the hidden layer at each time step depends not only on the current input data, but also on the hidden state of the previous time step. This feature enables the RNN to comprehensively consider historical information during prediction, so as to more accurately predict the performance state of the current time step. The output layer maps the state of the hidden layer to the predicted value of the current time step. Among them, the expression of the RNN model can be shown as follows.
[0084]
[0085] In the above formula, h t represents the hidden layer state at time step t; W h is the hidden layer weight matrix, which is used to connect the hidden state h t-1 of the previous time step; W x is the input weight matrix, which connects the current input data x t (such as the current load, response time, and throughput, CPU usage, memory consumption, network latency, and response time); b h is the bias term of the hidden layer; f() is the activation function of the hidden layer; g() is the activation function of the output layer; y t is the output value of the output layer.
[0086] Optionally, the pre-trained recurrent neural network can be obtained by the computer device in the following ways: obtaining historical performance test data; performing data cleaning and normalization processing on the historical performance test data to obtain the processed historical performance test data; inputting the processed historical performance test data into the pre-constructed initialized recurrent neural network to obtain the historical performance prediction results corresponding to the historical performance test data; training the initialized recurrent neural network in the direction of reducing the difference between the historical performance prediction results corresponding to the historical performance test data and the actual historical performance results to obtain the trained recurrent neural network; validating the trained recurrent neural network, and obtaining the pre-trained recurrent neural network when the validation results meet the preset conditions.
[0087] Optionally, the computer device trains the initialized recurrent neural network in a direction to reduce the difference between the historical performance prediction result corresponding to the historical performance test data and the actual historical performance result, and obtains the trained recurrent neural network. It can iteratively update the initialized recurrent neural network based on the mean squared error (MSE) between the historical performance prediction result and the actual historical performance result, and obtain the trained recurrent neural network when it is determined that the mean squared error is less than the preset mean squared error threshold. Among them, MSE can be used to reflect the deviation between the predicted value and the actual value. The smaller the loss value, the higher the degree of fitting of the model to the data. Optionally, to minimize the loss, the computer device can use the backpropagation through time (BPTT) algorithm to update the weights of the initialized recurrent neural network layer by layer. BPTT unfolds the model along time, and gradually transmits the error from the output layer back to each time step of the hidden layer to ensure that the states of each time step participate in the loss optimization process. In each iteration, the computer device can adjust the weight parameters according to the gradient of the loss, gradually reduce the prediction error, and thus improve the prediction accuracy of the model.
[0088] Optionally, the initialized recurrent neural network can be obtained by the computer device randomly assigning values to the weights, bias parameters, etc. of the obtained recurrent neural network.
[0089] Optionally, the computer device validates the trained recurrent neural network, and obtains the pre-trained recurrent neural network when the validation result meets the preset conditions. It can be to use the cross-validation method to validate the trained recurrent neural network, and obtain the pre-trained recurrent neural network when the validation result meets the preset conditions. Among them, cross-validation divides the data set into several subsets, and the model is trained and tested multiple times under different training / validation splits to ensure that the performance of the model is not limited to a specific training set, but has high prediction accuracy for the performance change trend of the overall data set. The cross-validation result can help identify potential overfitting problems of the model, enabling the model to handle diverse load scenarios in practical applications. The potential biases found during cross-validation are corrected by further tuning the model parameters, such as adjusting the learning rate, increasing the regularization term, or optimizing the number of hidden layer nodes, to improve the robustness and stability of the model.
[0090] By adopting the embodiments of the present application, the computer device can perform feature dimensionality reduction and noise filtering on each data in the high-dimensional performance test dataset by using an autoencoder model, extract key features (i.e., low-dimensional feature vectors) from complex data, and ensure the effectiveness of the input data of the pre-trained performance prediction model. Then, by using the pre-trained performance prediction model to analyze the key features, future performance prediction results can be accurately obtained. Thus, based on the performance prediction results, a performance optimization strategy for the software to be tested can be generated in advance. Furthermore, it is beneficial for users to optimize the software to be tested in a timely manner based on the performance optimization strategy to ensure the stable operation of the software to be tested.
[0091] The following provides an overall description of the software performance testing method provided by the embodiments of the present application. Please refer to Figure 3 , Figure 3 which is a schematic flowchart of another software performance testing method provided by the embodiments of the present application. As Figure 3 shown, the software performance testing method may include but is not limited to the following steps:
[0092] S301. In response to a test instruction for the software to be tested, determine a performance testing target for the software to be tested; the test instruction includes the performance testing target.
[0093] S302. Input the performance testing target into a pre-trained test configuration recommendation model to obtain a test configuration set corresponding to the performance testing target; the test configuration recommendation model is trained based on the historical test configuration parameters corresponding to the object associated with the test instruction and the historical test targets corresponding to the historical test configuration parameters.
[0094] S303. Based on the performance testing target, determine at least one test task, and generate a test script based on the test configuration set and the at least one test task; the test script includes sub-test scripts corresponding to each test task.
[0095] In an optional implementation manner, the relevant descriptions of steps S301 to S303 can be respectively referred to the descriptions in the foregoing steps S201 to S203, and will not be elaborated here.
[0096] S304. Determine at least one container associated with each test task, and determine the required resources of at least one container associated with each test task based on the test configuration set and the at least one test task.
[0097] S305. Allocate the required resources to each container to obtain multiple containers after resource allocation.
[0098] S306. In each container after resource allocation, execute the sub-test script corresponding to each test task, and monitor the performance test data corresponding to each test task in real time.
[0099] Optionally, after step S306, the computer device may only execute the following step S307; or may only execute the following steps S308 to S311; or may execute both the following step S307 and the following steps S308 to S311, which is not limited herein.
[0100] S307. Obtain a performance test result for the software to be tested based on the performance test data corresponding to each test task monitored in real time.
[0101] S308. Construct a performance test data set based on the performance test data corresponding to each test task monitored in real time and historical performance test data.
[0102] S309. Perform feature dimensionality reduction and denoising processing on the data in the performance test data set to obtain a low-dimensional feature vector corresponding to the performance test data set.
[0103] S310. Input the low-dimensional feature vector into a pre-trained performance prediction model to obtain a performance prediction result for the software to be tested.
[0104] S311. Generate a performance optimization strategy for the software to be tested based on the performance prediction result.
[0105] In an optional implementation manner, for the related descriptions of steps S307 to S311, reference may be made to the description of the implementation manner corresponding to the performance optimization strategy for the software to be tested generated based on the performance test data corresponding to each test task monitored in real time as described above, and details are not elaborated herein.
[0106] In the embodiments of the present application, on the one hand, the computer device can obtain a performance test result for the software to be tested based on the performance test data corresponding to each test task monitored in real time, thereby facilitating the user to timely learn about the performance of the software to be tested; on the other hand, it can also generate a performance optimization strategy for the software to be tested based on the performance test data corresponding to each test task monitored in real time, thereby facilitating the user to timely optimize the software to be tested based on the performance optimization strategy to ensure the stable operation of the software to be tested.
[0107] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least some of the steps or stages in other steps or other steps.
[0108] Based on the same inventive concept, an embodiment of the present application also provides a software performance testing device for implementing the software performance testing method described above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the software performance testing device provided below can refer to the limitations on the software performance testing method in the above text, and will not be repeated here.
[0109] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of a software performance testing device provided by an embodiment of the present application. As Figure 4 shown, the software performance testing device may include but is not limited to:
[0110] A user management module 401 for managing users of the verification platform, where the users include but are not limited to developers, testers, and operation and maintenance personnel;
[0111] A test configuration module 402 for configuring a test configuration set corresponding to a test target and generating a test script based on the test configuration set;
[0112] A test execution module 403 for executing the test script to obtain a performance test result for the software to be tested.
[0113] A real-time monitoring module 404 for collecting real-time performance data during the test execution process, including but not limited to CPU usage rate, memory consumption, network latency, and response time;
[0114] An intelligent analysis module 405 for using a deep learning algorithm to identify the performance bottlenecks and anomalies of the software to be tested from the real-time performance data and generating a test report.
[0115] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of another software performance testing device provided by an embodiment of the present application. As Figure 5As shown, the software performance testing device may include, but is not limited to:
[0116] A determination module 501, configured to determine a performance testing objective for the software to be tested in response to a test instruction for the software to be tested; the test instruction includes the performance testing objective;
[0117] A recommendation module 502, configured to input the performance testing objective into a pre-trained test configuration recommendation model to obtain a set of test configurations corresponding to the performance testing objective; the test configuration recommendation model is trained based on historical test configuration parameters corresponding to an object associated with the test instruction and historical testing objectives corresponding to the historical test configuration parameters;
[0118] A determination and generation module 503, further configured to determine at least one test task based on the performance testing objective, and generate a test script based on the set of test configurations and the at least one test task;
[0119] A processing module 504, configured to run the test script to obtain a performance testing result for the software to be tested.
[0120] In one embodiment, the test script includes sub-test scripts corresponding to each test task; the determination module 501 is further configured to determine at least one container associated with each test task; determine the required resources of at least one container associated with each test task based on the set of test configurations and the at least one test task; allocate the required resources to each container to obtain multiple containers after resource allocation; when the processing module 504 is configured to run the test script to obtain a performance testing result for the software to be tested, it is specifically configured to: execute the sub-test script corresponding to each test task in each container after resource allocation, and monitor in real time the performance testing data corresponding to each test task; obtain a performance testing result for the software to be tested based on the performance testing data corresponding to each test task monitored in real time.
[0121] In one embodiment, the processing module 504 is further configured to: dynamically adjust the number of containers associated with each test task based on the performance testing data corresponding to each test task monitored in real time and a preset container adjustment rule.
[0122] In one embodiment, when the processing module 504 dynamically adjusts the number of containers associated with each test task based on the performance test data corresponding to each test task monitored in real time and the preset container adjustment rules, it is specifically configured to: based on the performance test data corresponding to each test task monitored in real time, determine in real time the resource utilization rate of each container in at least one container associated with each test task; in the case where it is determined that the resource utilization rate of each container in at least one container is greater than a first preset resource utilization rate threshold and less than a second preset resource utilization rate threshold, create a new container, and the new container is used to execute a part of the sub-test scripts in the sub-test scripts corresponding to at least one container; in the case where it is determined that there is any container in at least one container whose corresponding resource utilization rate is less than a third preset resource utilization rate threshold, allocate the sub-test script running in any container to other containers in at least one container except any container for execution, and delete any container; the third preset resource utilization rate threshold is less than the first preset resource utilization rate threshold.
[0123] In one embodiment, the device may further include an acquisition module. The acquisition module is used to, for each test task, acquire the historical resource utilization rate of at least one container corresponding to the test task within a preset time period before the current moment; the processing module 504 is further used to analyze the historical resource utilization rate to obtain the resource utilization rate change trend of at least one container; and dynamically adjust the number of containers associated with the test task based on the resource utilization rate change trend of the container.
[0124] In one embodiment, the device may further include a construction module. The construction module is used to construct a performance test data set based on the performance test data corresponding to each test task monitored in real time and the historical performance test data; the processing module 504 is further used to perform feature dimensionality reduction and denoising processing on the data in the performance test data set to obtain a low-dimensional feature vector corresponding to the performance test data set; input the low-dimensional feature vector into a pre-trained performance prediction model to obtain a performance prediction result for the software to be tested; and generate a performance optimization strategy for the software to be tested based on the performance prediction result.
[0125] Each module in the above software performance test device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the terminal device in hardware form or be independent of it, or can be stored in the memory in the terminal device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0126] In an exemplary embodiment, an embodiment of the present application provides a computer device, which may be a terminal device, and its internal structure diagram may be as Figure 6As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a software performance testing method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0127] Those skilled in the art can understand that Figure 6 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0128] In an exemplary embodiment, the present application provides a computer device, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, it implements the steps in the above software performance testing method.
[0129] In an exemplary embodiment, the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor, it implements the steps in the above software performance testing method.
[0130] In an exemplary embodiment, the present application provides a computer program product, including a computer program. When the computer program is executed by the processor, it implements the steps in the above software performance testing method.
[0131] It should be noted that the data involved in this application (including but not limited to test instructions, performance test objectives, test configuration sets, test scripts, performance test results, etc.) are all information and data authorized by users or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0132] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in this application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.
[0133] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this application.
[0134] The above-described embodiments merely represent several implementation manners of this application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of this application. It should be noted that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can still be made, and these all belong to the protection scope of this application. Therefore, the protection scope of this application shall be subject to the appended claims.
Claims
1. A software performance testing method, characterized in that, The method includes: In response to a test instruction for the software to be tested, determining a performance test target for the software to be tested; the performance test target is included in the test instruction; Inputting the performance test target into a pre-trained test configuration recommendation model to obtain a test configuration set corresponding to the performance test target; the test configuration recommendation model is trained based on historical test configuration parameters corresponding to the object associated with the test instruction and historical test targets corresponding to the historical test configuration parameters; Based on the performance test target, determining at least one test task, and generating a test script based on the test configuration set and at least one of the test tasks; Running the test script to obtain a performance test result for the software to be tested.
2. The method according to claim 1, wherein The test script includes sub-test scripts corresponding to each of the test tasks; the method further includes: Determining at least one container associated with each of the test tasks; Based on the test configuration set and at least one of the test tasks, determining the required resources of at least one of the containers associated with each of the test tasks; Allocating the required resources to each of the containers to obtain multiple containers after resource allocation; The running the test script to obtain a performance test result for the software to be tested includes: In each of the containers after resource allocation, executing the sub-test scripts corresponding to each of the test tasks and monitoring in real time the performance test data corresponding to each of the test tasks; Based on the performance test data corresponding to each of the test tasks monitored in real time, obtaining a performance test result for the software to be tested.
3. The method according to claim 2, wherein The method further includes: Based on the performance test data corresponding to each of the test tasks monitored in real time and a preset container adjustment rule, dynamically adjusting the number of containers associated with each of the test tasks.
4. The method according to claim 3, characterized in that, The dynamically adjusting the number of containers associated with each of the test tasks based on the performance test data corresponding to each of the test tasks monitored in real time and a preset container adjustment rule includes: Based on the performance test data corresponding to each of the test tasks monitored in real time, determining in real time the resource utilization rate of each of the at least one container associated with each of the test tasks; In the case where it is determined that the resource utilization rate of each of the at least one container is greater than a first preset resource utilization rate threshold and less than a second preset resource utilization rate threshold, creating a new container, and the new container is used to execute some of the sub-test scripts in the sub-test scripts corresponding to the at least one container; In the case where it is determined that among the at least one container, the resource utilization rate of any one container is less than a third preset resource utilization rate threshold, allocating the sub-test script running in the any one container to other containers other than the any one container among the at least one container for execution, and deleting the any one container; the third preset resource utilization rate threshold is less than the first preset resource utilization rate threshold.
5. The method according to claim 2, wherein The method further includes: For each of the test tasks, obtaining the historical resource utilization rate of at least one of the containers corresponding to the test task within a preset time period before the current moment; Analyze the utilization rate of the historical resources to obtain the trend of the utilization rate change of at least one of the containers; Dynamically adjust the number of containers associated with the test task based on the trend of the utilization rate change of the containers.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Construct a performance test data set based on the performance test data corresponding to each test task monitored in real time and the historical performance test data; Perform feature dimensionality reduction and denoising processing on the data in the performance test data set to obtain the low-dimensional feature vectors corresponding to the performance test data set; Input the low-dimensional feature vectors into a pre-trained performance prediction model to obtain the performance prediction results for the software to be tested; Generate a performance optimization strategy for the software to be tested based on the performance prediction results.
7. A software performance testing device, characterized in that, The device includes: A determination module, configured to determine a performance test target for the software to be tested in response to a test instruction for the software to be tested; the test instruction includes the performance test target; A recommendation module, configured to input the performance test target into a pre-trained test configuration recommendation model to obtain a test configuration set corresponding to the performance test target; the test configuration recommendation model is trained based on the historical test configuration parameters corresponding to the object associated with the test instruction and the historical test targets corresponding to the historical test configuration parameters; A determination and generation module, further configured to determine at least one test task based on the performance test target, and generate a test script based on the test configuration set and at least one of the test tasks; A processing module, configured to run the test script to obtain the performance test results for the software to be tested.
8. A computer device, characterized in that, It includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 6 are implemented.