Equipment test method and device, test control equipment, test system and medium

By determining the number of test processes based on the number of processor cores of the test device and setting a reasonable memory occupancy value, the problem of unreasonable memory allocation of test control devices is solved, and the reliability and stability of virtual machine testing is achieved.

CN119718959APending Publication Date: 2025-03-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411998099.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, the memory allocation of the test control device is unreasonable, which can easily lead to waste or insufficient memory space, which will lead to test failure.

Method used

By obtaining the number of processor cores of the test device, determine the number of test processes to be started, and determine the memory footprint based on the number of test processes and the memory consumption value of a single test process, and set a reasonable heap memory capacity value to reasonably use the memory of the test control device.

Benefits of technology

It effectively avoids wasted or insufficient memory space, improves the reliability and stability of the test, and ensures the successful completion of virtual machine tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718959A_ABST
    Figure CN119718959A_ABST
Patent Text Reader

Abstract

The invention provides an equipment test method and device, test control equipment, a test system and a medium, and relates to the field of virtual machine test.The method comprises the steps that the number of processor cores of test equipment is obtained, and the number of test processes needing to be started in the test equipment is determined according to the number of the processor cores; determining a memory occupancy value according to the number of the test processes and the memory consumption value corresponding to the single test process; wherein the memory consumption value is a measured value; setting a heap memory capacity value according to the memory occupancy value, and setting a heap memory space in a local memory according to the heap memory capacity value; starting the test process in the test equipment according to the test process number, controlling the test process to execute a preset pressure test script, and storing test data returned by the test equipment by using the heap memory space; the memory occupation value can be determined according to the number of the test processes needing to be started by the test equipment, and the heap memory capacity value can be set according to the memory occupation value, so that the memory of the test control equipment is reasonably used, and the test reliability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of virtual machine testing, and in particular to a device testing method, a device, a test control device, a test system and a medium. Background Art

[0002] In order to effectively test the performance of virtual machines, in the related art, the test control device usually uses the test tool to control the test device to execute a series of stress test items, and the test control device collects test data to determine the test results. However, in the related art, the test tool allocates memory to the test control device unreasonably, which easily leads to waste of memory space or insufficient memory space in the test control device; and when the memory space is insufficient, the test control device is prone to memory overflow, resulting in test failure. Summary of the invention

[0003] The purpose of the present invention is to provide a device testing method, apparatus, test control equipment, test system and medium, which can determine the memory occupancy value according to the number of test processes required to be started by the test equipment, and can set the heap memory capacity value according to the memory occupancy value, so as to reasonably use the memory of the test control equipment to improve the test reliability.

[0004] In order to solve the above technical problems, the present invention provides a device testing method, comprising:

[0005] Obtain the number of processor cores of the test device, and determine the number of test processes to be started in the test device according to the number of processor cores;

[0006] Determine the memory usage value according to the number of test processes and the memory consumption value corresponding to a single test process; wherein the memory consumption value is an actual measured value;

[0007] The heap memory capacity value is set according to the memory usage value, and the heap memory space is set in the local memory according to the heap memory capacity value;

[0008] Start the test process in the test device according to the number of test processes, control the test process to execute the preset stress test script, and use the heap memory space to save the test data returned by the test device.

[0009] Optionally, set the heap memory capacity value based on the memory usage value, including:

[0010] Get the total capacity and free capacity of the local memory, and determine the default value of the heap memory capacity based on the total capacity;

[0011] Determine whether the memory usage value is greater than the default value of the heap memory capacity;

[0012] If the memory usage value is not greater than the default value of the heap memory capacity, the memory usage value is set to the heap memory capacity value;

[0013] If the memory usage value is greater than the default value of the heap memory capacity, determine whether the memory usage value is greater than the free capacity value;

[0014] If the memory usage value is not greater than the free capacity value, the memory usage value is set to the heap memory capacity value;

[0015] If the memory usage value is greater than the free capacity value, the free capacity value is set to the heap memory capacity value.

[0016] Optionally, after determining that the memory usage value is greater than the free capacity value, the method further includes:

[0017] Set the preset memory overflow parameters to the activated state to use the heap memory space and the local hard disk space to save the test data.

[0018] Optionally, use the heap memory space and the local hard disk space to save test data, including:

