Hard drive cable testing methods, devices, electronic equipment and storage media

By generating a serial number table and comparing the physical slot numbers of the hard drives, the system automatically detects and corrects hard drive cable connection errors, thus resolving system operation problems caused by hard drive cable connection errors and reducing the server failure rate.

CN115658399BActive Publication Date: 2026-11-17INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211183242.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-27
Publication Date
2026-11-17
Estimated Expiration
2042-09-27

AI Technical Summary

Technical Problem

In server systems, incorrect hard drive cable connections can prevent the hard drive positioning light from illuminating, affecting normal system operation and maintenance. Current technology makes it difficult to automatically detect the correctness of hard drive SATA cable connections before the product leaves the factory.

Method used

By obtaining the serial numbers of the working hard drives in the redundant disk array, generating a serial number table, clearing the disk array information, performing single-disk redundant array activation, obtaining the first and second physical slot numbers of the hard drives, comparing the slot numbers to determine the correctness of the cable connection, and sending alarm information to correct the error.

Benefits of technology

Before the server leaves the factory, it automatically detects and corrects hard drive cable connection errors, reducing the server failure rate and ensuring normal system operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115658399B_ABST
    Figure CN115658399B_ABST
Patent Text Reader

Abstract

This invention provides a hard drive cable detection method. The method includes: obtaining the serial numbers of multiple working hard drives in a redundant disk array and generating a serial number table based on the serial numbers; clearing the disk array information of the working hard drives and determining a target hard drive based on the serial number table; performing single-disk redundant array activation on the target hard drive and obtaining a first physical slot number and a second physical slot number of the target hard drive; and determining the detection result of the target hard drive cable based on the first physical slot number and the second physical slot number. By comparing the first physical slot number and the second physical slot number, the method detects whether the hard drive cable is connected correctly and displays an alarm for hard drives with incorrect connections, thereby reducing the failure rate of servers after they leave the factory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hard disk testing, and in particular to a method, apparatus, electronic device, and storage medium for testing hard disk cables. Background Technology

[0002] Modern server systems typically require a large number of SATA SSDs. However, connecting the hard drive cables requires manual installation. This process involves plugging the SATA cables into the corresponding hard drives. When the lengths of the cables for the upper and lower hard drives in the same area are similar, it is inevitable that the SATA cables will be connected incorrectly. This can cause users to be unable to activate the corresponding hard drive's identification light when sending commands to locate a particular hard drive, thus affecting the normal operation of the system and maintenance. Therefore, it is necessary to detect the correctness of the hard drive SATA cable connections on the production line before the server leaves the factory and to display an alarm for incorrectly connected hard drives to prevent any impact on customers after the server leaves the factory. Summary of the Invention

[0003] Therefore, it is necessary to provide a hard drive cable detection method, device, electronic device, and storage medium that can automatically detect whether the hard drive SATA cable is connected correctly, in order to address the above-mentioned technical problems.

[0004] Firstly, a method for detecting hard drive cables is provided, the method comprising:

[0005] Obtain the serial numbers of multiple working hard disks in the redundant disk array and generate a serial number table based on the serial numbers;

[0006] Clear the disk array information of the working hard disk and determine the target hard disk according to the serial number table;

[0007] Perform single-disk redundant array activation on the target hard disk and obtain the first physical slot number and the second physical slot number of the target hard disk;

[0008] The detection result of the target hard drive cable is determined based on the first physical slot number and the second physical slot number.

[0009] In one embodiment, performing single-disk redundant array activation on the target hard disk and obtaining the first physical slot number and the second physical slot number of the target hard disk includes:

[0010] After performing single-disk redundant array activation on the target hard disk, the slot identifier number corresponding to the target hard disk is determined and the first physical slot number is obtained based on the slot identifier number;

[0011] Perform read and write operations on the drive letter in the operating system and obtain the second physical slot number based on the read and write operations.

[0012] In one embodiment, after performing single-disk redundant array activation on the target hard drive, determining the slot identifier corresponding to the target hard drive and obtaining the first physical slot number based on the slot identifier includes:

[0013] Determine the slot identifier number corresponding to the target hard drive from the redundant disk array;

[0014] Execute the indicator light lighting operation according to the slot identifier and the operating system's lighting command line, and determine the first target indicator light from multiple first indicator lights according to the indicator light lighting operation;

[0015] Obtain the first physical slot number of the first target indicator light from the redundant disk array.

[0016] In one embodiment, the step of executing an indicator light activation operation based on the slot identifier and the operating system's activation command line, and determining a first target indicator light from a plurality of first indicator lights based on the indicator light activation operation, includes:

[0017] When performing the indicator light illumination operation, the first level of all first indicator lights is detected;

[0018] The first indicator light whose first level changes is identified as the first target indicator light.

