Pressure test method, device, equipment, medium and program product
By establishing a neural network model based on sample data, the maximum pressure generation of the load machine is automatically tested, which solves the problems of low efficiency and low accuracy of traditional tests, and realizes efficient and accurate pressure generation testing.
Patent Information
- Application Number
- CN202210610774.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-31
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2042-05-31
AI Technical Summary
In traditional performance tests, the maximum pressure generation test of the loader is inefficient and the results of manual estimation are inaccurate, resulting in the inability to maximize the capacity of the loader.
By obtaining the sample data of multiple test scripts of different complexity under different processor parameters configurations, a data set is generated, and a neural network model is established based on this data set, and training is performed to obtain the pressure generation test model. Enter the parameters of the load machine to be tested into this model and automatically test the maximum pressure generation of the load machine.
The maximum pressure generation of the automated test load machine is realized, which avoids the tedious work of manual estimation and the risk of misoperation, and improves the testing efficiency and accuracy.
Smart Images

Figure CN114936159B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software testing, and in particular to a pressure testing method, device, equipment, medium and program product. Background Art
[0002] In traditional performance testing, when relevant technical personnel perform stress testing on the target server (it should be noted that stress testing is an important means of software quality assurance), they are often not clear about the maximum stress capacity of the load machine that can be used. On the one hand, manual estimation is required to determine the maximum stress that the load machine can exert; on the other hand, the manual estimation process is cumbersome and the estimation results are not necessarily accurate, and the capacity of the load machine cannot be maximized, resulting in inefficient stress testing of the load machine.
[0003] Application Contents
[0004] In view of the above-mentioned shortcomings of the prior art, the present application provides a pressure test method, device, equipment, medium and program product to solve the problem of low efficiency of the pressure test of the load machine in the above-mentioned pressure test.
[0005] In a first aspect, the present application provides a pressure test method, comprising:
[0006] Obtaining sample data obtained by running multiple test scripts of different complexity under different processor parameter configuration conditions on the load machine, and generating a data set according to the sample data; the complexity of the test script is determined by the size of the components in the test script or / and the size of the test script, and the processor parameters are determined according to the hardware configuration of the load machine;
[0007] A neural network model is established based on the sample data of the data set, and training is performed to obtain a pressure test model;
[0008] Input the parameters of the load machine to be tested into the stress test model to obtain the stress of the load machine and complete the stress test, wherein the parameters of the load machine to be tested include the processor parameters of the load machine to be tested and the complexity of the test script.
[0009] In one embodiment of the present application, the complexity of the test script is determined by the size of the components in the test script, including:
[0010] Determine the data size of the components in the test script;
[0011] Calculating the ratio of the data amount of each component to obtain a first ratio of each component;
[0012] Compare the first ratio with a preset threshold;
[0013] If the first ratio is less than a preset threshold, the weight coefficient of the component is determined to be a first weight; or, if the first ratio is not less than a preset threshold, the weight coefficient of the component is determined to be a second weight;
[0014] The weight coefficients of the components in the test script are accumulated to determine the first complexity of the components in the test script.
[0015] In one embodiment of the present application, the complexity of the test script is determined by the size of the test script, including:
[0016] Determine the data volume of the test script;
[0017] Performing a ratio calculation on the data volume of the test script to obtain a second ratio of the test script;
[0018] Compare the second ratio with a preset threshold;
[0019] If the second ratio is less than the preset threshold, the weight coefficient of the test script is determined to be the first weight, and the first weight is determined as the second complexity of the test script; or, if the second ratio is not less than the preset threshold, the weight coefficient of the test script is determined to be the second weight, and the second weight is determined as the second complexity of the test script.
[0020] In one embodiment of the present application, the complexity of the test script is determined by the size of the components in the test script and the size of the test script, including:
[0021] Determine the data size of the components in the test script;
[0022] Calculating the ratio of the data amount of each component to obtain a first ratio of each component;
[0023] Compare the first ratio with a preset threshold;
[0024] If the first ratio is less than a preset threshold, the weight coefficient of the component is determined to be a first weight; or, if the first ratio is not less than a preset threshold, the weight coefficient of the component is determined to be a second weight;
[0025] Accumulating the weight coefficients of the components in the test script to determine the first complexity of the components in the test script; and,
[0026] Determine the data volume of the test script;
[0027] Performing a ratio calculation on the data volume of the test script to obtain a second ratio of the test script;
[0028] Compare the second ratio with a preset threshold;
[0029] If the second ratio is less than a preset threshold, the weight coefficient of the test script is determined to be the first weight, and the first weight is determined as the second complexity of the test script; or, if the second ratio is not less than the preset threshold, the weight coefficient of the test script is determined to be the second weight, and the second weight is determined as the second complexity of the test script;
[0030] The first complexity and the second complexity are weightedly integrated to obtain a final complexity of the test script.
[0031] In one embodiment of the present application, before the neural network model is established based on the sample data of the data set and the pressure test model is obtained through training, the method further includes:
[0032] Using a principal component analysis method to filter out the correlation of the processor parameters, and obtain the processor parameters after the first preprocessing, wherein the processor parameters at least include a main frequency, an external frequency, a bus frequency, a cache, and a core number;
[0033] The processor parameters after the first preprocessing are normalized to obtain the processor parameters after the second preprocessing.
[0034] In one embodiment of the present application, the neural network model is established based on the sample data of the data set, and the training is performed to obtain the pressure test model, including:
[0035] The data set is divided into a training set and a validation set according to a k-fold cross-validation method;
[0036] Using the training set to train the neural network model to obtain an initial pressure test model;
[0037] The verification set is used to verify the fitting accuracy of the initial pressure emission test model, and the final pressure emission test model is determined according to the verification result.
[0038] In one embodiment of the present application, the method of determining the final pressure test model according to the verification result further includes:
[0039] When there are multiple neural network models, multiple trained neural network models are obtained according to the test results;
[0040] A stacked model is constructed by using the plurality of trained neural network models as a first layer model and a regression model as a second layer model;
[0041] dividing the training set into a plurality of folds;
[0042] Selecting one fold as validation data, and using the remaining folds to train the first layer model to obtain a plurality of corresponding pressure amount prediction models;
[0043] Using a plurality of corresponding pressure emission prediction models to calculate the verification data respectively to obtain a plurality of pressure emission prediction values;
[0044] Repeat the steps of training the first layer model and calculating the pressure prediction value until all folds are used as verification data;
[0045] The second layer model is trained using each of the pressure emission prediction values and the actual pressure emission data in the verification data corresponding to each of the pressure emission prediction values to obtain the pressure emission test model.
[0046] In a second aspect, the present application provides a pressure test device, comprising:
[0047] A data acquisition module is used to acquire sample data obtained by the load machine running multiple test scripts of different complexity under different processor parameter configuration conditions, and generate a data set according to the sample data; the complexity of the test script is determined by the size of the components in the test script and / or the size of the test script, and the processor parameters are determined according to the hardware configuration of the load machine;
[0048] A model building module, which builds a neural network model based on the sample data of the data set and performs training to obtain a pressure test model;
[0049] The pressure test module is used to input the parameters of the load machine to be tested into the pressure test model to obtain the pressure of the load machine and complete the pressure test, wherein the parameters of the load machine to be tested include the processor parameters of the load machine to be tested and the complexity of the test script.
[0050] In a third aspect, the present application provides an electronic device, including:
[0051] one or more processors;
[0052] The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the electronic device implements the above-mentioned pressure measurement test method.
[0053] In a fourth aspect, the present application provides a computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor of a computer, enables the computer to execute the above-mentioned pressure emission test method.
[0054] In a fifth aspect, the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The computer processor reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer executes the above-mentioned pressure release test method.
[0055] Beneficial effects of the present application: The present application determines the complexity of each test script and the processor parameters of the load machine that runs the test script, constructs a data set according to the processor parameters and the complexity of the test script to train a neural network model, and determines a pressure test model that can directly test the maximum pressure of the load machine. The pressure test model can automatically test the maximum pressure of the load machine, avoiding the tedious workload of manually estimating the pressure and the risk of misoperation, which not only improves the test efficiency of the load machine pressure, but also improves the pressure test accuracy.
[0056] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0058] Figure 1 is a schematic diagram of an implementation environment of a pressure test method shown in an exemplary embodiment of the present application;
[0059] Figure 2 is a flow chart of a pressure test method shown in an exemplary embodiment of the present application;
[0060] Figure 3 is a flow chart showing the complexity of a test script according to an exemplary embodiment of the present application;
[0061] Figure 4 is another flow chart of determining the complexity of a test script according to an exemplary embodiment of the present application;
[0062] Figure 5 is another flow chart of determining the complexity of a test script according to an exemplary embodiment of the present application;
[0063] Figure 6 yes Figure 2 Step S230 in the illustrated embodiment is a flow chart in an exemplary embodiment;
[0064] Figure 7 yes Figure 5 A complete flow chart of determining the complexity of a test script as shown in an exemplary embodiment;
[0065] Figure 8 is a schematic diagram of a pressure test model training shown in an exemplary embodiment of the present application;
[0066] Fig. 9 is a structural block diagram of a pressure test device shown in an exemplary embodiment of the present application;
[0067] Fig.10 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0068] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.
[0069] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0070] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.
[0071] See also Figure 1 , is a schematic diagram of an application environment for implementing a pressure test method provided in an embodiment of the present application. Figure 1 As shown, the implementation environment application network architecture may include a server 101 (server cluster) and a user terminal cluster. The user terminal cluster may include one or more user terminals, and the number of user terminals is not limited here. Figure 1As shown, it may specifically include user terminal 100a, user terminal 100b, user terminal 100c, ..., user terminal 100n. Figure 1 As shown, user terminal 100a, user terminal 100b, user terminal 100c, ..., user terminal 100n can be respectively connected to the server 10 through a network, so that each user terminal can exchange data with the server 10 through the network connection. The specific connection method of the network connection is not limited here, for example, it can be directly or indirectly connected through a wired communication method, or it can be directly or indirectly connected through a wireless communication method.
[0072] Each user terminal in the user terminal cluster may include: a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a car terminal, a smart TV, and other smart terminals with image data processing functions. Figure 1 Each user terminal in the user terminal cluster shown in FIG. 1 may be installed with a target application (i.e., an application client). When the application client runs in each user terminal, it may be respectively connected to the above-mentioned Figure 1 The server 101 shown in the figure performs data interaction. The application client may include a social client, a multimedia client (e.g., a video client), an entertainment client (e.g., a game client), an education client, a live broadcast client, and other application clients. The application client may be an independent client or a small program integrated in a client (e.g., a social client, an education client, a multimedia client, etc.), which is not limited here.
[0073] like Figure 1 As shown, the server 101 in the embodiment of the present application can be the server corresponding to the application client. The server 101 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0074] For ease of understanding, the embodiments of the present application can be Figure 1 Select one user terminal from the multiple user terminals shown as the target user terminal. For example, the embodiment of the present application can Figure 1 The user terminal 100a shown is used as the target user terminal, and the target user terminal may be integrated with the target application (i.e., application client). At this time, the target user terminal may implement data interaction with the server 101 through the business data platform corresponding to the application client. The above-mentioned pressure test method may be performed in any device such as a server, a terminal, a server cluster, or a cloud computing service cluster.
[0075] This application helps relevant technical personnel to have a clearer judgment on the performance of the CPU of the load machine used during performance testing, so that relevant technical personnel can maximize the use of the load machine resources in their hands for performance testing.
[0076] See also Figure 2 , is a flow chart of a pressure test method shown in an exemplary embodiment of the present application, which is described in detail as follows:
[0077] Step S210, obtaining sample data obtained by running a plurality of test scripts of different complexity under different processor parameter configuration conditions on the load machine, and generating a data set according to the sample data; the complexity of the test script is determined by the size of the components in the test script and / or the size of the test script, and the processor parameters are determined according to the hardware configuration of the load machine;
[0078] Specifically, the data set can be obtained through manual annotation, wherein the data set includes sample data obtained when a load machine runs test scripts of different complexities under different processor parameter configuration conditions, and there is at least one load machine, for example, sample data obtained when a load machine runs multiple test scripts of different complexities under a first processor parameter condition, and sample data obtained when a load machine runs multiple test scripts of different complexities under an Nth processor parameter condition, where N is a positive integer, wherein the sample data includes the processor parameters of the load machine, the complexity of the test script, and the current maximum pressure amount obtained.
[0079] It should be noted that the processor parameters include at least the main frequency, external frequency, bus frequency, cache and number of cores. The richer the sample data in the data set, the more accurate the test data obtained when the stress test model trained with the sample data is tested.
[0080] Step S220, establishing a neural network model based on the sample data of the data set, and performing training to obtain a pressure test model;
[0081] Specifically, neural networks are divided into feedforward neural networks and feedback neural networks. Here, the neural network model can be a convolutional neural network (CNN). The convolutional neural network is a type of feedforward neural network that includes convolution operations, usually composed of convolution layers, pooling layers, fully connected layers, activation layers, etc., and can be used for feature extraction of high-dimensional data such as images and data sets.
[0082] In deep learning, for various reasons (such as the data set is too small, training from scratch is too time-consuming or difficult to converge, etc.), the network can be pre-trained before training on a specific data set for a specific task. The network is then fine-tuned on the data set of the specific task. Usually, pre-training is performed on a larger data set, and the training task can be the same as or different from the subsequent specific task. The trained network parameters can be used as initialization parameters for subsequent training, so as to obtain better feature extraction or faster convergence speed in the fine-tuning stage, and improve network performance.
[0083] Step S230, inputting the parameters of the load machine to be tested into the stress test model to obtain the stress of the load machine and complete the stress test, wherein the parameters of the load machine to be tested include the processor parameters of the load machine to be tested and the complexity of the test script.
[0084] In this embodiment, by determining the complexity of each test script and the processor parameters of the load machine that runs the test script, a data set is constructed according to the processor parameters and the complexity of the test script to train a neural network model, and a pressure test model that can directly test the maximum pressure of the load machine is determined. The pressure test model can be used to automatically test the maximum pressure of the load machine, avoiding the tedious workload of manually estimating the pressure and the risk of misoperation, which not only improves the test efficiency of the load machine pressure, but also improves the pressure test accuracy.
[0085] See also Figure 3 , is a flow chart showing a method of determining the complexity of a test script according to an exemplary embodiment of the present application, wherein the complexity of the test script is determined by the size of components in the test script, including:
[0086] Step S310, determining the data volume of the components in the test script;
[0087] Specifically, the component name and the unique identification number of the component in the test script are used for identification to determine the number of components. In addition, the size of the component data packet is used to determine the size of the component data volume.
[0088] Step S320, calculating the ratio of the data volume of each component to obtain a first ratio of each component;
[0089] Specifically, the first ratio of each component is obtained by dividing the data size of each component by a preset data size (for example, 1 KB) to perform a ratio calculation.
[0090] Step S330, comparing the first ratio with a preset threshold;
[0091] Specifically, for example, the preset threshold can be set adaptively according to the needs and the scenario. For example, the preset threshold in the present application can be 1.
[0092] Step S340: if the first ratio is less than a preset threshold, the weight coefficient of the component is determined to be a first weight; or, if the first ratio is not less than a preset threshold, the weight coefficient of the component is determined to be a second weight;
[0093] Specifically, if the first ratio is less than 1, the weight coefficient of the component is determined to be the first weight (for example, 1); if the first ratio is not less than 1, the weight coefficient of the component is determined to be the second weight, that is, calculated by the function formula 2x / (1+x), where x is a positive integer.
[0094] Step S350, accumulating the weight coefficients of the components in the test script to determine the first complexity of the components in the test script.
[0095] Specifically, the first complexity of the components in the test script is determined by cumulative summation.
[0096] Through the above method, the first complexity of each component in the test script after accumulation can be accurately obtained, avoiding the influence of large complexity fluctuations between components caused by data packet size, and truly reflecting the complexity of the components in the test script.
[0097] See also Figure 4 , is another flow chart of determining the complexity of a test script according to an exemplary embodiment of the present application, wherein the complexity of the test script is determined by the size of the test script, including:
[0098] Step S410, determining the data volume of the test script;
[0099] Specifically, the test script is identified by its name and unique identification number to determine the number of test scripts. In addition, the data volume of the test script is determined by the data packet size of the test script.
[0100] Step S420, performing ratio calculation on the data volume of the test script to obtain a second ratio of the test script;
[0101] Specifically, the second ratio of each component is obtained by dividing the data volume of each test script by a preset data volume (eg, 1 KB, Kilobyte, a unit of measurement) to perform a ratio calculation.
[0102] Step S430, comparing the second ratio with a preset threshold;
[0103] Specifically, for example, the preset threshold can be set adaptively according to the needs and the scenario. For example, the preset threshold in the present application can be 1.
[0104] Step S440, if the second ratio is less than a preset threshold, the weight coefficient of the test script is determined to be the first weight, and the first weight is determined as the second complexity of the test script; or, if the second ratio is not less than the preset threshold, the weight coefficient of the test script is determined to be the second weight (i.e., calculated by the function formula 2x / (1+x), where x is a positive integer), and the second weight is determined to be the second complexity of the test script.
[0105] Specifically, the complexity of each test script can be accurately quantified.
[0106] Through the above method, the second complexity of the test script can be accurately obtained, avoiding the influence of large complexity fluctuations between test scripts caused by data packet sizes, and can truly reflect the complexity of the test script.
[0107] See also Figure 5 , is another flow chart of determining the complexity of a test script according to an exemplary embodiment of the present application, wherein the complexity of the test script is determined by the size of the components in the test script and the size of the test script, and further includes:
[0108] Step S510, determining a first complexity of a component in the test script and a second complexity of the test script;
[0109] Specifically, in combination with the above Figure 3 The first complexity determination process and Figure 4 The second complexity determination process performs calculations.
[0110] Step S520, performing weighted fusion on the first complexity and the second complexity to obtain a final complexity of the test script.
[0111] Specifically, see Figure 7 , which is a complete flow chart for determining the complexity of a test script shown in an exemplary embodiment of the present application, and the final complexity of the test script can be determined by weighted summation.
[0112] Through the above method, the final complexity of the test script is determined based on the components of the test script and the test script itself, which greatly improves the accuracy of the complexity of the test script.
[0113] In another exemplary embodiment, before the neural network model is established based on the sample data of the data set and the training is performed to obtain the pressure test model, the method further includes:
[0114] Using a principal component analysis method to filter out the correlation of the processor parameters, and obtain the processor parameters after the first preprocessing, wherein the processor parameters at least include a main frequency, an external frequency, a bus frequency, a cache, and a core number;
[0115] Specifically, by filtering out the correlation of processor parameters, that is, when a certain parameter is determined to be erroneous, other associated parameters are detected based on the correlation to determine whether they are erroneous, thereby implementing correlation filtering and improving data authenticity and validity.
[0116] The processor parameters after the first preprocessing are normalized to obtain the processor parameters after the second preprocessing.
[0117] Specifically, by normalizing the parameters of each processor, fluctuations in the data range caused by parameters of different data types are avoided.
[0118] See also Figure 6 ,yes Figure 2 Step S230 in the illustrated embodiment is a flowchart in an exemplary embodiment, wherein the step of establishing a neural network model based on the sample data of the data set and training to obtain a pressure test model includes:
[0119] Step S610, dividing the data set into a training set and a validation set;
[0120] Specifically, the k-fold cross-validation method is used to divide the data set into a training set and a validation set.
[0121] Step S620, training the neural network model using the training set to obtain an initial pressure test model;
[0122] Step S630, using the verification set to verify the initial compression test model fitting accuracy, and determining the final compression test model according to the verification result.
[0123] In this embodiment, the method of determining the final pressure test model according to the verification result further includes:
[0124] When there are multiple neural network models, multiple trained neural network models are obtained according to the test results;
[0125] A stacked model is constructed by using the plurality of trained neural network models as a first layer model and a regression model as a second layer model;
[0126] dividing the training set into a plurality of folds;
[0127] Selecting one fold as validation data, and using the remaining folds to train the first layer model to obtain a plurality of corresponding pressure amount prediction models;
[0128] Using a plurality of corresponding pressure emission prediction models to calculate the verification data respectively to obtain a plurality of pressure emission prediction values;
[0129] Repeat the steps of training the first layer model and calculating the pressure prediction value until all folds are used as verification data;
[0130] The second layer model is trained using each of the pressure emission prediction values and the actual pressure emission data in the verification data corresponding to each of the pressure emission prediction values to obtain the pressure emission test model.
[0131] Through the above method, the trained pressure test model can be quickly obtained, which is convenient for the subsequent maximum pressure test of the load machine to be effectively performed.
[0132] See also Figure 7 , is a complete flow chart of a pressure test method shown in an exemplary embodiment of the present application, which is described in detail as follows:
[0133] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of a pressure test method according to an exemplary embodiment of the present invention. The method can be applied to Figure 1 It should be understood that the method can also be applied to other exemplary implementation environments and be specifically executed by devices in other implementation environments, and this embodiment does not limit the implementation environment to which the method is applicable.
[0134] In this embodiment, the pressure test method is described as follows:
[0135] First, calculate the complexity of the test script. For example, in the performance test, determine the size of each component in each test script to assign a weight to each component. Specifically, divide the component data packet size by 1KB, and the ratio obtained is used as the first ratio for calculating the weight. If the first ratio is less than 1, the weight is reset to 1; otherwise, if the first ratio is not less than 1, the first ratio is input into the function 2x / (1+x) to determine the weight coefficient of the current component, where x is a positive integer. In this way, the large size differences of each component are overcome, and the large fluctuations between the weight coefficients caused by the large size differences of each component are avoided. According to the above method, all the components used in all the scripts to be tested are added together to form the total size of the component weight (for example, the weights of all components are accumulated and placed in the range of 1-100), that is, the first complexity of the test script is determined.
[0136] Secondly, the total size of the script is also considered as a factor here, because some components will be modified to a large extent during the script writing process. In order to consider this situation, the total size of the script needs to be taken into account in the calculation of the weight. The calculation method is the same as the component weight calculation method, as follows:
[0137] For example, determine the weight corresponding to each test script. Specifically, divide the data packet size of the test script by 1KB, and use the ratio obtained as the second ratio for calculating the weight. If the second ratio is less than 1, the weight coefficient is set to 1; otherwise, if the second ratio is not less than 1, input the second ratio into the function 2x / (1+x) to determine the weight coefficient of the current test script, where x is a positive integer. In this way, the large size differences of the test scripts are overcome, and the large fluctuations in the weight coefficients caused by the large size differences of the test scripts are avoided. According to the above method, all the test scripts used in all the scripts to be tested are added together to form the total size of the test script weight, that is, the second complexity of the test script is determined.
[0138] After calculating the first complexity of the component and the second complexity of the test script, the influence of the two weights is considered, so the two complexities are weightedly fused respectively, and the fusion coefficient is 0.5, that is, the sum of the first complexity multiplied by 0.5 and the second complexity multiplied by 0.5. In this way, the final complexity of the test script is calculated.
[0139] After the complexity of the test script is determined, the stress test model is initialized. Figure 8 , the pressure test model is a two-layer neural network model. Figure 8As described, the complexity of the test script, main frequency, external frequency, bus frequency, cache, and core number are the inputs of the double-layer neural network model. Therefore, the input layer of the neural network model is set to six nodes. The neural network model contains two hidden layers, and the number of nodes in the two hidden layers is consistent, both of which are 6 nodes. At the same time, the output of the neural network model is 9 nodes, that is, the output of the neural network model is 9-bit binary numbers, which is converted to a decimal range of 0-1024. Therefore, the output range of the maximum load capacity of the CPU is 0-1024. After determining the structure of the neural network model, the next step is to initialize the training of the neural network model, that is, to prepare multiple input and output data to train the model. Since each parameter in the CPU (central processing unit, referred to as CPU) parameter may have a certain correlation, PCA (Principal Component Analysis, PCA) is performed on the second to sixth parameters of the neural network model input to eliminate the correlation of these data. Then, in order to consider the large fluctuation of the data range caused by different data types, the 6 nodes input to the neural network model are normalized. After completing the above steps, the neural network model can be trained. Since the output nodes are more than the input nodes, k-fold cross validation is used to train the neural network model. Here, 10 is taken as the value of k. Then, when the neural network model converges, the neural network model can be used as a stress test model to calculate the maximum stress of the load machine CPU.
[0140] After the stress test model is trained, it can be used to test the maximum stress of the load machine. First, call an automation tool based on Python (i.e., computer programming language) programming language, and use the wmi (Windows Management Instrumentation, Windows Management Specification, i.e., system plug-in) library in the automation tool to write a script to read the relevant data (processor parameters) of the hardware configuration of the CPU carried by the load machine that the tool needs to use; then, use the processing parameters read by the automation tool and the complexity of the test script in the performance test currently used to normalize, and then input it into the trained stress test model. The stress test model obtains the maximum stress that the CPU can bear based on the input fir tree data. In addition, the automation tool can also show the processor parameter data of the main frequency, external frequency, bus frequency, cache, number of cores of the CPU of the load machine and the calculated maximum stress to the user of the tool.
[0141] Fig. 9is a structural block diagram of a pressure test device shown in an exemplary embodiment of the present application. The device can be applied to Figure 1 The device can also be applied to other exemplary implementation environments and be specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applied.
[0142] like Fig. 9 As shown, the exemplary pressure test device includes:
[0143] The data acquisition module 901 is used to acquire sample data obtained by the load machine running multiple test scripts of different complexity under different processor parameter configuration conditions, and generate a data set according to the sample data; the complexity of the test script is determined by the size of the components in the test script and / or the size of the test script, and the processor parameters are determined according to the hardware configuration of the load machine;
[0144] A model building module 902 is used to build a neural network model based on the sample data of the data set, and to train the model to obtain a pressure test model;
[0145] The pressure test module 903 is used to input the parameters of the load machine to be tested into the pressure test model to obtain the pressure of the load machine and complete the pressure test, wherein the parameters of the load machine to be tested include the processor parameters of the load machine to be tested and the complexity of the test script.
[0146] In this exemplary pressure test device, by determining the complexity of each test script and the processor parameters of the load machine that runs the test script, a data set is constructed according to the processor parameters and the complexity of the test script to train a neural network model, and a pressure test model that can directly test the maximum pressure of the load machine is determined. The pressure test model can be used to automatically test the maximum pressure of the load machine, avoiding the tedious workload of manually estimating the pressure and the risk of misoperation, which not only improves the test efficiency of the load machine pressure, but also improves the pressure test accuracy.
[0147] It should be noted that the pressure test device provided in the above embodiment and the pressure test method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the pressure test device provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0148] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the pressure measurement test method provided in the above-mentioned embodiments.
[0149] Fig.10 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Fig.10 The computer system 1000 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0150] like Fig.10 As shown, the computer system 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1002 or the program loaded from the storage part 1008 to the random access memory (RAM) 1003, such as executing the method described in the above embodiment. In RAM 1003, various programs and data required for system operation are also stored. CPU 1001, ROM 1002 and RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0151] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0152] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1009, and / or installed from a removable medium 1011. When the computer program is executed by a central processing unit (CPU) 1001, various functions defined in the system of the present application are executed.
[0153] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0154] The flowchart and block diagram in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0155] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0156] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the pressure-generating amount testing method as described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0157] Another aspect of the present application also provides a computer program product, which includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the pressure test method provided in each of the above embodiments.
[0158] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A pressure test method, characterized in that: include: Obtaining sample data obtained by running a plurality of test scripts of different complexity under different processor parameter configuration conditions on the load machine, and generating a data set according to the sample data; The complexity of the test script is determined by the size of the components in the test script and / or the size of the test script, and the processor parameters are determined according to the hardware configuration of the load machine; A neural network model is established based on the sample data of the data set, and training is performed to obtain a pressure test model; wherein the input layer of the neural network model is set to six nodes, which are respectively the complexity of the test script, the main frequency, the external frequency, the bus frequency, the cache and the number of cores, and the neural network model contains two hidden layers, and the number of nodes of the two hidden layers is consistent with six nodes, and the output of the neural network model is nine nodes; the neural network model is initialized, and the correlation between the main frequency, the external frequency, the bus frequency, the cache and the number of cores is first filtered out by the principal component analysis method to improve the accuracy of the data, and then the six nodes input to the neural network model are normalized, and then the neural network model is trained by using k-fold cross validation until the pressure test model is obtained after convergence; The parameters of the load machine to be tested are input into the stress test model to obtain the stress of the load machine and complete the stress test, wherein the parameters of the load machine to be tested include the processor parameters of the load machine to be tested and the complexity of the test script, and the stress is the maximum pressure that can be generated by the load machine to be tested under the current configuration conditions.
2. The method according to claim 1, characterized in that The complexity of the test script is determined by the size of the components within the test script, including: Determine the data size of the components in the test script; Calculate the ratio of the data volume of each component divided by the preset data volume to obtain a first ratio of each component; Compare the first ratio with a preset threshold; If the first ratio is less than a preset threshold, the weight coefficient of the component is determined to be a first weight; or, if the first ratio is not less than a preset threshold, the weight coefficient of the component is determined to be a second weight; The weight coefficients of the components in the test script are accumulated to determine the first complexity of the components in the test script.
3. The method according to claim 1, characterized in that: The complexity of the test script is determined by the size of the test script, including: Determine the data volume of the test script; Calculate the ratio of the data volume of the test script divided by the preset data volume to obtain a second ratio of the test script; Compare the second ratio with a preset threshold; If the second ratio is less than the preset threshold, the weight coefficient of the test script is determined to be the first weight, and the first weight is determined as the second complexity of the test script; or, if the second ratio is not less than the preset threshold, the weight coefficient of the test script is determined to be the second weight, and the second weight is determined as the second complexity of the test script.
4. The method according to claim 1, characterized in that The complexity of the test script is determined by the size of the components in the test script and the size of the test script, including: Determine the data size of the components in the test script; Calculate the ratio of the data volume of each component divided by the preset data volume to obtain a first ratio of each component; Compare the first ratio with a preset threshold; If the first ratio is less than a preset threshold, the weight coefficient of the component is determined to be a first weight; or, if the first ratio is not less than a preset threshold, the weight coefficient of the component is determined to be a second weight; Accumulating the weight coefficients of the components in the test script to determine the first complexity of the components in the test script; and, Determine the data volume of the test script; Calculate the ratio of the data volume of the test script divided by the preset data volume to obtain a second ratio of the test script; Compare the second ratio with a preset threshold; If the second ratio is less than a preset threshold, the weight coefficient of the test script is determined to be the first weight, and the first weight is determined as the second complexity of the test script; or, if the second ratio is not less than the preset threshold, the weight coefficient of the test script is determined to be the second weight, and the second weight is determined as the second complexity of the test script; The first complexity and the second complexity are weightedly integrated to obtain the final complexity of the test script.
5. The method according to any one of claims 1 to 4, characterized in that: Before establishing a neural network model based on the sample data of the data set, the method further includes: Filtering the correlation of the processor parameters to obtain the processor parameters after the first preprocessing, wherein the processor parameters at least include main frequency, external frequency, bus frequency, cache and core number; The processor parameters after the first preprocessing are normalized to obtain the processor parameters after the second preprocessing.
6. The method according to any one of claims 1 to 4, characterized in that: The step of establishing a neural network model based on the sample data of the data set and training the model to obtain a pressure test model includes: Dividing the data set into a training set and a validation set; Using the training set to train the neural network model to obtain an initial pressure test model; The verification set is used to verify the fitting accuracy of the initial pressure emission test model, and the final pressure emission test model is determined according to the verification result.
7. The method according to claim 6, characterized in that The method of determining the final pressure test model according to the verification result further includes: When there are multiple neural network models, multiple trained neural network models are obtained according to the test results; A stacked model is constructed by using the plurality of trained neural network models as a first layer model and a regression model as a second layer model; dividing the training set into a plurality of folds; Selecting one fold as validation data, and using the remaining folds to train the first layer model to obtain a plurality of corresponding pressure amount prediction models; Using a plurality of corresponding pressure emission prediction models to calculate the verification data respectively to obtain a plurality of pressure emission prediction values; Repeat the steps of training the first layer model and calculating the pressure prediction value until all folds are used as verification data; The second layer model is trained using each of the pressure emission prediction values and the actual pressure emission data in the verification data corresponding to each of the pressure emission prediction values to obtain the pressure emission test model.
8. A pressure test device, characterized in that: The device comprises: A data acquisition module is used to acquire sample data obtained by the load machine running multiple test scripts of different complexity under different processor parameter configuration conditions, and generate a data set according to the sample data; the complexity of the test script is determined by the size of the components in the test script and / or the size of the test script, and the processor parameters are determined according to the hardware configuration of the load machine; A model building module, which establishes a neural network model based on the sample data of the data set, and performs training to obtain a pressure test model; wherein the input layer of the neural network model is set to six nodes, which are respectively the complexity of the test script, the main frequency, the external frequency, the bus frequency, the cache and the number of cores, and the neural network model contains two hidden layers, and the number of nodes of the two hidden layers is consistent with six nodes, and the output of the neural network model is nine nodes; initialize the neural network model, first use the principal component analysis method to filter out the correlation between the main frequency, the external frequency, the bus frequency, the cache and the number of cores to improve the accuracy of the data, and then normalize the six nodes input to the neural network model, and then use k-fold cross validation to train the neural network model until the pressure test model is obtained after convergence; The pressure test module is used to input the parameters of the load machine to be tested into the pressure test model to obtain the pressure of the load machine and complete the pressure test, wherein the parameters of the load machine to be tested include the processor parameters of the load machine to be tested and the complexity of the test script, and the pressure is the maximum pressure that can be generated by the load machine to be tested under the current configuration conditions.
9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the method described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer executes the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Asynchronous concurrent mechanism based pressure test system and test method
CN105446860A
Performance capacity test method, device and apparatus for big data system and storage medium
CN110377519A