[0019] In the process of controlling the test process to execute the preset stress test script, the memory usage value of the heap memory space is obtained in real time;

[0020] When it is determined that the memory usage value reaches the heap memory capacity value, the test data most recently sent by the test device is written into a designated file in the hard disk space.

[0021] Optionally, it also includes:

[0022] When it is determined that the test device has completed the execution of the stress test script, the test data in the heap memory space and the test data in the execution file are integrated to obtain the total test data;

[0023] Generate test results based on the total test data.

[0024] Optionally, obtain the number of processor cores of the test device, including:

[0025] Remotely log in to the test device through the network and read the number of processor cores from the test device.

[0026] Optionally, the process of determining the memory consumption value includes:

[0027] Set the experimental heap memory space in the local memory and set the number of processes to the initial value;

[0028] Start the test process in the test device according to the process number, control the test process to execute the preset stress test script, and control the test device to send the test data generated by the test process to the local machine;

[0029] Use the experimental heap memory space to save the test data, and obtain the garbage collection log generated by the local memory at the same time, and determine the garbage data size corresponding to the current number of processes based on the garbage collection log; wherein the garbage collection log contains the garbage data size corresponding to the local memory when performing a complete garbage collection operation;

[0030] Determine whether the number of processes reaches the preset upper limit;

[0031] If the number of processes does not reach the preset upper limit, the number of processes is increased, and the step of starting the test process in the test device according to the number of processes is entered;

[0032] If the number of processes reaches a preset upper limit, the memory consumption value corresponding to a single test process is determined based on the size of garbage data corresponding to each process number.

[0033] The present invention also provides a device testing apparatus, comprising:

[0034] A test process number determination module is used to obtain the number of processor cores of the test device and determine the number of test processes to be started in the test device according to the number of processor cores;

[0035] A memory occupancy value determination module is used to determine a memory occupancy value according to the number of test processes and a memory consumption value corresponding to a single test process; wherein the memory consumption value is an actual measured value;

[0036] A heap memory space setting module is used to set a heap memory capacity value according to a memory usage value, and to set a heap memory space in a local memory according to the heap memory capacity value;

[0037] The test module is used to start the test process in the test device according to the number of test processes, control the test process to execute the preset stress test script, and use the heap memory space to save the test data returned by the test device.

[0038] The present invention also provides a test control device, comprising:

[0039] Memory for storing computer programs;

[0040] The processor is used to implement the above-mentioned device testing method when executing a computer program.

[0041] The present invention also provides a testing system, comprising:

[0042] A test control device, used to execute the above device test method;

[0043] The test device is used to start the test process under the control of the test control device, execute the preset stress test script using the test process, and return the test data to the test control device.

[0044] The present invention also provides a non-volatile computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are loaded and executed by a processor, the above-mentioned device testing method is implemented.

[0045] The present invention provides a device testing method, comprising: obtaining the number of processor cores of a test device, and determining the number of test processes to be started in the test device according to the number of processor cores; determining a memory occupancy value according to the number of test processes and a memory consumption value corresponding to a single test process; wherein the memory consumption value is an actual measured value; setting a heap memory capacity value according to the memory occupancy value, and setting a heap memory space in a local memory according to the heap memory capacity value; starting a test process in the test device according to the number of test processes, controlling the test process to execute a preset stress test script, and using the heap memory space to save test data returned by the test device.

[0046] It can be seen that the present invention can first obtain the number of processor cores of the test device, and determine the number of test processes to be started in the test device according to the number of processor cores. Subsequently, the memory occupancy value can be determined according to the number of test processes and the memory consumption value corresponding to a single test process; wherein the memory consumption value is a measured value, that is, the present invention has pre-measured the memory occupancy value to be increased for each additional test process. Subsequently, the present invention can set the heap memory capacity value according to the memory occupancy value, and set the heap memory space in the local memory according to the heap memory capacity value, so that a reasonable heap memory space can be set. Furthermore, the test process can be started in the test device according to the number of test processes, the test process can be controlled to execute a preset stress test script, and the heap memory space can be used to save the test data returned by the test device, which can avoid the defects of memory space waste or insufficient memory space at the test control device, thereby not only ensuring the reasonable use of memory at the test control device, but also ensuring the reliability and stability of virtual machine testing. The present invention also provides a device testing device, a test control device, a test system and a medium, which have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0048] Figure 1 A flow chart of a device testing method provided by an embodiment of the present invention;

