A hard disk lighting method, device, server and product

By generating a mapping relationship table between the hard disk drive letter and the baseboard management controller disk sequence in the operating system, the problem of lighting misalignment of the NVMe hard disk status indicator when the PCIe cable is connected incorrectly is solved, and accurate lighting is achieved when the PCIe cable is installed out of order. Effect.

CN118245335BActive Publication Date: 2024-09-24JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410683907.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-24
Estimated Expiration
2044-05-30

AI Technical Summary

Technical Problem

The existing NVMe hard disk status indicator light control technology can easily cause lighting misalignment when the PCIe cable is connected incorrectly, and cannot meet the actual needs of production and maintenance links.

Method used

By generating and maintaining the mapping relationship table between the hard disk drive letter and the baseboard management controller disk sequence in the operating system, the lighting command is escaped into the target lighting command, and forwarded to the complex programmable logic device through the baseboard management controller. Realize the hard disk lighting operation and isolate the mapping relationship between the PCIe cable position and the hard disk position.

Benefits of technology

Even when PCIe cables are installed out of order, the indicator lights of the target hard disk can still be accurately lit to avoid misaligned lights, and the mapping relationship table is automatically updated to adapt to changes in hardware topology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000
    Figure 00000000_0000
Patent Text Reader

Abstract

The embodiments of the present application provide a method, device, server and product for lighting a hard disk, which belongs to the technical field of data processing. The method includes: the operating system responds to a lighting instruction, obtains the drive letter of the target hard disk corresponding to the lighting instruction, and according to a mapping relationship table, converts the lighting instruction into a target lighting command and sends it to the baseboard management controller. The mapping relationship table includes the mapping relationship between the drive letter of each hard disk under the operating system and the disk sequence under the baseboard management controller. The target lighting command carries the disk sequence of the target hard disk; after receiving the target lighting command, the baseboard management controller forwards the target lighting command to a complex programmable logic device; the complex programmable logic device performs the lighting operation in response to the target lighting command. The embodiments of the present application aim to provide a method for lighting normally when the PCIe cables are installed out of order.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of data processing, and in particular, to a hard disk lighting method, device, server and product. Background Art

[0002] With the rapid development of big data, network card technology has also been greatly improved. 100Gbps / 200Gbps network card technology has become very mature and has been widely used in various industries. When high-speed network cards are used in storage machines, NVMe (Non-Volatile Memoryexpress, non-volatile memory host controller interface specification) hard disk technology has also developed rapidly, among which NVMe hard disk status indicator light control technology has also attracted much attention.

[0003] In the current NVMe hard disk status indicator light control technology, when the CPU (Central Processing Unit) is in the volume management device enable mode, VPP_I2C (Voltage Programming Pluse Inter-Intergrated Circuit) is responsible for sending the indicator light control signal; when the CPU is in the volume management device disable mode, the I2C (Inter-Integrated Circuit) of the baseboard management controller is responsible for sending the indicator light control signal, and the complex programmable logic device is responsible for parsing the control signal and executing the corresponding hard disk status indicator light control.

[0004] However, the current NVMe hard drive status indicator light control technology is mainly based on the mapping relationship between the hard drive physical slot and the hard drive position of the baseboard management controller. This relationship is fixed. If the PCIe (peripheral component interconnect express, a high-speed serial computer expansion bus standard) line connecting the hard drive is connected incorrectly, the hard drive position will change. If the lighting operation is still based on the mapping relationship established between the hard drive physical slot and the hard drive position of the baseboard management controller, the problem of lighting misalignment will occur. However, in the production link or later maintenance link, the problem of cable misconnection is inevitable. Therefore, the lighting effect of the current indicator light control technology cannot meet the needs of actual applications. Summary of the invention

[0005] The embodiments of the present application provide a hard disk lighting method, device, server and product, aiming to provide a method that can still light up normally when the PCIe cables are installed in disorder.

[0006] In a first aspect, an embodiment of the present application provides a hard disk lighting method, which is applied to a server, wherein the server includes an operating system, a baseboard management controller, multiple hard disks based on a non-volatile memory host controller interface specification, and a complex programmable logic device, and the method includes:

[0007] The operating system obtains the drive letter of the target hard disk corresponding to the light-on instruction in response to the light-on instruction, and converts the light-on instruction into a target light-on command according to a mapping relationship table and sends it to the baseboard management controller, wherein the mapping relationship table includes a mapping relationship between the drive letter of each hard disk under the operating system and the drive sequence under the baseboard management controller, and the target light-on command carries the drive sequence of the target hard disk;

[0008] After receiving the target lighting command, the baseboard management controller forwards the target lighting command to the complex programmable logic device;

[0009] The complex programmable logic device performs a lighting operation in response to the target lighting command.

[0010] Optionally, the method further comprises:

[0011] The operating system executes a mapping relationship table generation strategy to generate and store a mapping relationship table.

[0012] Optionally, the mapping relationship table generation strategy includes:

[0013] Obtaining a drive letter and a hard disk serial number corresponding to each hard disk among the multiple hard disks, and storing them in a first database;

[0014] Obtaining the disk sequence and hard disk serial number of each hard disk in the baseboard management controller;

[0015] Matching the hard disk serial numbers of the current hard disks with the hard disk serial numbers stored in the first database;

[0016] A mapping relationship is established between the drive letters and drive sequences of the hard disks with the same hard disk serial numbers, and a mapping relationship table is generated.

[0017] Optionally, a command line tool nvmecli is installed in the operating system, and obtaining a drive letter and a hard disk serial number corresponding to each hard disk in the multiple hard disks includes:

[0018] The command line tool nvmecli is called to obtain a drive letter and a hard disk serial number corresponding to each hard disk in the multiple hard disks.

[0019] Optionally, the operating system is installed with a platform management tool ipmitool, and obtaining the disk sequence and hard disk serial number of each hard disk in the baseboard management controller includes:

