Test method and device for server hard disk, storage medium and electronic equipment
Patent Information
- Application Number
- CN202411546085.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2044-10-31
AI Technical Summary
[0005]本申请实施例提供了一种服务器硬盘的测试方法和装置、存储介质及电子设备,以至少解决相关技术中,服务器硬盘的测试效率低等问题
[0041]This application proposes a method for testing server hard drives. First, a target test request is received, which may request the execution of a target test task on a server hard drive deployed on the server. The target test task includes executing one or more reference test scripts. Then, in response to the target test request, the method extracts the target test script to be executed from one or more reference test scripts according to the test priority of each reference test script. Next, the method filters out target server hard drives whose current hard drive parameters match the target test parameters of the target test script from the one or more server hard drives deployed on the server. The target test parameters indicate the hard drive parameters that the server hard drive to be tested needs to achieve before the target test script performs the corresponding test operation. Finally, the target test script is executed on the target server hard drive until one or more... All reference test scripts are executed to obtain the target test results. In the above server hard drive testing method, when responding to the target test request, the target test script to be executed can be intelligently selected according to the test priority. Unlike the existing technology, which requires constructing a server hard drive that meets the target test parameters from scratch before preparing to execute the target test script, this solution can filter out the target server hard drive whose current hard drive parameters match the target test parameters of the target test script from multiple server hard drives, and directly execute the target test script on the target server hard drive. This can save a lot of time consumed in constructing a server hard drive that meets the target test parameters, and improve the testing efficiency of server hard drives. By adopting the above technical solution, the problem of low testing efficiency of server hard drives in related technologies is solved, and the technical effect of improving the testing efficiency of server hard drives is achieved.
Smart Images