[0019] In one embodiment, performing read / write operations on the drive letter in the operating system and obtaining the second physical slot number based on the read / write operations includes:

[0020] When performing read / write operations on the drive letter, detect the second level changes of all second indicator lights;

[0021] The second target indicator light is determined from the second indicator light based on the second level change, and the second physical slot number of the second target indicator light is obtained from the back panel.

[0022] In one embodiment, determining the detection result of the target hard drive cable based on the first physical slot number and the second physical slot number includes:

[0023] Determine whether the first physical slot number and the second physical slot number are consistent;

[0024] If not, then it is determined that the target hard drive cable detection is faulty and an alarm message is sent, wherein the alarm message includes the serial number of the target hard drive;

[0025] If so, the target hard drive cable is confirmed to be functioning normally and the detection result is saved to the serial number table.

[0026] In one embodiment, after determining the detection result of the target hard drive cable based on the first physical slot number and the second physical slot number, the process includes:

[0027] The remaining undetected working hard disks are identified based on the serial number table, and the physical slot numbers of the remaining working hard disks are obtained.

[0028] The detection results of the remaining working hard disks are determined based on the physical slot number;

[0029] When there are no other undetected working hard drives, the detection of the working hard drive's cable ends.

[0030] On the other hand, a hard disk cable detection device is provided, the device comprising:

[0031] The generation module is used to obtain the serial numbers of multiple working hard disks in the redundant disk array and generate a serial number table based on the serial numbers;

[0032] The hard disk determination module is used to clear the disk array information of the working hard disk and determine the target hard disk according to the serial number table;

[0033] The acquisition module is used to perform single-disk redundant array activation on the target hard disk and acquire the first physical slot number and the second physical slot number of the target hard disk;

[0034] The result determination module is used to determine the detection result of the target hard disk cable based on the first physical slot number and the second physical slot number.

[0035] In one embodiment, the acquisition module performs single-disk redundant array activation on the target hard drive and acquires the first physical slot number and the second physical slot number of the target hard drive, including:

[0036] After performing single-disk redundant array activation on the target hard disk, the slot identifier number corresponding to the target hard disk is determined and the first physical slot number is obtained based on the slot identifier number;

[0037] Perform read and write operations on the drive letter in the operating system and obtain the second physical slot number based on the read and write operations.

[0038] In one embodiment, after performing single-disk redundant array activation on the target hard drive, the acquisition module determines the slot identifier corresponding to the target hard drive and obtains the first physical slot number based on the slot identifier, including:

[0039] Determine the slot identifier number corresponding to the target hard drive from the redundant disk array;

[0040] Execute the indicator light lighting operation according to the slot identifier and the operating system's lighting command line, and determine the first target indicator light from multiple first indicator lights according to the indicator light lighting operation;

[0041] Obtain the first physical slot number of the first target indicator light from the redundant disk array.

[0042] In one embodiment, the acquisition module executes an indicator light activation operation based on the slot identifier and the operating system's activation command line, and determines a first target indicator light from a plurality of first indicator lights based on the indicator light activation operation, including:

[0043] When performing the indicator light illumination operation, the first level of all first indicator lights is detected;

[0044] The first indicator light whose first level changes is identified as the first target indicator light.

[0045] In one embodiment, the acquisition module performs read / write operations on the drive letter in the operating system and obtains the second physical slot number based on the read / write operations, including:

[0046] When performing read / write operations on the drive letter, detect the second level changes of all second indicator lights;

[0047] The second target indicator light is determined from the second indicator light based on the second level change, and the second physical slot number of the second target indicator light is obtained from the back panel.

[0048] In one embodiment, the result determination module determines the detection result of the target hard drive cable based on the first physical slot number and the second physical slot number, including:

[0049] Determine whether the first physical slot number and the second physical slot number are consistent;

[0050] If not, then it is determined that the target hard drive cable detection is faulty and an alarm message is sent, wherein the alarm message includes the serial number of the target hard drive;

[0051] If so, the target hard drive cable is confirmed to be functioning normally and the detection result is saved to the serial number table.

[0052] In one embodiment, after the result determination module determines the detection result of the target hard disk cable based on the first physical slot number and the second physical slot number, it includes:

[0053] The remaining undetected working hard disks are identified based on the serial number table, and the physical slot numbers of the remaining working hard disks are obtained.

[0054] The detection results of the remaining working hard disks are determined based on the physical slot number;

[0055] When there are no other undetected working hard drives, the detection of the working hard drive's cable ends.

[0056] In another aspect, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0057] Obtain the serial numbers of multiple working hard disks in the redundant disk array and generate a serial number table based on the serial numbers;

[0058] Clear the disk array information of the working hard disk and determine the target hard disk according to the serial number table;