[0020] The platform management tool ipmitool is called to obtain the disk sequence and hard disk serial number of each hard disk in the baseboard management controller.

[0021] Optionally, the method further comprises:

[0022] Each time the computer is turned on, the operating system automatically updates the mapping relationship table.

[0023] Optionally, the method further comprises:

[0024] Real-time detection of whether hot-swap operation occurs;

[0025] When the hot plug operation is detected, the operating system updates the mapping relationship table.

[0026] Optionally, detecting in real time whether a hot-swap operation occurs includes:

[0027] Automatically run monitoring state machine;

[0028] The monitoring state machine analyzes the command line utility Dmesg log at a preset time interval to check whether there is a hot plug record;

[0029] If there is a hot plug record within the preset time interval, it indicates that a hot plug operation has occurred, and the monitoring state machine sends a mapping relationship table refresh command to the operating system.

[0030] Optionally, after detecting in real time whether a hot plug operation occurs, the method further includes:

[0031] When a pull-out type operation is detected, the hard disk to be removed is determined;

[0032] The operating system deletes the mapping relationship between the drive letter and the drive sequence corresponding to the hard disk to be deleted in the mapping relationship table.

[0033] Optionally, after detecting in real time whether a hot plug operation occurs, the method further includes:

[0034] When a hot-swap operation is detected, the operating system determines whether a mapping relationship between a drive letter and a drive sequence corresponding to the hot-swap hard disk changes;

[0035] If the mapping relationship between the drive letter and the disk sequence corresponding to the hot-swappable hard disk changes, the mapping relationship between the drive letter and the disk sequence after the change is used to overwrite the current mapping relationship between the drive letter and the disk sequence of the hot-swappable hard disk in the mapping relationship table.

[0036] Optionally, according to the mapping relationship table, translating the lighting instruction into a target lighting command includes:

[0037] The operating system separates the command character, the drive letter of the target hard disk, the lighting type and the lighting action included in the lighting instruction;

[0038] For the command character, the drive letter of the target hard disk, the lighting type and the lighting action,

[0039] The command character, the drive letter of the target hard disk, the type of lighting, and the lighting action included in the lighting instruction are respectively escaped, wherein the drive letter of the target hard disk is escaped to the drive sequence of the target hard disk according to the mapping relationship table during the escape process;

[0040] Based on the escaped command character, the disk sequence of the target hard disk, the lighting type and the lighting action, a target lighting command is obtained by combination.

[0041] Optionally, a platform management tool ipmitool is installed on the operating system, and according to a mapping relationship table, the light-on instruction is converted into a target light-on command, including:

[0042] The platform management tool ipmitool is called, and the platform management tool ipmitool converts the light-on instruction into a target light-on command according to a mapping relationship table.

[0043] Optionally, the method further comprises:

[0044] The operating system determines the target hard disk in response to the user's positioning light lighting selection operation, and generates a positioning light lighting instruction corresponding to the target hard disk, wherein the lighting instruction carries the drive letter of the target hard disk.

[0045] Optionally, the method further comprises:

[0046] The operating system monitors the health status of any hard disk among the multiple hard disks, and when any hard disk is in an unhealthy state, generates a lighting instruction for a fault light corresponding to the target hard disk, wherein the lighting instruction carries the drive letter of the target hard disk.

[0047] Optionally, the method further comprises:

[0048] The operating system generates a lighting instruction for a positioning light corresponding to the target operating hard disk in response to an insertion operation of the target operating hard disk in the test mode, and displays a drive letter corresponding to the operating hard disk on an interface of the operating system.

[0049] In a second aspect, an embodiment of the present application provides a hard disk lighting device, which is applied to a server, wherein the server includes an operating system, a baseboard management controller, multiple hard disks based on a non-volatile memory host controller interface specification, and a complex programmable logic device, wherein the device includes:

[0050] a target lighting command generating module, arranged in the operating system, for responding to a lighting command, obtaining a drive letter of a target hard disk corresponding to the lighting command, and translating the lighting command into a target lighting command according to a mapping relationship table and sending the target lighting command to the baseboard management controller, wherein the mapping relationship table includes a mapping relationship between a drive letter of each hard disk under the operating system and a drive sequence under the baseboard management controller, and the target lighting command carries the drive sequence of the target hard disk;

[0051] A command forwarding module, arranged in the baseboard management controller, is used for forwarding the target lighting command to the complex programmable logic device after receiving the target lighting command;

[0052] A command execution module is provided in the complex programmable logic device and is used for executing a lighting operation in response to the target lighting command.

[0053] In a third aspect, an embodiment of the present application provides a server, comprising an operating system, a baseboard management controller, multiple hard disks based on a non-volatile memory host controller interface specification, and a complex programmable logic device, wherein the server is used to execute the hard disk lighting method described in the first aspect of the embodiment.

[0054] In a fourth aspect, an embodiment of the present application provides a non-volatile readable storage medium, wherein the non-volatile readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the hard disk lighting method described in the first aspect of the embodiment is executed.

[0055] In a fifth aspect, an embodiment of the present application provides a computing and processing device, including:

[0056] A memory in which a computer-readable code is stored; and one or more processors, when the computer-readable code is executed by the one or more processors, the computing and processing device executes the hard disk lighting method described in the first aspect of the embodiment.

[0057] In a sixth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the hard disk lighting method described in the first aspect of the embodiment.

[0058] Beneficial effects:

[0059] When the method turns on the hard disk, the operating system responds to the turning-on instruction, obtains the drive letter of the target hard disk corresponding to the turning-on instruction, and according to a mapping relationship table, converts the turning-on instruction into a target turning-on command and sends it to the baseboard management controller, wherein the mapping relationship table includes the mapping relationship between the drive letter of each hard disk under the operating system and the disk sequence under the baseboard management controller, and the target turning-on command carries the disk sequence of the target hard disk; after receiving the target turning-on command, the baseboard management controller forwards the target turning-on command to the complex programmable logic device; and the complex programmable logic device performs the turning-on operation in response to the target turning-on command.

