Server hard disk testing method and device, storage medium and electronic equipment

Through an intelligent server hard disk testing method, priority sorting and hard disk parameter matching are used to solve the problem of low testing efficiency in the existing technology, and a faster and more reliable testing process is achieved.

CN119440926AActive Publication Date: 2025-02-14INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202411546085.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14
Estimated Expiration
2044-10-31

AI Technical Summary

Technical Problem

In the prior art, the testing efficiency of server hard disks is low and there is a lack of effective automated testing methods, which leads to a long test time and is prone to data loss.

Method used

Provides a test method for server hard disks. By receiving target test requests, responding to and extracting the highest priority test script, filtering out the target hard disk with matching hard disk parameters, and executing the test script until all reference test scripts are completed.

Benefits of technology

Improves the testing efficiency of server hard disks, reduces testing time, avoids data loss, and simplifies the testing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440926A_ABST
    Figure CN119440926A_ABST
Patent Text Reader

Abstract

The invention discloses a server hard disk testing method and device, a storage medium and electronic equipment. The server hard disk testing method comprises the steps that a target testing request is received; in response to the target test request, extracting a current to-be-executed target test script from one or more reference test scripts according to the test priority of each reference test script; screening out a target server hard disk of which the current hard disk parameter is matched with the target test parameter of the target test script from one or more server hard disks deployed in the server; the target test script is executed on the target server hard disk until the one or more reference test scripts are all executed, and the target test result is obtained, by adopting the technical scheme, the problems that in the related technology, the test efficiency of the server hard disk is low and the like are solved, and then the technical effect of improving the test efficiency of the server hard disk is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the computer field, and in particular, to a server hard disk testing method and device, a storage medium, and an electronic device. Background Art

[0002] In the field of information technology, data storage is a core component. Solid State Drive (SSD), as a new generation of storage devices, is gradually replacing traditional mechanical hard disk drives (HDD) with its excellent read and write speed, high reliability and durability. The popularity of SSDs has also brought about the need for strict quality control and performance testing. In order to ensure the reliability and performance of SSD products, manufacturers must conduct a series of automated tests on each SSD, such as read and write performance tests, stability tests, compatibility tests, and durability tests. These tests can ensure that the SSD can perform as expected under various operating conditions and meet the needs of different application scenarios.

[0003] In the prior art, SSD testing methods usually rely on manual or semi-automated processes. Testers need to select all available test hard drives, then remotely connect to the test devices where these hard drives are located and send test scripts. Before the test begins, the SSD usually needs to be formatted to ensure that the test starts from a clean state, which is not only time-consuming but may also cause the loss of data from previous tests. In addition, in order to simulate specific test conditions, such as high load or specific usage scenarios, testers may need to manually construct these conditions, which further increases the complexity and time cost of the test.

[0004] In view of the problems in the related technologies such as low testing efficiency of server hard disks, no effective solutions have been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a method and device for testing a server hard disk, a storage medium, and an electronic device, so as to at least solve the problem of low testing efficiency of a server hard disk in the related art.

[0006] According to an embodiment of the present application, a method for testing a server hard disk is provided, comprising:

[0007] Receiving a target test request, wherein the target test request is used to request execution of a target test task on a server hard disk deployed in the server, the target test task including execution of one or more reference test scripts;

[0008] In response to the target test request, extracting a target test script to be executed currently from one or more reference test scripts according to the test priority of each reference test script;

[0009] Filter out a target server hard disk whose current hard disk parameters match the target test parameters of the target test script from one or more server hard disks deployed in the server, wherein the target test parameters are used to indicate the hard disk parameters that the server hard disk to be tested needs to reach before the target test script performs the corresponding test operation on the server hard disk to be tested;

[0010] The target test script is executed on the target server hard disk until one or more reference test scripts are executed to obtain a target test result.

[0011] Optionally, extracting a target test script to be executed currently from one or more reference test scripts according to the test priority of each reference test script includes:

[0012] Detect the queue priority of the script test queue where each reference test script in one or more reference test scripts is located, wherein the queue priority is used to indicate the priority with which the reference test script in the corresponding script test queue is executed, and the reference test script in the script test queue with a higher queue priority is executed with a higher priority;

[0013] The target test script with the highest test priority is obtained from the target script test queue with the highest test priority in the current queue.

[0014] Optionally, before detecting the queue priority of the script test queue where each of the one or more reference test scripts is located, the method further includes:

[0015] Detecting 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 environmental configuration parameters that the hard disk of the server to be tested needs to achieve before the corresponding reference test script performs the corresponding test operation on the hard disk of the server to be tested, and the device condition information is used to indicate the target device operating parameters that the hard disk of the server to be tested needs to achieve before the corresponding reference test script performs the corresponding test operation on the hard disk of the server to be tested, and the hard disk parameters indicated to be achieved by the target test parameters include the target environmental configuration parameters and the target device operating parameters;

[0016] Dividing one or more of the reference test scripts into one or more of the 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;

[0017] The queue priority is assigned to each of the one or more script test queues.

[0018] Optionally, allocating the queue priority to each of the one or more script test queues includes:

[0019] Detecting a first construction parameter of the environmental condition information corresponding to each of the script test queues, and a 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 to be tested to construct the environmental configuration parameters indicated by the environmental condition information, and the second construction parameter is used to indicate the difficulty of controlling the hard disk of the server to be tested to construct the device operating parameters indicated by the device condition information;

[0020] Detecting the number of scripts of the reference test scripts included in each of the script test queues;

[0021] The queue priority is assigned to each script test queue according to the first construction parameter, the second construction parameter and the number of scripts of each script test queue, wherein the queue priority of the script test queue with an easier difficulty level indicated by the first construction parameter is set higher, the queue priority of the script test queue with an easier difficulty level indicated by the second construction parameter is set higher, and the queue priority of the script test queue with a larger number of scripts is set higher.

[0022] Optionally, one or more server hard disks deployed in the server are divided into multiple hard disk resource pools, current environment configuration parameters of the server hard disks in the same hard disk resource pool are the same, the hard disk parameters indicated by the target test parameters include target environment configuration parameters and target device operation parameters, and selecting a target server hard disk whose current hard disk parameters match the target test parameters of the target test script from the one or more server hard disks deployed in the server includes:

[0023] Detecting whether the current environment configuration parameters of the server hard disk in the hard disk resource pool are consistent with the target environment configuration parameters in the multiple hard disk resource pools, wherein the current hard disk parameters of the server hard disk to be tested include the current environment configuration parameters;

[0024] In the case where it is detected that the current environment configuration parameters of the server hard disk in the target hard disk resource pool among 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 screened out 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;

[0025] When it is detected that the current environment configuration parameters of no server hard disk in the multiple hard disk resource pools are consistent with the target environment configuration parameters, and / or, the current device operating parameters of no server hard disk are consistent with the target device operating parameters, the current environment configuration parameters and / or the current device operating parameters of one or more server hard disks are adjusted.

[0026] Optionally, the adjusting the current environment configuration parameters of one or more of the server hard disks and / or the current device operation parameters includes:

[0027] Obtain a 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 disks.

[0029] Optionally, when the target test task includes executing N reference test scripts, the test priority of the target test script is ranked as the i-th among the N reference test scripts, N is a positive integer greater than 1, and i is an integer greater than or equal to 1 and less than N, executing the target test script on the target server hard disk until one or more reference test scripts are executed to obtain a target test result includes:

[0030] Execute the target test script on the target server hard disk to obtain the i-th sub-test result;

[0031] Determine the reference test script ranked i+1th in the test priority among the N reference test scripts as the target test script to be executed currently, until i+1 equals N, terminate the execution of the N reference test scripts, and obtain N sub-test results;

[0032] The N sub-test results are determined as the target test results.

[0033] According to another embodiment of the present application, a server hard disk test device is provided, including:

[0034] A receiving module, configured to receive a target test request, wherein the target test request is used to request execution of a target test task on a server hard disk deployed in the server, wherein the target test task includes execution of one or more reference test scripts;

[0035] A response module, used for responding to the target test request, and extracting the target test script to be executed currently from one or more reference test scripts according to the test priority of each reference test script;

[0036] A screening module, used to screen out a target server hard disk whose current hard disk parameters match the target test parameters of the target test script from one or more server hard disks deployed in the server, wherein the target test parameters are used to indicate the hard disk parameters that the server hard disk to be tested needs to reach before the target test script performs a corresponding test operation on the server hard disk to be tested;

[0037] An execution module is used to execute the target test script on the target server hard disk until one or more reference test scripts are executed to obtain a target test result.

[0038] According to another embodiment of the present application, a computer program product is provided, including a computer program, wherein the computer program is executed by a processor to perform the steps in any of the above method embodiments.

[0039] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0040] According to another embodiment of the present application, an electronic device is 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 execute the steps in any one of the above method embodiments.