[0059] Perform single-disk redundant array activation on the target hard disk and obtain the first physical slot number and the second physical slot number of the target hard disk;

[0060] The detection result of the target hard drive cable is determined based on the first physical slot number and the second physical slot number.

[0061] In one embodiment, the processor performs the following steps when executing the computer program:

[0062] The step of performing single-disk redundant array activation on the target hard drive and obtaining the first physical slot number and the second physical slot number of the target hard drive includes:

[0063] After performing single-disk redundant array activation on the target hard disk, the slot identifier number corresponding to the target hard disk is determined and the first physical slot number is obtained based on the slot identifier number;

[0064] Perform read and write operations on the drive letter in the operating system and obtain the second physical slot number based on the read and write operations.

[0065] In one embodiment, the processor performs the following steps when executing the computer program:

[0066] After performing single-disk redundant array activation on the target hard drive, determining the slot identifier corresponding to the target hard drive and obtaining the first physical slot number based on the slot identifier includes:

[0067] Determine the slot identifier number corresponding to the target hard drive from the redundant disk array;

[0068] Execute the indicator light lighting operation according to the slot identifier and the operating system's lighting command line, and determine the first target indicator light from multiple first indicator lights according to the indicator light lighting operation;

[0069] Obtain the first physical slot number of the first target indicator light from the redundant disk array.

[0070] In one embodiment, the processor performs the following steps when executing the computer program:

[0071] The step of executing the indicator light lighting operation based on the slot identifier and the operating system's lighting command line, and determining the first target indicator light from a plurality of first indicator lights based on the indicator light lighting operation, includes:

[0072] When performing the indicator light illumination operation, the first level of all first indicator lights is detected;

[0073] The first indicator light whose first level changes is identified as the first target indicator light.

[0074] In one embodiment, the processor performs the following steps when executing the computer program:

[0075] The step of performing read / write operations on the drive letter in the operating system and obtaining the second physical slot number based on the read / write operations includes:

[0076] When performing read / write operations on the drive letter, detect the second level changes of all second indicator lights;

[0077] The second target indicator light is determined from the second indicator light based on the second level change, and the second physical slot number of the second target indicator light is obtained from the back panel.

[0078] In one embodiment, the processor performs the following steps when executing the computer program:

[0079] The detection result of determining the target hard drive cable based on the first physical slot number and the second physical slot number includes:

[0080] Determine whether the first physical slot number and the second physical slot number are consistent;

[0081] If not, then it is determined that the target hard drive cable detection is faulty and an alarm message is sent, wherein the alarm message includes the serial number of the target hard drive;

[0082] If so, the target hard drive cable is confirmed to be functioning normally and the detection result is saved to the serial number table.

[0083] In one embodiment, the processor performs the following steps when executing the computer program:

[0084] After determining the detection result of the target hard drive cable based on the first physical slot number and the second physical slot number, the process includes:

[0085] The remaining undetected working hard disks are identified based on the serial number table, and the physical slot numbers of the remaining working hard disks are obtained.

[0086] The detection results of the remaining working hard disks are determined based on the physical slot number;

[0087] When there are no other undetected working hard drives, the detection of the working hard drive's cable ends.

[0088] In another aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0089] Obtain the serial numbers of multiple working hard disks in the redundant disk array and generate a serial number table based on the serial numbers;

[0090] Clear the disk array information of the working hard disk and determine the target hard disk according to the serial number table;

[0091] Perform single-disk redundant array activation on the target hard disk and obtain the first physical slot number and the second physical slot number of the target hard disk;

[0092] The detection result of the target hard drive cable is determined based on the first physical slot number and the second physical slot number.

[0093] In one embodiment, the computer program performs the following steps when executed by a processor:

[0094] The step of performing single-disk redundant array activation on the target hard drive and obtaining the first physical slot number and the second physical slot number of the target hard drive includes:

[0095] After performing single-disk redundant array activation on the target hard disk, the slot identifier number corresponding to the target hard disk is determined and the first physical slot number is obtained based on the slot identifier number;

[0096] Perform read and write operations on the drive letter in the operating system and obtain the second physical slot number based on the read and write operations.

[0097] In one embodiment, the computer program performs the following steps when executed by a processor:

[0098] After performing single-disk redundant array activation on the target hard drive, determining the slot identifier corresponding to the target hard drive and obtaining the first physical slot number based on the slot identifier includes:

[0099] Determine the slot identifier number corresponding to the target hard drive from the redundant disk array;

[0100] Execute the indicator light lighting operation according to the slot identifier and the operating system's lighting command line, and determine the first target indicator light from multiple first indicator lights according to the indicator light lighting operation;

[0101] Obtain the first physical slot number of the first target indicator light from the redundant disk array.

[0102] In one embodiment, the computer program performs the following steps when executed by a processor:

[0103] The step of executing the indicator light lighting operation based on the slot identifier and the operating system's lighting command line, and determining the first target indicator light from a plurality of first indicator lights based on the indicator light lighting operation, includes:

[0104] When performing the indicator light illumination operation, the first level of all first indicator lights is detected;

[0105] The first indicator light whose first level changes is identified as the first target indicator light.

[0106] In one embodiment, the computer program performs the following steps when executed by a processor:

[0107] The step of performing read / write operations on the drive letter in the operating system and obtaining the second physical slot number based on the read / write operations includes:

[0108] When performing read / write operations on the drive letter, detect the second level changes of all second indicator lights;

[0109] The second target indicator light is determined from the second indicator light based on the second level change, and the second physical slot number of the second target indicator light is obtained from the back panel.

[0110] In one embodiment, the computer program performs the following steps when executed by a processor:

[0111] The detection result of determining the target hard drive cable based on the first physical slot number and the second physical slot number includes:

[0112] Determine whether the first physical slot number and the second physical slot number are consistent;

[0113] If not, then it is determined that the target hard drive cable detection is faulty and an alarm message is sent, wherein the alarm message includes the serial number of the target hard drive;

[0114] If so, the target hard drive cable is confirmed to be functioning normally and the detection result is saved to the serial number table.

[0115] In one embodiment, the computer program performs the following steps when executed by a processor:

[0116] After determining the detection result of the target hard drive cable based on the first physical slot number and the second physical slot number, the process includes:

[0117] The remaining undetected working hard disks are identified based on the serial number table, and the physical slot numbers of the remaining working hard disks are obtained.

[0118] The detection results of the remaining working hard disks are determined based on the physical slot number;

[0119] When there are no other undetected working hard drives, the detection of the working hard drive's cable ends.

[0120] The system obtains the serial numbers of multiple working hard drives in a redundant disk array and generates a serial number table based on these serial numbers. It then clears the disk array information of the working hard drives and identifies the target hard drive based on the serial number table. Single-disk redundant array activation is performed on the target hard drive, and its first and second physical slot numbers are obtained. The detection result of the target hard drive cable is determined based on the first and second physical slot numbers. By comparing the first and second physical slot numbers, the system detects whether the hard drive cable is connected correctly and displays an alarm for incorrectly connected hard drives, reducing the failure rate of the server after it leaves the factory. Attached Figure Description

[0121] Figure 1 This is a flowchart illustrating the hard drive cable testing method.

[0122] Figure 2 This is a schematic diagram illustrating the steps of a hard drive cable testing method.

[0123] Figure 3 A schematic diagram of a hard disk cable detection device;

[0124] Figure 4 This is an internal structural diagram of a computer device in an embodiment of the present invention. Detailed Implementation

[0125] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description, in conjunction with the accompanying drawings and embodiments, further illustrates this application. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0126] The method provided in this application can be applied to, for example... Figure 1The flowchart shown illustrates the hard drive cable testing method. Before the server leaves the factory, a serial number table of the working hard drives in the server is first generated and the original disk array information is cleared. Then, the physical slot number corresponding to the locate light and active light is obtained based on the ignition of the locate light and the read / write operation of the drive letter. Finally, it is determined whether the hard drive SATA cable (data cable) is connected correctly.

[0127] In one embodiment, such as Figure 2 As shown, the present invention provides a hard disk cable detection method, the method comprising:

[0128] S201. Obtain the serial numbers of multiple working hard disks in the redundant disk array and generate a serial number table based on the serial numbers;

[0129] S202. Clear the disk array information of the working hard disk and determine the target hard disk according to the serial number table;

[0130] S203. Perform single-disk redundant array activation on the target hard disk and obtain the first physical slot number and the second physical slot number of the target hard disk.

[0131] S204. Determine the detection result of the target hard disk cable based on the first physical slot number and the second physical slot number.

[0132] Specifically, the system accesses the server, obtains the serial numbers of all hard drives connected to the RAID card (Redundant Array of Independent Disks) and generates a serial number table, retrieves the physical slot numbers Physical_slot1 and Physical_slot2 of the hard drives according to the serial numbers, and checks whether the hard drive cables are properly connected.

[0133] In one embodiment, performing single-disk redundant array activation on the target hard disk and obtaining the first physical slot number and the second physical slot number of the target hard disk includes:

[0134] After performing single-disk redundant array activation on the target hard disk, the slot identifier number corresponding to the target hard disk is determined and the first physical slot number is obtained based on the slot identifier number;

[0135] Perform read and write operations on the drive letter in the operating system and obtain the second physical slot number based on the read and write operations.