[0049] Figure 2A flowchart of another device testing method provided by an embodiment of the present invention;

[0050] Figure 3 A structural block diagram of a device testing apparatus provided by an embodiment of the present invention;

[0051] Figure 4 A structural block diagram of a test control device provided by an embodiment of the present invention;

[0052] Figure 5 A structural block diagram of a test system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] In order to effectively test the performance of virtual machines, in the related art, the test control device usually uses the test tool to control the test device to perform a series of stress test items, and the test control device collects test data to determine the test results. Common test tools are SPECpower and SPECjbb. However, in the related art, the test tool allocates a fixed size of memory space in the test control device by default. Such unreasonable memory allocation can easily lead to waste of memory space or insufficient memory space in the test control device; and when the memory space is insufficient, the test control device is prone to memory overflow, resulting in test failure.

[0055] In view of this, in order to solve the technical problem of how to more reliably allocate memory space in a test control device to improve the reliability of virtual machine testing, the present invention can provide a device testing method, which can determine the memory occupancy value according to the number of test processes required to be started by the test device, and can set the heap memory capacity value according to the memory occupancy value, so as to reasonably use the memory of the test control device to improve test reliability.

[0056] For easier understanding, please refer to Figure 1 , Figure 1 A flow chart of a device testing method provided by an embodiment of the present invention, the method may include:

[0057] S101. Obtain the number of processor cores of a test device, and determine the number of test processes to be started in the test device according to the number of processor cores.

[0058] In this step, the number of processor cores of the test device will be obtained first, and the number of test processes to be started in the test device will be determined based on the number of processor cores. This is because in virtual machine testing, it is usually necessary to allocate multiple test processes to the test device processor core, and each test process will occupy a piece of memory space in the test control device. As the number of processor cores of the test device increases, the memory space originally fixedly allocated by the test tool in the test control device will be difficult to meet the test requirements. Therefore, in this embodiment, the number of processor cores and the number of test processes of each test device will be obtained in advance to predetermine the size of the memory space required by the test device.

[0059] It should be noted that this embodiment does not limit the method for obtaining the number of processor cores, which can be manually input or directly obtained from the test device. In this embodiment, to ensure that the number of processor cores is accurate and reliable, the test device can be remotely logged in through the network and the number of processor cores can be read from the test device. For example, the test device can be logged in through SSH (Secure Shell) to obtain the number of processor cores.

[0060] Based on this, obtaining the number of processor cores of the test device can include:

[0061] Step 11: Remotely log in to the test device through the network and read the number of processor cores from the test device.

[0062] S102, determining a memory usage value according to the number of test processes and a memory consumption value corresponding to a single test process; wherein the memory consumption value is an actual measured value;

[0063] In this step, the memory occupancy value can be determined according to the number of test processes and the memory consumption value corresponding to a single test process. The memory consumption value is a measured value, that is, this embodiment can pre-test how much memory space will be occupied in the test control device when a test process is added to the test device. In this way, this embodiment can accurately determine how much memory space will be occupied in the test control device according to the number of test processes started in the test device.

[0064] It should be noted that the present embodiment does not limit the specific value of the memory consumption value, which can be set according to actual conditions, for example, 256M. The present embodiment also does not limit the specific process of determining the memory consumption value, which can be set according to actual application requirements.

[0065] S103: setting a heap memory capacity value according to the memory occupancy value, and setting a heap memory space in the local memory according to the heap memory capacity value.

[0066] In this step, the heap memory capacity value is determined based on the memory usage value obtained in the previous step to set a reasonable heap memory space. It should be pointed out that since the memory space occupied by the test device may be larger than the free capacity value currently available in the memory of the test control device, the numerical relationship between the memory usage value and the free capacity value needs to be considered when setting the heap memory capacity value. The following describes the specific process of setting the heap memory capacity value based on the memory usage value.

[0067] Based on this, the heap memory capacity value is set according to the memory usage value, which can include:

[0068] Step 21: Obtain the total capacity value and free capacity value of the local memory, and determine the default value of the heap memory capacity according to the total capacity value.