[0060] By maintaining the mapping relationship between the drive letter of each hard disk and the drive sequence under the baseboard management controller in the mapping relationship table, the PCIe wiring position is decoupled from the hard disk position, so that when the PCIe cables are installed in disorder, the target hard disk can still be accurately lit. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0062] Figure 1 A schematic diagram of lighting in the related art provided by an embodiment of the present application is shown;

[0063] Figure 2 A flowchart showing the steps of the hard disk lighting method provided by an embodiment of the present application is shown;

[0064] Figure 3 A flowchart showing the steps of the mapping relationship table generation strategy provided by an embodiment of the present application is shown;

[0065] Figure 4 A schematic diagram of establishing a mapping relationship provided in an embodiment of the present application is shown;

[0066] Figure 5 A schematic diagram of a mapping relationship table provided in an embodiment of the present application is shown;

[0067] Figure 6 A schematic diagram of a process for detecting a hot-swap operation provided in an embodiment of the present application is shown;

[0068] Figure 7 A flowchart of the steps of generating a target lighting command provided by an embodiment of the present application is shown;

[0069] Figure 8 A functional module diagram of a hard disk lighting device provided in an embodiment of the present application is shown;

[0070] Fig. 9A schematic diagram of a server provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0071] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0072] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, each embodiment of the present application will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in each embodiment of the present application, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can also be implemented. The division of the following embodiments is for the convenience of description, and the specific implementation of the present application should not constitute any limitation, and the various embodiments can be combined with each other and referenced to each other without contradiction.

[0073] HDD: Hard Disk Drive, mechanical hard disk;

[0074] NVMe: Non-Volatile Memory express, non-volatile memory host controller interface specification;

[0075] PCIe: peripheral component interconnect express, a high-speed serial computer expansion bus standard;

[0076] IT:Information Technology, information technology;

[0077] CPU: Central Processing Unit, central processing unit;

[0078] VMDEnable: Volume Management Device Enable, volume management device enable;

[0079] VMDDisable: Volume Management Device Disable, volume management device disabled;

[0080] BMC: Baseboard Management Controller, which is an independent hardware chip or firmware embedded in the server's motherboard and is used to monitor, manage, diagnose and recover server hardware;

[0081] VPP_I2C: Voltage Programming Pluse Inter-Intergrated Circuit, voltage programming pulse two-wire bidirectional serial bus;

[0082] CPLD: Complex Programmable logic device, complex programmable logic device;

[0083] I2C: Inter-Integrated Circuit, two-wire bidirectional serial bus;

[0084] nvme-cli: a command-line tool for interacting with NVMe devices;

[0085] ipmitool: a command-line IPMI (Intelligent Platform Management Interface) platform management tool that can be used in Linux systems;

[0086] Dmesg: Diagnostic Message, is a command-line utility for examining and controlling kernel loopback buffer messages on Linux and Unix systems.

[0087] With the rapid improvement of network card technology, 100Gbps / 200Gbps network card technology has become very mature and is widely used in various industries. When high-speed network cards are used in storage machines, the read and write speeds of traditional HDD hard drives cannot give full play to the performance of network cards. NVMe hard drives came into being. Their ultra-high read and write speeds and stability are highly favored by various industries.

[0088] The current NVMe hard drive status indicator light control technology has attracted the attention of major manufacturers and is being designed and developed by the manufacturers themselves.

[0089] Reference Figure 1 , shows a schematic diagram of lighting in the related technology. When the CPU is in the volume management device enabled VMDEnable mode, the voltage programming pulse two-line bidirectional serial bus VPP_I2C is responsible for sending the hard disk indicator light control signal. When the CPU is in the volume management device disabled VMDDisable mode, the baseboard management controller's two-line bidirectional serial bus I2C is responsible for sending the hard disk indicator light control signal. The complex programmable logic device set on the backplane is responsible for parsing the control command and executing the corresponding hard disk status indicator light control.

[0090] Although the introduction of the baseboard management controller solves the lighting problem in VMDDisable mode, since the I2C channel of the baseboard management controller is not directly related to the CPU, it is necessary to establish a relationship mapping table between the hard disk position under the system and the hard disk position of the baseboard management controller, that is, to establish a mapping relationship between the physical slot position of the hard disk and the disk sequence. However, this relationship mapping table is fixed. When the PCIe line is connected incorrectly, the hard disk position under the system changes. At this time, the original relationship mapping table is used to light up the lights, and the problem of misplaced lighting will occur. In the production link or the later maintenance link, the problem of wrong cable connection cannot be avoided.

[0091] In order to avoid the misalignment of lights caused by incorrect PCIe line connection, one method is to do a wiring check, read the hard disk physical interface under the system, and determine whether it is consistent with the preset hard disk plug-in position. If it is inconsistent, it will remind you to change the position of the hard disk; however, this method is based on the preset interface position and is only applicable to standard configurations. When there is a non-standard configuration, it is necessary to modify the preset information such as the physical interface position and the baseboard management controller hard disk disk sequence, and it cannot be flexibly applied to multiple configurations.

[0092] Another method is to obtain the target disk identification information by reading the target disk asset information, and send the target identification information to the complex programmable logic device, so that the complex programmable logic device determines the target light corresponding to the target NVMe hard disk according to the target identification information, and controls the target light to light up; wherein, the complex programmable logic device pre-stores the correspondence between each identification information and each target light. Although this method realizes the decoupling of the PCIe wiring position and the hard disk position, the identification information is pre-stored in the complex programmable logic device, which is not convenient for later maintenance. After replacing the hard disk, the corresponding relationship in the complex programmable logic device needs to be refreshed; in addition, the baseboard management controller only sends the target identification information, and the complex programmable logic device can only light up one color light, and cannot choose to control the positioning light and the fault light.

[0093] Therefore, an embodiment of the present application provides a hard disk lighting method, which can still light up normally when the PCIe cables are installed out of order.

