Hard disk disc sequence identification method, electronic device and server

By determining the connection relationship between the hard drive and the protocol conversion component, as well as the processor's affiliation, hard drive link information is generated, solving the problem of low hard drive positioning efficiency and improving the efficiency and accuracy of hard drive positioning.

CN120723849BActive Publication Date: 2025-11-21LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511236571.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-01
Publication Date
2025-11-21
Estimated Expiration
2045-09-01

AI Technical Summary

Technical Problem

Existing hard drive sequence identification methods suffer from low hard drive location efficiency, especially when troubleshooting hardware failures, making it difficult to quickly and accurately locate the specific hard drive.

Method used

By determining the connection relationship between the hard disk and the first communication port of the protocol conversion unit, the connection relationship between the protocol conversion unit and the second communication port of the processor, and the processor's ownership relationship, hard disk link information is generated, and a correspondence between the hard disk serial number at the software level and the actual location at the hardware level is established.

Benefits of technology

This improves the efficiency and accuracy of hard drive positioning, enabling fast and accurate hard drive location and solving the problem of low hard drive positioning efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120723849B_ABST
    Figure CN120723849B_ABST
Patent Text Reader

Abstract

The application discloses a hard disk disc sequence identification method, an electronic device and a server, relates to the technical field of servers, and comprises the following steps: determining a first connection relationship, a first belonging relationship, a second connection relationship and a second belonging relationship, the first connection relationship is a connection relationship between a hard disk and a first communication port, the first belonging relationship is a belonging relationship between the first communication port and a protocol conversion component, the second connection relationship is a connection relationship between the protocol conversion component and a second communication interface, and the second belonging relationship is a belonging relationship between the second communication port and a processor; at least two hard disk link information is generated based on the first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship, and the at least two hard disk link information is used for recording hard disk links formed by hard disks in at least two hard disks being connected to the processor via the first communication port, the protocol conversion component and the second communication port, so that the problem of low hard disk positioning efficiency of the hard disk disc sequence identification method in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of servers, and in particular to a hard disk serial number identification method, an electronic device, and a server. BACKGROUND

[0002] An electronic device (for example, a server) can access a hard disk to expand the storage of the electronic device. Considering that there are cases where the protocol supported by the hard disk is inconsistent with the protocol on the processor side of the electronic device, protocol conversion components can be used to perform protocol conversion between the hard disk and the processor.

[0003] For scenarios where there is protocol conversion between the processor of the electronic device and the hard disk, when the hard disk has a problem, the hard disk serial number in the error report information is the hard disk serial number defined at the software level. Maintenance engineers need to spend a long time to locate the specific hard disk position according to the software error report, which reduces the efficiency of hardware fault handling.

[0004] Therefore, the hard disk serial number identification method in the related art has the technical problem of low efficiency of hard disk positioning. SUMMARY

[0005] The present application provides a hard disk serial number identification method, an electronic device, and a server to at least solve the technical problem of low efficiency of hard disk positioning in the hard disk serial number identification method in the related art.

[0006] The present application provides a hard disk serial number identification method applied to an electronic device, the electronic device including at least one processor, a hard disk in at least two hard disks hung under the electronic device being connected to a first communication port of a protocol conversion component in at least one protocol conversion component hung under the electronic device, the protocol conversion component in the at least one protocol conversion component being connected to a second communication port of a processor in the at least one processor; the method includes determining a first connection relationship, a first attribution relationship, a second connection relationship, and a second attribution relationship, wherein the first connection relationship is the connection relationship between the hard disk and the first communication port, the first attribution relationship is the attribution relationship between the first communication port and the protocol conversion component, the second connection relationship is the connection relationship between the protocol conversion component and the second communication interface, and the second attribution relationship is the attribution relationship between the second communication port and the processor; based on the first connection relationship, the first attribution relationship, the second connection relationship, and the second attribution relationship, generating at least two hard disk link information, wherein the at least two hard disk link information is used to record the hard disk link formed by the hard disk in the at least two hard disks being connected to the processor via the first communication port, the protocol conversion component, and the second communication port.

[0007] The application further provides an electronic device, comprising: at least one processor, a hard disk of at least two hard disks hung on the electronic device is connected to a first communication port of a protocol conversion component of at least one protocol conversion component hung on the electronic device, the protocol conversion component of the at least one protocol conversion component is connected to a second communication port of a processor of the at least one processor, and a basic input and output system is run on the electronic device; wherein the basic input and output system is used for determining a first connection relationship, a first belonging relationship, a second connection relationship and a second belonging relationship, wherein the first connection relationship is a connection relationship of the hard disk and the first communication port, the first belonging relationship is a belonging relationship of the first communication port and the protocol conversion component, the second connection relationship is a connection relationship of the protocol conversion component and the second communication interface, and the second belonging relationship is a belonging relationship of the second communication port and the processor; at least two hard disk link information is generated based on the first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship, wherein the at least two hard disk link information is used for recording a hard disk link formed by a hard disk of the at least two hard disks being connected to the processor via the first communication port, the protocol conversion component and the second communication port.

[0008] The application further provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the hard disk sequence identification methods.

[0009] The application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, wherein the computer program is executed by a processor to implement the steps of any of the hard disk sequence identification methods.

[0010] The application further provides a computer program product, comprising a computer program, and the computer program is executed by a processor to implement the steps of any of the hard disk sequence identification methods.

[0011] The first connection relationship, the first attribution relationship, the second connection relationship and the second attribution relationship are determined, the first connection relationship is a connection relationship between the hard disk and the first communication port, the first attribution relationship is an attribution relationship between the first communication port and the protocol conversion component, the second connection relationship is a connection relationship between the protocol conversion component and the second communication interface, and the second attribution relationship is an attribution relationship between the second communication port and the processor. At least two hard disk link information is generated based on the first connection relationship, the first attribution relationship, the second connection relationship and the second attribution relationship, wherein the at least two hard disk link information is used to record a hard disk link formed by a hard disk in the at least two hard disks connected to the processor via the first communication port, the protocol conversion component and the second communication port. Since the communication ports of the protocol conversion component and the processor are unique, based on the connection relationship between the hard disk and the first communication port, the attribution relationship between the first communication port and the protocol conversion component, the connection relationship between the protocol conversion component and the second communication interface, and the attribution relationship between the second communication port and the processor, a complete hardware link from the hard disk to the processor can be established, a one-to-one correspondence between the software level hard disk logical identifier and the hardware level actual position is established, and the software level hard disk serial number is associated with the specific hard disk link. Therefore, the corresponding hardware position can be quickly located according to the software defined hard disk serial number, and thus the technical problem of low efficiency of hard disk positioning in the related art can be solved, and the technical effect of improving the efficiency and accuracy of hard disk positioning is achieved. BRIEF DESCRIPTION OF DRAWINGS

[0012] In order to more clearly illustrate the embodiments of the present application, the drawings required in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0013] Figure 1 An application scenario diagram of a hard disk disk sequence identification method provided by an embodiment of the present application.

[0014] Figure 2 A flowchart of a hard disk disk sequence identification method provided by an embodiment of the present application.

[0015] Figure 3 A schematic diagram of a hard disk disk sequence identification method provided by an embodiment of the present application.

[0016] Figure 4 A schematic diagram of another hard disk disk sequence identification method provided by an embodiment of the present application.

[0017] Figure 5 A device block diagram of a hard disk disk sequence identification device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0018] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative effort belong to the protection scope of the present application.

[0019] It should be noted that, in the description of the present application, the terms “comprise”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. The terms “first”, “second” and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0020] In order for those skilled in the art to better understand the technical solutions of the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0021] According to an aspect of an embodiment of the present application, a hard disk disk sequence identification method is provided. Optionally, in the present embodiment, the above-mentioned hard disk disk sequence identification method can be applied to an electronic device as shown in Figure 1 As shown in Figure 1 The electronic device includes at least one processor 102, a hard disk 104 of at least two hard disks 104 hung under the electronic device is connected to a first communication port 108 of a protocol conversion component 106 of at least one protocol conversion component 106 hung under the electronic device, and the protocol conversion component 106 of the at least one protocol conversion component is connected to a second communication port 110 of the processor 102 of the at least one processor.

[0022] Figure 2 is a flow diagram of an optional hard disk disk sequence identification method according to an embodiment of the present application, as shown in Figure 2 The flow of the method includes the following steps:

[0023] Step S202, determining a first connection relationship, a first belonging relationship, a second connection relationship and a second belonging relationship, wherein the first connection relationship is the connection relationship between the hard disk and the first communication port, the first belonging relationship is the belonging relationship between the first communication port and the protocol conversion component, the second connection relationship is the connection relationship between the protocol conversion component and the second communication interface, and the second belonging relationship is the belonging relationship between the second communication port and the processor;

[0024] In step S204, at least two hard disk link information is generated based on the first connection relationship, the first home relationship, the second connection relationship and the second home relationship, wherein the at least two hard disk link information is used to record the hard disk in the at least two hard disks connected to the processor via the first communication port, the protocol conversion component and the second communication port to form a hard disk link.

[0025] The method in the embodiment can be applied to the field of server technology and can be applied to a scene of intelligently identifying and managing the hard disks connected to the protocol conversion components.

[0026] In a server environment, storage expansion is usually essential to meet the growing demand for data processing. The protocol of the central processor for external communication tends to be single and standardized, for example, Peripheral Component Interconnect Express (PCIe) has become mainstream to achieve high-speed and low-latency data transmission. However, external storage devices, especially hard disk drives, still use protocols such as Serial Advanced Technology Attachment (SATA), which are incompatible with PCIe in some aspects, especially in parallel transmission and low latency. This inconsistency in protocols leads to bottlenecks and efficiency problems in data transmission, especially when a high-speed CPU tries to communicate with a low-speed storage device. When the protocol supported by the hard disk is inconsistent with the protocol supported by the central processor (CPU) of the electronic device, a protocol conversion component is needed to bridge the communication between the two protocols.

[0027] In the protocol conversion scenario, the software layer number of the hard disk (such as sda, sdb, etc. in the operating system) does not directly reflect the physical location of the hard disk in the server. When the hard disk fails, the error information usually contains the software layer defined hard disk serial number, not the physical layer identifier. For example, when the error information prompts that "hard disk sdb fails", it is necessary to determine which physical hard disk position in the server chassis this "sdb" actually corresponds to. Without direct mapping, this may require manual inspection of system configuration, hard disk connection layout, or even physical inspection of hard disk connection position to determine the correct physical location. This process not only takes time, but also is prone to errors, especially in large server clusters where the number of hard disks is large and the physical location is complex.