[0069] In this step, the total capacity value and free capacity value of the local memory will be obtained first, and the default value of the heap memory capacity will be determined based on the total capacity value. For example, the default value of the heap memory capacity is usually 1 / 4 of the total capacity value. The reason for determining the default value of the heap memory capacity is that if the memory usage value is less than the default value of the heap memory capacity, the memory usage value is directly set to the heap memory capacity value, and no error will be generated, and no memory overflow will occur; if the memory usage value is greater than the default value of the heap memory capacity, it is possible that the memory usage value is further greater than the free capacity value of the memory, resulting in an error or memory overflow.

[0070] Step 22: Determine whether the memory usage value is greater than the default value of the heap memory capacity. If the memory usage value is not greater than the default value of the heap memory capacity, proceed to step 23; if the memory usage value is greater than the default value of the heap memory capacity, proceed to step 24.

[0071] Step 23: Set the memory usage value to the heap memory capacity value.

[0072] Step 24: Determine whether the memory usage value is greater than the free capacity value; if the memory usage value is not greater than the free capacity value, proceed to step 25; if the memory usage value is greater than the free capacity value, proceed to step 26.

[0073] In this step, since the memory usage value is greater than the default value of the heap memory capacity, there is a risk of error reporting and memory overflow due to the memory usage value being greater than the free capacity value of the memory. Therefore, it is necessary to further determine whether the memory usage value is greater than the free capacity value. If not, the memory usage value can be set to the heap memory capacity value; otherwise, if it is greater, the free capacity value can only be set to the heap memory capacity value at most.

[0074] Step 25: Set the memory usage value to the heap memory capacity value.

[0075] Step 26: Set the free capacity value to the heap memory capacity value.

[0076] Furthermore, when the memory space of the test control device is insufficient and the heap memory capacity value is less than the actual memory occupancy value, the hard disk space can be further used to save the test data returned by the test device. To this end, a memory overflow parameter can be preset in the control script of the test control device, and when it is determined that the memory occupancy value is greater than the free capacity value, the preset memory overflow parameter is set to an activated state to use the heap memory space and the hard disk space of the local machine to save the test data.

[0077] Based on this, after determining that the memory usage value is greater than the free capacity value, it also includes:

[0078] Step 31: Set the preset memory overflow parameters to an activated state to utilize the heap memory space and the local hard disk space to save the test data.

[0079] S104: Start a test process in the test device according to the number of test processes, control the test process to execute a preset stress test script, and use the heap memory space to save the test data returned by the test device.

[0080] In this step, after the heap memory space is created, the test process can be started in the test device according to the number of test processes, the test process can be controlled to execute the preset stress test script, and the heap memory space can be used to save the test data returned by the test device. However, when it is determined that the memory usage value is greater than the free capacity value, since the heap memory space cannot completely store the test data returned by the test device, the test data can also be written to the hard disk space of the test control device to avoid memory overflow.

[0081] It should be noted that this embodiment does not limit how to use the heap memory space and the hard disk space to save test data at the same time. For example, the test data in the heap memory space can be dynamically written to the hard disk space to release memory space; for another example, the memory usage value of the heap memory space can be obtained in real time, and when it is determined that the memory usage value reaches the heap memory capacity value, the test data recently sent by the test device is written to a specified file in the hard disk space.

[0082] Based on this, the test data can be saved by using the heap memory space and the local hard disk space, including:

[0083] Step 41: in the process of controlling the test process to execute the preset stress test script, the memory usage value of the heap memory space is obtained in real time;

[0084] Step 42: When it is determined that the memory usage value reaches the heap memory capacity value, the test data most recently sent by the test device is written into a designated file in the hard disk space.

[0085] Furthermore, when the test device completes the test, the test results can be generated based on the test data in the heap memory space. Of course, if the test data is stored in both the heap memory space and the hard disk space, the test data in the heap memory space and the test data in the execution file need to be integrated to obtain the total test data, and then the test results are generated based on the total test data. This merging process can occur in the hard disk space.

[0086] Based on this, the method may further include:

[0087] Step 51: when it is determined that the test device has completed the execution of the stress test script, the test data in the heap memory space and the test data in the execution file are integrated to obtain the total test data;

[0088] Step 52: Generate test results based on the total test data.