[0041] In an embodiment of the present application, a method for testing a server hard disk is proposed. First, a target test request is received. The target test request can request to execute a target test task on a server hard disk deployed in a server. The target test task includes executing one or more reference test scripts. Then, in response to the target test request, the target test script to be executed is extracted from one or more reference test scripts according to the test priority of each reference test script. Then, a target server hard disk whose current hard disk parameters match the target test parameters of the target test script is screened out from one or more server hard disks deployed in the server. The target test parameters can indicate the hard disk parameters that the target test script needs to reach for the server hard disk to be tested before the target test script executes the corresponding test operation on the server hard disk to be tested. Finally, the target test script is executed on the target server hard disk until one or more All reference test scripts are executed to obtain the target test results. In the above-mentioned server hard disk test method, when responding to the target test request, the target test script to be executed can be intelligently selected according to the test priority. This is different from the prior art in that before preparing to execute the target test script, it is necessary to construct a server hard disk that meets the target test parameters from scratch. This solution can filter out the target server hard disk whose current hard disk parameters match the target test parameters of the target test script from multiple server hard disks, and directly execute the target test script on the target server hard disk, thereby saving a lot of time consumed in constructing a server hard disk that meets the target test parameters and improving the test efficiency of the server hard disk. The above-mentioned technical solution is adopted to solve the problems of low test efficiency of server hard disks in related technologies and achieve the technical effect of improving the test efficiency of server hard disks. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a hardware structure block diagram of a computer device of a server hard disk testing method according to an embodiment of the present application;

[0043] Figure 2 is a flow chart of a method for testing a server hard disk according to an embodiment of the present application;

[0044] Figure 3 is a schematic diagram of a server hard disk test process and a test system according to an embodiment of the present application;

[0045] Figure 4 It is a structural diagram of a server hard disk test system script according to an embodiment of the present application;

[0046] Figure 5 It is a schematic diagram of a server hard disk testing method flow according to an embodiment of the present application;

[0047] Figure 6is a schematic diagram of a method for testing a server hard disk according to an embodiment of the present application;

[0048] Figure 7 It is a structural block diagram of a server hard disk testing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0049] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0050] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0051] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a computer device for testing a server hard disk in an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0052] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the test method of the server hard disk in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a 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 a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0053] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0054] In this embodiment, a method for testing a server hard disk is provided. Figure 2 is a flow chart of a method for testing a server hard disk according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0055] Step S12, receiving a target test request, wherein the target test request is used to request execution of a target test task on a server hard disk deployed in the server, wherein the target test task includes executing one or more reference test scripts;

[0056] Step S14, in response to the target test request, extracting the target test script to be executed currently from one or more reference test scripts according to the test priority of each reference test script;

[0057] Step S16, screening out a target server hard disk whose current hard disk parameters match the target test parameters of the target test script from one or more server hard disks deployed in the server, wherein the target test parameters are used to indicate the hard disk parameters that the server hard disk to be tested needs to reach before the target test script performs the corresponding test operation on the server hard disk to be tested;

[0058] Step S18, executing the target test script on the target server hard disk until one or more reference test scripts are executed to obtain a target test result.

[0059] Optionally, in this embodiment, Figure 3 is a schematic diagram of a server hard disk test process and a test system according to an embodiment of the present 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 design can be but is not limited to being used to receive, respond to, schedule and execute test requests for server hard disks, and can be but is not limited to executing the various steps in the server hard disk testing method proposed in this application through the above modules in the test system.

[0060] Optionally, in this embodiment, the target test request may be but is not limited to a request to execute a series of target test tasks for a server hard disk deployed on the server, where the server hard disk may be but is not limited to including 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 the required test content in detail, including a test object, a test type, a test condition, a test script, etc., for example: test object: SSD model XP1000, batch number BATCH20241015, quantity 10,000; test type: performance test, reliability test; test conditions: operating system Windows 10, ambient temperature of 23°C±2°C, ambient humidity of 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 formatting test script LowLevelFormatTestScript_v1.0 (clears all data and resets the SSD status), 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 test urgency or importance of the test script. It can be a digital identifier, directly using numbers 1, 2, 3, etc. to identify the priority. The smaller the number, the higher the priority.

[0063] Optionally, in this embodiment, assuming that the test priority of the performance test script PerfTest_SeqWriteTest_v1.0 is 1, the test priority of the reliability test script Reliability_TortureTest_v2.0 is 2, and the test priority of the low-level formatting test script LowLevelFormatTestScript_v1.0 is 3, the test system will extract the test scripts as target test scripts waiting for execution in the order of the test priorities of the test scripts, i.e., PerfTest_SeqWriteTest_v1.0, Reliability_TortureTest_v2.0, and LowLevelFormatTestScript_v1.0.