[0028] In addition, because the serial number on the software level can change after each system startup, hard disk hot plug or hardware configuration change, it also causes additional difficulties in identifying and locating the faulty hard disk. In a server environment, hot plug technology allows users to replace hard disks without shutting down the system, which greatly improves the availability and maintainability of the system. However, hot plug operations can also introduce problems of serial number confusion. Specifically, when a hard disk is unplugged and reinserted, or a new hard disk is replaced, the operating system may reassign device identifiers. For example, in the system, hard disk devices can be named / dev / sda, / dev / sdb, etc. Due to the automatic identification mechanism of the system, the new hard disk or the hard disk after the position change may be assigned a different device identifier, for example, the original / dev / sda may become / dev / sdb. This change in serial number will affect the location of the hard disk.

[0029] The server system can be equipped with multiple storage controllers to achieve data redundancy, improve storage performance, or support more hard disks. In such a multi-controller scenario, the serial number assignment of the hard disk can be grouped according to the controller. This means that the hard disks connected under controller 0 can be identified by the operating system as sda and sdb, while the hard disks under controller 1 can be identified as sdc and sdd. Such grouping is related to the physical connection and configuration of the controller, but cannot intuitively reflect the physical location of the hard disk in the server chassis.

[0030] In addition, in some cases, especially for old servers or servers using non-standard backplane designs, it may not be possible to accurately deliver hard disk slot number information from the hardware level, and it may be necessary to rely on vendor-specific tools or manually mark the hard disk location.

[0031] Therefore, the hard disk disc sequence identification method of the related art has the technical problem of low efficiency of hard disk positioning.

[0032] To at least partially solve the above technical problems, the embodiment provides a hard disk disc sequence identification method, which can determine a first connection relationship, a first belonging relationship, a second connection relationship and a second belonging relationship, wherein the first connection relationship is a connection relationship between the hard disk and a first communication port, the first belonging relationship is a belonging relationship between the first communication port and a protocol conversion component, the second connection relationship is a connection relationship between the protocol conversion component and a second communication interface, and the second belonging relationship is a belonging relationship between the second communication port and the processor; at least two hard disk link information is generated based on the first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship, wherein the at least two hard disk link information is used to record a hard disk link formed by a hard disk in the at least two hard disks connected to the processor via the first communication port, the protocol conversion component and the second communication port, and since the communication ports of the protocol conversion component and the processor are unique, the hard disk link information is identified based on the connection relationship between the hard disk and the first communication port, the belonging relationship between the first communication port and the protocol conversion component, the connection relationship between the protocol conversion component and the second communication interface and the belonging relationship between the second communication port and the processor, the hard disk serial number read on the software level can be associated with the specific hard disk link, the hard disk can be quickly located through the hard disk link, and therefore, the technical problem of low hard disk positioning efficiency of the hard disk disc sequence identification method in the related art can be solved, and the technical effect of improving the efficiency and accuracy of hard disk positioning is achieved.

[0033] In the embodiment, the electronic device can include at least one processor and at least two hard disks, and the interaction between these components can be achieved through at least one protocol conversion component, which can bridge the differences between different communication protocols and ensure smooth data transmission.

[0034] Optionally, the hard disk can be connected to the corresponding port of the protocol conversion component through the first communication port thereof, wherein the first communication port can be a port used for data exchange with the protocol conversion component, so as to ensure that the hard disk can send or receive data to the protocol conversion component, thereby indirectly communicating with the processor.

[0035] Optionally, the protocol conversion component can also be connected to the second communication port of the processor through the second communication port thereof.

[0036] Optionally, there can be one or more processors in the electronic device, and each processor can communicate with a plurality of hard disks through one or more protocol conversion components, wherein the communication protocol of the hard disk and the communication protocol of the processor can be different, and the conversion of the communication protocols is achieved through the protocol conversion component, for example, as Figure 3As shown, the processor 0 can be connected to a plurality of protocol conversion components, which can communicate through the PCIe protocol, and the plurality of protocol conversion components can be connected to a plurality of hard disks, which can communicate through the SATA protocol, to realize indirect communication between the processor and the hard disks.

[0037] Alternatively, there can also be a plurality of processors in the electronic device, such as Figure 4 As shown, the plurality of processors can also be connected to a plurality of protocol conversion components to realize mounting and indirect communication of the plurality of hard disks.

[0038] In this embodiment, the first connection relationship, the first attribution relationship, the second connection relationship, and the second attribution relationship can be determined.

[0039] Here, the first connection relationship refers to the connection relationship between the hard disk and the first communication port, and the first communication port is a port on the protocol conversion component. Through the first communication port, the protocol conversion component can directly communicate with the hard disk.

[0040] It should be noted that the relationship between the first communication port and the hard disk is unique, that is, there is a corresponding first communication port for each hard disk.

[0041] Alternatively, the first attribution relationship can be determined, that is, the attribution relationship between the first communication port and the protocol conversion component can be determined, and thus the corresponding relationship between the hard disk and the protocol conversion component can also be determined.

[0042] Here, the second connection relationship refers to the connection relationship between the protocol conversion component and the second communication port, and the second communication port is a port on the processor. Through the second communication port, the protocol conversion component can communicate data with the processor.

[0043] Alternatively, the first communication port and the second communication port can use different communication protocols.

[0044] Alternatively, in a multi-processor server, each CPU can have a plurality of communication ports, which can be connected to different protocol conversion components or other high-speed devices. In this regard, the second attribution relationship can be determined, that is, the attribution relationship between the second communication port and the processor can be determined, and thus the corresponding relationship between the protocol conversion component and the processor can be determined.

[0045] Optionally, the first communication port corresponding to the hard disk can be determined through the first connection relationship, and the protocol conversion component corresponding to the first communication port can be determined through the first attribution relationship, and the two together constitute a direct connection path between the hard disk and the protocol conversion component; similarly, the second communication port corresponding to the protocol conversion component can be determined through the second connection relationship, and the processor to which the second communication port specifically belongs can be determined through the second attribution relationship, and the second connection relationship and the second attribution relationship together define the transmission path of data from the protocol conversion component to the CPU, and further, in combination with the above four relationships, a set of detailed hard disk link information can be generated, and the above at least two hard disk link information can be used to record the hard disk link formed by the hard disk in the at least two hard disks connecting to the processor via the first communication port, the protocol conversion component and the second communication port.

[0046] Optionally, the at least two hard disk link information can include hard disk identification, hard disk corresponding first communication port information, hard disk corresponding protocol conversion component information, hard disk corresponding second communication port information, and hard disk corresponding processor information.

[0047] It should be noted that the hardware architecture of the electronic device is certain, that is, the data path of each hard disk to the CPU is also explicit, unique, and does not change with the change of the system state, and at the software level, the allocation of the hard disk serial number can be affected by factors such as hot plug operation and system restart, while the physical connection relationship between the components at the hardware level (i.e., the data path of the hard disk connecting to the CPU through which hardware components) is fixed. By identifying the hard disk link information, a stable mapping can be established, and even if the software serial number changes or the hard disk position changes, the link path of the hard disk can be reconstructed, the corresponding hardware position can be quickly located through the link information, and the physical position of the hard disk can also be dynamically updated at the software level.

[0048] By the embodiment of the present application, a hard disk sequence identification method is applied to an electronic device, the electronic device comprising at least one processor, a hard disk of at least two hard disks hung under the electronic device being connected to a first communication port of a protocol conversion component of at least one protocol conversion component hung under the electronic device, the protocol conversion component of the at least one protocol conversion component being connected to a second communication port of a processor of the at least one processor; the method comprises: determining a first connection relationship, a first attribution relationship, a second connection relationship and a second attribution relationship, wherein the first connection relationship is a connection relationship between the hard disk and the first communication port, the first attribution relationship is an attribution relationship between the first communication port and the protocol conversion component, the second connection relationship is a connection relationship between the protocol conversion component and the second communication port, and the second attribution relationship is an attribution relationship between the second communication port and the processor; and based on the first connection relationship, the first attribution relationship, the second connection relationship and the second attribution relationship, generating at least two hard disk link information, wherein the at least two hard disk link information is used to record a hard disk link formed by a hard disk of the at least two hard disks being connected to the processor via the first communication port, the protocol conversion component and the second communication port, so as to solve the technical problem of low efficiency of hard disk positioning in the related art hard disk sequence identification method, and improve the efficiency and accuracy of hard disk positioning.

[0049] In one example embodiment, a basic input output system is running on the electronic device;

[0050] The first connection relationship, the first attribution relationship, the second connection relationship and the second attribution relationship are determined, comprising:

[0051] The hard disk information of the hard disk hung under the electronic device is read by the basic input output system to obtain at least two hard disk information, wherein the at least two hard disk information is used to record the first connection relationship, one hard disk information of the at least two hard disk information corresponds to one hard disk of the at least two hard disks, and the one hard disk information of the at least two hard disk information comprises a hard disk serial number and first port information, in the one hard disk information of the at least two hard disk information, the hard disk serial number is a hard disk serial number of a hard disk corresponding to one hard disk information, and the first port information is port information of a first communication port to which a hard disk corresponding to one hard disk information is connected.

[0052] Here, the basic input output system (BIOS) is a firmware program in computer hardware, which runs before the operating system is loaded, and is responsible for completing the self-checking and initialization of the hardware. BIOS can identify and configure various hardware devices connected to the system, including hard disks, memories, network interface cards, etc.

[0053] In the embodiment, when the server starts, the basic input and output system on the electronic device can scan all hard disks connected to the electronic device, read their basic attributes, including hard disk serial numbers, manufacturer information, capacity size, health status, etc., and can also read the connection ports of the hard disks, which can be the first communication ports.

[0054] Optionally, through the process, the BIOS can generate at least two hard disk information, each of which can include data about a single hard disk, such as a hard disk serial number and first port information describing the connection between the hard disk and the sub-device.

[0055] Optionally, in the generated hard disk information, there is a one-to-one correspondence between each hard disk information and the actual hard disk. The hard disk serial number here can be an identifier assigned to the hard disk by the BIOS software layer, and the first port information can be the port information of the first communication port to which the hard disk corresponding to the hard disk information is connected.