[0094] Reference Figure 2 , shows a flowchart of the steps of a hard disk lighting method provided by an embodiment of the present application, the method is applied to a server, the server includes an operating system, a baseboard management controller, multiple hard disks based on a non-volatile memory host controller interface specification, and a complex programmable logic device, the method may include the following steps:

[0095] S101: The operating system responds to a light-on instruction, obtains the drive letter of the target hard disk corresponding to the light-on instruction, and according to a mapping relationship table, converts the light-on instruction into a target light-on command and sends it to the baseboard management controller. The mapping relationship table includes a mapping relationship between the drive letter of each hard disk under the operating system and the disk sequence under the baseboard management controller, and the target light-on command carries the disk sequence of the target hard disk.

[0096] In this embodiment, when any NVME hard disk is turned on, the positioning light of the hard disk may be turned on, and when any hard disk fails, the fault light of the hard disk may be turned on.

[0097] In a feasible implementation, the operating system determines the target hard disk in response to the user's positioning light lighting selection operation, generates a positioning light lighting instruction corresponding to the target hard disk, and the lighting instruction carries the drive letter of the target hard disk.

[0098] In another feasible implementation, the operating system monitors the health status of any hard disk among the multiple hard disks. When any hard disk is in an unhealthy state, a lighting instruction for the fault light corresponding to the target hard disk is generated, and the lighting instruction carries the drive letter of the target hard disk.

[0099] In addition to the instruction to light up the positioning light or the fault light of any hard disk, it also includes the instruction to turn off the positioning light or the fault light of any hard disk that has been lit.

[0100] In the operating system, a mapping relationship table is pre-generated and stored, and the mapping relationship table includes the mapping relationship between the drive letter of each hard disk under the operating system and the drive sequence under the baseboard management controller. For example, the operating system executes a mapping relationship table generation strategy to generate and store the mapping relationship table.

[0101] Reference Figure 3 , shows a flowchart of the steps of the mapping relationship table generation strategy provided in an embodiment of the present application, wherein the mapping relationship table generation strategy includes the following steps:

[0102] A1: Obtain the drive letter and the hard disk serial number corresponding to each hard disk in the multiple hard disks, and store them in the first database.

[0103] Specifically, the operating system has a command line tool nvmecli installed. When obtaining the drive letter and hard disk serial number corresponding to each of the multiple hard disks, the command line tool nvmecli can be called to use the in-band command to obtain the drive letter corresponding to each of the multiple hard disks, and then obtain the hard disk serial number of each hard disk one by one according to the drive letter, and match the drive letter and hard disk serial number corresponding to each hard disk in the first database.

[0104] The drive letter is a relative identifier assigned to the hard disk in the operating system, and the hard disk serial number is obtained by reading the hard disk. The hard disk serial number of each hard disk is unique.

[0105] A2: Obtain the disk sequence and hard disk serial number of each hard disk in the baseboard management controller.

[0106] Specifically, the platform management tool ipmitool is installed in the operating system. When obtaining the disk sequence and hard disk serial number of each hard disk in the baseboard management controller, the operating system can call the platform management tool ipmitool and use out-of-band commands to obtain the disk sequence and hard disk serial number of each hard disk in the baseboard management controller.

[0107] The baseboard management controller system will assign corresponding disk sequences to the current hard disks, and the disk sequence number of each hard disk is unique.

[0108] A3: Match the hard disk serial numbers of the current hard disks with the hard disk serial numbers stored in the first database.

[0109] Reference Figure 4 , showing a schematic diagram of establishing a mapping relationship provided in an embodiment of the present application. For a hard disk, the drive letter of the hard disk in the operating system and the drive sequence in the baseboard management controller are not unique, and it is difficult to associate them. However, the hard disk serial number of a hard disk is unique. Through the unique and unchanging hard disk serial number, a mapping relationship between the drive letter of the hard disk in the operating system and the drive sequence in the baseboard management controller can be established.

[0110] The hard disk serial numbers of each hard disk obtained from the baseboard management controller can be matched with the hard disk serial numbers stored in the first database. If the same hard disk serial number exists, an association relationship can be established between the drive letter and the drive sequence corresponding to the hard disk serial number.

[0111] A4: Establish a mapping relationship between the drive letters and drive sequences of the hard disks with the same hard disk serial numbers, and generate a mapping relationship table.

[0112] Reference Figure 5, showing a schematic diagram of a mapping relationship table provided in an embodiment of the present application. For example, in the operating system, it is obtained that the drive letter nvme0n1 and the hard disk serial number 1xxxxxx have a corresponding relationship and are stored in the first database. After the disk sequence 0x00 and the hard disk serial number 1xxxxxx are obtained in the BMC, a match is made in the first database to see whether there is an identical hard disk serial number 1xxxxxx. Because the identical hard disk serial number 1xxxxxx exists in the first database, a mapping relationship is established between the drive letter nvme0n1 and the disk sequence 0x00 that are identical to the hard disk serial number 1xxxxxx. Similarly, a mapping relationship is established between the drive letter nvme1n1 and the disk sequence 0x01, a mapping relationship between the drive letter nvme2n1 and the disk sequence 0x02... a mapping relationship between the drive letter nvmenn1 and the disk sequence 0x00, and a mapping relationship between the drive letter nvme0n1 and the disk sequence 0xnn.

[0113] The mapping relationship table in this embodiment includes the mapping relationship between the drive letter under the operating system and the drive sequence under the baseboard management controller system, which can isolate BDF (Bus Device Function) and Physical Slot, and decouple the wiring position from the hard disk position, so that even if the PCIe cables are installed in disorder, the lights can still be turned on normally, and the problem of misplaced lighting caused by the wrong connection of the PCIe cables will not occur.

[0114] Furthermore, the mapping relationship table is not fixed. Each time the computer is turned on, the operating system automatically updates the mapping relationship table to solve the misalignment problem caused by drive letter drift, so that the mapping relationship is always consistent with the hardware topology.

