Device and method for acquiring hard disk information and server
By setting CPLD on the server backplane to obtain hard disk information in parallel and save it, the problem of BMC web interface is solved, and the speed of obtaining hard disk information is improved.
Patent Information
- Application Number
- CN202510682982.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2025-08-29
AI Technical Summary
In the prior art, when the server BMC web interface acquires hard disk information, the delay is severe and the user experience is poor due to the serial issuance of instructions.
Set up CPLD on the backplane of the server, obtain hard disk information in parallel through the I2C bus, save it in parallel and send an interrupt request to the BMC, and the BMC responds and feedbacks the information.
It speeds up the acquisition of hard disk information, solves the problem of lag in the BMC web interface, and improves the response speed.
Smart Images

Figure CN120560944A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of server management, and in particular to a device, method and server for obtaining hard disk information. Background Art
[0002] With the advent of the big data and cloud era, the demand for servers, especially storage servers, is increasing across all sectors of society. This is primarily due to the high data storage capacity and high-speed data throughput capabilities of storage servers. In practical applications, to achieve high data throughput, storage servers are typically required to support a larger number of hard drives.
[0003] Currently, out-of-band management of a server's hard drive backplane (or simply backplane) is performed by the motherboard's BMC (Baseboard Management Controller). The server's BMC web interface displays information about the hard drives and their corresponding backplanes. The BMC monitors information from various server sensors, including backplane and hard drive information. Current high-capacity storage servers, such as those with 2U 24-bay, 4U 36-bay, and 4U 60-bay drives, have a large number of hard drives, resulting in a high volume of information displayed on the web interface.
[0004] Each time the BMC web interface is opened or refreshed, it serially sends multiple requests for server hard drive information to the hard drive backplane and hard drives. Each request uses IPMI (Intelligent Platform Management Interface) commands to obtain and respond to the backplane and hard drive data in real time. Because commands are sent serially, the next request can only be sent after the current request completes. The total time it takes to open or refresh the entire web interface is approximately equal to the cumulative time taken for each request. This results in very slow BMC web interface operation, severe latency, and a poor user experience. Summary of the Invention
[0005] In view of this, the present invention provides a device, method and server for obtaining hard disk information. A CPLD is set on the backplane and the CPLD is used to obtain hard disk information in parallel, thereby speeding up the acquisition of hard disk information and solving the problem of BMC web interface freezing.
[0006] In a first aspect, the present invention provides a device for obtaining hard disk information, the device being applied to a server, the server comprising a mainboard and multiple backplanes, each of which is plugged with multiple hard disks, the device comprising: a BMC disposed on the mainboard, and a CPLD disposed on each of the backplanes, the CPLD being connected to the BMC and the multiple hard disks on the backplane via an I2C bus. The BMC is used to send an acquisition instruction to the CPLD when the BMC web interface needs to acquire hard disk information, and the acquisition instruction is used to instruct the CPLD to acquire hard disk information of all hard disks plugged into the backplane; The CPLD is used to obtain hard disk information of all hard disks plugged into the backplane in parallel according to the acquisition instruction, save the acquired hard disk information, and then send an interrupt request to the BMC, wherein the interrupt request is used to notify the BMC to obtain the saved hard disk information; The BMC is further configured to respond to an interrupt request sent by the CPLD, obtain the hard disk information stored in the CPLD, and then feed the obtained hard disk information back to the BMC web interface.
[0007] Optionally, the CPLD includes: an I2C slave module, a register control module, multiple read control modules matching the number of hard disks, and multiple I2C master modules. The register control module includes a register for storing hard disk information. The connection relationship between the modules is as follows: the I2C slave module is connected to the BMC, the register control module is connected to the I2C slave module, each read control module is connected to the register control module, each I2C master module is correspondingly connected to each read control module and each hard disk, and each I2C master module is also connected to the register control module, wherein, The I2C slave module is configured to receive the acquisition instruction from the BMC and send a register write request to the register control module according to the acquisition instruction; The register control module is configured to receive the register write request and send a hard disk information read request to each of the read control modules according to the register write request; The read control module is configured to receive the hard disk information read request and send the address data of the hard disk information to the corresponding I2C master module according to the hard disk information read request; The I2C master module is configured to receive the address data of the hard disk information sent by the corresponding read control module and obtain the hard disk information of the corresponding hard disk according to the address data; the I2C master module is further configured to write the obtained hard disk information into the register in the register control module after obtaining the hard disk information and feedback the obtained hard disk information to the corresponding read control module; The read control module is further configured to send a confirmation signal to the register control module after confirming that the corresponding I2C master module has acquired the hard disk information of the corresponding hard disk; The register control module is further configured to send the interrupt request to the I2C slave module after receiving the confirmation signal sent by each read control module; The I2C slave module is further configured to forward the interrupt request to the BMC.
[0008] Optionally, the register control module includes a plurality of registers matching the number of hard disks, and each register is used to store hard disk information of a corresponding hard disk.
[0009] Optionally, the register control module further includes: A read request control register, configured to receive the register write request and send a hard disk information read request to each of the read control modules according to the register write request; The interrupt control register is used to send an interrupt request to the I2C slave module after receiving the confirmation signal sent by each read control module.
[0010] Optionally, the hard disk information obtained includes: temperature information, in-place status, fault status, and positioning status of the hard disk; The register includes 16 bits, bits 0 to 7 are used to store hard disk temperature information, bit 8 is used to store in-position status, bit 9 is used to store fault status, bit 10 is used to store positioning status, and bits 11 to 15 are reserved bits.
[0011] Optionally, the read control module includes: ROM memory, used for storing address data of hard disk information to be obtained; The state machine is used to send the address data and the data valid indication signal to the corresponding I2C master module in sequence.
[0012] In a second aspect, the present invention provides a method for obtaining hard disk information, the method being applied to a server, the server comprising a mainboard and multiple backplanes, each of the backplanes being plugged with multiple hard disks, the mainboard being provided with a BMC, each of the backplanes being provided with a CPLD, the CPLD being connected to the BMC and the multiple hard disks on the backplane via an I2C bus, the method comprising: When the BMC web interface needs to obtain hard disk information, the BMC sends an acquisition instruction to the CPLD, wherein the acquisition instruction is used to instruct the CPLD to obtain hard disk information of all hard disks plugged into the backplane; The CPLD obtains the hard disk information in parallel according to the acquisition instruction, saves the obtained hard disk information, and then sends an interrupt request to the BMC, wherein the interrupt request is used to notify the BMC to obtain the saved hard disk information; The BMC responds to the interrupt request, obtains the hard disk information stored in the CPLD, and then feeds the obtained hard disk information back to the BMC web interface.
[0013] Optionally, the CPLD includes: an I2C slave module, a register control module, multiple read control modules matching the number of hard disks, and multiple I2C master modules, the register control module includes a register for storing hard disk information, and the modules are connected as follows: the I2C slave module is connected to the BMC, the register control module is connected to the I2C slave module, each read control module is connected to the register control module, each I2C master module is correspondingly connected to each read control module and each hard disk, and each I2C master module is also connected to the register control module; The CPLD obtains the hard disk information in parallel according to the acquisition instruction, saves the obtained hard disk information, and then sends an interrupt request to the BMC, specifically including: The I2C slave module receives the acquisition instruction from the BMC, and sends a register write request to the register control module according to the acquisition instruction; The register control module receives the register write request, and sends a hard disk information read request to each of the read control modules according to the register write request; The read control module receives the hard disk information read request, and sends the address data of the hard disk information to the corresponding I2C master module according to the hard disk information read request; The I2C master module receives the address data of the hard disk information sent by the corresponding read control module, obtains the hard disk information of the corresponding hard disk according to the address data, writes the obtained hard disk information into the register in the register control module after obtaining the hard disk information, and feeds back the obtained hard disk information to the corresponding read control module; After confirming that the corresponding I2C master module has acquired the hard disk information of the corresponding hard disk, the read control module sends a confirmation signal to the register control module; After receiving the confirmation signal from each of the read control modules, the register control module sends the interrupt request to the I2C slave module; The I2C slave module forwards the interrupt request to the BMC.
[0014] Optionally, the hard disk information obtained includes: temperature information, in-place status, fault status, and positioning status of the hard disk; The register includes 16 bits, bits 0 to 7 are used to store hard disk temperature information, bit 8 is used to store in-position status, bit 9 is used to store fault status, bit 10 is used to store positioning status, and bits 11 to 15 are reserved bits.
[0015] In a third aspect, the present invention provides a server comprising the device for obtaining hard disk information as provided in the first aspect.
[0016] The present invention provides a device, method, and server for obtaining hard disk information. When the BMC web interface needs to obtain hard disk information, the CPLD on the backplane concurrently obtains the hard disk information of all hard disks plugged into the backplane, saves the obtained hard disk information, and then sends an interrupt request to the BMC. The BMC responds to the interrupt request and obtains the hard disk information stored by the CPLD all at once. Compared to existing technologies, the CPLD obtains hard disk information in parallel, thereby speeding up the acquisition process and resolving the issue of BMC web interface lag. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A topological diagram of a device for obtaining hard disk information in one embodiment of the present invention; Figure 2 This is a block diagram of the internal module structure of the CPLD in one embodiment of the present invention; Figure 3 This is a structural block diagram of a register control module in one embodiment of the present invention; Figure 4 A schematic diagram of storage information of a register in one embodiment of the present invention; Figure 5 This is a structural block diagram of a read control module in one embodiment of the present invention; Figure 6 The figure is a flow chart of a method for obtaining hard disk information in one embodiment of the present invention. DETAILED DESCRIPTION
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0019] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0020] The following embodiments of the present invention are described in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.
[0021] An embodiment of the present invention provides a device for obtaining hard disk information. The device is applied to a server. The server includes a mainboard and multiple backplanes, each of which is connected to multiple hard disks. The device for obtaining hard disk information includes: a Baseboard Management Controller (BMC) provided on the mainboard, and a Complex Programmable Logic Device (CPLD) provided on each backplane. Each CPLD is connected to the BMC and multiple hard disks on the backplane via an I2C bus. When the BMC web interface needs to obtain hard disk information, the BMC sends an acquisition instruction to the CPLD. The acquisition instruction is used to instruct the CPLD to obtain the hard disk information of all hard disks plugged into the backplane. The CPLD is used to obtain the hard disk information of all hard disks plugged into the backplane in parallel according to the acquisition instruction, save the obtained hard disk information, and then send an interrupt request to the BMC. The interrupt request is used to notify the BMC to obtain the saved hard disk information. The BMC is also used to respond to interrupt requests from the CPLD, obtain hard disk information saved by the CPLD, and then feed the obtained hard disk information back to the BMC web interface.
[0022] Figure 1 For example, a device topology diagram of a hard disk is obtained according to an embodiment of the present invention. Figure 1As shown, the server includes multiple backplanes, each equipped with a CPLD. The BMC connects to each backplane's CPLD via the I2C bus. Each backplane's CPLD is connected in parallel to the multiple hard drives plugged into that backplane via the I2C bus. The CPLD is used to obtain drive information from the multiple hard drives plugged into that backplane. The number of backplanes (N) and the number of hard drives (M) connected to each backplane are determined by the server specifications. For example, a 2U12 backplane can have one 12-drive-slot backplane or three 4-drive-slot backplanes; a 4U36 backplane can have three 12-drive-slot backplanes.
[0023] As is known, the CPLD itself is blank and needs to be programmed to implement specific hardware functions. According to an embodiment of the present invention, the CPLD structure on each backplane is the same, such as Figure 2 As shown in the figure, taking M hard disks on each backplane as an example, to implement the above functions, the CPLD may include: an I2C slave module I2C_Slave, a register control module REG_Ctrl, M read control modules Rd_Ctrl 1, Rd_Ctrl 2, ..., Rd_Ctrl M that match the number of hard disks, and M I2C master modules I2C_Master1, I2C_Master 2, ..., I2C_Master M. Of course, the number of read control modules and I2C master modules may also exceed the number of hard disks. What is explained here is that the register control module REG_Ctrl includes registers for storing hard disk information ( Figure 2 (not shown), the connection relationship between each module is as follows: The I2C slave module I2C_Slave is connected to the BMC, the register control module REG_Ctrl is connected to the I2C slave module I2C_Slave, each read control module Rd_Ctrl 1, Rd_Ctrl 2, ..., Rd_Ctrl M is connected to the register control module REG_Ctrl, each I2C master module I2C_Master 1, I2C_Master 2, ..., I2C_Master M is connected to each read control module Rd_Ctrl 1, Rd_Ctrl 2, ..., Rd_Ctrl M and hard disk 1 to hard disk M, and each I2C master module I2C_Master 1, I2C_Master 2, ..., I2C_Master M is also connected to the register control module REG_Ctrl, wherein, The I2C slave module I2C_Slave is used to receive the acquisition instruction from the BMC and send a register write request to the register control module REG_Ctrl according to the acquisition instruction; The register control module REG_Ctrl is used to receive register write requests and send hard disk information read requests to each read control module Rd_Ctrl 1~M according to the register write request; The read control module Rd_Ctrl 1~M is used to receive hard disk information read requests and send the address data of the hard disk information to the corresponding I2C master module I2C_Master 1~M according to the hard disk information read request; The I2C master modules I2C_Master 1-M are used to receive the address data of the hard disk information sent by the corresponding read control modules Rd_Ctrl 1-M and obtain the hard disk information corresponding to hard disks 1 to M based on the address data. After obtaining the hard disk information, the I2C master modules I2C_Master1-M are also used to write the obtained hard disk information into the registers in the register control module REG_Ctrl and feedback the obtained hard disk information to the corresponding read control modules Rd_Ctrl 1-M. The read control module Rd_Ctrl 1~M is further used to send a confirmation signal to the register control module REG_Ctrl after confirming that the corresponding I2C master module I2C_Master 1~M has obtained the hard disk information of the corresponding hard disk; The register control module REG_Ctrl is also used to send an interrupt request to the I2C slave module I2C_Slave after receiving the confirmation signal sent by each read control module Rd_Ctrl 1~M; The I2C slave module I2C_Slave is also used to forward interrupt requests to the BMC.
[0024] In this embodiment, the BMC and CPLD communicate, with the BMC acting as the master and the CPLD as the slave; the CPLD and hard disk communicate, with the CPLD acting as the master and the hard disk acting as the slave. The I2C slave module I2C_Slave is used to implement I2C communication between the CPLD (slave) and the BMC (master), while the I2C master modules I2C_Master 1-M are used to implement I2C communication between the CPLD (master) and Hard Disks 1-M (slave). The design of the I2C slave modules I2C_Slave and I2C master modules I2C_Master 1-M is a well-established technology and is not the focus of this invention, so it is not defined here. The unique design of this invention lies in the register control module REG_Ctrl, the register format, and the read control modules Rd_Ctrl 1-M. This is described in detail below.
[0025] As an implementation method, Figure 3 The structure diagram of the register control module REG_Ctrl in one embodiment is shown in FIG. Figure 3The register control module REG_Ctrl includes M registers that match the number of hard disks, denoted as REG0, REG1, ..., REG M-1. Each register is used to store the hard disk information corresponding to hard disks 1 to M. These M registers are connected to the I2C slave module I2C_Slave and the I2C master modules I2C_Master 1 to M to perform read and write operations on these M registers.
[0026] Further, refer to Figure 3 , the register control module REG_Ctrl also includes: The read request control register is connected to I2C_Slave and Rd_Ctrl 1~M, and is used to receive register write requests and send hard disk information read requests Rd_Req to each read control module Rd_Ctrl 1~M according to the register write request; The interrupt control register is used to send an interrupt request IRQ to the I2C_Slave after receiving the confirmation signal Rd_Ack1~M sent by each read control module Rd_Ctrl 1~M.
[0027] Specifically, when REG_Ctrl receives a register write request from the localbus wr of I2C_Slave, it checks whether the write address is the pre-agreed address (for example, 0x80. Both parties agree on an address in advance. Writing to this address indicates that hard disk information is to be obtained). If so, it sends a hard disk information read request Rd_Req to each read control module Rd_Ctrl 1~M.
[0028] After receiving the hard drive information read request Rd_Req, Rd_Ctrl 1-M obtains the hard drive information in parallel through the I2C master. When the I2C master module feeds back the acquired hard drive information to the corresponding register control module, it stores the hard drive information in different registers REG according to the hard drive serial number. Hard drive serial numbers 1-M correspond one-to-one with registers REG0-REGM-1.
[0029] As an implementation manner, the acquired hard disk information includes: temperature information, in-place status, fault status, and positioning status of the hard disk. Figure 4 FIG. 1 is a schematic diagram of storage information of a register REG in an embodiment, referring to FIG. Figure 4The storage format of register REG can be designed as follows: Register REG consists of 16 bits, bits 0-7 are used to store hard drive temperature information, bit 8 is used to store the in-position state, bit 9 is used to store the fault state, bit 10 is used to store the location state, and bits 11-15 are reserved. In addition, bits 9 and 10 are open to the BMC for writing. The BMC can operate these two bits through the I2C bus for lighting control.
[0030] As an implementation method, Figure 5 This is a structural block diagram of any read control module Rd_Ctrl 1~M in an embodiment, refer to Figure 5 , taking Rd_Ctrl 1 as an example, the read control module Rd_Ctrl 1 includes: ROM memory, used for storing address data of hard disk information to be obtained; The state machine is used to sequentially send the address data and data valid indication signal of the hard disk information to the corresponding I2C master module.
[0031] Specifically, if Figure 5 As shown, the state machine ADDR_Ctrl_Machine is used to control I2C_Master1 to obtain hard disk information. When the read control module Rd_Ctrl1 receives the hard disk information read request Rd_Req, it starts the state machine. The state machine's ADDR changes to obtain different address data Data, thereby sequentially sending the hard disk information address data Data to I2C_Master1 and simultaneously sending the data valid indication signal Data_Vld to I2C_Master1.
[0032] After receiving the address data, I2C_Master1 retrieves the hard disk information based on it. Once I2C_Master1 has retrieved the hard disk information, it sends a notification to the corresponding Rd_Ctrl1 module via the localbus wr. After confirming that the corresponding I2C_Master1 has retrieved the corresponding hard disk information, Rd_Ctrl1 sends an acknowledgment signal, Rd_Ack1, to REG_Ctrl. If the hard disk to which Rd_Ctrl1 corresponds is not in place, Rd_Ctrl1 directly sends an acknowledgment signal, Rd_Ack1, upon receiving a hard disk information read request, Rd_Req.
[0033] The structures and working principles of other read control modules Rd_Ctrl2, ..., Rd_Ctrl M are similar to those of Rd_Ctrl1 and will not be described in detail.
[0034] After receiving the confirmation signals Rd_Ack1~M from all Rd_Ctrl 1~M, the register control module REG_Ctrl sends an interrupt request IRQ to the BMC through the I2C Slave module. This interrupt request is used to notify the BMC to obtain the hard disk information saved by the CPLD. Finally, the register control module REG_Ctrl feeds back the data of REG0~REGM-1 to the I2C Slave through the localbus rd bus, and the I2C Slave module then forwards it to the BMC.
[0035] An embodiment of the present invention provides a device for obtaining hard disk information. When the BMC web interface needs to obtain hard disk information, the CPLD on the backplane concurrently obtains the hard disk information of all hard disks plugged into the backplane, saves the obtained hard disk information, and then sends an interrupt request to the BMC. The BMC responds to the interrupt request and obtains the hard disk information stored by the CPLD all at once. Compared to existing technologies, the CPLD obtains hard disk information in parallel, thereby speeding up the acquisition process and resolving the issue of BMC web interface lag.
[0036] In practical applications, the device for acquiring hard drive information according to the present invention only requires two BMC commands for an 8-slot backplane, reducing the time by four times compared to directly acquiring information one by one. For a 12-slot backplane, the time can be increased by six times. This solves the problems of traditional acquisition methods, such as too many target hard drives, too many commands, long acquisition times, web interface lag, and slow response.
[0037] On the other hand, an embodiment of the present invention further provides a method for obtaining hard disk information. The method is applied to a server, wherein the server includes a mainboard and multiple backplanes, each backplane is connected to multiple hard disks, a baseboard management controller BMC is provided on the mainboard, and a complex programmable logic device CPLD is provided on the backplane. The CPLD is connected to the BMC and the multiple hard disks on the backplane via an I2C bus. The method includes the following steps: Step 1: When the BMC web interface needs to obtain hard disk information, the BMC sends a get command to the CPLD. This get command is used to instruct the CPLD to obtain the hard disk information of all hard disks plugged into the backplane. Step 2: The CPLD obtains the hard disk information of all hard disks plugged into the backplane in parallel according to the acquisition instruction, saves the acquired hard disk information, and then sends an interrupt request to the BMC. The interrupt request is used to notify the BMC to obtain the saved hard disk information. Step 3: The BMC responds to the interrupt request, obtains the hard disk information saved by the CPLD, and then feeds the obtained hard disk information back to the BMC web interface.
[0038] The overall process of the embodiment of the present invention is as follows Figure 6 As shown in the figure, when the BMC is powered on or the user opens / refreshes the web interface, the BMC backend IPMI process starts and a task thread is created. The BMC sends a hard disk information acquisition instruction (i.e., an acquisition instruction) to the backplane CPLD. After receiving the acquisition instruction, the CPLD acquires the hard disk information in parallel and saves the acquired hard disk information in the register of the register control module REG_Ctrl. After acquiring the hard disk information, the CPLD sends an interrupt request to the BMC. After receiving the interrupt request, the BMC sends a read request to acquire the CPLD register data to the CPLD. The BMC acquires the hard disk information of all hard disks stored in the backplane CPLD register at one time and then feeds the data back to the BMC web interface.
[0039] According to one embodiment of the present invention, the backplane CPLD includes: an I2C slave module, a register control module, multiple read control modules matching the number of hard disks, and multiple I2C master modules. The register control module includes a register for storing hard disk information. The modules are connected as follows: the I2C slave module is connected to the BMC, the register control module is connected to the I2C slave module, each read control module is connected to the register control module, each I2C master module is connected to each read control module and each hard disk, and each I2C master module is also connected to the register control module. The above step 2 specifically includes: Step 21: The I2C slave module receives the acquisition instruction from the BMC and sends a register write request to the register control module according to the acquisition instruction; Step 22: The register control module receives the register write request and sends a hard disk information read request to each read control module according to the register write request; Step 23: The read control module receives the hard disk information read request and sends the address data of the hard disk information to the corresponding I2C master module according to the hard disk information read request; Step 24: The I2C master module receives the address data of the hard disk information sent by the corresponding read control module, obtains the hard disk information of the corresponding hard disk according to the address data, writes the obtained hard disk information into the register in the register control module, and feeds back the obtained hard disk information to the corresponding read control module; Step 25: After confirming that the corresponding I2C master module has obtained the hard disk information of the corresponding hard disk, the read control module sends a confirmation signal to the register control module; Step 26: After receiving the confirmation signals from each read control module, the register control module sends an interrupt request to the I2C slave module; Step 27: The I2C slave module forwards the interrupt request to the BMC.
[0040] According to one embodiment of the present invention, the acquired hard drive information includes: hard drive temperature, in-place status, fault status, and location status. The storage format of the backplane CPLD register REG can be designed as follows: Register REG comprises 16 bits, with bits 0-7 used to store hard drive temperature information, bit 8 used to store in-place status, bit 9 used to store fault status, bit 10 used to store location status, and bits 11-15 reserved. Bits 9 and 10 are writable by the BMC, which can manipulate these two bits via the I2C bus for lighting control.
[0041] It can be understood that the method for obtaining hard disk information provided by the embodiment of the present invention is implemented based on the aforementioned device embodiment and can produce the same technical effect.
[0042] On the other hand, an embodiment of the present invention further provides a server, which includes the device for obtaining hard disk information provided by the above embodiment.
[0043] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A device for obtaining hard disk information, characterized in that: The device is applied to a server, which includes a mainboard and multiple backplanes, each of which is plugged with multiple hard disks. The device includes: a BMC arranged on the mainboard, and a CPLD arranged on each of the backplanes. The CPLD is connected to the BMC and the multiple hard disks on the backplane via an I2C bus. The BMC is used to send an acquisition instruction to the CPLD when the BMC web interface needs to acquire hard disk information, and the acquisition instruction is used to instruct the CPLD to acquire the hard disk information of all hard disks plugged into the backplane; The CPLD is used to obtain the hard disk information of all hard disks plugged into the backplane in parallel according to the acquisition instruction, save the acquired hard disk information, and then send an interrupt request to the BMC, wherein the interrupt request is used to notify the BMC to obtain the saved hard disk information; The BMC is further configured to respond to the interrupt request sent by the CPLD, obtain the hard disk information stored in the CPLD, and then feed the obtained hard disk information back to the BMC web interface.
2. The device for obtaining hard disk information according to claim 1, characterized in that: The CPLD includes: an I2C slave module, a register control module, multiple read control modules matching the number of hard disks, and multiple I2C master modules. The register control module includes a register for storing hard disk information. The connection relationship between the modules is as follows: the I2C slave module is connected to the BMC, the register control module is connected to the I2C slave module, each read control module is connected to the register control module, each I2C master module is correspondingly connected to each read control module and each hard disk, and each I2C master module is also connected to the register control module, wherein, The I2C slave module is configured to receive the acquisition instruction from the BMC and send a register write request to the register control module according to the acquisition instruction; The register control module is configured to receive the register write request and send a hard disk information read request to each of the read control modules according to the register write request; The read control module is configured to receive the hard disk information read request and send the address data of the hard disk information to the corresponding I2C master module according to the hard disk information read request; The I2C master module is configured to receive the address data of the hard disk information sent by the corresponding read control module and obtain the hard disk information of the corresponding hard disk according to the address data; the I2C master module is further configured to write the obtained hard disk information into the register in the register control module after obtaining the hard disk information and feedback the obtained hard disk information to the corresponding read control module; The read control module is further configured to send a confirmation signal to the register control module after confirming that the corresponding I2C master module has acquired the hard disk information of the corresponding hard disk; The register control module is further configured to send the interrupt request to the I2C slave module after receiving the confirmation signal sent by each read control module; The I2C slave module is further configured to forward the interrupt request to the BMC.
3. The device for obtaining hard disk information according to claim 2, characterized in that: The register control module includes a plurality of registers matching the number of hard disks, and each register is used to store hard disk information of a corresponding hard disk.
4. The device for obtaining hard disk information according to claim 2, wherein: The register control module also includes: A read request control register, configured to receive the register write request and send a hard disk information read request to each of the read control modules according to the register write request; The interrupt control register is used to send the interrupt request to the I2C slave module after receiving the confirmation signal sent by each read control module.
5. The device for obtaining hard disk information according to claim 2, wherein: The hard disk information obtained includes: hard disk temperature information, in-place status, fault status, and positioning status; The register includes 16 bits, bits 0 to 7 are used to store the temperature information of the hard disk, bit 8 is used to store the in-position state, bit 9 is used to store the fault state, bit 10 is used to store the positioning state, and bits 11 to 15 are reserved bits.
6. The device for obtaining hard disk information according to claim 2, characterized in that: The read control module includes: ROM memory, used for storing address data of hard disk information to be obtained; The state machine is used to send the address data and the data valid indication signal to the corresponding I2C master module in sequence.
7. A method for obtaining hard disk information, characterized in that: The method is applied to a server, which includes a mainboard and multiple backplanes, each of which is plugged with multiple hard disks. The mainboard is provided with a BMC, and each of the backplanes is provided with a CPLD. The CPLD is connected to the BMC and the multiple hard disks on the backplane via an I2C bus. The method includes: When the BMC web interface needs to obtain hard disk information, the BMC sends an acquisition instruction to the CPLD, wherein the acquisition instruction is used to instruct the CPLD to obtain the hard disk information of all hard disks plugged into the backplane; The CPLD obtains the hard disk information of all hard disks plugged into the backplane in parallel according to the acquisition instruction, saves the acquired hard disk information, and then sends an interrupt request to the BMC, wherein the interrupt request is used to notify the BMC to obtain the saved hard disk information; The BMC responds to the interrupt request, obtains the hard disk information stored in the CPLD, and then feeds the obtained hard disk information back to the BMC web interface.
8. The method according to claim 7, characterized in that The CPLD includes: an I2C slave module, a register control module, multiple read control modules matching the number of hard disks, and multiple I2C master modules. The register control module includes a register for storing hard disk information. The connection relationship between the modules is as follows: the I2C slave module is connected to the BMC, the register control module is connected to the I2C slave module, each read control module is connected to the register control module, each I2C master module is correspondingly connected to each read control module and each hard disk, and each I2C master module is also connected to the register control module; The CPLD obtains the hard disk information in parallel according to the acquisition instruction, saves the obtained hard disk information, and then sends an interrupt request to the BMC, specifically including: The I2C slave module receives the acquisition instruction from the BMC, and sends a register write request to the register control module according to the acquisition instruction; The register control module receives the register write request, and sends a hard disk information read request to each of the read control modules according to the register write request; The read control module receives the hard disk information read request, and sends the address data of the hard disk information to the corresponding I2C master module according to the hard disk information read request; The I2C master module receives the address data of the hard disk information sent by the corresponding read control module, obtains the hard disk information of the corresponding hard disk according to the address data, writes the obtained hard disk information into the register in the register control module after obtaining the hard disk information, and feeds back the obtained hard disk information to the corresponding read control module; After confirming that the corresponding I2C master module has acquired the hard disk information of the corresponding hard disk, the read control module sends a confirmation signal to the register control module; After receiving the confirmation signal from each of the read control modules, the register control module sends the interrupt request to the I2C slave module; The I2C slave module forwards the interrupt request to the BMC.
9. The method for obtaining hard disk information according to claim 8, characterized in that: The hard disk information obtained includes: hard disk temperature information, in-place status, fault status, and positioning status; The register includes 16 bits, bits 0 to 7 are used to store the temperature information of the hard disk, bit 8 is used to store the in-position state, bit 9 is used to store the fault state, bit 10 is used to store the positioning state, and bits 11 to 15 are reserved bits.
10. A server, characterized in that: The server includes the device for obtaining hard disk information according to any one of claims 1 to 6.