[0136] Specifically, the first step is to clear the RAID information of all hard drives. This involves setting the hard drives to non-RAID status in the server system, deleting the original configuration information saved during the previous RAID setup, and then resetting the hard drives to RAID status. After clearing the RAID information of all hard drives, the system sequentially sets up RAID 0 for hard drive number 1. RAID 0 involves synchronous writing and reading of data across multiple disks, merging multiple hard drives into one and continuously distributing data across each disk. Because the bandwidth is doubled, the read / write speed is doubled. A single-disk RAID 0 setup involves clearing the RAID information of all hard drives, separating the previously merged drives, and activating only one drive, such as hard drive number 1.

[0137] In one embodiment, after performing single-disk redundant array activation on the target hard drive, determining the slot identifier corresponding to the target hard drive and obtaining the first physical slot number based on the slot identifier includes:

[0138] Determine the slot identifier number corresponding to the target hard drive from the redundant disk array;

[0139] Execute the indicator light lighting operation according to the slot identifier and the operating system's lighting command line, and determine the first target indicator light from multiple first indicator lights according to the indicator light lighting operation;

[0140] Obtain the first physical slot number of the first target indicator light from the redundant disk array.

[0141] Specifically, as mentioned above, when hard drive 1 is activated individually (single-disk redundant array activation), the system file in the server system is accessed, and the slot ID (slot identifier) ​​of the disk under the RAID card is queried through the command in the system file. Based on the slot ID corresponding to the hard drive and the activation command, the location light (first target indicator light) of the disk is turned on.

[0142] In one embodiment, the step of executing an indicator light activation operation based on the slot identifier and the operating system's activation command line, and determining a first target indicator light from a plurality of first indicator lights based on the indicator light activation operation, includes:

[0143] When performing the indicator light illumination operation, the first level of all first indicator lights is detected;

[0144] The first indicator light whose first level changes is identified as the first target indicator light.

[0145] Specifically, when the location light corresponding to the target hard drive lights up, the RAID card accesses the CPLD module (Complex Programmable Logic Device) and detects the level changes of all indicator lights. For example, a RAID card with 8 hard drives has 8 corresponding location lights. When a level change is detected, the location light corresponding to the target hard drive is determined from the 8 location lights. Then, the I2C address of that location light and the corresponding physical slot number Physical_slot1 are determined.

[0146] In one embodiment, performing read / write operations on the drive letter in the operating system and obtaining the second physical slot number based on the read / write operations includes:

[0147] When performing read / write operations on the drive letter, detect the second level changes of all second indicator lights;

[0148] The second target indicator light is determined from the second indicator light based on the second level change, and the second physical slot number of the second target indicator light is obtained from the back panel.

[0149] Specifically, the correspondence between the active LEDs of the hard drives and Physical_slot2 is defined during the initial backplane design. Under the operating system, read and write operations are performed on the target hard drive, such as drive letter sda corresponding to hard drive number 1. Similarly, the CPLD module is accessed through the RAID card, and the level changes of all indicator lights are detected. For example, there are 8 active LEDs on the RAID card with 8 connected hard drives. When a level change is detected, the active LED corresponding to the target hard drive is determined from the 8 active LEDs, and the I2C address of the active LED is determined. The corresponding physical slot number Physical_slot2 is obtained from the backplane design specifications.

[0150] In one embodiment, determining the detection result of the target hard drive cable based on the first physical slot number and the second physical slot number includes:

[0151] Determine whether the first physical slot number and the second physical slot number are consistent;

[0152] If not, then it is determined that the target hard drive cable detection is faulty and an alarm message is sent, wherein the alarm message includes the serial number of the target hard drive;

[0153] If so, the target hard drive cable is confirmed to be functioning normally and the detection result is saved to the serial number table.

[0154] Specifically, although the "locate" and "active" lights are different and have different data transmission paths, as long as the cable connection is correct, the final physical slot numbers of the two lights on the same hard drive should be consistent. The SATA cable connection result of the hard drive is determined by comparing whether Physical_slot1 and Physical_slot2 are consistent. If they are consistent, the SATA cable connection of the hard drive is detected as correct, and the detection result is saved to the serial number table; if they are inconsistent, the SATA cable connection of the hard drive is detected as incorrect, and an alarm message containing, for example, an error message indicating a SATA cable connection error for hard drive number 1 is sent.

[0155] In one embodiment, after determining the detection result of the target hard drive cable based on the first physical slot number and the second physical slot number, the process includes:

[0156] The remaining undetected working hard disks are identified based on the serial number table, and the physical slot numbers of the remaining working hard disks are obtained.

[0157] The detection results of the remaining working hard disks are determined based on the physical slot number;

[0158] When there are no other undetected working hard drives, the detection of the working hard drive's cable ends.

[0159] Specifically, after testing hard drive number 1, the cable test continues for hard drive number 2. The testing process ends when all hard drive cables in the sequence list have been tested.

[0160] The proposed solution has the following beneficial effects:

[0161] 1) Before the server leaves the factory, the physical slot number corresponding to the locate and active lights is compared to detect whether the hard drive SATA cable is connected correctly;

[0162] 2) Display an alarm for incorrectly connected hard drives to remind users to reconnect the SATA cable to reduce the server's failure rate.

[0163] It should be understood that, although Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but may be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0164] In one embodiment, such as Figure 3 As shown, a hard disk cable testing device is provided, the device comprising:

[0165] The generation module 301 is used to obtain the serial numbers of multiple working hard disks in the disk redundancy array and generate a serial number table based on the serial numbers;

[0166] The hard disk determination module 302 is used to clear the disk array information of the working hard disk and determine the target hard disk according to the serial number table;

[0167] The acquisition module 303 is used to perform single-disk redundant array activation on the target hard disk and acquire the first physical slot number and the second physical slot number of the target hard disk.

[0168] The result determination module 304 is used to determine the detection result of the target hard disk cable based on the first physical slot number and the second physical slot number.

[0169] In one embodiment, the acquisition module performs single-disk redundant array activation on the target hard drive and acquires the first physical slot number and the second physical slot number of the target hard drive, including:

[0170] After performing single-disk redundant array activation on the target hard disk, the slot identifier number corresponding to the target hard disk is determined and the first physical slot number is obtained based on the slot identifier number;

[0171] Perform read and write operations on the drive letter in the operating system and obtain the second physical slot number based on the read and write operations.

[0172] In one embodiment, after performing single-disk redundant array activation on the target hard drive, the acquisition module determines the slot identifier corresponding to the target hard drive and obtains the first physical slot number based on the slot identifier, including:

[0173] Determine the slot identifier number corresponding to the target hard drive from the redundant disk array;

[0174] Execute the indicator light lighting operation according to the slot identifier and the operating system's lighting command line, and determine the first target indicator light from multiple first indicator lights according to the indicator light lighting operation;

[0175] Obtain the first physical slot number of the first target indicator light from the redundant disk array.

[0176] In one embodiment, the acquisition module executes an indicator light activation operation based on the slot identifier and the operating system's activation command line, and determines a first target indicator light from a plurality of first indicator lights based on the indicator light activation operation, including:

[0177] When performing the indicator light illumination operation, the first level of all first indicator lights is detected;

[0178] The first indicator light whose first level changes is identified as the first target indicator light.

[0179] In one embodiment, the acquisition module performs read / write operations on the drive letter in the operating system and obtains the second physical slot number based on the read / write operations, including:

[0180] When performing read / write operations on the drive letter, detect the second level changes of all second indicator lights;

[0181] The second target indicator light is determined from the second indicator light based on the second level change, and the second physical slot number of the second target indicator light is obtained from the back panel.

[0182] In one embodiment, the result determination module determines the detection result of the target hard drive cable based on the first physical slot number and the second physical slot number, including:

[0183] Determine whether the first physical slot number and the second physical slot number are consistent;

[0184] If not, then it is determined that the target hard drive cable detection is faulty and an alarm message is sent, wherein the alarm message includes the serial number of the target hard drive;

[0185] If so, the target hard drive cable is confirmed to be functioning normally and the detection result is saved to the serial number table.

[0186] In one embodiment, after the result determination module determines the detection result of the target hard disk cable based on the first physical slot number and the second physical slot number, it includes:

[0187] The remaining undetected working hard disks are identified based on the serial number table, and the physical slot numbers of the remaining working hard disks are obtained.

[0188] The detection results of the remaining working hard disks are determined based on the physical slot number;

[0189] When there are no other undetected working hard drives, the detection of the working hard drive's cable ends.

[0190] Specific limitations regarding the hard drive cable testing device can be found in the limitations of the hard drive cable testing method described above, and will not be repeated here. Each module in the aforementioned hard drive cable testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0191] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an alarm information processing method. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0192] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0193] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps:

[0194] Obtain the serial numbers of multiple working hard disks in the redundant disk array and generate a serial number table based on the serial numbers;

[0195] Clear the disk array information of the working hard disk and determine the target hard disk according to the serial number table;

[0196] Perform single-disk redundant array activation on the target hard disk and obtain the first physical slot number and the second physical slot number of the target hard disk;

[0197] The detection result of the target hard drive cable is determined based on the first physical slot number and the second physical slot number.

[0198] In one embodiment, the processor performs the following steps when executing the computer program:

[0199] The step of performing single-disk redundant array activation on the target hard drive and obtaining the first physical slot number and the second physical slot number of the target hard drive includes:

[0200] After performing single-disk redundant array activation on the target hard disk, the slot identifier number corresponding to the target hard disk is determined and the first physical slot number is obtained based on the slot identifier number;

[0201] Perform read and write operations on the drive letter in the operating system and obtain the second physical slot number based on the read and write operations.