[0115] At the same time, the present embodiment also detects the hot plugging of the hard disk, and promptly updates the mapping relationship table when the hot plugging operation occurs, so that the mapping relationship table is kept in the latest state.

[0116] Specifically, whether a hot plug operation occurs can be detected in real time; when the hot plug operation is detected to occur, the operating system updates the mapping relationship table.

[0117] In a feasible implementation, when detecting in real time whether a hot plug operation occurs, a monitoring state machine can be set up, and the monitoring state machine automatically runs in the background; the monitoring state machine analyzes the command line utility Dmesg log at a preset time interval to check whether there is a hot plug record; if there is a hot plug record within the preset time interval, it indicates that a hot plug operation has occurred, and the monitoring state machine sends a mapping relationship table refresh command to the operating system.

[0118] Reference Figure 6, shows a flow chart of detecting hot-plug operation provided by an embodiment of the present application, the monitoring state machine analyzes the command line utility Dmesg log, and then determines whether there is a hot-plug record, if so, calls the mapping relationship table refresh command to refresh the mapping relationship table, and the refreshed mapping relationship table overwrites the first database; if not, the command line utility Dmesg log is analyzed again after a preset time interval.

[0119] In a feasible implementation, when real-time detection is made as to whether a hot-plug operation occurs, if a pull-out type operation is detected, the hard disk to be deleted is determined; the operating system deletes the mapping relationship between the drive letter and the drive sequence corresponding to the hard disk to be deleted in the mapping relationship table.

[0120] In another feasible implementation, when real-time detection is made as to whether a hot-swap operation occurs, if a hot-swap operation is detected, the operating system determines whether the mapping relationship between the drive letter and the disk sequence corresponding to the hot-swap hard disk has changed; if the mapping relationship between the drive letter and the disk sequence corresponding to the hot-swap hard disk has changed, the mapping relationship between the drive letter and the disk sequence after the change is used to overwrite the current mapping relationship between the drive letter and the disk sequence of the hot-swap hard disk in the mapping relationship table.

[0121] By updating the mapping relationship table after a power-on or hot-swap operation, the mapping relationship table can store the latest mapping relationship between the hard disk drive letter and the drive sequence, further reducing the possibility of misalignment of the lights.

[0122] In this embodiment, the lighting instruction includes a command symbol, the drive letter of the target hard disk, a lighting type and a lighting action. For example, the lighting instruction is: nvmeled nvme0n1 locate start, wherein nvmeled is a command symbol, indicating that the object of this instruction is the indicator light of the NVME hard disk; nvme0n1 is the drive letter of the target hard disk; the lighting types include locate and fault, locate indicates lighting the positioning light, and fault indicates lighting the fault light; the lighting actions include start and stop, start indicates lighting, and stop indicates extinguishing.

[0123] When the operating system responds to a lighting instruction, including a lighting instruction for a positioning light or a lighting instruction for a fault light, the drive letter of the target hard disk is obtained, the drive sequence corresponding to the target hard disk is determined in the mapping table, and the lighting instruction is escaped.

[0124] When escaping the lighting instruction into a target lighting command, the operating system first splits the command character, the drive letter of the target hard disk, the lighting type and the lighting action included in the lighting instruction, and then escapes the command character, the drive letter of the target hard disk, the lighting type and the lighting action included in the lighting instruction respectively. During the escaping process, the drive letter of the target hard disk is escaped to the disk sequence of the target hard disk according to the mapping relationship table. Finally, based on the escaped command character, the disk sequence of the target hard disk, the lighting type and the lighting action, the target lighting command is combined to obtain.

[0125] In a feasible implementation manner, a platform management tool ipmitool is installed on the operating system. The operating system calls the platform management tool ipmitool, and the platform management tool ipmitool can convert the light-on instruction into a target light-on command according to a mapping relationship table.

[0126] Reference Figure 7 , shows a flowchart of the steps of generating a target lighting command provided by an embodiment of the present application, and the process of converting the lighting command into a target lighting command includes the following steps:

[0127] B1: The operating system separates the command character, the drive letter of the target hard disk, the lighting type and the lighting action included in the lighting instruction.

[0128] For example, the light-on command is: nvmeled nvme0n1 locate start, which is divided into nvmeled (command), nvme0n1 (drive letter of the target hard disk), locate (light-on type) and start (light-on action).

[0129] B2: respectively escaping the command character, the drive letter of the target hard disk, the lighting type and the lighting action included in the lighting instruction.

[0130] For example, escape the command nvmeled to ipmitool raw 0x3c 0x50 0x01;

[0131] When escaping the drive letter nvme0n1 of the target hard disk, the drive letter corresponding to the drive letter is obtained in the mapping relationship table as 0x00, and the drive letter nvme0n1 in the light-on instruction is escaped to 0x00;

[0132] The lighting type locate is escaped to 0x00; if the lighting type is fault, it is escaped to 0x01;

[0133] The lighting action start is escaped to 0x01; if the lighting action is stop, it is escaped to 0x00.

[0134] B3: Based on the escaped command character, the disk sequence of the target hard disk, the lighting type and the lighting action, a target lighting command is obtained.

[0135] For example, the lighting command: nvmeled nvme0n1 locate start is translated into the target lighting command: ipmitool raw 0x3c 0x50 0x01 0x00 0x00 0x01.

[0136] S102: After receiving the target lighting command, the baseboard management controller forwards the target lighting command to the complex programmable logic device.

[0137] The operating system sends the target lighting command escaped based on the platform management tool ipmitool to the baseboard management controller, and the baseboard management controller sends the target lighting command to the complex programmable logic device of the backplane through the I2C channel.

[0138] S103: The complex programmable logic device performs a lighting operation in response to the target lighting command.

[0139] After receiving the target lighting command, the complex programmable logic device parses and executes the target lighting command, thereby lighting the target hard disk.