[0089] Based on the above embodiments, the present invention can first obtain the number of processor cores of the test device, and determine the number of test processes to be started in the test device according to the number of processor cores. Subsequently, the memory occupancy value can be determined according to the number of test processes and the memory consumption value corresponding to a single test process; wherein the memory consumption value is a measured value, that is, the present invention has pre-measured the memory occupancy value to be increased for each additional test process. Subsequently, the present invention can set the heap memory capacity value according to the memory occupancy value, and set the heap memory space in the local memory according to the heap memory capacity value, so that a reasonable heap memory space can be set. Furthermore, the test process can be started in the test device according to the number of test processes, the test process can be controlled to execute the preset stress test script, and the heap memory space can be used to save the test data returned by the test device, which can avoid the defects of memory space waste or insufficient memory space at the test control device, thereby not only ensuring the reasonable use of memory at the test control device, but also ensuring the reliability and stability of the virtual machine test.

[0090] Based on the above embodiment, the process of determining the memory consumption value is introduced below. Based on this, the process of determining the memory consumption value may include:

[0091] S201. Set an experimental heap memory space in the local memory and set the number of processes to an initial value.

[0092] In this step, since the memory consumption value corresponding to the test process is not determined, a large-capacity experimental heap memory space can be created. For example, 512G of memory can be set in the test control device, and the default maximum heap memory of the test tool is 128G.

[0093] Furthermore, the number of processes can be set as an initial value, and the number of processes can be gradually increased in subsequent steps to test the memory consumption corresponding to different numbers of processes. The initial value can be 2.

[0094] S202. Start a test process in the test device according to the process number, control the test process to execute a preset stress test script, and control the test device to send the test data generated by the test process to the local machine.

[0095] S203. Use the experimental heap memory space to save test data, and at the same time obtain the garbage collection log generated by the local memory, and determine the garbage data size corresponding to the current number of processes based on the garbage collection log; wherein the garbage collection log contains the garbage data size corresponding to the local memory when performing a complete garbage collection operation.

[0096] In this step, you can add a parameter for printing garbage collection logs in the control-side script in advance. This parameter can output detailed logs of garbage collection and record the memory size after each full garbage collection operation (FullGC). Among them, the full garbage collection operation is an important operation of the Java virtual machine (JVM) in the garbage collection process, involving the recovery of the entire heap memory, including the recovery of the new generation (Young Generation) and the old generation (Old Generation) data. By analyzing the garbage collection log, you can more accurately determine the memory space occupied by each process number.

[0097] S204, determine whether the number of processes reaches the preset upper limit; if the number of processes does not reach the preset upper limit, proceed to step S205; if the number of processes reaches the preset upper limit, proceed to step S206.

[0098] It should be noted that this embodiment does not limit the specific value of the preset upper limit value, which can be set according to actual application requirements.

[0099] S205: Increase the number of processes and enter the step of starting a test process in the test device according to the number of processes.

[0100] This embodiment also does not limit the method of increasing the number of processes. For example, the number of processes may be adjusted in the order of 2, 4, 8, and 16.

[0101] S206. Determine the memory consumption value corresponding to a single test process according to the size of garbage data corresponding to each process number.

[0102] Based on the above embodiments, the above device testing method will be fully introduced below in combination with specific examples. The present invention is divided into three modules: system acquisition module, prediction module, and monitoring and adjustment module. The details are as follows:

[0103] 1. System acquisition module:

[0104] Step 1: The control machine reads the number of logical cores of the test machine's CPU through remote login, recorded as C;

[0105] Step 2: Get the current total memory M1 of the controller;

[0106] Step 3: Get the current free memory capacity M2 of the control machine.

[0107] (II) Prediction module:

[0108] Step 1: Calculate the number of processes N that need to be started for the test, which is equal to C divided by 2 (the tuning test is to bind two processor cores to one process, which is conducive to maximizing performance);

[0109] Step 2: Calculate the default heap memory size of the control machine: generally, it is 1 / 4 of the total machine memory (JDK parameter characteristics), so the default heap memory size X1=M1 / 4;

[0110] Step 3: Calculate the actual required heap memory size: For each additional process, the heap memory needs to increase by 256M (calculated), and the required heap memory size X2 = number of processes N*256M;

[0111] Step 4: Compare the default heap memory X1 and the required heap memory X2;

[0112] 1) If X1 is greater than or equal to X2, set the heap memory Xmx equal to X2 in the controller configuration file;

[0113] 2) If X1 is less than X2, compare the free memory M2 and X2;