[0202] In one embodiment, the processor performs the following steps when executing the computer program:

[0203] After performing single-disk redundant array activation on the target hard drive, determining the slot identifier corresponding to the target hard drive and obtaining the first physical slot number based on the slot identifier includes:

[0204] Determine the slot identifier number corresponding to the target hard drive from the redundant disk array;

[0205] Execute the indicator light lighting operation according to the slot identifier and the operating system's lighting command line, and determine the first target indicator light from multiple first indicator lights according to the indicator light lighting operation;

[0206] Obtain the first physical slot number of the first target indicator light from the redundant disk array.

[0207] In one embodiment, the processor performs the following steps when executing the computer program:

[0208] The step of executing the indicator light lighting operation based on the slot identifier and the operating system's lighting command line, and determining the first target indicator light from a plurality of first indicator lights based on the indicator light lighting operation, includes:

[0209] When performing the indicator light illumination operation, the first level of all first indicator lights is detected;

[0210] The first indicator light whose first level changes is identified as the first target indicator light.

[0211] In one embodiment, the processor performs the following steps when executing the computer program:

[0212] The step of performing read / write operations on the drive letter in the operating system and obtaining the second physical slot number based on the read / write operations includes:

[0213] When performing read / write operations on the drive letter, detect the second level changes of all second indicator lights;

[0214] The second target indicator light is determined from the second indicator light based on the second level change, and the second physical slot number of the second target indicator light is obtained from the back panel.

[0215] In one embodiment, the processor performs the following steps when executing the computer program:

[0216] The detection result of determining the target hard drive cable based on the first physical slot number and the second physical slot number includes:

[0217] Determine whether the first physical slot number and the second physical slot number are consistent;

[0218] If not, then it is determined that the target hard drive cable detection is faulty and an alarm message is sent, wherein the alarm message includes the serial number of the target hard drive;

[0219] If so, the target hard drive cable is confirmed to be functioning normally and the detection result is saved to the serial number table.

[0220] In one embodiment, the processor performs the following steps when executing the computer program:

[0221] After determining the detection result of the target hard drive cable based on the first physical slot number and the second physical slot number, the process includes:

[0222] The remaining undetected working hard disks are identified based on the serial number table, and the physical slot numbers of the remaining working hard disks are obtained.

[0223] The detection results of the remaining working hard disks are determined based on the physical slot number;

[0224] When there are no other undetected working hard drives, the detection of the working hard drive's cable ends.

[0225] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0226] Obtain the serial numbers of multiple working hard disks in the redundant disk array and generate a serial number table based on the serial numbers;

[0227] Clear the disk array information of the working hard disk and determine the target hard disk according to the serial number table;

[0228] Perform single-disk redundant array activation on the target hard disk and obtain the first physical slot number and the second physical slot number of the target hard disk;

[0229] The detection result of the target hard drive cable is determined based on the first physical slot number and the second physical slot number.

[0230] In one embodiment, the computer program performs the following steps when executed by a processor:

[0231] The step of performing single-disk redundant array activation on the target hard drive and obtaining the first physical slot number and the second physical slot number of the target hard drive includes:

[0232] After performing single-disk redundant array activation on the target hard disk, the slot identifier number corresponding to the target hard disk is determined and the first physical slot number is obtained based on the slot identifier number;

[0233] Perform read and write operations on the drive letter in the operating system and obtain the second physical slot number based on the read and write operations.

[0234] In one embodiment, the computer program performs the following steps when executed by a processor:

[0235] After performing single-disk redundant array activation on the target hard drive, determining the slot identifier corresponding to the target hard drive and obtaining the first physical slot number based on the slot identifier includes:

[0236] Determine the slot identifier number corresponding to the target hard drive from the redundant disk array;

[0237] Execute the indicator light lighting operation according to the slot identifier and the operating system's lighting command line, and determine the first target indicator light from multiple first indicator lights according to the indicator light lighting operation;

[0238] Obtain the first physical slot number of the first target indicator light from the redundant disk array.

[0239] In one embodiment, the computer program performs the following steps when executed by a processor:

[0240] The step of executing the indicator light lighting operation based on the slot identifier and the operating system's lighting command line, and determining the first target indicator light from a plurality of first indicator lights based on the indicator light lighting operation, includes:

[0241] When performing the indicator light illumination operation, the first level of all first indicator lights is detected;

[0242] The first indicator light whose first level changes is identified as the first target indicator light.

[0243] In one embodiment, the computer program performs the following steps when executed by a processor:

[0244] The step of performing read / write operations on the drive letter in the operating system and obtaining the second physical slot number based on the read / write operations includes:

[0245] When performing read / write operations on the drive letter, detect the second level changes of all second indicator lights;