[0140] In a feasible implementation, the method further includes: the operating system generates a lighting instruction for a positioning light corresponding to the target operating hard disk in response to an insertion operation of the target operating hard disk in a test mode, and displays the drive letter corresponding to the operating hard disk on the interface of the operating system.

[0141] In addition to lighting up the hard disk based on the mapping relationship between the disk sequence and the drive letter in order to view the location of the located hard disk or the faulty hard disk, in the test scenario, a faulty disk will be installed in a hard disk slot to simulate the system's processing plan for the faulty hard disk. At this time, the location of the hard disk is known, and the drive letter of the inserted hard disk needs to be known from the system. This solution can also be applied to this test scenario, that is, the faulty disk to be tested is lit up, and the drive letter of the lit hard disk is prompted in the display window of the operating system, so that the tester can quickly locate the drive letter of the faulty disk and then test the service of the faulty disk.

[0142] The method generates a mapping relationship table including the mapping relationship between the drive letters of each hard disk and the drive sequence under the baseboard management controller. When lighting up, based on the mapping relationship table, as long as the drive letter of the target hard disk is available, the target hard disk is lit up, and the BDF and Physical Slot are isolated, and the wiring position is decoupled from the hard disk position. Even if the PCIe cables are installed out of order, the lighting misalignment will not occur.

[0143] At the same time, the mapping relationship table is automatically updated when the power is turned on and is updated when a hot plug operation occurs, so that the mapping relationship is always consistent with the hardware topology, further reducing the situation of misplacement of lights.

[0144] In addition, this method is highly versatile and can be applied to machines of different specifications, achieving greater compatibility.

[0145] Reference Figure 8 , shows a functional module diagram of a hard disk lighting device provided by an embodiment of the present application, which is applied to a server, wherein the server includes an operating system, a baseboard management controller, multiple hard disks based on a non-volatile memory host controller interface specification, and a complex programmable logic device, and the device includes:

[0146] The target lighting command generating module 100 is arranged in the operating system, and is used for obtaining the drive letter of the target hard disk corresponding to the lighting command in response to the lighting command, and converting the lighting command into a target lighting command according to a mapping relationship table and sending it to the baseboard management controller, wherein the mapping relationship table includes the mapping relationship between the drive letter of each hard disk under the operating system and the drive sequence under the baseboard management controller, and the target lighting command carries the drive sequence of the target hard disk;

[0147] A command forwarding module 200, arranged in the baseboard management controller, is used for forwarding the target lighting command to the complex programmable logic device after receiving the target lighting command;

[0148] The command execution module 300 is arranged in the complex programmable logic device, and is used to execute the lighting operation in response to the target lighting command.

[0149] Optionally, the device further comprises:

[0150] The mapping relationship table generation module is arranged in the operating system and is used to execute the mapping relationship table generation strategy, generate the mapping relationship table and store it.

[0151] Optionally, the mapping relationship table generating module includes:

[0152] A first acquisition unit, used to acquire a drive letter and a hard disk serial number corresponding to each hard disk among the multiple hard disks, and store them in a first database;

[0153] A second acquisition unit, used to acquire the disk sequence and hard disk serial number of each hard disk in the baseboard management controller;

[0154] A matching unit, used for matching the hard disk serial numbers of the current hard disks with the hard disk serial numbers stored in the first database;

[0155] The mapping relationship establishing unit is used to establish a mapping relationship between the drive letters and drive sequences of the hard disks with the same hard disk serial numbers, and generate a mapping relationship table.

[0156] Optionally, a command line tool nvmecli is installed in the operating system, and the first obtaining unit includes:

[0157] The first calling unit is used to call the command line tool nvmecli to obtain the drive letter and hard disk serial number corresponding to each hard disk in the multiple hard disks.

[0158] Optionally, a platform management tool ipmitool is installed in the operating system, and the second obtaining unit includes:

[0159] The second calling unit is used to call the platform management tool ipmitool to obtain the disk sequence and hard disk serial number of each hard disk in the baseboard management controller.

[0160] Optionally, the device further comprises:

[0161] The first updating module is used for the operating system to automatically update the mapping relationship table each time the computer is turned on.

[0162] Optionally, the device further comprises:

[0163] The second updating module is used to detect in real time whether a hot plug operation occurs; when the hot plug operation is detected, the operating system updates the mapping relationship table.

[0164] Optionally, the second updating module includes:

[0165] A monitoring unit, used for automatically running a monitoring state machine;

[0166] An analysis unit, configured for the monitoring state machine to analyze the command line utility Dmesg log at preset time intervals to check whether there is a hot plug record;

[0167] The refresh unit is used to indicate that a hot plug operation has occurred if there is a hot plug record within the preset time interval, and the monitoring state machine sends a mapping relationship table refresh command to the operating system.

[0168] Optionally, the device further comprises:

[0169] A deletion module, used to determine the hard disk to be deleted when a pull-out type operation is detected;

[0170] The operating system deletes the mapping relationship between the drive letter and the drive sequence corresponding to the hard disk to be deleted in the mapping relationship table.

[0171] Optionally, the device further comprises:

[0172] A replacement module is used to, when a hot-swap operation is detected, determine whether the mapping relationship between the drive letter and the disk sequence corresponding to the hot-swap hard disk has changed by the operating system; if the mapping relationship between the drive letter and the disk sequence corresponding to the hot-swap hard disk has changed, overwrite the current mapping relationship between the drive letter and the disk sequence of the hot-swap hard disk in the mapping relationship table with the changed mapping relationship between the drive letter and the disk sequence.

[0173] Optionally, the target lighting command generation module includes:

[0174] A splitting unit, used for splitting the command character, the drive letter of the target hard disk, the lighting type and the lighting action included in the lighting instruction;

[0175] An escape unit, used to respectively escape the command character, the drive letter of the target hard disk, the lighting type and the lighting action included in the lighting instruction, wherein the drive letter of the target hard disk is escaped to the drive sequence of the target hard disk according to the mapping relationship table during the escape process;