[0056] It should be noted that in the at least two hard disk information, part of the information of different hard disks can be the same, for example, it can be the same or the manufacturer is the same, however, the connection port corresponding to each hard disk is unique, that is, a hard disk only corresponds to one first communication port (i.e. downstream port), the downstream port information of different hard disks is different, based on this, each hard disk can be numbered, the hard disk serial numbers of different hard disks are different, and the hard disk serial number and the first port information are one-to-one corresponding.

[0057] Optionally, in the case of basic input and output system startup, the hard disk information of the hard disk mounted under the electronic device can be read by the basic input and output system to obtain at least two hard disk information.

[0058] Through the embodiment, by reading the hard disk information of the hard disk mounted under the electronic device by the basic input and output system when starting, the accuracy and efficiency of hard disk information recording can be improved, and the efficiency of hard disk positioning can be improved.

[0059] In one example embodiment, after obtaining at least two hard disk information by reading the hard disk information of the hard disk mounted under the electronic device by the basic input and output system, the above method further comprises:

[0060] storing the at least two hard disk information into a first storage structure by the basic input and output system, wherein the first storage structure is a data structure for storing hard disk information, one of the at least two hard disk information is stored as a hard disk information record in the first storage structure, and the hard disk information record in the first storage structure includes a first serial number field for recording a hard disk serial number and a first port information field for recording first port information.

[0061] In the embodiment, after the BIOS reads the hard disk information of the hard disk mounted under the electronic device, the BIOS can store at least two hard disk information into the first storage structure, which can be creating a first storage structure for storage, or storing the at least two hard disk information into an existing first storage structure.

[0062] Optionally, the first storage structure can be a two-dimensional array, which can accommodate information records of multiple hard disks. Each record can correspond to a hard disk, that is, one of the at least two hard disk information can be stored as a hard disk information record in the first storage structure, and the hard disk information record in the first storage structure includes: a first serial number field for recording the serial number of the hard disk and a first port information field for recording the first port information.

[0063] Optionally, using a two-dimensional array to store hard disk information records can facilitate information management and retrieval. Each row of the two-dimensional array can represent a hard disk, and each column can represent different attributes of the hard disk, such as the serial number, manufacturer, capacity, status, and port information. This structure is very suitable for storing hardware information with multiple attributes, and is easy to traverse, retrieve, or update by program.

[0064] Optionally, in a hard disk information record, the first serial number field can be used to record the serial number of the hard disk, which can be a unique identifier assigned to the hard disk by the BIOS during initialization. The process of generating the serial number is the same as in the previous embodiment; the first port information field can be used to record information of the first communication port to which the hard disk is connected, such as port number, port type, etc.

[0065] Exemplarily, the first storage structure can be an HDD_Info array, and the data can include: {{hard disk 1, manufacturer information, hard disk capacity, downstream port information, status} {hard disk 2, manufacturer information, hard disk capacity, downstream port information, status}…}.

[0066] Through the embodiment, by storing the read hard disk information into the first storage structure, the efficiency of querying and managing hard disk information can be improved, which facilitates hard disk state monitoring, load balancing adjustment, and rapid positioning of faulty hard disks.

[0067] In an exemplary embodiment, a basic input / output system runs on an electronic device;

[0068] Determining the first connection relationship, the first attribution relationship, the second connection relationship, and the second attribution relationship includes:

[0069] The component port configuration information of the at least one protocol conversion component is acquired by the basic input output system, wherein the component port configuration information is used to record the first ownership relationship based on the combination of the component identification of the protocol conversion component and the port information of the first communication port.

[0070] In the embodiment, the basic input output system can also be used to acquire the information of the protocol conversion component, which can be used to acquire the component port configuration information of the at least one protocol conversion component to establish the first ownership relationship between the first communication port and the protocol conversion component, and further establish the corresponding relationship between the hard disk and the protocol conversion component.

[0071] Optionally, the BIOS can acquire the component identification of each protocol conversion component, which can be a serial number or a device number, and the embodiment does not limit this.

[0072] Optionally, the BIOS can also read the port information of all the first communication ports on the protocol conversion component, including but not limited to the port number, the supported protocol type, the state, etc.

[0073] Optionally, the BIOS can combine the component identification with the port information of the first communication port to form the component port configuration information, which is used to record the first ownership relationship to map each first communication port to a specific protocol conversion component, and further determine which port of which component a single hard disk is connected to even if there are multiple same protocol conversion components.

[0074] Through the embodiment, the limitation of the ownership relationship between the first communication port and the protocol conversion component by the component port configuration information can clearly define the ownership relationship, facilitate the definition of the connection path of the hard disk, and improve the efficiency of the hard disk positioning.

[0075] In one example embodiment, a basic input output system runs on an electronic device;

[0076] The first connection relationship, the first ownership relationship, the second connection relationship and the second ownership relationship are determined, comprising:

[0077] The protocol conversion component information of the protocol conversion component mounted under the electronic device is read by the basic input output system to obtain at least one protocol conversion component information, wherein the at least one protocol conversion component information is used to record the second connection relationship, one protocol conversion component information in the at least one protocol conversion component information corresponds to one protocol conversion component in the at least one protocol conversion component, and the one protocol conversion component information in the at least one protocol conversion component information includes component identification and second port information. In the one protocol conversion component information in the at least one protocol conversion component information, the component identification is the component identification of the protocol conversion component corresponding to the one protocol conversion component information, and the second port information is the port information of the second communication port to which the protocol conversion component corresponding to the one protocol conversion component information is connected.

[0078] In the embodiment, the basic input output system can read the protocol conversion component information of the protocol conversion component mounted under the electronic device to obtain at least one protocol conversion component information, and one protocol conversion component information in the at least one protocol conversion component information includes but is not limited to component identification and port information of the second communication port to which the protocol conversion component is connected.

[0079] Similar to the foregoing embodiments, the component serial number of the protocol conversion component can be a serial number, a device number or other unique code, which is not limited in the embodiment, as long as it is used to uniquely identify each protocol conversion component in the system.

[0080] Here, the second port information can be the port information of the communication port between the protocol conversion component and the processor, which can be a PCle port. Based on the component information and the second port information, the connection relationship between the protocol conversion component and the second communication port, i.e., the second connection relationship, can be determined and recorded in the at least one protocol conversion component information.

[0081] Through the embodiment, the second connection relationship is determined by reading the information of the protocol conversion chip mounted under the system by the BIOS, which can facilitate to clearly determine the connection path of the hard disk and improve the efficiency of hard disk positioning.

[0082] In one exemplary embodiment, after the protocol conversion component information of the protocol conversion component mounted under the electronic device is read by the basic input output system, the foregoing method further includes:

[0083] storing the at least one protocol conversion chip information into a second data structure by the basic input output system, wherein the second data structure is a data structure for storing protocol conversion chip information, one of the at least one protocol conversion chip information is stored as a protocol conversion chip information record in the second data structure, and the protocol conversion chip information record in the second data structure comprises a first chip identification field for recording chip identification and a second port information field for recording second port information.

[0084] In the embodiment, after reading the protocol conversion chip information of the protocol conversion chip mounted on the electronic device by the basic input output system, the at least one protocol conversion chip information can be stored into a second data structure.

[0085] Optionally, the second data structure can be a two-dimensional array, and the BIOS can create an independent record for each protocol conversion chip while accommodating multiple key fields such as chip identification and port information in each record.

[0086] Optionally, the BIOS can convert the information of each protocol conversion chip into a protocol conversion chip information record and store it into the second data structure after reading the information of each protocol conversion chip, and the protocol conversion chip information record in the second data structure can include but is not limited to a first chip identification field for recording chip identification and a second port information field for recording second port information.

[0087] Here, the first chip identification field can be used to store the unique identification code of the protocol conversion chip, i.e., to record chip identification.

[0088] Optionally, the second port information field can be used to store detailed information of the second communication port to which the protocol conversion chip is connected, which can be PCIe port information for communication with the CPU or other upstream devices.

[0089] For example, the second data structure can be Protocol_Conversion_Chip_Info, which can include {{Protocol Conversion Chip 1, PCIe Port Number}, {Protocol Conversion Chip 1, PCIe Port Number}…}.

[0090] Through the embodiment, by storing the read protocol conversion chip into the second data structure, the efficiency of querying and managing hard disk information can be improved, and hard disk state monitoring, load balancing adjustment and rapid positioning of faulty hard disks can be facilitated.

[0091] In one exemplary embodiment, a basic input output system is running on an electronic device;

[0092] The first connection relationship, the first attribution relationship, the second connection relationship, and the second attribution relationship are determined, including:

[0093] The port information of the processor on the electronic device is read through the basic input output system to obtain at least one processor port information, wherein the at least one processor port information is used to record the second attribution relationship, one processor port information in the at least one processor port information corresponds to one second communication port of one processor in the at least one processor, and one processor port information in the at least one processor port information includes processor identification and third port information. In one processor port information in the at least one processor port information, the processor identification is the processor identification of the processor corresponding to the one processor port information, and the third port information is the port information of the second communication port corresponding to the one processor port information.

[0094] Optionally, the port information of the processor on the electronic device can be read through the basic input output system to obtain at least one processor port information, one processor port information in the at least one processor port information includes processor identification and third port information, and in one processor port information in the at least one processor port information, the processor identification is the processor identification of the processor corresponding to the one processor port information, and the third port information is the port information of the second communication port corresponding to the one processor port information, that is, the information of the port on the processor used for communication with the protocol conversion component can be read.

[0095] Optionally, the processor identification can be the unique identification of the processor associated with the specific port information, can be the processor model, the serial number, or any other form of unique identification code, and the embodiment is not limited in this regard as long as different processors can be distinguished.

[0096] Optionally, the third port information can include but is not limited to the port number, the state, the supported protocol type, and the like.

[0097] Based on the third port information and the processor identification, the connection attribution of the second communication port and the processor can be determined, and then it can be determined that the protocol conversion component is connected to which processor through which second communication port.

[0098] Through the embodiment, by reading the processor information and recording the second attribution relationship, the accuracy of the link path determination can be improved, and then the accuracy of the hard disk positioning can be improved.

[0099] In one exemplary embodiment, after the port information of the processor on the electronic device is read through the basic input output system, the above method further includes:

[0100] The at least one processor port information is stored into a third storage structure by the basic input / output system, wherein the third storage structure is a data structure for storing processor port information, one of the at least one processor port information is stored as a processor port information record in the third storage structure, and the processor port information record in the third storage structure comprises a first processor identification field for recording a processor identification and a third port information field for recording third port information.

[0101] Optionally, after reading the port information of the processor on the electronic device by the basic input / output system, the at least one processor port information can be stored into the third storage structure by the basic input / output system.

[0102] Optionally, the third storage structure can be a two-dimensional array, and such an array structure allows each row (a record) to be used for recording processor port information, and each column (a field) to be used for storing a specific type of data.

[0103] Optionally, the first processor identification field can be used for storing a unique identification of the processor, such as a processor model or a serial number.

[0104] Optionally, the third port information field can be used for recording the port information of the second communication port of the processor, including a port number, a port state, a supported protocol type, etc.

[0105] Exemplarily, the third storage structure can be CPU_PCIE_Info, which can be {{CPU0, PCIe0}, {CPU0, PCIe1}, {CPU1, PCIe2}…}, wherein the ID of the PCIe port is unique, and the PCIe port number represents the ID of the port.

[0106] Through the embodiment, by storing the at least one processor port information into the third storage structure, the efficiency of querying and managing the hard disk information can be improved, and the hard disk can be quickly positioned.

[0107] In an exemplary embodiment, the first connection relationship is represented based on a combination of the hard disk serial number and the port information of the first communication port, the first attribution relationship is represented based on a combination of the port information of the first communication port and the component identification of the protocol conversion component, the second connection relationship is represented based on a combination of the component identification of the protocol conversion component and the port information of the second communication interface, and the second attribution relationship is represented based on a combination of the port information of the second communication port and the processor identification of the processor.

[0108] Based on the first connection relationship, the first attribution relationship, the second connection relationship and the second attribution relationship, at least two hard disk link information are generated, comprising:

[0109] based on the port information of the first communication port, integrating the first connection relationship and the first belonging relationship into at least two first sub-link information, wherein the at least two first sub-link information are used to record the sub-link formed by the hard disk in the at least two hard disks being connected to the protocol conversion component via the first communication port;

[0110] based on the component identification of the protocol conversion component, integrating the second connection relationship and the at least two first sub-link information into at least two second sub-link information, wherein the at least two second sub-link information are used to record the sub-link formed by the hard disk in the at least two hard disks being connected to the second communication port via the first communication port and the protocol conversion component;

[0111] based on the port information of the second communication port, integrating the second belonging relationship and the at least two second sub-link information into at least two hard disk link information.

[0112] In the embodiment, the hard disk link identification can be performed according to the uniqueness of the communication ports of the protocol conversion component and the processor.

[0113] Optionally, the first connection relationship can be represented based on the combination of the hard disk serial number and the port information of the first communication port, the first belonging relationship can be represented based on the combination of the port information of the first communication port and the component identification of the protocol conversion component, the second connection relationship can be represented based on the combination of the component identification of the protocol conversion component and the port information of the second communication interface, and the second belonging relationship can be represented based on the combination of the port information of the second communication port and the processor identification of the processor.

[0114] Optionally, by integrating the first connection relationship and the first belonging relationship, at least two first sub-link information can be formed, which are used to record the sub-link formed by the hard disk in the at least two hard disks being connected to the protocol conversion component via the first communication port, i.e., how the hard disk is connected to the specific protocol conversion component via the first communication port. Each first sub-link information can record the serial number of the hard disk and the component identification of the protocol conversion component to which the hard disk is connected.

[0115] Optionally, based on the first sub-link information, the component identification of the protocol conversion component can be introduced, the second connection relationship and the first sub-link information can be integrated to generate at least two second sub-link information, which further expands the connection description and includes the path from the hard disk to the protocol conversion component and then to the second communication port of the processor.

[0116] Optionally, based on the port information of the second communication port, the second home relationship can be combined with the second sub-link information to form a complete set of hard disk link information, which can include the entire data path from the hard disk to the processor, including but not limited to the hard disk serial number, the first communication port information, the protocol conversion component identifier, and the final processor identifier and the second communication port information connected thereto.

[0117] Through this embodiment, through the step-by-step generation of hard disk link information, clear hard disk link information can be provided, and the efficiency of hard disk positioning can be improved.

[0118] In one exemplary embodiment, the first connection relationship is recorded through at least two hard disk information, one of the at least two hard disk information corresponds to one of the at least two hard disks, and one of the at least two hard disk information includes a hard disk serial number and first port information. In one of the at least two hard disk information, the hard disk serial number is the hard disk serial number of the hard disk corresponding to one hard disk information, and the first port information is the port information of the first communication port to which the hard disk corresponding to one hard disk information is connected. The first home relationship is recorded through the combination of the component identifier of the protocol conversion component in the component port configuration information and the port information of the first communication port;

[0119] Based on the port information of the first communication port, the first connection relationship and the first home relationship are integrated into at least two first sub-link information, including:

[0120] The hard disk information in the at least two hard disk information is executed as the following first data operation:

[0121] According to the first port information in the current hard disk information, the component port configuration information is searched, and the combination of the hard disk serial number in the current hard disk information, the first port information of the current hard disk information, and the found component identifier is recorded as a first sub-link information.

[0122] Optionally, the first connection relationship can be recorded through at least two hard disk information, and the at least two hard disk information can be stored in the first storage structure, and the first storage structure can be a two-dimensional array.

[0123] Optionally, one of the at least two hard disk information can correspond to one of the at least two hard disks, and the one of the at least two hard disk information is stored as a hard disk information record in the first storage structure; the one of the at least two hard disk information includes a hard disk serial number and first port information, in the one of the at least two hard disk information, the hard disk serial number is a hard disk serial number of a hard disk corresponding to the one of the at least two hard disk information and is stored in a first serial number field of the corresponding hard disk information record, and the first port information is port information of a first communication port to which the hard disk corresponding to the one of the at least two hard disk information is connected and is stored in a first port information field of the corresponding hard disk information record; the first attribution relationship is recorded by a combination of a component identifier of the protocol conversion component and the port information of the first communication port in the component port configuration information, and the process of obtaining the above information and storing it into an array is similar to the foregoing embodiments, which will not be described here.

[0124] Optionally, a first storage structure can be constructed, which can be a hard disk relationship array, which can be a two-dimensional array, from which a hard disk information record can be read, and the read hard disk information can be respectively stored as current hard disk information in the first storage structure.

[0125] Optionally, a plurality of hard disk information records can be recorded in the first storage structure, each of which corresponds to one of the at least two hard disks, which can include but is not limited to: a hard disk serial number of the hard disk and port information of the first communication port between the hard disk and the protocol conversion component. Similar to the foregoing embodiments, the hard disk serial number is a unique identifier of the hard disk, and the first port information indicates a specific physical port to which the hard disk and the protocol conversion component are connected.

[0126] Optionally, a hard disk information record can further include a second serial number field for recording a hard disk serial number, a fourth port information field for recording port information of a first communication port, a second component identifier field for recording a component identifier of a protocol conversion component, a fifth port information field for recording port information of a second communication port, and a second processor identifier field for recording a processor identifier of a processor.

[0127] Exemplarily, a two-dimensional array can be created for recording hard disk link information, including the correspondence of hard disks, PCIe port numbers, CPU serial numbers, which can be denoted as Soft_Ralationship, and the recorded information is as follows: {{hard disk 1, protocol conversion chip 1, downlink port number 0, PCIe 1, CPU 1}, {hard disk 2, protocol conversion chip 2, downlink port number 1, PCIe 0, CPU 0}…}.

[0128] Optionally, the hard disk information in the at least two hard disk information can be respectively taken as current hard disk information to perform the following first data operation: searching component port configuration information according to the first port information in the current hard disk information, and recording the combination of the hard disk serial number in the current hard disk information, the first port information of the current hard disk information and the searched component identification as a first sub-link information.

[0129] Optionally, the searching action can be repeatedly performed, and the hard disk link information of multiple hard disks can be searched. For example, the information can be taken from the two-dimensional array HDD_Info one by one, such as taking the hard disk 1 and the downstream port information in the first loop, determining that the protocol conversion chip is 1 and the downstream port number is 0 according to the downstream port information, and storing this information in Soft_Ralationship as {{hard disk 1, protocol conversion chip 1, downstream port number 0, empty, empty}}. Continue the next loop to take the hard disk 2 and the downstream port information, determine that the protocol conversion chip is 2 and the downstream port number is 1 according to the downstream port information, and store this information in Soft_Ralationship as {{hard disk 1, protocol conversion chip 1, downstream port number 0, empty, empty}, {hard disk 2, protocol conversion chip 2, downstream port number 1, empty, empty}}. Continue the loop until all the information in HDD_Info is taken out to determine the correspondence between each hard disk and the protocol conversion chip and the downstream port number.

[0130] Through the embodiment, the efficiency and accuracy of hard disk positioning can be improved by determining the hard disk link information of the hard disk and storing it in the hard disk relationship array.

[0131] In one example embodiment, one protocol conversion component information in the at least one protocol conversion component information corresponds to one protocol conversion component in the at least one protocol conversion component, and the one protocol conversion component information in the at least one protocol conversion component information includes a component identification and second port information. In the one protocol conversion component information in the at least one protocol conversion component information, the component identification is the component identification of the protocol conversion component corresponding to the one protocol conversion component information, and the second port information is the port information of the second communication port connected to the protocol conversion component corresponding to the one protocol conversion component information.

[0132] Based on the component identification of the protocol conversion component, the second connection relationship and the at least two first sub-link information are integrated into at least two second sub-link information, including:

[0133] The first sub-link information in the at least two first sub-link information is respectively taken as current first sub-link information to perform the following second data operation, wherein the component identification of the protocol conversion component in the current first sub-link information is the current component identification.

[0134] According to the current component identifier, at least one protocol conversion component information is searched;

[0135] The current first sub-link information and the second port information in the searched protocol conversion component information are integrated into a second sub-link information.