[0114] a) If M2 is greater than or equal to X2, set the heap memory Xmx to X2 in the controller configuration file;

[0115] b) If M2 is less than X2, set the heap memory Xmx equal to M2 in the controller configuration file, and set the memory overflow parameter Flag=1 (this parameter is used as a memory overflow indicator. When it is 0, it only monitors memory usage. When it is 1, it starts monitoring and adjusts the memory usage plan).

[0116] The requirement of increasing the heap memory capacity by 256 MB for each additional process in step 3 of the above process is based on actual measurements. The specific test process is as follows:

[0117] Step 1: The control machine is equipped with a large-capacity memory (such as 512G), delete the heap memory parameter in the control-side script, and use the default mode. At this time, the maximum heap memory is 512 / 4=128G;

[0118] Step 2: Add the garbage collection log print parameter in the control-side script. This parameter can output detailed logs of garbage collection and record the memory size after each FullGC.

[0119] Step 3: The test end starts only one process and initiates the test;

[0120] Step 4: Check the memory size recorded in the GC log in the control-side script;

[0121] Step 5: Start two processes on the test side, initiate the test, and check the memory size recorded in the GC log in the control side script;

[0122] Step 6: The test end starts four processes, initiates the test, and checks the memory size recorded in the GC log in the control end script;

[0123] Step 7: The test end starts eight processes, initiates the test, and checks the memory size recorded in the GC log in the control end script;

[0124] Step 8: Repeat the test according to this rule and record the data; compare the memory size and the corresponding number of processes recorded in each test, and calculate that for each additional process, the memory usage increases by 64M.

[0125] Step 9: According to the reference given by JDK, the maximum heap memory size = old generation size * 4. For each additional process, the control end heap memory needs to increase by 64M * 4 = 256M.

[0126] (III) Monitoring and adjustment module:

[0127] Step 1: Start the monitoring script after starting the SPEC Power test process;

[0128] Step 2: Monitor the script to determine the memory overflow parameter Flag value:

[0129] When Flag is 0, use HeapMemoryUsage (heap memory usage view parameter) to monitor and output memory usage;

[0130] When Flag is 1, use HeapMemoryUsage (heap memory usage view parameter) to monitor the heap memory usage in real time. When HeapMemoryUsage is equal to M2, set the file output stream parameter (FileOutputStream). This parameter can specify the data storage address and write the data to the local storage file. The memory is no longer used. Although this method will reduce the data reading and writing speed (from writing to memory to writing to the hard disk), it will avoid the problem of program errors and inability to run caused by memory overflow.

[0131] Finally, please refer to Figure 2 , Figure 2 This is a flow chart of another device testing method provided by an embodiment of the present invention, which fully demonstrates the setting process and testing process of the heap memory capacity value.

[0132] The following is an introduction to the equipment testing device, test control device, test system, computer program product, and computer-readable storage medium provided in the embodiments of the present invention. The equipment testing device, test control device, test system, computer program product, and computer-readable storage medium described below can be referenced to each other with the equipment testing method described above.

[0133] Please refer to Figure 3 , Figure 3 This is a structural block diagram of a device testing device provided by an embodiment of the present invention. The device may include:

[0134] The test process number determination module 301 is used to obtain the number of processor cores of the test device and determine the number of test processes to be started in the test device according to the number of processor cores;

[0135] A memory occupancy value determination module 302 is used to determine a memory occupancy value according to the number of test processes and a memory consumption value corresponding to a single test process; wherein the memory consumption value is a measured value;

[0136] A heap memory space setting module 303 is used to set a heap memory capacity value according to the memory occupancy value, and to set a heap memory space in the local memory according to the heap memory capacity value;

[0137] The test module 304 is used to start a test process in the test device according to the test process number, control the test process to execute a preset stress test script, and use the heap memory space to save the test data returned by the test device.

[0138] Optionally, the heap memory space setting module 303 includes:

[0139] The acquisition submodule is used to obtain the total capacity value and free capacity value of the local memory, and determine the default value of the heap memory capacity according to the total capacity value;

[0140] The first judgment submodule is used to judge whether the memory usage value is greater than the default value of the heap memory capacity; if the memory usage value is not greater than the default value of the heap memory capacity, the memory usage value is set to the heap memory capacity value;