[0176] The target lighting command generating unit is used to obtain the target lighting command based on the escaped command character, the disk sequence of the target hard disk, the lighting type and the lighting action.

[0177] Optionally, a platform management tool ipmitool is installed on the operating system, and the target lighting command generation module includes:

[0178] The third calling unit is used to call the platform management tool ipmitool, and the platform management tool ipmitool converts the light-on instruction into a target light-on command according to a mapping relationship table.

[0179] Optionally, the device further comprises:

[0180] The first lighting instruction generating module is used to respond to the user's positioning light lighting selection operation, determine the target hard disk, and generate a lighting instruction for the positioning light corresponding to the target hard disk, wherein the lighting instruction carries the drive letter of the target hard disk.

[0181] Optionally, the device further comprises:

[0182] The second lighting instruction generation module is used to monitor the health status of any hard disk among the multiple hard disks. When any hard disk is in an unhealthy state, a lighting instruction for the fault light corresponding to the target hard disk is generated, and the lighting instruction carries the drive letter of the target hard disk.

[0183] Optionally, the device further comprises:

[0184] The third lighting instruction generating module is used to generate a lighting instruction for the positioning light corresponding to the target operating hard disk in response to the insertion operation of the target operating hard disk in the test mode, and display the drive letter corresponding to the operating hard disk on the interface of the operating system.

[0185] Reference Fig. 9 , showing a schematic diagram of a server provided in an embodiment of the present application, the server includes an operating system, a baseboard management controller (BMC), multiple hard disks based on the non-volatile memory host controller interface specification (NVMe), and a complex programmable logic device (CPLD). The operating system transmits data with the complex programmable logic device arranged on the backplane through VPP_I2C, and the baseboard management controller transmits data with the complex programmable logic device arranged on the backplane through an I2C channel.

[0186] The server is used to execute the hard disk lighting method described in the embodiment. Specifically, the operating system responds to the lighting instruction, obtains the drive letter of the target hard disk corresponding to the lighting instruction, and according to the mapping relationship table, converts the lighting instruction into a target lighting command and sends it to the baseboard management controller. The mapping relationship table includes the mapping relationship between the drive letter of each hard disk under the operating system and the disk sequence under the baseboard management controller, and the target lighting command carries the disk sequence of the target hard disk; after receiving the target lighting command, the baseboard management controller forwards the target lighting command to the complex programmable logic device; the complex programmable logic device performs the lighting operation in response to the target lighting command.

[0187] An embodiment of the present application also provides a non-volatile readable storage medium, which stores a computer program, wherein the computer program, when executed by a processor, executes the hard disk lighting method described in the embodiment, specifically, the operating system responds to a lighting instruction, obtains the drive letter of the target hard disk corresponding to the lighting instruction, and according to a mapping relationship table, converts the lighting instruction into a target lighting command and sends it to the baseboard management controller, wherein the mapping relationship table includes a mapping relationship between the drive letter of each hard disk under the operating system and the disk sequence under the baseboard management controller, and the target lighting command carries the disk sequence of the target hard disk; after receiving the target lighting command, the baseboard management controller forwards the target lighting command to the complex programmable logic device; the complex programmable logic device performs a lighting operation in response to the target lighting command.

[0188] An embodiment of the present application also provides a computing and processing device, including: a memory, in which a computer-readable code is stored; one or more processors, when the computer-readable code is executed by the one or more processors, the computing and processing device executes the hard disk lighting method described in the embodiment, specifically, the operating system responds to the lighting instruction, obtains the drive letter of the target hard disk corresponding to the lighting instruction, and according to a mapping relationship table, converts the lighting instruction into a target lighting command and sends it to the baseboard management controller, the mapping relationship table includes the mapping relationship between the drive letter of each hard disk under the operating system and the disk sequence under the baseboard management controller, and the target lighting command carries the disk sequence of the target hard disk; after receiving the target lighting command, the baseboard management controller forwards the target lighting command to the complex programmable logic device; the complex programmable logic device performs the lighting operation in response to the target lighting command.

[0189] The embodiment of the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the hard disk lighting method described in the embodiment. Specifically, the operating system responds to the lighting instruction, obtains the drive letter of the target hard disk corresponding to the lighting instruction, and according to a mapping relationship table, converts the lighting instruction into a target lighting command and sends it to the baseboard management controller. The mapping relationship table includes the mapping relationship between the drive letter of each hard disk under the operating system and the disk sequence under the baseboard management controller, and the target lighting command carries the disk sequence of the target hard disk; after receiving the target lighting command, the baseboard management controller forwards the target lighting command to the complex programmable logic device; the complex programmable logic device performs the lighting operation in response to the target lighting command.

Claims

1. A method for lighting a hard disk. It is characterized in that Applied to a server, the server includes an operating system, a baseboard management controller, multiple hard disks based on a non-volatile memory host controller interface specification, and a complex programmable logic device, the method includes: The operating system obtains the drive letter of the target hard disk corresponding to the light-on instruction in response to the light-on instruction, and converts the light-on instruction into a target light-on command according to a mapping relationship table and sends it to the baseboard management controller, wherein the mapping relationship table includes a mapping relationship between the drive letter of each hard disk under the operating system and the drive sequence under the baseboard management controller, and the target light-on command carries the drive sequence of the target hard disk; After receiving the target lighting command, the baseboard management controller forwards the target lighting command to the complex programmable logic device; The complex programmable logic device performs a lighting operation in response to the target lighting command.

2. The method according to claim 1, It is characterized in that The method further comprises: The operating system executes a mapping relationship table generation strategy to generate and store a mapping relationship table.