Figure CN119440926B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a method and apparatus for testing server hard drives, a storage medium, and an electronic device. Background Technology
[0002] In the field of information technology, data storage is a core component. Solid-state drives (SSDs), as a new generation of storage devices, are gradually replacing traditional hard disk drives (HDDs) due to their superior read / write speeds, high reliability, and durability. The widespread adoption of SSDs has also brought about the need for rigorous quality control and performance testing. To ensure the reliability and performance of SSD products, manufacturers must conduct a series of automated tests on each SSD, such as read / write performance testing, stability testing, compatibility testing, and durability testing. These tests ensure that SSDs exhibit expected performance under various operating conditions and meet the needs of different application scenarios.
[0003] In current technologies, SSD testing typically relies on manual or semi-automated processes. Testers need to select all available test drives, then remotely connect to the test device containing these drives and send test scripts. Before testing begins, the SSDs usually need to be formatted to ensure they start testing in a clean state, which is not only time-consuming but may also lead to data loss from previous tests. Furthermore, to simulate specific test conditions, such as high load or specific usage scenarios, testers may need to manually construct these conditions, further increasing the complexity and time cost of the test.
[0004] There is still no effective solution to the problem of low testing efficiency of server hard drives in related technologies. Summary of the Invention
[0005] This application provides a testing method and apparatus for server hard drives, a storage medium, and an electronic device, to at least solve the problem of low testing efficiency of server hard drives in related technologies.
[0006] According to one embodiment of this application, a method for testing a server hard drive is provided, including:
[0007] Receive a target test request, wherein the target test request is used to request the execution of a target test task on the server hard disk deployed in the server, and the target test task includes executing one or more reference test scripts;
[0008] In response to the target test request, the target test script to be executed is extracted from one or more of the reference test scripts according to the test priority of each reference test script;
[0009] Select a target server hard drive from one or more server hard drives deployed in the server whose current hard drive parameters match the target test parameters of the target test script. The target test parameters are used to indicate the hard drive parameters that the server hard drive to be tested needs to achieve before the target test script performs the corresponding test operation on the server hard drive to be tested.
[0010] The target test script is executed on the target server hard drive until one or more of the reference test scripts have been executed, and the target test result is obtained.
[0011] Optionally, the step of extracting the target test script to be executed from one or more of the reference test scripts according to the test priority of each reference test script includes:
[0012] Detect the queue priority of the script test queue in which each of the one or more reference test scripts is located, wherein the queue priority is used to indicate the priority of the reference test script in the corresponding script test queue being executed, and the reference test script in the script test queue with the higher queue priority is executed more preferentially;
[0013] Retrieve the target test script with the highest test priority from the target script test queue with the highest current queue priority.
[0014] Optionally, before detecting the queue priority of the script test queue in which each of the one or more reference test scripts is located, the method further includes:
[0015] The system detects the environmental condition information and device condition information of each of the one or more reference test scripts. The environmental condition information is used to indicate the target environment configuration parameters that the hard drive under test needs to achieve before the corresponding reference test script performs the corresponding test operation. The device condition information is used to indicate the target device operating parameters that the hard drive under test needs to achieve before the corresponding reference test script performs the corresponding test operation. The hard drive parameters indicated by the target test parameters include the target environment configuration parameters and the target device operating parameters.
[0016] Based on the environmental condition information and the device condition information, one or more reference test scripts are divided into one or more script test queues, wherein the environmental condition information and the device condition information are the same among the reference test scripts in the same script test queue.
[0017] Assign the queue priority to each of the script test queues in one or more of the script test queues.
[0018] Optionally, assigning a queue priority to each of the one or more script test queues includes:
[0019] The first construction parameter of the environment condition information and the second construction parameter of the device condition information corresponding to each script test queue are detected. The first construction parameter is used to indicate the difficulty of controlling the hard disk of the server under test to construct the environment configuration parameters indicated by the environment condition information, and the second construction parameter is used to indicate the difficulty of controlling the hard disk of the server under test to construct the device running parameters indicated by the device condition information.
[0020] Detect the number of reference test scripts included in each of the script test queues;
[0021] Each script test queue is assigned a queue priority based on its first construction parameter, second construction parameter, and number of scripts. The script test queue with a higher difficulty level indicated by the first construction parameter has a higher queue priority, the script test queue with a higher difficulty level indicated by the second construction parameter has a higher queue priority, and the script test queue with a larger number of scripts has a higher queue priority.
[0022] Optionally, one or more server hard drives deployed in the server are divided into multiple hard drive resource pools. The current environment configuration parameters of each server hard drive within the same hard drive resource pool are the same. The hard drive parameters indicated by the target test parameters include target environment configuration parameters and target device operating parameters. The step of selecting target server hard drives from the one or more server hard drives deployed in the server whose current hard drive parameters match the target test parameters of the target test script includes:
[0023] Detect whether the current environment configuration parameters of the server hard disk in the multiple hard disk resource pools are consistent with the target environment configuration parameters, wherein the current hard disk parameters of the server hard disk to be tested include the current environment configuration parameters;
[0024] If the current environment configuration parameters of the server hard disk in the target hard disk resource pool are found to be consistent with the target environment configuration parameters, the target server hard disk whose current device operating parameters are consistent with the target device operating parameters is selected from the target hard disk resource pool. The current hard disk parameters of the server hard disk to be tested include the current device operating parameters.
[0025] If the current environment configuration parameters of one or more of the server hard drives are found to be consistent with the target environment configuration parameters in multiple hard drive resource pools, and / or the current device operating parameters of one or more of the server hard drives are found to be consistent with the target device operating parameters, then the current environment configuration parameters of one or more of the server hard drives, and / or the current device operating parameters, are adjusted.
[0026] Optionally, adjusting the current environment configuration parameters of one or more of the server hard drives, and / or the current device operating parameters, includes:
[0027] Obtain the target preprocessing script corresponding to the target test script, wherein the target preprocessing script is used to adjust the current environment configuration parameters of the server hard disk to be consistent with the target environment configuration parameters indicated by the target test script, and / or to adjust the current device operating parameters of the server hard disk to be consistent with the target device operating parameters indicated by the target test script;
[0028] The target preprocessing script is executed on one or more of the server hard drives.
[0029] Optionally, when the target test task includes executing N reference test scripts, and the test priority of the target test script is ranked as the i-th among the N reference test scripts, where N is a positive integer greater than 1 and i is an integer greater than or equal to 1 and less than N, the execution of the target test script on the target server hard drive until one or more of the reference test scripts have been executed to obtain the target test result includes:
[0030] The target test script is executed on the target server hard drive to obtain the i-th sub-test result;
[0031] The reference test script with the test priority ranked i+1th among the N reference test scripts is determined as the target test script to be executed now, until i+1 equals N, then the execution of the N reference test scripts ends, and N sub-test results are obtained.
[0032] The N sub-test results are determined as the target test result.
[0033] According to another embodiment of the present application, a testing apparatus for a server hard disk is also provided, comprising:
[0034] A receiving module is used to receive a target test request, wherein the target test request is used to request the execution of a target test task on the server hard disk deployed in the server, and the target test task includes executing one or more reference test scripts;
[0035] The response module is used to respond to the target test request and extract the target test script to be executed from one or more reference test scripts according to the test priority of each reference test script;
[0036] The filtering module is used to filter out target server hard drives whose current hard drive parameters match the target test parameters of the target test script from one or more server hard drives deployed in the server. The target test parameters are used to indicate the hard drive parameters that the server hard drive to be tested needs to achieve before the target test script performs the corresponding test operation on the server hard drive to be tested.
[0037] The execution module is used to execute the target test script on the target server hard disk until one or more of the reference test scripts have been executed to obtain the target test result.
[0038] According to yet another embodiment of this application, a computer program product is also provided, including a computer program that is executed by a processor through the steps of any of the above method embodiments.
[0039] According to yet another embodiment of this application, a computer-readable storage medium is also provided, wherein a computer program is stored therein, and the computer program is configured to perform the steps in any of the above method embodiments when it is run.
[0040] According to yet another embodiment of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0041] This application proposes a method for testing server hard drives. First, a target test request is received, which may request the execution of a target test task on a server hard drive deployed on the server. The target test task includes executing one or more reference test scripts. Then, in response to the target test request, the method extracts the target test script to be executed from one or more reference test scripts according to the test priority of each reference test script. Next, the method filters out target server hard drives whose current hard drive parameters match the target test parameters of the target test script from the one or more server hard drives deployed on the server. The target test parameters indicate the hard drive parameters that the server hard drive to be tested needs to achieve before the target test script performs the corresponding test operation. Finally, the target test script is executed on the target server hard drive until one or more... All reference test scripts are executed to obtain the target test results. In the above server hard drive testing method, when responding to the target test request, the target test script to be executed can be intelligently selected according to the test priority. Unlike the existing technology, which requires constructing a server hard drive that meets the target test parameters from scratch before preparing to execute the target test script, this solution can filter out the target server hard drive whose current hard drive parameters match the target test parameters of the target test script from multiple server hard drives, and directly execute the target test script on the target server hard drive. This can save a lot of time consumed in constructing a server hard drive that meets the target test parameters, and improve the testing efficiency of server hard drives. By adopting the above technical solution, the problem of low testing efficiency of server hard drives in related technologies is solved, and the technical effect of improving the testing efficiency of server hard drives is achieved. Attached Figure Description
[0042] Figure 1 This is a hardware structure block diagram of a computer device for a server hard drive testing method according to an embodiment of this application;
[0043] Figure 2 This is a flowchart of a server hard drive testing method according to an embodiment of this application;
[0044] Figure 3 This is a schematic diagram of a server hard disk testing process and testing system according to an embodiment of this application;
[0045] Figure 4 This is a structural diagram of a server hard disk testing system script according to an embodiment of this application;
[0046] Figure 5 This is a schematic diagram of a test method flow for a server hard drive according to an embodiment of this application;
[0047] Figure 6This is a schematic diagram of a server hard drive testing method according to an embodiment of this application;
[0048] Figure 7 This is a structural block diagram of a server hard drive testing device according to an embodiment of this application. Detailed Implementation
[0049] The embodiments of this application will be described in detail below with reference to the accompanying drawings and examples.
[0050] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0051] The methods and embodiments provided in this application can be executed on a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure block diagram of a computer device for a server hard drive testing method according to an embodiment of this application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The server device may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the server equipment described above. For example, the server equipment may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0052] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the server hard drive testing method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the server device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0053] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the server device. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0054] This embodiment provides a method for testing server hard drives. Figure 2 This is a flowchart of a server hard drive testing method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps:
[0055] Step S12, receive a target test request, wherein the target test request is used to request the execution of a target test task on the server hard disk deployed in the server, and the target test task includes executing one or more reference test scripts;
[0056] Step S14: In response to the target test request, extract the target test script to be executed from one or more reference test scripts according to the test priority of each reference test script;
[0057] Step S16: Select a target server hard drive from one or more server hard drives deployed in the server whose current hard drive parameters match the target test parameters of the target test script. The target test parameters are used to indicate the hard drive parameters that the server hard drive to be tested needs to achieve before the target test script performs the corresponding test operation on the server hard drive to be tested.
[0058] Step S18: Execute the target test script on the target server hard disk until one or more of the reference test scripts have been executed to obtain the target test result.
[0059] Optionally, in this embodiment, Figure 3 This is a schematic diagram of a server hard drive testing process and testing system according to an embodiment of this application, such as... Figure 3 As shown, assuming there is a server hard disk testing system, the system may include a test classification module, an environment identification module, a test record storage module, a test matching module, and a test update module. The system is designed to receive, respond to, schedule, and execute test requests for server hard disks, and may execute, but is not limited to, the various steps in the server hard disk testing method proposed in this application through the above modules in the testing system.
[0060] Optionally, in this embodiment, the target test request may be, but is not limited to, a request to perform a series of target test tasks on the server hard drive deployed on the server, wherein the server hard drive may include, but is not limited to, SSD, SATA (Serial Advanced Technology Attachment), SAS (Serial Attached SCSI), etc.
[0061] Optionally, in this embodiment, the target test request can be a document or data structure that describes in detail the required test content, including the test object, test type, test conditions, test script, etc. For example: Test object: SSD model XP1000, batch number BATCH20241015, quantity 10000; Test type: performance test, reliability test; Test conditions: operating system Windows 10, ambient temperature 23℃±2℃, ambient humidity 45%±10%; Test script: performance test script PerfTest_SeqWriteTest_v1.0 (used to test the continuous write performance of SSD), reliability test script Reliability_TortureTest_v2.0 (used to simulate the operation of SSD under extreme conditions), low-level format test script LowLevelFormatTestScript_v1.0 (clears all data and resets SSD state), etc.
[0062] Optionally, in this embodiment, the test priority can be, but is not limited to, an identifier that can be used to indicate the urgency or importance of the test script. It can be a numerical identifier, directly using numbers such as 1, 2, 3, etc. to identify the priority. The smaller the number, the higher the priority.
[0063] Optionally, in this embodiment, assuming that the performance test script PerfTest_SeqWriteTest_v1.0 has a test priority of 1, the reliability test script Reliability_TortureTest_v2.0 has a test priority of 2, and the low-level formatting test script LowLevelFormatTestScript_v1.0 has a test priority of 3, the test system will extract the test scripts as target test scripts for execution in the order of their test priorities, namely PerfTest_SeqWriteTest_v1.0, Reliability_TortureTest_v2.0, and LowLevelFormatTestScript_v1.0.
[0064] Optionally, in this embodiment, the hard drive whose corresponding hard drive parameters match the target test parameters of the target test script is selected from multiple SSDs and determined as the target server hard drive. The hard drive parameters can be, but are not limited to, environment configuration parameters and device operating parameters.
[0065] Optionally, in this embodiment, Figure 4 This is a structural diagram of a server hard disk testing system script according to an embodiment of this application, such as... Figure 4 As shown, the server hard drive testing system script includes a preprocessing script and a test script. The preprocessing script contains multiple preprocessing scripts used to construct corresponding hard drive parameters according to the requirements of different test scripts. The test script includes three parts: environment information definition (defining the environment parameters required for the test), which can be represented by test environment tags; test preprocessing (checking whether the server hard drive parameters meet the test parameters of the test script; if no server hard drive meets the conditions, calling the preprocessing script to construct hard drive parameters that match the test parameters), which can be represented by test condition tags; and formal testing (the test script executes the test operations and obtains the test results).
[0066] As an optional approach, extracting the target test script to be executed from one or more reference test scripts according to the test priority of each reference test script includes:
[0067] S21, detect the queue priority of the script test queue in which each of the one or more reference test scripts is located, wherein the queue priority is used to indicate the priority of the reference test script in the corresponding script test queue being executed, and the reference test script in the script test queue with the higher queue priority is executed more preferentially.
[0068] S22, retrieve the target test script with the highest test priority from the target script test queue with the highest current queue priority.
[0069] Optionally, in this embodiment, it is assumed that there are script test queues and corresponding queue priorities: queue A (level A), queue B (level B), and queue C (level C). The earlier the alphabetical order of the queue priority, the higher the priority. Therefore, test scripts in queue A are executed before test scripts in queue B.
[0070] Optionally, in this embodiment, for queue A, assuming that queue A contains test scripts and the corresponding test priority relationships are test1 (level 1), test2 (level 2), and test3 (level 3), then when queue A is the target script test queue, the order of obtaining test scripts will be in the order of test priority from high to low, that is, test1, test2, and test3, and the test scripts will be obtained in sequence as target test scripts to be executed.
[0071] Optionally, in this embodiment, such as Figure 3 As shown, after the target test script is executed, the test record saving module in the test system is used to save the test records of the test disk. The test records are used to indicate the reference test scripts that have been tested.
[0072] As an optional approach, before detecting the queue priority of the script test queue in which each of the one or more reference test scripts is located, the method further includes:
[0073] S31, Detect the environmental condition information and device condition information of each of the one or more reference test scripts, wherein the environmental condition information is used to indicate the target environment configuration parameters that the hard disk of the server under test needs to achieve before the corresponding test operation is performed by the corresponding reference test script, and the device condition information is used to indicate the target device operating parameters that the hard disk of the server under test needs to achieve before the corresponding test operation is performed by the corresponding reference test script, wherein the hard disk parameters indicated by the target test parameters include the target environment configuration parameters and the target device operating parameters;
[0074] S32, one or more reference test scripts are divided into one or more script test queues according to the environmental condition information and the device condition information, wherein the environmental condition information and the device condition information are the same among the reference test scripts in the same script test queue;
[0075] S33, assign the queue priority to each of the script test queues in one or more script test queues.
[0076] Optionally, in this embodiment, such as Figure 3As shown, the test classification module in the test system can perform two classifications based on the environmental condition information and device condition information of each test script, dividing all test scripts into different test queues. One classification operation can be: classifying the test scripts first according to the environmental condition information, and then classifying the test scripts a second time according to the test device condition information under the same environmental condition information category. After the two classifications, test scripts in the same category are identified as a script test queue, and all test scripts in a script test queue belong to the same category of environmental condition information and the same category of device condition information.
[0077] Optionally, in this embodiment, the test classification module can also mark a test script as unrecoverable if it is an unrecoverable test. An unrecoverable test means that after the test script is executed, the server hard drive used for the test cannot be restored to its pre-test state, such as the low-level formatting test script LowLevelFormatTestScript_v1.0. Test scripts marked as unrecoverable will be placed in a dedicated script test queue with the lowest priority. This queue will only be executed after all other script test queues have been completed, thereby maximizing the utilization of the server hard drive and improving the efficiency of server hard drive testing.
[0078] Optionally, in this embodiment, the environmental condition information can be the environmental configuration parameters of the SSD to be tested, such as the SSD's own parameters (e.g., model and batch number), operating system parameters (Windows 10 or Linux Ubuntu 20.04, etc.), and environmental temperature parameters (23℃±2℃). The device condition information can be the device operating parameters of the SSD to be tested, which can be used to indicate the specific requirements or states that the server hard drive needs to meet before performing the test, such as the server hard drive read / write count parameters and the server hard drive's used space ratio parameters.
[0079] As an optional approach, assigning a queue priority to each of the one or more script test queues includes:
[0080] S41, detect the first construction parameter of the environment condition information corresponding to each script test queue, and the second construction parameter of the device condition information, wherein the first construction parameter is used to indicate the difficulty of controlling the hard disk of the server under test to construct the environment configuration parameters indicated by the environment condition information, and the second construction parameter is used to indicate the difficulty of controlling the hard disk of the server under test to construct the device running parameters indicated by the device condition information.
[0081] S42, Detect the number of reference test scripts included in each script test queue;
[0082] S43, assign a queue priority to each script test queue according to the first construction parameter, the second construction parameter, and the number of scripts in each script test queue, wherein the script test queue with a higher difficulty level indicated by the first construction parameter has a higher queue priority, the script test queue with a higher difficulty level indicated by the second construction parameter has a higher queue priority, and the script test queue with a larger number of scripts has a higher queue priority.
[0083] Optionally, in this embodiment, for a single script test queue, all the test scripts contained therein belong to the same category of environmental condition information and the same category of device condition information. The method of assigning queue priorities to the script test queue based on the test priorities of the test scripts in the script test queue may include, but is not limited to, the following steps:
[0084] The first step is to calculate the first build parameter. The difficulty of controlling the hard drive of the server under test to build the environment configuration parameters indicated by the environment condition information is determined as the first build parameter. For example, the following are possible: 1 point (standard configuration, no special settings required); 2 points (requires specific operating system or network configuration); 3 points (requires complex environment simulation, such as multi-system collaboration or special network environment), etc.
[0085] The second step is to calculate the second construction parameter. The difficulty of controlling the hard drive of the server under test to construct the device operating parameters indicated by the device condition information is determined as the second construction parameter. For example, the following are possible: 1 point (standard operating parameters, no special adjustment required); 2 points (requires special power management or performance monitoring settings); 3 points (requires simulating extreme operating conditions, such as high temperature, high load or specific hardware failure mode), etc.
[0086] The third step is to calculate the number of test scripts in the script test queue.
[0087] The fourth step is to calculate the queue priority based on the first construction parameter, the second construction parameter, and the number of scripts. The calculation method can be as follows:
[0088]
[0089] Among them, weight factor 1 and weight factor 2 are constants. Weight factor 1 is used to adjust the relative importance of the first construction parameter, and weight factor 2 is used to adjust the relative importance of the second construction parameter. The script test queue with the higher priority calculation result has a higher queue priority.
[0090] Optionally, in this embodiment, it is assumed that the first construction parameter of queue A is 2, the second construction parameter is 1, and the number of scripts is 5, and the first construction parameter of queue B is 3, the second construction parameter is 2, and the number of scripts is 3. The preset weight factor 1 and weight factor 2 are 1. Through the queue priority calculation formula, the queue priority calculation results of queue A and queue B are 1.67 and 0.6 respectively, that is, the queue priority of queue A is higher than that of queue B.
[0091] As an optional solution, one or more server hard drives deployed in the server are divided into multiple hard drive resource pools. The current environment configuration parameters of each server hard drive within the same hard drive resource pool are the same. The hard drive parameters indicated by the target test parameters include target environment configuration parameters and target device operating parameters. The step of selecting target server hard drives from the one or more server hard drives deployed in the server whose current hard drive parameters match the target test parameters of the target test script includes:
[0092] S51, detect whether there are any server hard disks in the multiple hard disk resource pools whose current environment configuration parameters are consistent with the target environment configuration parameters, wherein the current hard disk parameters of the server hard disk to be tested include the current environment configuration parameters;
[0093] S52, when it is detected that the current environment configuration parameters of the server hard disk in the target hard disk resource pool in the multiple hard disk resource pools are consistent with the target environment configuration parameters, the target server hard disk whose current device operating parameters are consistent with the target device operating parameters is selected from the target hard disk resource pool, wherein the current hard disk parameters of the server hard disk to be tested include the current device operating parameters;
[0094] S53, if the current environment configuration parameters of one or more server hard drives in multiple hard drive resource pools are consistent with the target environment configuration parameters, and / or the current device operating parameters of one or more server hard drives are consistent with the target device operating parameters, then the current environment configuration parameters of one or more server hard drives, and / or the current device operating parameters are adjusted.
[0095] Optionally, in this embodiment, such as Figure 3 As shown, the environment identification module in the test system divides one or more SSDs deployed on the server into multiple disk resource pools according to their corresponding environment configuration parameters. That is, all SSDs within a disk resource pool have the same environment configuration parameters. Figure 3As shown, the test matching module in the test system is used to filter out target server hard drives from multiple SSDs whose current hard drive parameters match the target test parameters of the target test script. This may include, but is not limited to, the following steps: First, compare the environment configuration parameters of the SSDs in each hard drive resource pool with the target environment configuration parameters, and determine the matching hard drive resource pool as the target hard drive resource pool. If there is no matching hard drive resource pool, adjust the environment configuration parameters of the SSDs, that is, start the preprocessing script to configure the corresponding environment parameters. Then, filter SSDs from the target hard drive resource pool whose device operating parameters are consistent with the target device operating parameters. If the filtering result exists, determine the filtering result as the target server hard drive. If the filtering result does not exist, adjust the device operating parameters of the SSDs, that is, start the preprocessing script to configure the corresponding device operating parameters.
[0096] As an optional solution, adjusting the current environment configuration parameters of one or more of the server hard drives, and / or the current device operating parameters, includes:
[0097] S61, obtain the target preprocessing script corresponding to the target test script, wherein the target preprocessing script is used to adjust the current environment configuration parameters of the server hard disk to be consistent with the target environment configuration parameters indicated by the target test script, and / or to adjust the current device operating parameters of the server hard disk to be consistent with the target device operating parameters indicated by the target test script;
[0098] S62, execute the target preprocessing script on one or more of the server hard drives.
[0099] Optionally, in this embodiment, such as Figure 4 As shown, the preprocessing script in the server hard disk test system script can perform corresponding hard disk parameter construction operations according to the requirements of different test scripts, including adjusting environment configuration parameters and device operating parameters, and adjusting the server hard disk parameters to the parameters required by the target test script.
[0100] As an optional approach, where the target test task includes executing N reference test scripts, and the test priority of the target test script is ranked as the i-th among the N reference test scripts, where N is a positive integer greater than 1 and i is an integer greater than or equal to 1 and less than N, the execution of the target test script on the target server hard drive until one or more of the reference test scripts have been executed to obtain the target test result includes:
[0101] S71, Execute the target test script on the target server hard disk to obtain the i-th sub-test result;
[0102] S72, determine the (i+1)th reference test script in the N reference test scripts according to the test priority as the target test script to be executed, until i+1 equals N, and end the execution of the N reference test scripts to obtain the N sub-test results;
[0103] S73, determine the N sub-test results as the target test result.
[0104] Optionally, in this embodiment, such as Figure 3 As shown, the test update module in the test system is used to update the status of the script test queue and the hard disk resource pool in real time. Assuming the target test task requires the execution of N test scripts, the execution method can be, but is not limited to, the following: Select the script test queue with the highest priority in the current script test queue as the target queue. For the test scripts in the target queue, select test scripts as target test scripts according to their test priority. Filter the server hard disks in the hardware resource pool that match the target test scripts as target server hard disks. Before matching, determine if the current server hard disk status is normal; remove server hard disks with abnormal status from the current hard disk resource pool. Simultaneously, the test update module updates the status of the hard disk resource pool. After matching the target server hard disk, execute the target test script to obtain a sub-test result. Then, remove the target test script from the script test queue. Next, select other unexecuted test scripts according to their test priority. If the number of test scripts in the script test queue becomes 0, delete the script test queue. This process continues until all test scripts are executed, resulting in N sub-test results, which are then determined as the target test result.
[0105] This embodiment provides a method for testing server hard drives. Figure 5 This is a schematic diagram of a server hard drive testing method according to an embodiment of this application, as shown below. Figure 5As shown, the main steps are as follows: First, the server hard drive testing system checks if a queue of scripts to be processed exists. If so, the system selects a script queue and checks if it is empty. Once a non-empty queue is selected, the system chooses a test script from it according to its test priority and further confirms whether there is an available hardware resource pool to execute the script. If a hardware resource pool exists, the system checks whether the server hard drives in the hardware resource pool meet the test conditions, which include the environment configuration parameters and device operating parameters required to execute the test script. If the test conditions are not met, the system calls a preprocessing script to prepare a server hard drive that meets the test conditions. Once the hard drive is ready, the test script will be executed. This process may loop until the script test queue is empty or all hard drive resource pools are used up. The entire process aims to ensure that the test can be executed efficiently and orderly, while ensuring the consistency of the test environment and test conditions.
[0106] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0107] This embodiment also provides a server hard drive testing device, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0108] Figure 6 This is a structural block diagram of a server hard drive testing apparatus according to an embodiment of this application; as shown... Figure 6 As shown, it includes:
[0109] The receiving module 602 is used to receive a target test request, wherein the target test request is used to request the execution of a target test task on the server hard disk deployed in the server, and the target test task includes executing one or more reference test scripts;
[0110] The response module 604 is used to respond to the target test request and extract the target test script to be executed from one or more reference test scripts according to the test priority of each reference test script;
[0111] The filtering module 606 is used to filter out target server hard drives whose current hard drive parameters match the target test parameters of the target test script from one or more server hard drives deployed in the server. The target test parameters are used to indicate the hard drive parameters that the server hard drive to be tested needs to achieve before the target test script performs the corresponding test operation on the server hard drive to be tested.
[0112] The execution module 608 is used to execute the target test script on the target server hard disk until one or more of the reference test scripts have been executed to obtain the target test result.
[0113] In one exemplary embodiment, the response module includes:
[0114] The first detection unit is used to detect the queue priority of the script test queue in which each of the reference test scripts is located in one or more reference test scripts, wherein the queue priority is used to indicate the priority of the reference test script in the corresponding script test queue being executed, and the reference test script in the script test queue with the higher queue priority is executed more preferentially.
[0115] The acquisition unit is used to acquire the target test script with the highest test priority from the target script test queue with the highest current queue priority.
[0116] In one exemplary embodiment, the apparatus further includes:
[0117] The detection module is configured to detect environmental condition information and device condition information of each of the one or more reference test scripts before detecting the queue priority of each reference test script in the script test queue. The environmental condition information indicates the target environment configuration parameters that the hard drive under test needs to achieve before the corresponding reference test script performs the corresponding test operation. The device condition information indicates the target device operating parameters that the hard drive under test needs to achieve before the corresponding reference test script performs the corresponding test operation. The target test parameters indicate the hard drive parameters to be achieved, including the target environment configuration parameters and the target device operating parameters.
[0118] The partitioning module is used to partition one or more reference test scripts into one or more script test queues according to the environmental condition information and the device condition information, wherein the environmental condition information and the device condition information are the same among the reference test scripts in the same script test queue.
[0119] The allocation module is used to assign the queue priority to each of the script test queues in one or more script test queues.
[0120] In one exemplary embodiment, the allocation module includes:
[0121] The second detection unit is used to detect the first construction parameter of the environment condition information corresponding to each script test queue, and the second construction parameter of the device condition information. The first construction parameter is used to indicate the difficulty of controlling the hard disk of the server under test to construct the environment configuration parameters indicated by the environment condition information, and the second construction parameter is used to indicate the difficulty of controlling the hard disk of the server under test to construct the device operating parameters indicated by the device condition information.
[0122] The third detection unit is used to detect the number of reference test scripts included in each script test queue;
[0123] An allocation unit is configured to allocate a queue priority to each script test queue based on the first construction parameter, the second construction parameter, and the number of scripts in each script test queue, wherein the script test queue with a higher difficulty level indicated by the first construction parameter has a higher queue priority, the script test queue with a higher difficulty level indicated by the second construction parameter has a higher queue priority, and the script test queue with a larger number of scripts has a higher queue priority.
[0124] In an exemplary embodiment, one or more server hard drives deployed in the server are divided into multiple hard drive resource pools. The current environment configuration parameters of each server hard drive within the same hard drive resource pool are the same. The target test parameters indicate the hard drive parameters to be achieved, including target environment configuration parameters and target device operating parameters. The filtering module includes:
[0125] The fourth detection unit is used to detect whether there are any servers in the multiple disk resource pools whose current environment configuration parameters are consistent with the target environment configuration parameters, wherein the current disk parameters of the server disk to be tested include the current environment configuration parameters;
[0126] A filtering unit is configured to, when it is detected that the current environment configuration parameters of the server hard disk in the target hard disk resource pool in the multiple hard disk resource pools are consistent with the target environment configuration parameters, filter out the target server hard disk whose current device operating parameters are consistent with the target device operating parameters from the target hard disk resource pool, wherein the current hard disk parameters of the server hard disk to be tested include the current device operating parameters;
[0127] The configuration unit is configured to adjust the current environment configuration parameters of one or more server hard drives and / or the current device operating parameters when it is detected that the current environment configuration parameters of the server hard drives in multiple hard drive resource pools are consistent with the target environment configuration parameters, and / or the current device operating parameters of the server hard drives are consistent with the target device operating parameters.
[0128] In one exemplary embodiment, the configuration unit is configured to:
[0129] Obtain the target preprocessing script corresponding to the target test script, wherein the target preprocessing script is used to adjust the current environment configuration parameters of the server hard disk to be consistent with the target environment configuration parameters indicated by the target test script, and / or to adjust the current device operating parameters of the server hard disk to be consistent with the target device operating parameters indicated by the target test script;
[0130] The target preprocessing script is executed on one or more of the server hard drives.
[0131] In an exemplary embodiment, when the target test task includes executing N reference test scripts, and the test priority of the target test script is ranked as the i-th among the N reference test scripts, where N is a positive integer greater than 1 and i is an integer greater than or equal to 1 and less than N, the execution module includes:
[0132] An execution unit is used to execute the target test script on the target server hard disk to obtain the i-th sub-test result;
[0133] The first determining unit is used to determine the reference test script whose test priority is ranked i+1th among the N reference test scripts as the target test script to be executed, until i+1 equals N, and then end the execution of the N reference test scripts to obtain the N sub-test results.
[0134] The second determining unit is used to determine the N sub-test results as the target test result.
[0135] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0136] Embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the methods described in various embodiments of this application; the computer program product further includes a non-volatile computer-readable storage medium storing the computer program, which, when executed by a processor, implements the steps of the methods described in various embodiments of this application.
[0137] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0138] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0139] Embodiments of this application also provide an electronic device. Figure 7 This is a schematic diagram of an electronic device according to an embodiment of this application, such as... Figure 7 As shown, the electronic device includes a memory and a processor, the memory storing a computer program, and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0140] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0141] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0142] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0143] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A method for testing server hard drives, characterized in that, include: Receive a target test request, wherein the target test request is used to request the execution of a target test task on the server hard disk deployed in the server, and the target test task includes executing one or more reference test scripts; In response to the target test request, the target test script to be executed is extracted from one or more of the reference test scripts according to the test priority of each reference test script; Select a target server hard drive from one or more server hard drives deployed in the server whose current hard drive parameters match the target test parameters of the target test script. The target test parameters are used to indicate the hard drive parameters that the server hard drive to be tested needs to achieve before the target test script performs the corresponding test operation on the server hard drive to be tested. The target test script is executed on the target server hard drive until one or more of the reference test scripts have been executed, and the target test result is obtained.
2. The method according to claim 1, characterized in that, The step of extracting the target test script to be executed from one or more reference test scripts according to the test priority of each reference test script includes: Detect the queue priority of the script test queue in which each of the one or more reference test scripts is located, wherein the queue priority is used to indicate the priority of the reference test script in the corresponding script test queue being executed, and the reference test script in the script test queue with the higher queue priority is executed more preferentially; Retrieve the target test script with the highest test priority from the target script test queue with the highest current queue priority.
3. The method according to claim 2, characterized in that, Before detecting the queue priority of the script test queue in which each of the one or more reference test scripts is located, the method further includes: The system detects the environmental condition information and device condition information of each of the one or more reference test scripts. The environmental condition information is used to indicate the target environment configuration parameters that the hard drive under test needs to achieve before the corresponding reference test script performs the corresponding test operation. The device condition information is used to indicate the target device operating parameters that the hard drive under test needs to achieve before the corresponding reference test script performs the corresponding test operation. The hard drive parameters indicated by the target test parameters include the target environment configuration parameters and the target device operating parameters. Based on the environmental condition information and the device condition information, one or more reference test scripts are divided into one or more script test queues, wherein the environmental condition information and the device condition information are the same among the reference test scripts in the same script test queue. Assign the queue priority to each of the script test queues in one or more of the script test queues.
4. The method according to claim 3, characterized in that, Assigning a queue priority to each of the one or more script test queues includes: The first construction parameter of the environment condition information and the second construction parameter of the device condition information corresponding to each script test queue are detected. The first construction parameter is used to indicate the difficulty of controlling the hard disk of the server under test to construct the environment configuration parameters indicated by the environment condition information, and the second construction parameter is used to indicate the difficulty of controlling the hard disk of the server under test to construct the device running parameters indicated by the device condition information. Detect the number of reference test scripts included in each of the script test queues; Each script test queue is assigned a queue priority based on its first construction parameter, second construction parameter, and number of scripts. The script test queue with a higher difficulty level indicated by the first construction parameter has a higher queue priority, the script test queue with a higher difficulty level indicated by the second construction parameter has a higher queue priority, and the script test queue with a larger number of scripts has a higher queue priority.
5. The method according to claim 1, characterized in that, One or more server hard drives deployed in the server are divided into multiple hard drive resource pools. The current environment configuration parameters of each server hard drive within the same hard drive resource pool are the same. The hard drive parameters indicated by the target test parameters include target environment configuration parameters and target device operating parameters. The step of selecting target server hard drives from the one or more server hard drives deployed in the server whose current hard drive parameters match the target test parameters of the target test script includes: Detect whether the current environment configuration parameters of the server hard disk in the multiple hard disk resource pools are consistent with the target environment configuration parameters, wherein the current hard disk parameters of the server hard disk to be tested include the current environment configuration parameters; If the current environment configuration parameters of the server hard disk in the target hard disk resource pool are found to be consistent with the target environment configuration parameters, the target server hard disk whose current device operating parameters are consistent with the target device operating parameters is selected from the target hard disk resource pool. The current hard disk parameters of the server hard disk to be tested include the current device operating parameters. If the current environment configuration parameters of one or more of the server hard drives are found to be consistent with the target environment configuration parameters in multiple hard drive resource pools, and / or the current device operating parameters of one or more of the server hard drives are found to be consistent with the target device operating parameters, then the current environment configuration parameters of one or more of the server hard drives, and / or the current device operating parameters, are adjusted.
6. The method according to claim 5, characterized in that, The adjustment of the current environment configuration parameters of one or more of the server hard drives, and / or the current device operating parameters, includes: Obtain the target preprocessing script corresponding to the target test script, wherein the target preprocessing script is used to adjust the current environment configuration parameters of the server hard disk to be consistent with the target environment configuration parameters indicated by the target test script, and / or to adjust the current device operating parameters of the server hard disk to be consistent with the target device operating parameters indicated by the target test script; The target preprocessing script is executed on one or more of the server hard drives.
7. The method according to claim 1, characterized in that, In the case where the target test task includes executing N reference test scripts, and the test priority of the target test script is ranked as the i-th among the N reference test scripts, where N is a positive integer greater than 1 and i is an integer greater than or equal to 1 and less than N, the execution of the target test script on the target server hard drive until one or more of the reference test scripts have been executed, to obtain the target test result, includes: The target test script is executed on the target server hard drive to obtain the i-th sub-test result; The reference test script whose test priority is ranked i+1th among the N reference test scripts is determined as the target test script to be executed now, until i+1 equals N, then the execution of the N reference test scripts ends, and N sub-test results are obtained. The N sub-test results are determined as the target test result.
8. A testing device for server hard drives, characterized in that, include: A receiving module is used to receive a target test request, wherein the target test request is used to request the execution of a target test task on the server hard disk deployed in the server, and the target test task includes executing one or more reference test scripts; The response module is used to respond to the target test request and extract the target test script to be executed from one or more reference test scripts according to the test priority of each reference test script; The filtering module is used to filter out target server hard drives whose current hard drive parameters match the target test parameters of the target test script from one or more server hard drives deployed in the server. The target test parameters are used to indicate the hard drive parameters that the server hard drive to be tested needs to achieve before the target test script performs the corresponding test operation on the server hard drive to be tested. The execution module is used to execute the target test script on the target server hard disk until one or more of the reference test scripts have been executed to obtain the target test result.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Automation test method and device for unified storage equipment
CN107423181A
Hard disk rotation vibration test method, device, equipment and medium
CN118098322A