[0136] In the embodiment, the BIOS can scan and record detailed information of all protocol conversion components, including component identifiers and second port information, which can be stored in a second data structure. The array can be a two-dimensional array, each row (a record of protocol conversion component information) can correspond to an actual protocol conversion component, ensuring that each item has its component identifier and port information of the second communication port. Each component identifier field stores a unique identifier of the protocol conversion component to distinguish different protocol conversion components, which can be stored in the first component identifier field of the corresponding protocol conversion component information record. The second port information field records detailed port information of the communication between the protocol conversion component and the processor, which can be stored in the second port information field of the corresponding protocol conversion component information record. The process of obtaining the above information and storage is similar to the previous embodiment, which will not be repeated here.

[0137] Optionally, one of the at least two first sub-link information can be stored as a record of hard disk relationship in the first data structure. Similar to the previous embodiment, the first data structure can be a two-dimensional array for recording at least two hard disk link information. A record of hard disk relationship in the first data structure includes a second serial number field for recording a hard disk serial number, a fourth port information field for recording port information of a first communication port, a second component identifier field for recording a component identifier of a protocol conversion component, a fifth port information field for recording port information of a second communication port, and a second processor identifier field for recording a processor identifier of a processor. The process of obtaining the above sub-link information and storage is similar to the previous embodiment, which will not be repeated here.

[0138] Optionally, the first sub-link information in the at least two first sub-link information can be executed as the following second data operation of the current first sub-link information, wherein the component identifier of the protocol conversion component in the current first sub-link information is a current component identifier: according to the current component identifier, at least one protocol conversion component information is searched; the current first sub-link information and the second port information in the searched protocol conversion component information are integrated into a second sub-link information.

[0139] Optionally, the at least one protocol conversion component information is searched according to the current component identifier, and the current first sub-link information and the second port information in the searched protocol conversion component information are integrated into a second sub-link information, which can be reading the hard disk relationship records from the first data structure one by one, and the read hard disk relationship records can be compared with each data in the protocol conversion component information record in the second data structure until the matching data item is found. If a match is found, the second port information recorded in the data item is extracted, so that the second port information corresponding to the protocol conversion component specified in the current hard disk relationship record can be found and stored in the corresponding hard disk relationship record in the first data structure array to update the current hard disk relationship record, which can be the fifth port information field, and then combined with the hard disk serial number and protocol conversion chip serial number and other information to form a record containing more complete hardware link information.

[0140] For example, the protocol conversion chip serial number can be taken out from the two-dimensional array Soft_Ralationship one by one, such as taking out the protocol conversion chip 1, and comparing with each data in Protocol_Conversion_Chip_Info. If the serial numbers of the protocol conversion chips are consistent, the PCIe port number in the corresponding array in Protocol_Conversion_Chip_Info is taken out and placed in the array Soft_Ralationship.

[0141] Through this embodiment, by integrating the second port information into the first data structure, a record of more complete hardware link information can be formed, and the accuracy and efficiency of hard disk positioning can be improved.

[0142] In one example embodiment, the second connection relationship is recorded through at least one processor port information, the at least one processor port information is stored in a third storage structure, and the third storage structure is a two-dimensional array; one processor port information in the at least one processor port information corresponds to a second communication port of one processor in the at least one processor; one processor port information in the at least one processor port information includes a processor identifier and third port information, and in one processor port information in the at least one processor port information, the processor identifier is the processor identifier of the processor corresponding to the processor port information, and the third port information is the port information of the second communication port corresponding to the processor port information;

[0143] Based on the port information of the second communication port, the second ownership relationship and the at least two second sub-link information are integrated into at least two hard disk link information, which includes:

[0144] reading the hard disk relationship record from the first data structure, and performing the following third data operation on the read hard disk relationship record as a current hard disk relationship record, wherein the port information of the second communication port in the current hard disk relationship record is current port information:

[0145] searching for at least one processor port information in the third storage structure according to the current port information;

[0146] integrating the current second sub-link information and the processor identifier in the found processor port information into one hard disk link information.

[0147] Optionally, the second connection relationship (i.e., the connection relationship between the protocol conversion component and the second communication port) can be recorded by at least one processor port information, the at least one processor port information can be stored in the third storage structure, and the third storage structure can be a two-dimensional array. One processor port information in the at least one processor port information can correspond to one second communication port of one processor in the at least one processor, and one processor port information in the at least one processor port information can be stored as one piece of at least one processor port information in the third storage structure. One processor port information in the at least one processor port information can include a processor identifier and third port information. In one processor port information in the at least one processor port information, the processor identifier is the processor identifier of the processor corresponding to one processor port information and is stored in the first processor identifier field of the corresponding at least one processor port information, and the third port information is the port information of the second communication port corresponding to one processor port information and is stored in the third port information field of the corresponding at least one processor port information. The process of obtaining the above information and storing the above information is similar to the foregoing embodiments, and will not be described here.

[0148] Optionally, one second sub-link information in the at least two second sub-link information can be stored as one hard disk relationship record in the first data structure, and the first data structure can be a two-dimensional array for recording at least two hard disk link information. One hard disk relationship record in the first data structure can include: a second serial number field for recording a hard disk serial number, a fourth port information field for recording port information of the first communication port, a second component identifier field for recording a component identifier of the protocol conversion component, a fifth port information field for recording port information of the second communication port, and a second processor identifier field for recording a processor identifier of the processor.

[0149] Optionally, the second sub-link information and the second home relationship can be further integrated to form a set of hard disk link information including the hard disk, the protocol conversion component and the complete communication link between the processors, which can be achieved by continuously reading the hard disk relationship records from the first data structure, each record being regarded as a current hard disk relationship record, taking the second communication port information of the processor as an index to find the related processor identifier in the third storage structure, finding at least one matched processor port information by comparing the second communication port information (i.e. the current port information) in the current hard disk relationship record, storing the value of the processor identifier field in this record into the second processor identifier field of the current hard disk relationship record to complete the update of the information, so that each record in the first data structure will contain complete hard disk link information, including the specific path description from the hard disk, through the protocol conversion component to the processor.

[0150] Exemplarily, the PCIe port number can be taken out one by one from the two-dimensional array Soft_Ralationship, such as PCIe1, and compared with each data in CPU_PCIE_Info, if the PCIe port number is consistent, the CPU serial number in the corresponding array in CPU_PCIE_Info is taken out, and this port number is placed in the array Soft_Ralationship.

[0151] Through this embodiment, by integrating the second sub-link information and the processor port information to perfect the first data structure, more complete and accurate hard disk link information can be constructed, and the accuracy and efficiency of hard disk positioning can be improved.

[0152] In an exemplary embodiment, a basic input and output system is running on the electronic device;

[0153] Based on the first connection relationship, the first home relationship, the second connection relationship and the second home relationship, at least two hard disk link information are generated, including:

[0154] At least two hard disk link information are generated by the basic input and output system based on the first connection relationship, the first home relationship, the second connection relationship and the second home relationship, wherein one hard disk link information of the at least two hard disk link information corresponds to one hard disk of the at least two hard disks, and the one hard disk link information of the at least two hard disk link information includes a combination of a hard disk serial number, a port information of a first communication port, a component identifier of a protocol conversion component, a port information of a second communication port and a processor identifier of a processor.

[0155] In the embodiment, the basic input / output system can generate at least two hard disk link information based on the first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship. One of the at least two hard disk link information can be stored in the first data structure, and the first data structure can be a two-dimensional array for recording the at least two hard disk link information.

[0156] Optionally, one of the at least two hard disk link information can correspond to one of the at least two hard disks, and the one of the at least two hard disk link information can include a combination of a hard disk serial number, port information of the first communication port, component identification of the protocol conversion component, port information of the second communication port and processor identification of the processor.

[0157] For example, the data in the first data structure can include {{hard disk 1, protocol conversion chip 1, downlink port number 0, PCIe 1, CPU 1}, {hard disk 2, protocol conversion chip 2, downlink port number 1, PCIe 0, CPU 0}} and the like.

[0158] Through the embodiment, the hard disk link information is recognized by the basic input / output system and stored in the two-dimensional array, which can improve the convenience of hard disk information query and improve the efficiency and accuracy of hard disk positioning.

[0159] In one example embodiment, the electronic device further includes a baseboard management controller;

[0160] After generating the at least two hard disk link information based on the first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship, the method further includes:

[0161] The basic input / output system sends the at least two hard disk link information to the baseboard management controller;

[0162] In response to the received at least two hard disk link information, the baseboard management controller converts the at least two hard disk link information and hardware configuration information into a hard disk relationship table, wherein the hardware configuration information is used to indicate a hard disk physical serial number of a hard disk connected to a processor in the at least one processor, one of the at least two hard disk link information is converted into one of the hard disk relationship table, and the one of the hard disk relationship table includes the hard disk link information corresponding to the one of the hard disk relationship table and the hard disk physical serial number corresponding to the one of the hard disk relationship table.

[0163] Here, the Baseboard Management Controller (BMC) is a management unit independent of the main operating system, which can be used to monitor and manage the hardware resources of the system, and provides remote management and monitoring functions. Through various sensors and firmware functions, it can monitor the temperature, voltage, fan status, power status, etc. of the server, and can perform system restart, shutdown, etc.

[0164] In this embodiment, when the BIOS completes the generation process of at least two hard disk link information, one of which can include a complete communication path description between the hard disk and the processor, it can pass these information to the BMC for further processing and display.

[0165] Optionally, the BIOS can send the information to the baseboard management controller through the communication mechanism inside the system, such as through the Host to Baseboard (H2B) interface, to ensure that the information is transmitted between the firmware and the BMC safely and accurately.

[0166] Optionally, after receiving at least two hard disk link information, the BMC can convert the data and convert the above information combined with the hardware configuration information into an intuitive hard disk relationship table, each hard disk relationship item contains all the information of a hard disk link information and the corresponding hard disk physical serial number.

[0167] Optionally, each hard disk relationship item in the hard disk relationship table can include but is not limited to hard disk serial number, first communication port information, protocol conversion component identifier, second communication port information, processor identifier, and hard disk physical serial number.

[0168] Through this embodiment, the hard disk link information is converted into a hard disk relationship table by the baseboard management controller, which can more intuitively represent the hardware resource distribution and connection status of the server, and facilitate the positioning of the hard disk.

[0169] In one exemplary embodiment, after the baseboard management controller converts at least two hard disk link information and hardware configuration information into a hard disk relationship table, the above method further comprises:

[0170] Display at least part of the hard disk relationship items in the hard disk relationship table on the visual interface through the baseboard management controller.