3. The method according to claim 2, It is characterized in that The mapping relationship table generation strategy includes: Obtaining a drive letter and a hard disk serial number corresponding to each hard disk among the multiple hard disks, and storing them in a first database; Obtaining the disk sequence and hard disk serial number of each hard disk in the baseboard management controller; Matching the hard disk serial numbers of the current hard disks with the hard disk serial numbers stored in the first database; A mapping relationship is established between the drive letters and drive sequences of the hard disks with the same hard disk serial numbers, and a mapping relationship table is generated.

4. The method according to claim 3, It is characterized in that The operating system is installed with a command line tool nvmecli, and obtaining the drive letter and the hard disk serial number corresponding to each of the multiple hard disks includes: The command line tool nvmecli is called to obtain a drive letter and a hard disk serial number corresponding to each hard disk in the multiple hard disks.

5. The method according to claim 3, It is characterized in that The platform management tool ipmitool is installed in the operating system, and obtaining the disk sequence and hard disk serial number of each hard disk in the baseboard management controller includes: The platform management tool ipmitool is called to obtain the disk sequence and hard disk serial number of each hard disk in the baseboard management controller.

6. The method according to claim 1, It is characterized in that The method further comprises: Each time the computer is turned on, the operating system automatically updates the mapping relationship table.

7. The method according to claim 1, It is characterized in that The method further comprises: Real-time detection of whether hot-swap operation occurs; When the hot plug operation is detected, the operating system updates the mapping relationship table.

8. The method according to claim 7, It is characterized in that Real-time detection of hot-swap operations, including: Automatically run monitoring state machine; The monitoring state machine analyzes the command line utility Dmesg log at a preset time interval to check whether there is a hot plug record; If there is a hot plug record within the preset time interval, it indicates that a hot plug operation has occurred, and the monitoring state machine sends a mapping relationship table refresh command to the operating system.

9. The method according to claim 7, It is characterized in that After real-time detection of whether a hot-swap operation occurs, the method further includes: When a pull-out type operation is detected, the hard disk to be removed is determined; The operating system deletes the mapping relationship between the drive letter and the drive sequence corresponding to the hard disk to be deleted in the mapping relationship table.

10. The method according to claim 7, It is characterized in that After real-time detection of whether a hot-swap operation occurs, the method further includes: When a hot-swap operation is detected, the operating system determines whether a mapping relationship between a drive letter and a drive sequence corresponding to the hot-swap hard disk changes; If the mapping relationship between the drive letter and the drive sequence corresponding to the hot-swappable hard disk changes, the mapping relationship between the drive letter and the drive sequence after the change will overwrite the current mapping relationship between the drive letter and the drive sequence of the hot-swappable hard disk in the mapping relationship table.

11. The method according to claim 1, It is characterized in that According to the mapping relationship table, the lighting instruction is converted into a target lighting command, including: The operating system separates the command character, the drive letter of the target hard disk, the lighting type and the lighting action included in the lighting instruction; The command character, the drive letter of the target hard disk, the type of lighting, and the lighting action included in the lighting instruction are respectively escaped, wherein the drive letter of the target hard disk is escaped to the drive sequence of the target hard disk according to the mapping relationship table during the escape process; Based on the escaped command character, the disk sequence of the target hard disk, the lighting type and the lighting action, a target lighting command is obtained by combination.

12. The method according to claim 11, It is characterized in that The platform management tool ipmitool is installed on the operating system, and according to the mapping relationship table, the light-on instruction is converted into a target light-on command, including: The platform management tool ipmitool is called, and the platform management tool ipmitool converts the light-on instruction into a target light-on command according to a mapping relationship table.

13. The method according to any one of claims 1 to 12, It is characterized in that The method further comprises: The operating system determines the target hard disk in response to the user's positioning light lighting selection operation, and generates a positioning light lighting instruction corresponding to the target hard disk, wherein the lighting instruction carries the drive letter of the target hard disk.

14. The method according to any one of claims 1 to 12, It is characterized in that The method further comprises: The operating system monitors the health status of any hard disk among the multiple hard disks, and when any hard disk is in an unhealthy state, generates a lighting instruction for a fault light corresponding to the target hard disk, wherein the lighting instruction carries the drive letter of the target hard disk.

15. The method according to any one of claims 1 to 12, It is characterized in that The method further comprises: The operating system generates a lighting instruction for a positioning light corresponding to the target operating hard disk in response to an insertion operation of the target operating hard disk in the test mode, and displays a drive letter corresponding to the operating hard disk on an interface of the operating system.

16. A hard disk lighting device, It is characterized in that Applied to a server, the server includes an operating system, a baseboard management controller, multiple hard disks based on a non-volatile memory host controller interface specification, and a complex programmable logic device, the device includes: a target lighting command generating module, arranged in the operating system, for responding to a lighting command, obtaining a drive letter of a target hard disk corresponding to the lighting command, and translating the lighting command into a target lighting command according to a mapping relationship table and sending the target lighting command to the baseboard management controller, wherein the mapping relationship table includes a mapping relationship between a drive letter of each hard disk under the operating system and a drive sequence under the baseboard management controller, and the target lighting command carries the drive sequence of the target hard disk; A command forwarding module, arranged in the baseboard management controller, is used for forwarding the target lighting command to the complex programmable logic device after receiving the target lighting command; A command execution module is provided in the complex programmable logic device and is used for executing a lighting operation in response to the target lighting command.

17. A server, It is characterized in that The server includes an operating system, a baseboard management controller, multiple hard disks based on a non-volatile memory host controller interface specification, and a complex programmable logic device. The server is used to execute the hard disk lighting method described in any one of claims 1-15.

18. A non-volatile readable storage medium, It is characterized in that The non-volatile readable storage medium stores a computer program, wherein the computer program, when executed by a processor, executes the hard disk lighting method according to any one of claims 1 to 15.

19. A computing device, It is characterized in that include: A memory in which a computer-readable code is stored; and one or more processors, when the computer-readable code is executed by the one or more processors, the computing and processing device executes the hard disk lighting method according to any one of claims 1-15.

20. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instruction is executed by a processor, the hard disk lighting method described in any one of claims 1-15 is implemented.