[0141] The second judgment submodule is used to judge whether the memory usage value is greater than the free capacity value if the memory usage value is greater than the default value of the heap memory capacity; if the memory usage value is not greater than the free capacity value, the memory usage value is set to the heap memory capacity value; if the memory usage value is greater than the free capacity value, the free capacity value is set to the heap memory capacity value.

[0142] Optionally, the device may further include:

[0143] The parameter setting module is used to set the preset memory overflow parameters to an activated state so as to utilize the heap memory space and the hard disk space of the local machine to save the test data.

[0144] Optionally, the testing module 304 includes:

[0145] The monitoring submodule is used to obtain the memory usage value of the heap memory space in real time while controlling the test process to execute the preset stress test script;

[0146] The hard disk saving submodule is used to write the test data most recently sent by the test device into a designated file in the hard disk space when it is determined that the memory usage value reaches the heap memory capacity value.

[0147] Optionally, the device may further include:

[0148] An integration module, used to integrate the test data in the heap memory space and the test data in the execution file to obtain total test data when it is determined that the test device has completed the execution of the stress test script;

[0149] The test result generation module is used to generate the test result according to the total test data.

[0150] Optionally, the test process number determination module 301 includes:

[0151] The remote acquisition submodule is used to remotely log in to the test device through the network and read the number of processor cores from the test device.

[0152] Optionally, the device may further include:

[0153] Initialization module, used to set the experimental heap memory space in the local memory and set the number of processes to the initial value;

[0154] The test module is used to start the test process in the test device according to the process number, control the test process to execute the preset stress test script, and control the test device to send the test data generated by the test process to the local machine;

[0155] The log reading module is used to save the test data using the experimental heap memory space, and obtain the garbage collection log generated by the local memory, and determine the garbage data size corresponding to the current number of processes according to the garbage collection log; wherein the garbage collection log contains the garbage data size corresponding to the local memory when performing a complete garbage collection operation;

[0156] A loop control module is used to determine whether the number of processes reaches a preset upper limit; if the number of processes does not reach the preset upper limit, the number of processes is increased, and the step of starting a test process in the test device according to the number of processes is entered;

[0157] The memory consumption value determination module is used to determine the memory consumption value corresponding to a single test process based on the size of garbage data corresponding to each process number if the number of processes reaches a preset upper limit.

[0158] Please refer to Figure 4 , Figure 4 This is a structural block diagram of a test control device provided in an embodiment of the present invention. The embodiment of the present invention provides a test control device 10, including a processor 11 and a memory 12; wherein the memory 12 is used to store computer programs; the processor 11 is used to execute the device testing method provided in the aforementioned embodiment when executing the computer program.

[0159] For the specific process of the above-mentioned device testing method, reference may be made to the corresponding contents provided in the aforementioned embodiments, which will not be repeated here.

[0160] Furthermore, the memory 12, as a carrier for storing resources, may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.

[0161] In addition, the test control device 10 also includes a power supply 13, a communication interface 14, an input / output interface 15 and a communication bus 16; wherein the power supply 13 is used to provide working voltage for each hardware device on the test control device 10; the communication interface 14 can create a data transmission channel between the test control device 10 and external devices, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present invention, and is not specifically limited here; the input / output interface 15 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0162] Please refer to Figure 5 , Figure 5 This is a structural block diagram of a test system provided by an embodiment of the present invention. The embodiment of the present invention also provides a test system, including:

[0163] A test control device 10, used to execute the above device test method;

[0164] The test device 20 is used to start the test process under the control of the test control device, execute a preset stress test script using the test process, and return the test data to the test control device.

[0165] Since the embodiments of the test system part correspond to the embodiments of the device test method part, please refer to the description of the embodiments of the device test method part for the embodiments of the test system part, which will not be repeated here.

[0166] An embodiment of the present invention further provides a computer program product, including a computer program / instruction, which implements the device testing method of the above embodiment when executed by a processor.

[0167] Since the embodiments of the computer program product part correspond to the embodiments of the device testing method part, please refer to the description of the embodiments of the device testing method part for the embodiments of the computer program product part, and will not be repeated here.

[0168] An embodiment of the present invention further provides a non-volatile computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the device testing method of the above embodiment is implemented.

[0169] Since the embodiments of the non-volatile computer-readable storage medium part correspond to the embodiments of the device testing method part, please refer to the description of the embodiments of the device testing method part for the embodiments of the storage medium part, which will not be repeated here.