[0171] In this embodiment, in addition to the basic function of monitoring and managing the hardware state of the server, the baseboard management controller can further process and present the hardware connection information, so that it is displayed in an intuitive form in front of the user.

[0172] Optionally, after receiving the at least two hard disk link information via the BMC and combining them with the hardware configuration information to generate the hard disk relationship table, the BMC can display at least part of the hard disk relationship items in the hard disk relationship table on the visual interface, which can be a graphical representation such as a table, a chart or a graphical interface element, or other forms of representation, which can make the complex hardware connection and status information clear at a glance.

[0173] Optionally, the BMC can select necessary information from the hard disk relationship table, including but not limited to the serial number of the hard disk, the status, the processor identifier connected to, the physical location serial number, etc., and design the layout of the visual interface to display the hard disk relationship items in a clear format.

[0174] For example, a table can be used, in which each row represents a hard disk, and each column displays different attributes related to the hard disk relationship item. By filling the selected hard disk relationship item information into the visual table, each hard disk relationship item can be clearly listed, which can include the logical identifier of the hard disk, the physical serial number, the processor information connected to, the protocol conversion component information, etc. The display of these information can help users quickly locate the status and location of the hard disk. As shown in Table 1.

[0175] Table 1

[0176]

[0177] Optionally, in addition to static information display, the visual interface can also include interactive functions, such as clicking on the hard disk serial number to view more detailed hard disk status, or quickly locating a specific hard disk through a search function.

[0178] Through this embodiment, by visualizing the hard disk relationship table, the efficiency of hard disk positioning can be improved, and the user experience can be optimized.

[0179] In one example embodiment, after generating the at least two hard disk link information based on the first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship, the above method further comprises:

[0180] In response to the detected hot plug operation, the first connection relationship is re-determined, and the at least two hard disk link information is re-generated based on the re-determined first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship.

[0181] Here, hot plug is a technology that allows computer hardware to be replaced, added or removed without interruption during runtime, which can handle hardware maintenance or expansion without shutting down or restarting the system. However, for the case of hot plug, the status of the hard disk can also be updated.

[0182] Optionally, a hot plug operation such as insertion or removal of a hard disk can be detected, which can be detected by a processor, by a BMC, by a sensor or underlying firmware, and the embodiment is not limited in this regard.

[0183] Optionally, after detecting the hot plug operation, an instruction can be sent to the basic input / output system to re-determine the first connection relationship in response to the detected hot plug operation, and to re-generate at least two hard disk link information based on the re-determined first connection relationship, the first attribution relationship, the second connection relationship and the second attribution relationship.

[0184] Optionally, when the hot plug operation is detected, the first connection relationship, i.e. the connection state between the hard disk and the protocol conversion component, can be re-determined, which can be achieved by re-scanning hardware resources through BIOS or BMC to identify newly added hard disks or removed hard disks to update the connection relationship.

[0185] Optionally, the hardware resources can be re-scanned to identify the new hardware layout and connection state, including the connection relationship between the hard disk, the protocol conversion component and the CPU and the attribution relationship of the corresponding port, and the first connection relationship, the first attribution relationship, the second connection relationship and the second attribution relationship are updated according to the new scanning result to ensure the accuracy of the system resource mapping.

[0186] Optionally, based on the updated connection relationship and attribution relationship, new at least two hard disk link information can be generated, including the system identification number of the hard disk, the identification of the protocol conversion component, the identification of the CPU and the connection port information therebetween, and the updated hard disk link information is transmitted to the BMC for further processing and storage, and correspondingly, if the information changes, the BMC can also update the hard disk relationship table to ensure the real-time of the hardware configuration information on the visual interface.

[0187] Through the embodiment, by re-identifying and updating the information when the hot plug operation is detected, the real-time of the hard disk information identification can be ensured, and the accuracy of the hard disk positioning can be improved.

[0188] From the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases the former is a better embodiment.

[0189] According to another aspect of the embodiments of the present application, a hard disk sequence identification apparatus is also provided, which is applied to an electronic device, the electronic device comprising at least one processor, a hard disk of at least two hard disks hung under the electronic device being connected to a first communication port of a protocol conversion component of at least one protocol conversion component hung under the electronic device, the protocol conversion component of the at least one protocol conversion component being connected to a second communication port of a processor of the at least one processor; Figure 5 is a structural block diagram of an optional hard disk sequence identification apparatus according to the embodiments of the present application, as shown in Figure 5 The hard disk sequence identification apparatus comprises:

[0190] A determination unit 502 is configured to determine a first connection relationship, a first belonging relationship, a second connection relationship and a second belonging relationship, wherein the first connection relationship is a connection relationship between the hard disk and the first communication port, the first belonging relationship is a belonging relationship between the first communication port and the protocol conversion component, the second connection relationship is a connection relationship between the protocol conversion component and the second communication port, and the second belonging relationship is a belonging relationship between the second communication port and the processor.

[0191] A generation unit 504 is configured to generate at least two hard disk link information based on the first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship, wherein the at least two hard disk link information is used to record a hard disk link formed by a hard disk of the at least two hard disks being connected to the processor via the first communication port, the protocol conversion component and the second communication port.

[0192] As used in the following, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and contemplated.

[0193] It should be noted that the determination unit 502 in this embodiment can be used to execute the above step S202, and the generation unit 504 in this embodiment can be used to execute the above step S204.

[0194] By the embodiments of the present application, by determining a first connection relationship, a first attribution relationship, a second connection relationship and a second attribution relationship, wherein the first connection relationship is a connection relationship of the hard disk and the first communication port, the first attribution relationship is an attribution relationship of the first communication port and the protocol conversion component, the second connection relationship is a connection relationship of the protocol conversion component and the second communication port, and the second attribution relationship is an attribution relationship of the second communication port and the processor; based on the first connection relationship, the first attribution relationship, the second connection relationship and the second attribution relationship, at least two hard disk link information is generated, wherein the at least two hard disk link information is used to record a hard disk link formed by a hard disk in the at least two hard disks being connected to the processor via the first communication port, the protocol conversion component and the second communication port, which can solve the technical problem of low efficiency of hard disk positioning in the hard disk disk sequence identification method in the related art, and improve the efficiency and accuracy of hard disk positioning.

[0195] In one example embodiment, the electronic device runs a basic input and output system; the determining unit comprises: a first reading module configured to read hard disk information of a hard disk mounted under the electronic device through the basic input and output system to obtain at least two hard disk information, wherein the at least two hard disk information is used to record a first connection relationship, one hard disk information in the at least two hard disk information corresponds to one hard disk in the at least two hard disks, and the one hard disk information in the at least two hard disk information comprises a hard disk serial number and first port information, wherein in the one hard disk information in the at least two hard disk information, the hard disk serial number is a hard disk serial number of a hard disk corresponding to the one hard disk information, and the first port information is port information of a first communication port to which the hard disk corresponding to the one hard disk information is connected.

[0196] In one example embodiment, the apparatus described above further comprises: a first storage unit configured to, after obtaining the at least two hard disk information by reading the hard disk information of the hard disk mounted under the electronic device through the basic input and output system, store the at least two hard disk information into a first storage structure through the basic input and output system, wherein the first storage structure is a data structure used to store hard disk information, one hard disk information in the at least two hard disk information is stored as a hard disk information record in the first storage structure, and the hard disk information record in the first storage structure comprises: a first serial number field used to record the hard disk serial number and a first port information field used to record the first port information.

[0197] In one example embodiment, the electronic device runs a basic input and output system; the determining unit comprises: an acquisition module configured to acquire component port configuration information of at least one protocol conversion component through the basic input and output system, wherein the component port configuration information is used to record a first attribution relationship based on a combination of a component identifier of the protocol conversion component and port information of the first communication port.

[0198] In an example embodiment, the electronic device runs a basic input output system; the determining unit comprises: a second reading module configured to read, by the basic input output system, protocol conversion component information of a protocol conversion component mounted under the electronic device, to obtain at least one protocol conversion component information, wherein the at least one protocol conversion component information is used to record a second connection relationship, one protocol conversion component information in the at least one protocol conversion component information corresponds to one protocol conversion component in the at least one protocol conversion component, and the one protocol conversion component information in the at least one protocol conversion component information comprises a component identifier and second port information, in the one protocol conversion component information in the at least one protocol conversion component information, the component identifier is a component identifier of the protocol conversion component corresponding to the one protocol conversion component information, and the second port information is port information of a second communication port to which the protocol conversion component corresponding to the one protocol conversion component information is connected.

[0199] In an example embodiment, the apparatus further comprises: a second storage unit configured to, after reading, by the basic input output system, the protocol conversion component information of the protocol conversion component mounted under the electronic device, store, by the basic input output system, the at least one protocol conversion component information into a second data structure, wherein the second storage structure is a data structure used to store the protocol conversion component information, one protocol conversion component information in the at least one protocol conversion component information is stored as a protocol conversion component information record in the second data structure, and the protocol conversion component information record in the second data structure comprises: a first component identifier field used to record a component identifier and a second port information field used to record second port information.

[0200] In an example embodiment, the electronic device runs a basic input output system; the determining unit comprises: a third reading module configured to read, by the basic input output system, port information of a processor on the electronic device, to obtain at least one processor port information, wherein the at least one processor port information is used to record a second belonging relationship, one processor port information in the at least one processor port information corresponds to a second communication port of one processor in the at least one processor, and the one processor port information in the at least one processor port information comprises a processor identifier and third port information, in the one processor port information in the at least one processor port information, the processor identifier is a processor identifier of the processor corresponding to the one processor port information, and the third port information is port information of the second communication port corresponding to the one processor port information.

[0201] In one example embodiment, the apparatus further comprises a third storage unit configured to store the at least one processor port information into a third storage structure by the basic input / output system after reading the port information of the processor on the electronic device by the basic input / output system, wherein the third storage structure is a data structure for storing the processor port information, one of the at least one processor port information is stored as one of the at least one processor port information in the third storage structure, and the one of the at least one processor port information in the third storage structure comprises a first processor identification field for recording the processor identification and a third port information field for recording the third port information.