[0064] Optionally, in this embodiment, a hard disk whose corresponding hard disk parameters match the target test parameters of the target test script is selected from multiple SSDs and determined as the target server hard disk. The hard disk parameters may be but are not limited to environmental configuration parameters and device operation parameters.

[0065] Optionally, in this embodiment, Figure 4 is a structural diagram of a server hard disk test system script according to an embodiment of the present application, such as Figure 4 As shown, the server hard disk test system script includes a preprocessing script and a test script, wherein there are multiple preprocessing scripts in the preprocessing script part, which are used to perform corresponding hard disk parameter construction operations according to the requirements of different test scripts; the test script includes environmental information definition (defining environmental parameters required for testing), which can be but not limited to being expressed in the form of test environment marking, test preprocessing (checking whether the hard disk parameters of the server hard disk meet the test parameters of the test script, if there is no qualified server hard disk, calling the preprocessing script to construct hard disk parameters matching the test parameters), which can be but not limited to being expressed in the form of test condition marking, and formal testing (the test script executes the test operation and obtains the test results).

[0066] As an optional solution, extracting the target test script to be executed currently from one or more reference test scripts according to the test priority of each reference test script includes:

[0067] S21, detecting the queue priority of the script test queue where each reference test script in one or more reference test scripts is located, wherein the queue priority is used to indicate the priority with which the reference test script in the corresponding script test queue is executed, and the reference test script in the script test queue with a higher queue priority is executed with a higher priority;

[0068] S22, obtaining the target test script with the highest test priority from the target script test queue with the highest test priority in the current queue.

[0069] Optionally, in this embodiment, it is assumed that there are script test queues and corresponding queue priorities: queue A (A level), queue B (B level), queue C (C level), and the earlier the alphabetical order of the preset queue priority is, the higher the queue priority is. Then the order in which the test scripts in queue A are executed takes precedence over the 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 the test scripts will be in order of the test priority of the test scripts from high to low, that is, test1, test2, and test3, and the test scripts will be obtained in turn as target test scripts waiting for execution.

[0071] Optionally, in this embodiment, if Figure 3 As shown, after executing the target test script, the test record saving module in the test system is used to save the test record of the test disc, and the test record is used to indicate the reference test script that has been tested currently.

[0072] As an optional solution, before detecting the queue priority of the script test queue where each of the one or more reference test scripts is located, the method further includes:

[0073] S31, detecting 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 environmental configuration parameters that the hard disk of the server to be tested needs to achieve before the corresponding reference test script performs the corresponding test operation on the hard disk of the server to be tested, and the device condition information is used to indicate the target device operating parameters that the hard disk of the server to be tested needs to achieve before the corresponding reference test script performs the corresponding test operation on the hard disk of the server to be tested, and the hard disk parameters indicated by the target test parameters include the target environmental configuration parameters and the target device operating parameters;

[0074] S32, dividing one or more of the reference test scripts into one or more of the script test queues according to the environmental condition information and the device condition information, wherein the environmental condition information and the device condition information of the reference test scripts in the same script test queue are the same;

[0075] S33: assign the queue priority to each of the one or more script test queues.

[0076] Optionally, in this embodiment, if Figure 3As shown, the test classification module in the test system can perform two classifications according to the environmental condition information and equipment condition information of each test script, and divide all test scripts into different test queues. One classification operation may be: classify the test scripts for the first time according to the environmental condition information, and then classify the test scripts for the second time according to the test equipment condition information under the same environmental condition information classification. After the two classifications, the test scripts in the same category are confirmed 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 equipment condition information.

[0077] Optionally, in this embodiment, the test classification module can also mark the test script as an irrecoverable test when the test script is an irrecoverable test. An irrecoverable test means that after the test script is executed, the server hard disk used for the test will not be able to be restored to the state before the test, such as the low-level formatting test script LowLevelFormatTestScript_v1.0. The test script marked as irrecoverable will be placed in a special script test queue, and its queue priority will be set to the lowest. This queue will only be executed after other script test queues are executed, thereby maximizing the utilization of the server hard disk and improving the efficiency of the server hard disk test.

[0078] Optionally, in this embodiment, the environmental condition information may be environmental configuration parameters of the SSD to be tested, such as SSD parameters itself (such as model and batch number), operating system parameters (Windows 10 or Linux Ubuntu 20.04, etc.), ambient temperature parameters (23°C±2°C), etc., and the device condition information may be device operating parameters of the SSD to be tested, which can be used to indicate specific requirements or status that need to be met before the server hard disk performs the test, such as server hard disk read and write times parameters, server hard disk used space ratio parameters, etc.

[0079] As an optional solution, allocating the queue priority to each of the one or more script test queues includes:

[0080] S41, detecting a first construction parameter of the environmental condition information corresponding to each of the script test queues, and a 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 to be tested to construct the environmental configuration parameters indicated by the environmental condition information, and the second construction parameter is used to indicate the difficulty of controlling the hard disk of the server to be tested to construct the device operating parameters indicated by the device condition information;

[0081] S42, detecting the number of scripts of the reference test scripts included in each of the script test queues;

[0082] S43, allocating the queue priority for each script test queue according to the first construction parameter, the second construction parameter and the number of scripts of each script test queue, wherein the queue priority of the script test queue with an easier difficulty level indicated by the first construction parameter is set higher, the queue priority of the script test queue with an easier difficulty level indicated by the second construction parameter is set higher, and the queue priority of the script test queue with a larger number of scripts is set higher.

[0083] Optionally, in this embodiment, for a single script test queue, all test scripts contained therein belong to the same category of environmental condition information and the same category of device condition information, and a method of allocating queue priorities to the script test queue according to 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 construction parameter, and determine the difficulty of controlling the hard disk of the server to be tested to build the environmental configuration parameters indicated by the environmental condition information as the first construction parameter. For example, there are the following possibilities: 1 point (standard configuration, no special settings required); 2 points (specific operating system or network configuration required); 3 points (complex environmental simulation required, such as multi-system collaboration or special network environment), etc.

[0085] The second step is to calculate the second build parameter, and determine the difficulty of controlling the hard disk of the server to be tested to build the device operating parameters indicated by the device condition information as the second build parameter. For example, there are the following possibilities: 1 point (standard operating parameters, no special adjustment required); 2 points (special power management or performance monitoring settings required); 3 points (need to simulate 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 scripts included in the script test queue.

[0087] In the fourth step, the queue priority is calculated according to the first build parameter, the second build parameter and the number of scripts. The calculation method can be:

[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 higher the priority calculation result in the team, the higher the queue priority of the script test queue.

[0090] Optionally, in this embodiment, assuming that the first construction parameter of queue A is 2, the second construction parameter is 1, and the number of scripts is 5, the first construction parameter of queue B is 3, the second construction parameter is 2, and the number of scripts is 3, and the preset weight factor 1 and weight factor 2 are 1, the queue priority calculation formula can be used to obtain the queue priority calculation results of queue A and queue B as 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 disks deployed in the server are divided into multiple hard disk resource pools, the current environment configuration parameters of the server hard disks in the same hard disk resource pool are the same, the hard disk parameters indicated by the target test parameters include target environment configuration parameters and target device operation parameters, and the target server hard disk whose current hard disk parameters match the target test parameters of the target test script is screened out from the one or more server hard disks deployed in the server, includes:

[0092] S51, detecting whether the current environment configuration parameters of the server hard disk in the hard disk resource pool are consistent with the target environment configuration parameters in the multiple hard disk resource pools, 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 among the multiple hard disk resource pools are consistent with the target environment configuration parameters, the target server hard disk whose current device operation parameters are consistent with the target device operation parameters is screened out 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 operation parameters;

[0094] S53, when it is detected that there is no server hard disk in the multiple hard disk resource pools whose current environment configuration parameters are consistent with the target environment configuration parameters, and / or there is no server hard disk whose current device operating parameters are consistent with the target device operating parameters, adjust the current environment configuration parameters and / or the current device operating parameters of one or more of the server hard disks.

[0095] Optionally, in this embodiment, if Figure 3 As shown, the environment identification module in the test system divides one or more SSDs deployed in the server into multiple hard disk resource pools according to the corresponding environment configuration parameters, that is, the SSDs contained in a hard disk resource pool all have the same environment configuration parameters, such as Figure 3As shown, the test matching module in the test system is used to filter out the target server hard disk whose current hard disk parameters match the target test parameters of the target test script from multiple SSDs, and may include but is not limited to the following steps: first, compare the environmental configuration parameters of the SSD in each hard disk resource pool with the target environmental configuration parameters, and determine the matching hard disk resource pool as the target hard disk resource pool. If there is no matching hard disk resource pool, adjust the environmental configuration parameters of the SSD, that is, start the preprocessing script to configure the corresponding environmental parameters; then, filter the SSD whose device operating parameters are consistent with the target device operating parameters from the target hard disk resource pool. When the screening result is yes, determine the screening result as the target server hard disk. When the screening result is no, adjust the device operating parameters of the SSD, that is, start the preprocessing script to configure the corresponding device operating parameters.

[0096] As an optional solution, the adjusting the current environment configuration parameters of one or more of the server hard disks and / or the current device operation parameters includes:

[0097] S61, obtaining a 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 disks.

[0099] Optionally, in this embodiment, if 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 environmental configuration parameter adjustment and equipment operation parameter adjustment, to adjust the hard disk parameters of the server hard disk to the parameters required by the target test script.

[0100] As an optional solution, when the target test task includes executing N reference test scripts, the test priority of the target test script is ranked as the i-th in the N reference test scripts, N is a positive integer greater than 1, and i is an integer greater than or equal to 1 and less than N, the target test script is executed on the target server hard disk until one or more reference test scripts are executed to obtain a target test result, including:

[0101] S71, executing the target test script on the target server hard disk to obtain the i-th sub-test result;

[0102] S72, determining the reference test script ranked i+1th in the test priority among the N reference test scripts as the target test script to be executed currently, until i+1 equals N, terminating the execution of the N reference test scripts, and obtaining N sub-test results;

[0103] S73: Determine the N sub-test results as the target test results.

[0104] Optionally, in this embodiment, if 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 that the target test task requires the execution of N test scripts, the execution method can be but is not limited to: select the script test queue with the highest queue priority in the current script test queue as the target queue, select the test scripts as the target test scripts in the target queue according to the test priority of the test scripts, and filter out the server hard disk matching the target test script in the hardware resource pool as the target server hard disk. Before matching, determine whether the current server hard disk status is normal, and remove the server hard disk with an abnormal judgment result from the current hard disk resource pool. At the same time, 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, and then remove the target test script from the script test queue. Then select other unexecuted test scripts according to the order of test priority. If the number of test scripts in the script test queue becomes 0, delete the script test queue until all test scripts are executed, and N sub-test results are obtained, which are determined as the target test results.

[0105] In this embodiment, a method for testing a server hard disk is provided. Figure 5 is a schematic diagram of a server hard disk testing method flow according to an embodiment of the present application, such as Figure 5As shown, the main steps include the following: First, the server hard disk test system detects whether there is a script test queue to be processed. If so, the system will select a script test queue and check whether it is empty. Once a non-empty test queue is selected, the system will select a test script from it in the order of the test priority of the test script, and further confirm whether there is an available hardware resource pool to execute the script. If the hardware resource pool exists, the system will check whether the server hard disk in the hardware resource pool meets the test conditions, where the test conditions include the environment configuration parameters and device operation parameters required to execute the test script. If the test conditions are not met, the system will call the preprocessing script to prepare the server hard disk that meets the test conditions. Once the hard disk is ready, the test script will be executed. This process may be repeated until the script test queue is empty or all hard disk resource pools have been used up. The entire process is designed 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 description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0107] In this embodiment, a server hard disk test device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0108] Figure 6 is a structural block diagram of a server hard disk test device according to an embodiment of the present application; Figure 6 As shown, including:

[0109] A receiving module 602 is used to receive a target test request, wherein the target test request is used to request to execute a target test task on a server hard disk deployed in the server, and the target test task includes executing one or more reference test scripts;

[0110] A response module 604 is used to respond to the target test request and extract a target test script to be executed from one or more reference test scripts according to the test priority of each reference test script;

[0111] A screening module 606 is used to screen out a target server hard disk whose current hard disk parameters match the target test parameters of the target test script from one or more of the server hard disks deployed in the server, wherein the target test parameters are used to indicate the hard disk parameters that the server hard disk to be tested needs to reach before the target test script performs the corresponding test operation on the server hard disk 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 reference test scripts are executed to obtain a target test result.

[0113] In an exemplary embodiment, the response module includes:

[0114] A first detection unit is used to detect the queue priority of the script test queue where each reference test script in 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 to be executed, and the reference test script in the script test queue with a higher queue priority is executed with a higher priority;

[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 test priority in the current queue.

[0116] In an exemplary embodiment, the apparatus further comprises:

[0117] A detection module, used for detecting the environmental condition information and device condition information of each of the one or more reference test scripts before detecting the queue priority of the script test queue where each of the one or more reference test scripts is located, wherein the environmental condition information is used for indicating the target environmental configuration parameters that the hard disk of the server to be tested needs to achieve before the corresponding reference test script performs the corresponding test operation on the hard disk of the server to be tested, and the device condition information is used for indicating the target device operating parameters that the hard disk of the server to be tested needs to achieve before the corresponding reference test script performs the corresponding test operation on the hard disk of the server to be tested, and the hard disk parameters indicated to be achieved by the target test parameters include the target environmental configuration parameters and the target device operating parameters;

[0118] A division module, used for dividing one or more of the reference test scripts into one or more of the 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 between the reference test scripts in the same script test queue;

[0119] An allocation module is used to allocate the queue priority to each of the one or more script test queues.

[0120] In an exemplary embodiment, the allocation module comprises:

[0121] A second detection unit is used to detect a first construction parameter of the environmental condition information corresponding to each of the script test queues, and a 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 to be tested to construct the environmental configuration parameters indicated by the environmental condition information, and the second construction parameter is used to indicate the difficulty of controlling the hard disk of the server to be tested to construct the device operating parameters indicated by the device condition information;

[0122] A third detection unit, used for detecting the number of scripts of the reference test scripts included in each of the script test queues;

[0123] An allocation unit is used to allocate the queue priority for each script test queue according to the first construction parameter, the second construction parameter and the number of scripts of each script test queue, wherein the queue priority of the script test queue with an easier difficulty level indicated by the first construction parameter is set higher, the queue priority of the script test queue with an easier difficulty level indicated by the second construction parameter is set higher, and the queue priority of the script test queue with a larger number of scripts is set higher.

[0124] In an exemplary embodiment, one or more server hard disks deployed in the server are divided into multiple hard disk resource pools, the current environment configuration parameters of the server hard disks in the same hard disk resource pool are the same, the hard disk parameters indicated by the target test parameters include target environment configuration parameters and target device operation parameters, and the screening module includes:

[0125] A fourth detection unit is used to detect whether the current environment configuration parameters of the server hard disk in the hard disk resource pool are consistent with the target environment configuration parameters in the multiple hard disk resource pools, wherein the current hard disk parameters of the server hard disk to be tested include the current environment configuration parameters;

[0126] A screening unit, for screening 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 when it is detected that the current environment configuration parameters of the server hard disk in the target hard disk resource pool among 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 device operating parameters;

[0127] A configuration unit is used to adjust the current environment configuration parameters and / or the current device operating parameters of one or more of the server hard disks when it is detected that the current environment configuration parameters of the server hard disk that do not exist in the multiple hard disk resource pools are consistent with the target environment configuration parameters, and / or, the current device operating parameters of the server hard disk that do not exist are consistent with the target device operating parameters.

[0128] In an exemplary embodiment, the configuration unit is used to:

[0129] Obtain a 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 disks.

[0131] In an exemplary embodiment, when the target test task includes executing N reference test scripts, the test priority of the target test script is ranked as the i-th in the N reference test scripts, 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, configured to execute the target test script on the target server hard disk to obtain an i-th sub-test result;

[0133] A first determination unit is used to determine the reference test script ranked i+1th in the test priority among the N reference test scripts as the target test script to be executed currently, until i+1 is equal to N, terminate the execution of the N reference test scripts, and obtain N sub-test results;

[0134] The second determining unit is used to determine the N sub-test results as the target test results.

[0135] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0136] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method described in each embodiment of the present application; the computer program product also includes a non-volatile computer-readable storage medium, which stores the computer program, and when executed by a processor, implements the steps of the method described in each embodiment of the present application.