[0246] The second target indicator light is determined from the second indicator light based on the second level change, and the second physical slot number of the second target indicator light is obtained from the back panel.

[0247] In one embodiment, the computer program performs the following steps when executed by a processor:

[0248] The detection result of determining the target hard drive cable based on the first physical slot number and the second physical slot number includes:

[0249] Determine whether the first physical slot number and the second physical slot number are consistent;

[0250] If not, then it is determined that the target hard drive cable detection is faulty and an alarm message is sent, wherein the alarm message includes the serial number of the target hard drive;

[0251] If so, the target hard drive cable is confirmed to be functioning normally and the detection result is saved to the serial number table.

[0252] In one embodiment, the computer program performs the following steps when executed by a processor:

[0253] After determining the detection result of the target hard drive cable based on the first physical slot number and the second physical slot number, the process includes:

[0254] The remaining undetected working hard disks are identified based on the serial number table, and the physical slot numbers of the remaining working hard disks are obtained.

[0255] The detection results of the remaining working hard disks are determined based on the physical slot number;

[0256] When there are no other undetected working hard drives, the detection of the working hard drive's cable ends.

[0257] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0258] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0259] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for detecting hard disk cables, the method comprising: Obtain the serial numbers of multiple working hard disks in the redundant disk array and generate a serial number table based on the serial numbers; Clear the disk array information of the working hard disk and determine the target hard disk according to the serial number table; Perform single-disk redundant array activation on the target hard disk and obtain the first physical slot number and the second physical slot number of the target hard disk; The detection result of the target hard drive cable is determined based on the first physical slot number and the second physical slot number; The step of performing single-disk redundant array activation on the target hard drive and obtaining the first physical slot number and the second physical slot number of the target hard drive includes: After performing single-disk redundant array activation on the target hard disk, the slot identifier number corresponding to the target hard disk is determined and the first physical slot number is obtained based on the slot identifier number; Perform read / write operations on the drive letter in the operating system and obtain the second physical slot number based on the read / write operations; After performing single-disk redundant array activation on the target hard drive, determining the slot identifier corresponding to the target hard drive and obtaining the first physical slot number based on the slot identifier includes: Determine the slot identifier number corresponding to the target hard drive from the redundant disk array; Execute the indicator light lighting operation according to the slot identifier and the operating system's lighting command line, and determine the first target indicator light from multiple first indicator lights according to the indicator light lighting operation; Obtain the first physical slot number of the first target indicator light from the redundant disk array; The step of executing the indicator light lighting operation based on the slot identifier and the operating system's lighting command line, and determining the first target indicator light from a plurality of first indicator lights based on the indicator light lighting operation, includes: When performing the indicator light illumination operation, the first level of all first indicator lights is detected; The first indicator light whose first level changes is identified as the first target indicator light. The step of performing read / write operations on the drive letter in the operating system and obtaining the second physical slot number based on the read / write operations includes: When performing read / write operations on the drive letter, detect the second level changes of all second indicator lights; The second target indicator light is determined from the second indicator light based on the second level change, and the second physical slot number of the second target indicator light is obtained from the back panel.

2. The method of claim 1, wherein, The detection result of determining the target hard drive cable based on the first physical slot number and the second physical slot number includes: Determine whether the first physical slot number and the second physical slot number are consistent; If not, then it is determined that the target hard drive cable detection is faulty and an alarm message is sent, wherein the alarm message includes the serial number of the target hard drive; If so, the target hard drive cable is confirmed to be functioning normally and the detection result is saved to the serial number table.

3. The method of claim 1, wherein, After determining the detection result of the target hard drive cable based on the first physical slot number and the second physical slot number, the process includes: The remaining undetected working hard disks are identified based on the serial number table, and the physical slot numbers of the remaining working hard disks are obtained. The detection results of the remaining working hard disks are determined based on the physical slot number; When there are no other undetected working hard drives, the detection of the working hard drive's cable ends.

4. A hard disk cable detection device for implementing the method of claim 1, the device comprising: The generation module is used to obtain the serial numbers of multiple working hard disks in the redundant disk array and generate a serial number table based on the serial numbers; The hard disk determination module is used to clear the disk array information of the working hard disk and determine the target hard disk according to the serial number table; The acquisition module is used to perform single-disk redundant array activation on the target hard disk and acquire the first physical slot number and the second physical slot number of the target hard disk; The result determination module is used to determine the detection result of the target hard disk cable based on the first physical slot number and the second physical slot number.

5. An electronic device, comprising: include: One or more processors; And a memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the method as described in any one of claims 1 to 3.

6. A computer storage medium, characterized in that, It stores a computer program, which, when executed by a processor, implements the method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • A hard disk indicator light control method and system suitable for multiple types of hard disks

    CN109032900A

  • Server cable detection system and communication method thereof

    CN114661546A