[0202] In one example embodiment, the first connection relationship is represented based on a combination of the hard disk serial number and the port information of the first communication port, the first attribution relationship is represented based on a combination of the port information of the first communication port and the component identification of the protocol conversion component, the second connection relationship is represented based on a combination of the component identification of the protocol conversion component and the port information of the second communication interface, and the second attribution relationship is represented based on a combination of the port information of the second communication port and the processor identification of the processor; and the generating unit comprises: a first integration module configured to integrate the first connection relationship and the first attribution relationship into at least two first sub-link information based on the port information of the first communication port, wherein the at least two first sub-link information is used to record a sub-link formed by a hard disk of the at least two hard disks connected to the protocol conversion component via the first communication port; a second integration module configured to integrate the second connection relationship and the at least two first sub-link information into at least two second sub-link information based on the component identification of the protocol conversion component, wherein the at least two second sub-link information is used to record a sub-link formed by a hard disk of the at least two hard disks connected to the second communication port via the first communication port and the protocol conversion component; and a third integration module configured to integrate the second attribution relationship and the at least two second sub-link information into at least two hard disk link information based on the port information of the second communication port.

[0203] In one example embodiment, the first connection relationship is recorded by at least two hard disk information, one of the at least two hard disk information corresponds to one of the at least two hard disks, one of the at least two hard disk information includes a hard disk serial number and first port information, in one of the at least two hard disk information, the hard disk serial number is the hard disk serial number of the hard disk corresponding to the hard disk information, and the first port information is the port information of the first communication port to which the hard disk corresponding to the hard disk information is connected; the first attribution relationship is recorded by the combination of the component identifier of the protocol conversion component in the component port configuration information and the port information of the first communication port; the first integration module includes: a first execution submodule, configured to execute the following first data operation on the hard disk information in the at least two hard disk information as current hard disk information: searching the component port configuration information according to the first port information in the current hard disk information, and recording the combination of the hard disk serial number in the current hard disk information, the first port information of the current hard disk information, and the searched component identifier as one first sub-link information.

[0204] In one example embodiment, one of the at least one protocol conversion component information corresponds to one of the at least one protocol conversion component, one of the at least one protocol conversion component information includes a component identifier and second port information, in one of the at least one protocol conversion component information, the component identifier is the component identifier of the protocol conversion component corresponding to the protocol conversion component information, and the second port information is the port information of the second communication port to which the protocol conversion component corresponding to the protocol conversion component information is connected; the second integration module includes: a second execution submodule, configured to execute the following second data operation on the first sub-link information in the at least two first sub-link information as current first sub-link information, wherein the component identifier of the protocol conversion component in the current first sub-link information is the current component identifier: searching the at least one protocol conversion component information according to the current component identifier; and integrating the current first sub-link information and the second port information in the searched protocol conversion component information into one second sub-link information.

[0205] In an example embodiment, the second connection relationship is recorded through at least one processor port information, the at least one processor port information is stored into a third storage structure, the third storage structure is a two-dimensional array; one processor port information in the at least one processor port information corresponds to a second communication port of one processor in the at least one processor; one processor port information in the at least one processor port information includes a processor identifier and third port information, in one processor port information in the at least one processor port information, the processor identifier is a processor identifier of a processor corresponding to the one processor port information, and the third port information is port information of a second communication port corresponding to the one processor port information; the third integration module includes: a third execution submodule, configured to read the hard disk relationship record from the first data structure, and execute the following third data operation on the read hard disk relationship record as a current hard disk relationship record respectively, wherein the port information of the second communication port in the current hard disk relationship record is current port information: searching the at least one processor port information in the third storage structure according to the current port information; and integrating the current second sub-link information and the processor identifier in the searched processor port information into one hard disk link information.

[0206] In an example embodiment, the electronic device runs a basic input and output system; the generation unit includes: a generation module, configured to generate at least two hard disk link information through the basic input and output system based on the first connection relationship, the first belonging relationship, the second connection relationship, and the second belonging relationship, wherein one hard disk link information in the at least two hard disk link information corresponds to one hard disk in the at least two hard disks, and the one hard disk link information in the at least two hard disk link information includes a combination of a hard disk serial number, port information of a first communication port, component identifier of a protocol conversion component, port information of a second communication port, and processor identifier of a processor.

[0207] In an example embodiment, the electronic device further includes a baseboard management controller; the apparatus further includes: a sending unit, configured to send the at least two hard disk link information to the baseboard management controller through the basic input and output system after generating the at least two hard disk link information based on the first connection relationship, the first belonging relationship, the second connection relationship, and the second belonging relationship; and a conversion unit, configured to convert the at least two hard disk link information and hardware configuration information into a hard disk relationship table through the baseboard management controller in response to the received at least two hard disk link information, wherein the hardware configuration information is used to indicate a hard disk physical serial number of a hard disk connected to a processor in the at least one processor, one hard disk link information in the at least two hard disk link information is converted into one hard disk relationship item in the hard disk relationship table, and one hard disk relationship item in the hard disk relationship table contains the hard disk link information corresponding to the one hard disk relationship item and the hard disk physical serial number corresponding to the one hard disk relationship item.

[0208] In an example embodiment, the apparatus further includes a displaying unit configured to display, by the baseboard management controller, at least part of the hard disk relationship items in the hard disk relationship table on a visual interface after converting the first data structure and the hardware configuration information into the hard disk relationship table by the baseboard management controller.

[0209] In an example embodiment, the apparatus further includes an executing unit configured to, after generating the at least two hard disk link information based on the first connection relationship, the first attribution relationship, the second connection relationship and the second attribution relationship, re-determine the first connection relationship in response to a detected hot plug operation, and re-generate the at least two hard disk link information based on the re-determined first connection relationship, the first attribution relationship, the second connection relationship and the second attribution relationship.

[0210] The features of the embodiments corresponding to the hard disk sequence identification apparatus can be referred to the related descriptions of the embodiments of the hard disk sequence identification method, which will not be repeated here.

[0211] According to another embodiment provided in the present application, an electronic device is also provided, which includes at least one processor, a hard disk of at least two hard disks mounted on the electronic device is connected to a first communication port of a protocol conversion component of at least one protocol conversion component mounted on the electronic device, the protocol conversion component of the at least one protocol conversion component is connected to a second communication port of a processor of the at least one processor, and a basic input / output system is running on the electronic device; wherein,

[0212] The basic input / output system is configured to determine a first connection relationship, a first attribution relationship, a second connection relationship and a second attribution relationship, wherein the first connection relationship is a connection relationship between the hard disk and the first communication port, the first attribution relationship is an attribution relationship between the first communication port and the protocol conversion component, the second connection relationship is a connection relationship between the protocol conversion component and the second communication interface, and the second attribution relationship is an attribution relationship between the second communication port and the processor; and generate at least two hard disk link information based on the first connection relationship, the first attribution relationship, the second connection relationship and the second attribution relationship, wherein the at least two hard disk link information is used to record a hard disk link formed by a hard disk of the at least two hard disks connected to the processor via the first communication port, the protocol conversion component and the second communication port.

[0213] The electronic device can be used to implement the above-mentioned embodiments and preferred embodiments, wherein the features of the embodiments corresponding to the basic input / output system can be referred to the related descriptions of the embodiments of the hard disk sequence identification method, which will not be repeated here.

[0214] The embodiment of the present application further provides an electronic device, comprising a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned hard disk sequence identification method embodiments.

[0215] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is configured to execute the steps in any of the above-mentioned hard disk sequence identification method embodiments when running.

[0216] In an example embodiment, the above-mentioned computer readable storage medium can include but is not limited to a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0217] The embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps in any of the above-mentioned hard disk sequence identification method embodiments.

[0218] The embodiment of the present application further provides another computer program product, which comprises a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in any of the above-mentioned hard disk sequence identification method embodiments.

[0219] The skilled person can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the above description. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0220] The above describes in detail the hard disk sequence identification method, electronic device and server provided by the present application. The principles and implementation manners of the present application are described by applying specific examples. The above description of the examples is only used to help understand the method and core idea of the present application. It should be noted that the ordinary skilled person in the technical field can make some improvements and modifications to the present application without departing from the principles of the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A hard disk disc serial number recognition method, characterized by, The application is applied to an electronic device, the electronic device comprises at least one processor, a hard disk of at least two hard disks hung on the electronic device is connected to a first communication port of a protocol conversion component of at least one protocol conversion component hung on the electronic device, the protocol conversion component of the at least one protocol conversion component is connected to a second communication port of a processor of the at least one processor; the method comprises: determining a first connection relationship, a first belonging relationship, a second connection relationship and a second belonging relationship, wherein the first connection relationship is the connection relationship between the hard disk and the first communication port, the first belonging relationship is the belonging relationship between the first communication port and the protocol conversion component, the second connection relationship is the connection relationship between the protocol conversion component and the second communication interface, and the second belonging relationship is the belonging relationship between the second communication port and the processor; based on the first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship, generating at least two hard disk link information, wherein the at least two hard disk link information is used to record the hard disk link formed by connecting the hard disk in the at least two hard disks to the processor via the first communication port, the protocol conversion component and the second communication port; the first connection relationship is represented based on the combination of the hard disk serial number and the port information of the first communication port, the first belonging relationship is represented based on the combination of the port information of the first communication port and the component identification of the protocol conversion component, the second connection relationship is represented based on the combination of the component identification of the protocol conversion component and the port information of the second communication interface, and the second belonging relationship is represented based on the combination of the port information of the second communication port and the processor identification of the processor; the first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship are based on, generating at least two hard disk link information, comprising: based on the port information of the first communication port, integrating the first connection relationship and the first belonging relationship into at least two first sub-link information, wherein the at least two first sub-link information is used to record the sub-link formed by connecting the hard disk in the at least two hard disks to the protocol conversion component via the first communication port; based on the component identification of the protocol conversion component, integrating the second connection relationship and the at least two first sub-link information into at least two second sub-link information, wherein the at least two second sub-link information is used to record the sub-link formed by connecting the hard disk in the at least two hard disks to the second communication port via the first communication port and the protocol conversion component; based on the port information of the second communication port, integrating the second belonging relationship and the at least two second sub-link information into the at least two hard disk link information.

2. The method of claim 1, wherein, a basic input and output system is running on the electronic device; the determination of the first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship comprises: reading, by the basic input and output system, hard disk information of hard disks mounted under the electronic device, to obtain at least two hard disk information, wherein the at least two hard disk information is used to record the first connection relationship, one of the at least two hard disk information corresponds to one of the at least two hard disks, and the one of the at least two hard disk information includes a hard disk serial number and first port information, wherein, in the one of the at least two hard disk information, the hard disk serial number is the hard disk serial number of the hard disk corresponding to the one of the at least two hard disk information, and the first port information is the port information of the first communication port to which the hard disk corresponding to the one of the at least two hard disk information is connected.