[0137] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0138] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0139] An embodiment of the present application further provides an electronic device, Figure 7 is a schematic diagram of an electronic device according to an embodiment of the present application, such as Figure 7 As shown, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0140] In an 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] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0142] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0143] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for testing a server hard disk, characterized in that: include: Receiving a target test request, wherein the target test request is used to request execution of a target test task on a server hard disk deployed in the server, wherein the target test task includes executing one or more reference test scripts; In response to the target test request, extracting a target test script to be executed currently from one or more reference test scripts according to the test priority of each reference test script; Filter out a target server hard disk whose current hard disk parameters match the target test parameters of the target test script from one or more server hard disks deployed in the server, wherein the target test parameters are used to indicate the hard disk parameters that the server hard disk to be tested needs to reach before the target test script performs the corresponding test operation on the server hard disk to be tested; The target test script is executed on the target server hard disk until one or more reference test scripts are executed to obtain a target test result.

2. The method according to claim 1, characterized in that The step of extracting a target test script to be executed from one or more reference test scripts according to the test priority of each reference test script comprises: Detect the queue priority of the script test queue where each reference test script in one or more reference test scripts is located, wherein the queue priority is used to indicate the priority with which the reference test script in the corresponding script test queue is executed, and the reference test script in the script test queue with a higher queue priority is executed with a higher priority; The target test script with the highest test priority is obtained from the target script test queue with the highest test priority in the current queue.