[0170] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0171] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0172] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0173] The equipment testing method, device, test control equipment, test system and medium provided by the present invention are introduced in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.

Claims

1. A device testing method, characterized in that: include: Obtaining the number of processor cores of the test device, and determining the number of test processes to be started in the test device according to the number of processor cores; Determine the memory usage value according to the number of test processes and the memory consumption value corresponding to a single test process; wherein the memory consumption value is a measured value; Setting a heap memory capacity value according to the memory occupancy value, and setting a heap memory space in the local memory according to the heap memory capacity value; A test process is started in the test device according to the test process number, the test process is controlled to execute a preset stress test script, and the heap memory space is used to save the test data returned by the test device.

2. The device testing method according to claim 1, characterized in that: The step of setting the heap memory capacity value according to the memory occupancy value includes: Obtaining a total capacity value and a free capacity value of the local memory, and determining a default value of the heap memory capacity according to the total capacity value; Determine whether the memory usage value is greater than the default value of the heap memory capacity; If the memory usage value is not greater than the default value of the heap memory capacity, setting the memory usage value to the heap memory capacity value; If the memory occupancy value is greater than the default value of the heap memory capacity, determining whether the memory occupancy value is greater than the free capacity value; If the memory occupancy value is not greater than the free capacity value, setting the memory occupancy value to the heap memory capacity value; If the memory occupancy value is greater than the free capacity value, the free capacity value is set as the heap memory capacity value.

3. The device testing method according to claim 2, characterized in that: After determining that the memory occupancy value is greater than the free capacity value, the method further includes: The preset memory overflow parameter is set to an activated state to utilize the heap memory space and the hard disk space of the local machine to save the test data.

4. The device testing method according to claim 3, characterized in that: The using the heap memory space and the hard disk space of the local machine to save the test data includes: In the process of controlling the test process to execute a preset stress test script, obtaining the memory usage value of the heap memory space in real time; When it is determined that the memory usage value reaches the heap memory capacity value, the test data most recently sent by the test device is written into a designated file in the hard disk space.

5. The device testing method according to claim 1, characterized in that: The obtaining the number of processor cores of the test device includes: The test device is remotely logged in via a network, and the number of processor cores is read from the test device.

6. The device testing method according to any one of claims 1 to 5, characterized in that: The process of determining the memory consumption value includes: Setting an experimental heap memory space in the local memory and setting the number of processes to an initial value; Starting a test process in the test device according to the process number, controlling the test process to execute a preset stress test script, and controlling the test device to send test data generated by the test process to the local machine; The test data is saved by using the experimental heap memory space, and a garbage collection log generated by the local memory is obtained, and the size of garbage data corresponding to the current number of processes is determined according to the garbage collection log; wherein the garbage collection log contains the size of garbage data corresponding to the local memory when a complete garbage collection operation is performed; Determine whether the number of processes reaches a preset upper limit; If the number of processes does not reach the preset upper limit, the number of processes is increased, and the step of starting a test process in the test device according to the number of processes is entered; If the number of processes reaches the preset upper limit, the memory consumption value corresponding to a single test process is determined according to the size of garbage data corresponding to each of the process numbers.

7. A device testing apparatus, characterized in that: include: A test process number determination module is used to obtain the number of processor cores of the test device and determine the number of test processes to be started in the test device according to the number of processor cores; A memory occupancy value determination module, used to determine a memory occupancy value according to the number of test processes and a memory consumption value corresponding to a single test process; wherein the memory consumption value is a measured value; A heap memory space setting module, used to set a heap memory capacity value according to the memory occupancy value, and to set a heap memory space in the local memory according to the heap memory capacity value; The test module is used to start a test process in the test device according to the test process number, control the test process to execute a preset stress test script, and use the heap memory space to save the test data returned by the test device.

8. A test control device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the device testing method according to any one of claims 1 to 6 when executing the computer program.

9. A testing system, characterized in that: include: A test control device, used to execute the device test method according to any one of claims 1 to 6; The test device is used to start a test process under the control of the test control device, execute a preset stress test script using the test process, and return test data to the test control device.

10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are loaded and executed by a processor, the device testing method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Large-capacity simulation working condition dynamic storage method, battery cell test system and electronic equipment

    CN120803359A