3. The method of claim 2, wherein, After the reading, by the basic input and output system, of the hard disk information of the hard disks mounted under the electronic device, to obtain at least two hard disk information, the method further comprises: storing, by the basic input and output system, the at least two hard disk information into a first storage structure, wherein the first storage structure is a data structure used to store hard disk information, and one of the at least two hard disk information is stored as a hard disk information record in the first storage structure, and the hard disk information record in the first storage structure includes a first serial number field used to record a hard disk serial number and a first port information field used to record first port information.

4. The method of claim 1, wherein, The electronic device runs a basic input and output system; The determination of the first connection relationship, the first attribution relationship, the second connection relationship, and the second attribution relationship comprises: obtaining, by the basic input and output system, component port configuration information of the at least one protocol conversion component, wherein the component port configuration information is used to record the first attribution relationship based on the combination of the component identification of the protocol conversion component and the port information of the first communication port.

5. The method of claim 1, wherein, The electronic device runs a basic input and output system; The determination of the first connection relationship, the first attribution relationship, the second connection relationship, and the second attribution relationship comprises: reading, by the basic input and output system, protocol conversion component information of the protocol conversion components mounted under the electronic device, to obtain at least one protocol conversion component information, wherein the at least one protocol conversion component information is used to record the second connection relationship, one of the at least one protocol conversion component information corresponds to one of the at least one protocol conversion component, and the one of the at least one protocol conversion component information includes a component identification and second port information, wherein, in the one of the at least one protocol conversion component information, the component identification is the component identification of the protocol conversion component corresponding to the one of the at least one protocol conversion component information, and the second port information is the port information of the second communication port to which the protocol conversion component corresponding to the one of the at least one protocol conversion component information is connected.

6. The method of claim 5, wherein, After the reading, by the basic input and output system, of the protocol conversion component information of the protocol conversion components mounted under the electronic device, to obtain at least one protocol conversion component information, the method further comprises: store the at least one protocol conversion component information into a second storage structure through the basic input and output system, wherein the second storage structure is a data structure for storing protocol conversion component information, one piece of protocol conversion component information in the at least one protocol conversion component information is stored as one piece of protocol conversion component information record in the second storage structure, and one piece of protocol conversion component information record in the second storage structure comprises a first component identification field for recording component identification and a second port information field for recording second port information.

7. The method of claim 1, wherein, The electronic device runs a basic input and output system; The determining of the first connection relationship, the first attribution relationship, the second connection relationship and the second attribution relationship comprises: reading port information of a processor on the electronic device through the basic input and output system to obtain at least one processor port information, wherein the at least one processor port information is used for recording the second attribution relationship, one piece of processor port information in the at least one processor port information corresponds to one second communication port of one processor in the at least one processor, one piece of processor port information in the at least one processor port information comprises processor identification and third port information, and in one piece of processor port information in the at least one processor port information, the processor identification is the processor identification of the processor corresponding to the one piece of processor port information, and the third port information is the port information of the second communication port corresponding to the one piece of processor port information.

8. The method of claim 7, wherein, After the reading of the port information of the processor on the electronic device through the basic input and output system, the method further comprises: storing the at least one processor port information into a third storage structure through the basic input and output system, wherein the third storage structure is a data structure for storing processor port information, one piece of processor port information in the at least one processor port information is stored as one piece of processor port information record in the third storage structure, and one piece of processor port information record in the third storage structure comprises a first processor identification field for recording processor identification and a third port information field for recording third port information.

9. The method of claim 1, wherein, The first connection relationship is recorded through at least two hard disk information, one piece of hard disk information in the at least two hard disk information corresponds to one hard disk in the at least two hard disks, one piece of hard disk information in the at least two hard disk information comprises hard disk serial number and first port information, and in one piece of hard disk information in the at least two hard disk information, the hard disk serial number is the hard disk serial number of the hard disk corresponding to the one piece of hard disk information, and the first port information is the port information of the first communication port to which the hard disk corresponding to the one piece of hard disk information is connected; and the first attribution relationship is recorded through the combination of the component identification of the protocol conversion component in the component port configuration information and the port information of the first communication port. The integrating of the first connection relationship and the first attribution relationship into at least two first sub-link information based on the port information of the first communication port comprises: The hard disk information in the at least two hard disk information is respectively taken as current hard disk information to perform the following first data operation: According to the first port information in the current hard disk information, the component port configuration information is searched, and the combination of the hard disk serial number in the current hard disk information, the first port information of the current hard disk information and the searched component identification is recorded as a first sub-link information.

10. The method of claim 9, wherein, The protocol conversion component information in the at least one protocol conversion component information corresponds to a protocol conversion component in the at least one protocol conversion component, the protocol conversion component information in the at least one protocol conversion component information includes component identification and second port information, in the protocol conversion component information in the at least one protocol conversion component information, the component identification is the component identification of the protocol conversion component corresponding to the protocol conversion component information, and the second port information is the port information of the second communication port connected to the protocol conversion component corresponding to the protocol conversion component information; The second connection relationship and the at least two first sub-link information are integrated into at least two second sub-link information based on the component identification of the protocol conversion component, including: The first sub-link information in the at least two first sub-link information is respectively taken as current first sub-link information to perform the following second data operation, wherein the component identification of the protocol conversion component in the current first sub-link information is a current component identification: According to the current component identification, the at least one protocol conversion component information is searched; The current first sub-link information and the second port information in the searched protocol conversion component information are integrated into a second sub-link information.

11. The method of claim 10, wherein, The second connection relationship is recorded through at least one processor port information, one processor port information in the at least one processor port information corresponds to a second communication port of one processor in the at least one processor; One processor port information in the at least one processor port information includes processor identification and third port information, in the one processor port information in the at least one processor port information, the processor identification is the processor identification of the processor corresponding to the one processor port information, and the third port information is the port information of the second communication port corresponding to the one processor port information; The second attribution and the at least two second sub-link information are integrated into the at least two hard disk link information based on the port information of the second communication port, including: The second sub-link information in the at least two second sub-link information is respectively taken as current second sub-link information to perform the following third data operation, wherein the port information of the second communication port in the current second sub-link information is a current port information: According to the current port information, the at least one processor port information is searched; The current second sub-link information and the processor identification in the searched processor port information are integrated into a hard disk link information.

12. The method of claim 1, wherein, The electronic device runs a basic input and output system; The first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship are used to generate at least two hard disk link information. The first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship are used to generate at least two hard disk link information.

13. The method of claim 12, wherein, The electronic device further comprises a baseboard management controller; After the first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship are used to generate at least two hard disk link information, the method further comprises: The at least two hard disk link information is sent to the baseboard management controller by the basic input and output system; In response to the received at least two hard disk link information, the at least two hard disk link information and hardware configuration information are converted into a hard disk relationship table by the baseboard management controller, wherein the hardware configuration information is used to indicate the hard disk physical serial number of the hard disk connected to the processor in the at least one processor, one hard disk link information in the at least two hard disk link information is converted into one hard disk relationship item in the hard disk relationship table, and the one hard disk relationship item in the hard disk relationship table contains the hard disk link information corresponding to the one hard disk relationship item and the hard disk physical serial number corresponding to the one hard disk relationship item.

14. The method of claim 13, wherein, After the at least two hard disk link information and the hardware configuration information are converted into the hard disk relationship table by the baseboard management controller, the method further comprises: At least part of the hard disk relationship items in the hard disk relationship table are displayed on a visual interface by the baseboard management controller.

15. The method according to any one of claims 1 to 14, characterized in that, After the first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship are used to generate at least two hard disk link information, the method further comprises: In response to the detected hot plug operation, the first connection relationship is re-determined, and the at least two hard disk link information is re-generated based on the re-determined first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship.

16. An electronic device, comprising: The first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship are used to generate at least two hard disk link information. The first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship are used to generate at least two hard disk link information. The basic input / output system is used to determine a first connection relationship, a first belonging relationship, a second connection relationship and a second belonging relationship, wherein the first connection relationship is a connection relationship between the hard disk and the first communication port, the first belonging relationship is a belonging relationship between the first communication port and the protocol conversion component, the second connection relationship is a connection relationship between the protocol conversion component and the second communication interface, and the second belonging relationship is a belonging relationship between the second communication port and the processor; based on the first connection relationship, the first belonging relationship, the second connection relationship and the second belonging relationship, at least two hard disk link information is generated, wherein the at least two hard disk link information is used to record a hard disk link formed by a hard disk in the at least two hard disks connected to the processor via the first communication port, the protocol conversion component and the second communication port. The first connection relationship is represented based on a combination of a hard disk serial number and port information of the first communication port, the first belonging relationship is represented based on a combination of port information of the first communication port and a component identifier of the protocol conversion component, the second connection relationship is represented based on a combination of the component identifier of the protocol conversion component and port information of the second communication interface, and the second belonging relationship is represented based on a combination of port information of the second communication port and a processor identifier of the processor; the basic input / output system is further used to integrate the first connection relationship and the first belonging relationship into at least two first sub-link information based on the port information of the first communication port, wherein the at least two first sub-link information is used to record a sub-link formed by a hard disk in the at least two hard disks connected to the protocol conversion component via the first communication port; the second connection relationship and the at least two first sub-link information are integrated into at least two second sub-link information based on the component identifier of the protocol conversion component, wherein the at least two second sub-link information is used to record a sub-link formed by a hard disk in the at least two hard disks connected to the second communication port via the first communication port and the protocol conversion component; and the second belonging relationship and the at least two second sub-link information are integrated into the at least two hard disk link information based on the port information of the second communication port.

17. An electronic device, comprising: Comprise: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the hard disk disc sequence identification method according to any one of claims 1 to 15.

18. A server, characterized by Comprise: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the hard disk disc sequence identification method according to any one of claims 1 to 15.

19. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program is executed by the processor to implement the steps of the hard disk disc sequence identification method according to any one of claims 1 to 15.

Citation Information

Patent Citations

  • Port management method and system for SATA hard disk and related components

    CN110399170A

  • Hard disk physical position determining method and device

    CN112328440A