3. The method according to claim 2, characterized in that Before detecting the queue priority of the script test queue where each of the one or more reference test scripts is located, the method further includes: Detecting 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 environmental configuration parameters that the hard disk of the server to be tested needs to achieve before the corresponding reference test script performs the corresponding test operation on the hard disk of the server to be tested, and the device condition information is used to indicate the target device operating parameters that the hard disk of the server to be tested needs to achieve before the corresponding reference test script performs the corresponding test operation on the hard disk of the server to be tested, and the hard disk parameters indicated to be achieved by the target test parameters include the target environmental configuration parameters and the target device operating parameters; Dividing one or more of the reference test scripts into one or more of the 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; The queue priority is assigned to each of the one or more script test queues.

4. The method according to claim 3, characterized in that The allocating the queue priority to each of the one or more script test queues comprises: Detecting a first construction parameter of the environmental condition information corresponding to each of the script test queues, and a 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 to be tested to construct the environmental configuration parameters indicated by the environmental condition information, and the second construction parameter is used to indicate the difficulty of controlling the hard disk of the server to be tested to construct the device operating parameters indicated by the device condition information; Detecting the number of scripts of the reference test scripts included in each of the script test queues; The queue priority is assigned to each script test queue according to the first construction parameter, the second construction parameter and the number of scripts of each script test queue, wherein the queue priority of the script test queue with an easier difficulty level indicated by the first construction parameter is set higher, the queue priority of the script test queue with an easier difficulty level indicated by the second construction parameter is set higher, and the queue priority of the script test queue with a larger number of scripts is set higher.

5. The method according to claim 1, characterized in that One or more server hard disks deployed in the server are divided into multiple hard disk resource pools, the current environment configuration parameters of the server hard disks in the same hard disk resource pool are the same, the hard disk parameters indicated by the target test parameters include target environment configuration parameters and target device operation parameters, and the target server hard disk whose current hard disk parameters match the target test parameters of the target test script is selected from the one or more server hard disks deployed in the server, including: Detecting whether the current environment configuration parameters of the server hard disk in the hard disk resource pool are consistent with the target environment configuration parameters in the multiple hard disk resource pools, wherein the current hard disk parameters of the server hard disk to be tested include the current environment configuration parameters; In the case where it is detected that the current environment configuration parameters of the server hard disk in the target hard disk resource pool among 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 screened out 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; When it is detected that the current environment configuration parameters of no server hard disk in the multiple hard disk resource pools are consistent with the target environment configuration parameters, and / or, the current device operating parameters of no server hard disk are consistent with the target device operating parameters, the current environment configuration parameters and / or the current device operating parameters of one or more server hard disks are adjusted.

6. The method according to claim 5, characterized in that The adjusting the current environment configuration parameters of one or more of the server hard disks and / or the current device operation parameters includes: Obtain a 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 disks.

7. The method according to claim 1, characterized in that In the case where the target test task includes executing N reference test scripts, the test priority of the target test script is ranked as the i-th in the N reference test scripts, N is a positive integer greater than 1, and i is an integer greater than or equal to 1 and less than N, executing the target test script on the target server hard disk until one or more reference test scripts are executed to obtain a target test result, including: Execute the target test script on the target server hard disk to obtain the i-th sub-test result; Determine the reference test script ranked i+1th in the test priority among the N reference test scripts as the target test script to be executed currently, until i+1 equals N, terminate the execution of the N reference test scripts, and obtain N sub-test results; The N sub-test results are determined as the target test results.

8. A server hard disk testing device, characterized in that: include: A receiving module, configured to receive a target test request, wherein the target test request is used to request execution of a target test task on a server hard disk deployed in the server, wherein the target test task includes execution of one or more reference test scripts; A response module, used for responding to the target test request, and extracting the target test script to be executed currently from one or more reference test scripts according to the test priority of each reference test script; A screening module, used to screen out a target server hard disk whose current hard disk parameters match the target test parameters of the target test script from one or more server hard disks deployed in the server, wherein the target test parameters are used to indicate the hard disk parameters that the server hard disk to be tested needs to reach before the target test script performs a corresponding test operation on the server hard disk to be tested; An execution module is used to execute the target test script on the target server hard disk until one or more reference test scripts are executed to obtain a 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 implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.

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, the steps of the method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Automation test method and device for unified storage equipment

    CN107423181A

  • Test task execution method and device, equipment and storage medium

    CN116225937A

  • Test method and device of network switching equipment, storage medium and electronic device

    CN118075169A

  • Hard disk rotation vibration test method, device, equipment and medium

    CN118098322A

  • Method and apparatus for continuous integration testing

    US20220138093A1

Cited By

  • RAID card test method, device and system

    CN120315955A

  • Hard disk test method and electronic equipment

    CN120673793A