Hard disk information determination method, electronic device, storage medium, and program product

By acquiring server hardware signals and a set of preset strategies, the physical and logical locations of hard drives are automatically determined, solving the problem of low efficiency in determining hard drive information in large-scale data centers, improving efficiency and reducing operation and maintenance costs.

CN122240410APending Publication Date: 2026-06-19INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INSPUR SUZHOU INTELLIGENT TECH CO LTD
Filing Date
2026-05-20
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In large-scale data center scenarios, determining hard drive information by manually associating the physical and logical locations of hard drives is inefficient.

Method used

By acquiring the server's hardware signals and a set of preset policies, the index value of the hard drive is determined, and the physical and logical location of the hard drive is determined based on the index value and the set of preset policies. The correspondence between the hard drive information is established and stored in the preset storage space.

Benefits of technology

No manual matching is required, which improves the efficiency of determining the correspondence between the physical and logical locations of hard drives, adapts to diverse hardware configurations, and reduces operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122240410A_ABST
    Figure CN122240410A_ABST
Patent Text Reader

Abstract

This application discloses a method, electronic device, storage medium, and program product for determining hard disk information, relating to the field of server technology. The method includes: when it is necessary to determine the hard disk information of hard disks within a server, acquiring server hardware signals, a preset strategy set, and first information corresponding to multiple external hard disks. The first information indicates the physical location of the multiple hard disks within the server. The preset strategy set includes the arrangement strategy of the multiple hard disks. Based on the hardware signals, determining the index values ​​corresponding to the multiple hard disks; based on the index values ​​and the preset strategy set, determining second information corresponding to the multiple hard disks, the second information indicates the physical location of the multiple hard disks; determining the hard disk information of the multiple hard disks based on the first and second information, the hard disk information indicating the correspondence between the first and second information, and storing the hard disk information of the multiple hard disks in a preset storage space. This improves the efficiency of determining hard disk information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of server technology, and in particular to a method for determining hard disk information, electronic equipment, storage medium, and program product. Background Technology

[0002] With the rapid development of big data and artificial intelligence technologies, servers typically adopt hybrid storage architectures to meet the demands for high capacity and high performance. During operation and maintenance, it is necessary to understand the relationship between the physical and logical locations of hard drives.

[0003] In related technologies, operations and maintenance personnel can manually associate the physical and logical locations of hard drives through a management interface to determine the hard drive information of each drive. However, in the above method, when maintaining large-scale data center scenarios, relying solely on manual association leads to low efficiency in determining hard drive information. Summary of the Invention

[0004] This application provides a method, electronic device, storage medium, and program product for determining hard disk information, in order to at least solve the problem of low efficiency in determining hard disk information.

[0005] This application provides a method for determining hard disk information, including:

[0006] The system acquires the server's hardware signals, a set of preset strategies, and first information corresponding to multiple external hard drives. The first information indicates the physical location of the multiple hard drives within the server, and the set of preset strategies includes the arrangement strategies for the multiple hard drives. Based on the hardware signals, the system determines the index values ​​corresponding to the multiple hard drives.

[0007] Based on the index value and the preset strategy set, determine the second information corresponding to multiple hard drives. The second information is used to indicate the logical location of multiple hard drives. Based on the first information and second information corresponding to multiple hard drives, determine the hard drive information of multiple hard drives. The hard drive information is used to indicate the correspondence between the first information and the second information. The hard drive information of multiple hard drives is then stored in the preset storage space.

[0008] This application also provides a device for determining hard disk information, comprising: an acquisition module, a first determination module, a second determination module, and a third determination module. The acquisition module is used to acquire server hardware signals, a preset strategy set, and first information corresponding to multiple hard disks connected to the server. The first information indicates the physical location of the multiple hard disks within the server, and the preset strategy set includes the arrangement strategy of the multiple hard disks. The first determination module is used to determine index values ​​corresponding to the multiple hard disks based on the hardware signals. The second determination module is used to determine second information corresponding to the multiple hard disks based on the index values ​​and the preset strategy set. The second information indicates the logical location of the multiple hard disks. The third determination module is used to determine hard disk information of the multiple hard disks based on the first and second information corresponding to the multiple hard disks. The hard disk information indicates the correspondence between the first and second information, and stores the hard disk information of the multiple hard disks in a preset storage space.

[0009] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of any of the above-described methods for determining hard disk information.

[0010] This application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of any of the above-described methods for determining hard disk information.

[0011] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described methods for determining hard disk information.

[0012] This application provides a method for determining the hard drive information of a server's internal hard drives when needed. This involves acquiring the server's hardware signals, a set of preset strategies, and first information corresponding to multiple external hard drives. The first information indicates the logical location of each hard drive within the server. The set of preset strategies includes the arrangement strategies for each hard drive. Based on the hardware signals, index values ​​are determined for each hard drive. Based on the index values ​​and the set of preset strategies, second information is determined for each hard drive, indicating its physical location. Finally, based on the first and second information, the hard drive information is determined, indicating the correspondence between the first and second information. This information is then stored in a preset storage space. This method allows for the determination of the physical location of hard drives within the server based on the server's hardware signals and the set of preset strategies. On one hand, it eliminates the need for manual matching, improving the efficiency of determining the correspondence between physical and logical locations. On the other hand, by combining hardware signals and the set of preset strategies, the corresponding physical location is determined based on the index value, eliminating the need to develop separate arrangement strategies for each configuration, thus increasing flexibility and adapting to diverse hardware configurations. Attached Figure Description

[0013] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0014] Figure 1 This is a schematic diagram of the system architecture provided for an embodiment of this application;

[0015] Figure 2 A flowchart illustrating the method for determining hard disk information provided in an embodiment of this application;

[0016] Figure 3 A schematic diagram of the visual display interface provided in the embodiments of this application;

[0017] Figure 4 A schematic diagram illustrating the process of determining the second information provided in the embodiments of this application;

[0018] Figure 5 A schematic diagram illustrating the process of determining the preset strategy set provided in the embodiments of this application;

[0019] Figure 6 A schematic diagram illustrating the verification process of server hardware signals provided in an embodiment of this application;

[0020] Figure 7 A schematic diagram of the hardware architecture for determining hard disk information provided in an embodiment of this application;

[0021] Figure 8 A schematic diagram of the hard disk information determination device provided in this application embodiment;

[0022] Figure 9 A schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation

[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0024] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0025] In related technologies, operations and maintenance personnel can manually associate the physical and logical locations of hard drives through a management interface to determine the hard drive information of each drive. However, in the above method, when maintaining large-scale data center scenarios, relying solely on manual association leads to low efficiency in determining hard drive information.

[0026] To address the aforementioned issues, in this embodiment, when it is necessary to determine the hard drive information of the hard drives within the server, the server's hardware signals, a preset strategy set, and first information corresponding to multiple external hard drives can be obtained. The first information indicates the physical location of the multiple hard drives within the server, and the preset strategy set includes the arrangement strategy of the multiple hard drives. Based on the index value and the preset strategy set, second information corresponding to the multiple hard drives is determined, indicating the logical location of the multiple hard drives. Based on the first and second information corresponding to the multiple hard drives, the hard drive information of the multiple hard drives is determined, indicating the correspondence between the first and second information, and the hard drive information of the multiple hard drives is stored in a preset storage space. Thus, through the above method, the physical location of the hard drives within the server can be determined based on the server's hardware signals and the preset strategy set. On the one hand, manual matching is eliminated, improving the efficiency of physical location determination. On the other hand, by combining hardware signals and the preset strategy set, the corresponding physical location is determined based on the index value, eliminating the need to develop separate arrangement strategies for each configuration, thus improving flexibility and adapting to diverse hardware configurations.

[0027] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0028] The specific application environment architecture or hardware architecture upon which the method for determining hard disk information depends is described here. (References) Figure 1 , Figure 1 This is a schematic diagram of the system architecture provided for an embodiment of this application. Please refer to [link / reference]. Figure 1The system includes a server 100, which includes a baseboard management controller 101, a hub unit 102, and a programmable device 103. The hub unit 102 can connect to multiple hard drives 104. The programmable device 103 is integrated on the backplane of the server 100 and is connected to both the baseboard management controller 101 and the hub unit 102. The programmable device 103 can obtain the presence status of the multiple hard drives 104 connected to the hub unit 102. The baseboard management controller 101 can obtain the preset arrangement strategy of the hard drives stored in the hub unit and obtain the presence status of the multiple hard drives 104 from the programmable device 103, thereby mapping the physical and logical locations of each hard drive and determining the hard drive information of each hard drive.

[0029] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0030] Figure 2 This is a flowchart illustrating the method for determining hard disk information provided in an embodiment of this application, as shown below. Figure 2 As shown, embodiments of this application provide a method for determining hard disk information. The method is described in detail below:

[0031] S201. Obtain the server's hardware signals, preset policy set, and first information corresponding to multiple external hard drives of the server.

[0032] The execution entity in this application embodiment can be a baseboard management controller within a server, or a hard disk information determination device disposed within the baseboard management controller. The hard disk information determination device can be implemented by software, or by a combination of software and hardware.

[0033] The hardware signals of a server can be electrical signals transmitted by hardware units within the server. These hardware units can be expansion chips of the server, and the electrical signals can refer to the high and low level signals of multiple pins on the hardware units.

[0034] For example, the hardware signals can be: pin 1 high level, pin 2 high level, and pin 3 low level.

[0035] The preset strategy set can include multiple hard drive layout strategies. It can be understood that the preset strategy set can be hard drive layout rules pre-stored by the user. For example, the preset strategy set can be based on hard drive layout schemes, hub unit locations, port numbers, and logical location definitions.

[0036] For example, Table 1 is a set of preset strategies. Please refer to Table 1, which includes:

[0037] Table 1

[0038]

[0039] Understandably, in the preset strategy set shown in Table 1, when the hard drive layout scheme is scheme 0, if the hub unit position is position 0, then the logical position of the hard drive corresponding to port 0 is hard drive disk0, and the logical position of the hard drive corresponding to port 1 is hard drive disk1. Based on the preset strategy set, the hard drive layout strategy can be determined according to the mapping relationship between the hard drive layout scheme, hub unit position, port number, and logical position.

[0040] Multiple hard drives can be external hard drives connected to the server via a hub unit. Multiple hard drives are directly connected to the central processing unit via the hub unit. That is, multiple hard drives are not connected to the motherboard via the server backplane. Therefore, the baseboard management controller cannot directly monitor multiple hard drives and needs to obtain the first information of multiple hard drives through the backplane programmable device.

[0041] The first information can be used to indicate the physical location of multiple hard drives. The physical location can refer to the interface location or slot location of the hard drive on the hub unit. For example, multiple hard drives can include hard drive 1, hard drive 2 and hard drive 3. The physical location of hard drive 1 can be connected to interface 1, the physical location of hard drive 2 can be connected to interface 2, and the physical location of hard drive 3 can be connected to interface 3. The physical location of hard drive 1 can also be connected to slot 1, the physical location of hard drive 2 can also be connected to slot 2, and the physical location of hard drive 3 can also be connected to slot 3.

[0042] S202. Determine the index values ​​corresponding to multiple hard drives based on hardware signals.

[0043] The index value can be a numerical value determined by the high or low level of the hardware signal. For example, the index value can be 00, 01, 010, 111, etc.

[0044] Index values ​​can be determined as follows: based on hardware signals, determine the first level combination and the second level combination; based on the first level combination and the second level combination, determine the index values ​​corresponding to multiple hard drives.

[0045] The first level combination can be used to indicate multiple hard drive layout schemes. The first level combination can be determined by the level signals of multiple pins of the hardware unit in the server. For example, pins 1, 2, 3 and 4 of the hardware unit can be preset to indicate the first level combination. That is, assuming that the level of pin 1 is high, the level of pin 2 is low, the level of pin 3 is low and the level of pin 4 is high, the first level combination is (high level, low level, low level, high level).

[0046] The second level combination can be used to indicate the location of the hub unit within the server. The second level combination can be determined by the level signals of multiple pins of the hardware unit within the server. For example, pins 5, 6, 7, and 9 of the hardware unit can be preset to indicate the second level combination. That is, assuming that the level of pin 5 is low, the level of pin 6 is low, the level of pin 7 is high, and the level of pin 8 is high, then the second level combination is (low level, low level, high level, high level).

[0047] Optionally, the index value may include a first index value and a second index value, which can be determined by: performing a conversion process on the first level combination to obtain the first index value corresponding to the first level combination; and performing a conversion process on the second level combination to obtain the second index value corresponding to the second level combination.

[0048] Understandably, the index value can be a number obtained by converting the level combination into binary and then into decimal. The binary conversion can be converting a high-level signal to 1 and a low-level signal to 0.

[0049] For example, assuming the first level combination is (high level, low level, low level, high level), performing a binary conversion on the first level combination yields a binary value of 1001. Converting this binary value to decimal gives an index value of 9. Similarly, assuming the second level combination is (low level, low level, high level, high level), performing a binary conversion on the second level combination yields a binary value of 0011. Converting this binary value to decimal gives an index value of 3.

[0050] S203. Determine the second information corresponding to multiple hard drives based on the index value and the preset strategy set.

[0051] The second piece of information can be used to indicate the logical location of multiple hard drives within the server. Understandably, logical location refers to the logical disk order assigned to a hard drive by the server. This logical disk order can be dynamically assigned by the server and is a virtual number at the system level, used by users and software for actual access. The logical disk order can be determined based on factors such as hard drive connection interface, partition creation order, and boot priority.

[0052] Based on the index value, the second information corresponding to multiple hard drives can be determined from the preset strategy set.

[0053] S204. Based on the first information and the second information corresponding to the multiple hard drives, determine the hard drive information of the multiple hard drives and store the hard drive information of the multiple hard drives in a preset storage space.

[0054] Hard disk information can be used to indicate the correspondence between the first and second pieces of information.

[0055] The hard drive information of multiple hard drives can be determined as follows: For any one hard drive, obtain the first information corresponding to that hard drive. The first information can be used to indicate the physical location of the hard drive. For example, the first information can be slot1 or port1. Obtain the second information corresponding to that hard drive. The second information can be used to indicate the logical location of the hard drive. For example, the second information can be disk1. Establish the correspondence between the first information and the second information. For example, slot1 corresponds to disk1, and slot2 corresponds to disk2. Determine the correspondence between the first information and the second information of the hard drive as the hard drive information, and store the hard drive information in a preset storage space. The preset storage space can be non-volatile memory within the server.

[0056] Optionally, the server may have a corresponding visual display interface, which can be displayed on the server's display device. The visual display interface can be used to display hard drive information of multiple hard drives on the server. For example, the visual display interface can display multiple hard drives, and each hard drive can correspond to a hard drive display window. For any given hard drive, the hard drive display window can display the hard drive information, that is, the physical location and logical location of the hard drive. The hard drive display window can also display the type of hard drive, for example, it can display the hard drive type as SATA hard drive or NVMe hard drive. Optionally, within the hard drive display window, the hard drive can correspond to an indicator light control. The indicator light control can use different colors to identify different hard drive types. For example, when the hard drive type is SATA hard drive, the corresponding indicator light control can be displayed as blue, and when the hard drive type is NVMe hard drive, the corresponding indicator light control can be displayed as green.

[0057] Optionally, the baseboard management controller can also receive query commands. These commands can be sent by maintenance personnel to the baseboard management controller via electronic devices, and can be used to query the physical and logical locations of the hard drives.

[0058] Optionally, the baseboard management controller can also monitor the status of multiple hard drives. When a faulty hard drive is detected, it can control the indicator light control corresponding to the hard drive on the visual display interface to turn red, and at the same time generate alarm information. The alarm information can include the hard drive information of the faulty hard drive and the alarm log, and send the alarm information to the maintenance personnel, so as to facilitate the maintenance personnel to troubleshoot and perform subsequent operations such as disk replacement.

[0059] Below, in conjunction with Figure 3 The visual display interface is explained through specific examples.

[0060] Figure 3 For a schematic diagram of the visual display interface provided in the embodiments of this application, please refer to [link / reference]. Figure 3 It includes a visual display interface containing multiple hard drive controls. Each hard drive control represents a specific hard drive, and below each hard drive control is a corresponding hard drive display window that shows the hard drive's information. Each hard drive control also has an indicator light that can display different colors. For example, a blue indicator light indicates a SATA hard drive, a green indicator light indicates an NVMe hard drive, and a red indicator light indicates a hard drive malfunction requiring troubleshooting.

[0061] Understandably, the first information corresponding to multiple hard drives can be used to indicate the physical location of the multiple hard drives, and the second information corresponding to the multiple hard drives can be used to indicate the logical location of the multiple hard drives within the server. For any hard drive, by combining the first and second information, the physical location and logical location can be associated. Thus, when the server detects that any hard drive has failed, the actual physical location of the hard drive can be located through the logical location, which makes it easier for maintenance personnel to quickly locate the location of the failed hard drive and handle it.

[0062] In this embodiment, when it is necessary to determine hard disk information, the baseboard management controller can acquire the server's hardware signals, a preset strategy set, and first information corresponding to multiple hard disks connected to the server. The server's hardware signals can be electrical signals transmitted by hardware units within the server. The preset strategy set can include the arrangement strategy of multiple hard disks. The first information can be used to indicate the physical location of the multiple hard disks. Based on the hardware signals, the controller determines the index values ​​corresponding to the multiple hard disks. The index values ​​can be values ​​determined based on the high and low level signals of the hardware signals. Specifically, based on the hardware signals, the controller can determine a first level combination and a second level combination, and determine the index values ​​corresponding to the multiple hard disks based on the first level combination and the second level combination. Based on the index values ​​and the preset strategy set, the controller determines the second information corresponding to the multiple hard disks. The second information can be used to indicate the logical location of the multiple hard disks within the server. The logical location can refer to the logical disk order determined by the server for the hard disks. Based on the first and second information corresponding to the multiple hard disks, the controller determines the hard disk information of the multiple hard disks and stores the hard disk information of the multiple hard disks in a preset storage space. The hard disk information can be used to indicate the correspondence between the first and second information. The preset storage space can be a non-volatile memory within the server. In this way, the physical configuration can be dynamically identified through hardware signals and combined with a set of preset strategies to ensure real-time synchronization between hard drive location and logical location, solving the mapping error problem caused by software logic in the existing technology. At the same time, it supports multiple hard drive layout strategies, thereby adapting to the location changes of different customer-customized chassis and hub units without the need to modify firmware or manual intervention, significantly reducing operation and maintenance costs.

[0063] Based on any of the above embodiments, the following, in conjunction with Figure 4 The process of determining the second piece of information will be explained in detail.

[0064] Figure 4 This is a schematic diagram illustrating the process of determining the second information provided in an embodiment of this application. Please refer to [link / reference needed]. Figure 4 The method may include:

[0065] S401. Determine the first index value and the second index value corresponding to multiple hard disks based on the first level combination and the second level combination.

[0066] The first level combination is converted to obtain the first index value corresponding to multiple hard drives. The second level combination is converted to obtain the second index value corresponding to multiple hard drives.

[0067] The first level combination can be used to indicate multiple hard drive layout schemes, that is, the first level combination can be a chassis scheme selection signal. The second level combination can be used to indicate the location of the hub unit within the server, that is, the second level combination can be a positioning signal (e.g., a locate strap pin signal).

[0068] The execution steps of step S401 can be found in step S202 above, and will not be repeated here.

[0069] S402. Based on the first index value, perform matching processing within the preset strategy set to obtain the first strategy set.

[0070] The first strategy set may include the hard disk layout scheme corresponding to the first index value.

[0071] Understandably, the first set of strategies that matches the current hard drive layout can be selected from the preset strategy set using the first index value.

[0072] For example, assuming the preset strategy set is as shown in Table 1 above, if the first index value is 0, the corresponding hard disk layout scheme is scheme 0. Matching within the preset strategy set yields the first strategy set as shown in Table 2. Please refer to Table 2, which includes:

[0073] Table 2

[0074]

[0075] S403. Based on the second index value, perform matching processing within the first strategy set to obtain the second strategy set.

[0076] The second strategy set may include the arrangement scheme of multiple hard drives when the hub unit is at the position corresponding to the second index value.

[0077] Understandably, the second index value can be used to filter out the second set of strategies that match the current hub unit location from the first set of strategies.

[0078] For example, assuming the first strategy set is as shown in Table 2 above, if the second index value is 1, the corresponding hub unit position is position 1. Matching within the first strategy set yields the second strategy set as shown in Table 3. Please refer to Table 3, which includes:

[0079] Table 3

[0080]

[0081] S404. Determine the second information corresponding to multiple hard drives based on the second strategy set.

[0082] The second information corresponding to multiple hard drives can be determined according to the second strategy set as follows: Based on hardware signals, determine a third level combination; based on the third level combination, determine the hard drive presence status of each slot; among multiple preset slots, determine a target slot, where the hard drive presence status of the target slot is "hard drive present"; based on the target slot, determine the port positions corresponding to multiple hard drives; in the second strategy set, determine the position identifiers corresponding to the port positions of multiple hard drives respectively; and determine the port positions corresponding to multiple hard drives and the position identifiers corresponding to the port positions of multiple hard drives as the second information corresponding to multiple hard drives.

[0083] For example, the third level combination can be used to indicate the presence information of multiple preset slots of hard drives connected to the server. That is, the third level combination can be a port present pin signal (e.g., a Port Present pin signal). The third level combination can be determined by the level signals of multiple pins of the hardware unit within the server. The number of pins corresponding to the third level combination is the same as the number of hard drives that can be connected to the hub unit, and there is a one-to-one correspondence between the pins corresponding to the third level combination and the hard drives that can be connected to the hub unit. For example, pin 1 can correspond to hard drive 1, and pin 2 can correspond to hard drive 2. If the level of pin 1 is low, it can be considered that hard drive 1 is not present. If the level of pin 2 is high, it can be considered that hard drive 2 is present. For example, if the third level combination is (1, 0, 1, 1), it can be considered that hard drive 1 corresponding to pin 1 is present, hard drive 2 corresponding to pin 2 is not present, hard drive 3 corresponding to pin 3 is present, and hard drive 4 corresponding to pin 4 is present.

[0084] exist Figure 4 In the illustrated embodiment, when it is necessary to determine the second information, a first index value and a second index value corresponding to multiple hard drives can be determined based on a first level combination and a second level combination. Based on the first index value, a matching process is performed within a preset strategy set to obtain a first strategy set, which may include the hard drive layout scheme corresponding to the first index value. Based on the second index value, a matching process is performed within the first strategy set to obtain a second strategy set, which may include the layout scheme of multiple hard drives corresponding to the hub unit at the position corresponding to the second index value. Based on the second strategy set, the second information corresponding to the multiple hard drives is determined. Thus, by using the above method, automated sensing of hardware signals replaces manual recording, and standardized rules of preset strategies replace scattered configurations, ultimately achieving the correspondence between physical and logical locations, thereby improving the efficiency of hardware information confirmation.

[0085] Based on any of the above embodiments, the following, in conjunction with Figure 5 The process of determining the preset strategy set is explained in detail.

[0086] Figure 5 This is a schematic diagram illustrating the process of determining the preset strategy set provided in this application embodiment. Please refer to... Figure 5 The method may include:

[0087] S501. Obtain the set of policies to be verified from the target memory.

[0088] Optionally, the target memory can be a non-volatile memory, which can be a non-volatile memory connected to a hub unit.

[0089] The policy set can be policy set data that the baseboard management controller obtains from the target memory, and whose integrity has not yet been confirmed. It is understood that the policy set may be incorrect or incomplete during the process of obtaining it by the baseboard management controller due to transmission errors, accidental modification, malicious tampering, etc.

[0090] S502. Perform validation processing on the set of strategies to be validated.

[0091] The verification process can be performed as follows: obtain the first verification value corresponding to the set of policies to be verified; determine multiple bytes within the set of policies to be verified, sum the multiple bytes to obtain the second verification value; when the first verification value and the second verification value are the same, determine the set of policies to be verified as the preset policy set; when the first verification value and the second verification value are different, generate an error message, obtain the default policy, and determine the default policy as the preset policy set.

[0092] The first checksum can be an integrity identifier pre-calculated and saved when the policy set is generated or stored, which can be used for subsequent integrity verification. The first checksum can also be obtained through checksum processing when the policy set is generated or stored. Error information can include the reason for verification failure, such as checksum mismatch, for subsequent maintenance and troubleshooting. The default policy can be a pre-stored, rigorously verified set of basic policies, such as a minimal rule base fixed at the server's factory, used to ensure that the system can still correctly recognize the hard drive when the policy set is unavailable.

[0093] Understandably, when the first and second checksums are the same, it can be assumed that the policy set has not been modified or damaged during storage or transmission, and can be directly used as a valid rule base (i.e., the preset policy set). When the first and second checksums are different, it can be assumed that the policy set may have been tampered with (e.g., maliciously modified rules), corrupted (e.g., transmission errors, bad blocks in the storage medium), or mismatched versions. In this case, a backup default policy needs to be enabled.

[0094] exist Figure 5In the illustrated embodiment, when it is necessary to determine a preset policy set, a policy set to be verified can be obtained from the target memory. This policy set can be policy set data obtained by the baseboard management controller from the target memory, whose integrity has not yet been confirmed. Verification processing is performed on the policy set to be verified. Specifically, a first verification value corresponding to the policy set to be verified can be obtained. Multiple bytes within the policy set to be verified are determined, and these bytes are summed to obtain a second verification value. If the first and second verification values ​​are the same, the policy set to be verified is determined as the preset policy set. If the first and second verification values ​​are different, an error message is generated, and a default policy is obtained and determined as the preset policy set. In this way, the policy set is prevented from being tampered with or damaged, ensuring the accuracy of the hard disk logical mapping. Simultaneously, the system's fault tolerance is improved. Even if the policy set is unavailable, it can automatically switch to the default policy, ensuring basic hard disk identification functions and preventing the server from becoming completely unusable due to policy issues, thus buying time for maintenance personnel to repair the policy set.

[0095] Based on any of the above embodiments, the following, in conjunction with Figure 6 The process of verifying the server's hardware signals is explained in detail.

[0096] Figure 6 This is a schematic diagram illustrating the verification process of server hardware signals provided in an embodiment of this application. Please refer to [link / reference]. Figure 6 The method may include:

[0097] S601. Obtain the server's first signal at multiple times according to the preset frequency.

[0098] It is understandable that hardware signals may generate unstable false signals due to factors such as electromagnetic interference and poor contact. For example, pin signals may alternate between high and low levels within 1 second, leading to system misjudgment.

[0099] The preset frequency can be a value set by the user in advance. For example, the preset frequency can be once every 100 milliseconds.

[0100] The first signal can be an electrical signal transmitted by the server's hardware unit, namely, a high-level signal and a low-level signal.

[0101] S602. Perform a consistency check on the first signal at multiple times and obtain the consistency check result.

[0102] Consistency checks can be used to determine whether the first signal at multiple times is consistent.

[0103] For example, suppose there are multiple time points, namely time 1, time 2, time 3, time 4 and time 5, where the first signal of time 1 is 1 (high level signal), the first signal of time 2 is 0 (low level signal), the first signal of time 3 is 1, the first signal of time 4 is 1, and the first signal of time 5 is 1. Then the result of the consistency check is considered to be that the signals are inconsistent. If the first signal of time 1 is 1, the first signal of time 2 is 1, the first signal of time 3 is 1, the first signal of time 4 is 1, and the first signal of time 5 is 1, then the result of the consistency check is considered to be that the signals are consistent.

[0104] S603. When the consistency check result is that the signals are inconsistent, process the first signals at multiple times to obtain the server's hardware signals.

[0105] The server's hardware signal can be determined as follows: within the first signal at multiple times, determine whether a second signal exists, and the proportion of the second signal in the first signal at multiple times is greater than or equal to a first threshold; if it exists, then the second signal is determined as the server's hardware signal; if it does not exist, then determine a third signal within the first signal at multiple times, and determine the third signal as the server's hardware signal; the number of consecutive occurrences of the third signal within the first signal at multiple times is greater than or equal to a second threshold.

[0106] The first threshold and the second threshold can be preset values; for example, the first threshold can be 0.8 and the second threshold can be 3.

[0107] For example, suppose the first signals at multiple times are (1, 0, 1, 0, 1, 1, 1, 0, 1, 0). If the first threshold is 0.8 and the second threshold is 3, it can be determined that there is no second signal in the first signals at multiple times, but there is a third signal (1) in the first signals at multiple times, that is, there is a signal that appears more than the second threshold 3 times in a row. The third signal (1) is determined to be a hardware signal.

[0108] exist Figure 6In the illustrated embodiment, when it is necessary to determine the server's hardware signals, the server's first signals at multiple moments can be acquired at a preset frequency. These first signals can be electrical signals transmitted by the server's hardware units. A consistency check is performed on the first signals at multiple moments to obtain the consistency check results. The consistency check can be used to determine whether the first signals at multiple moments are consistent. If the consistency check result indicates that the signals are inconsistent, the first signals at multiple moments are processed to obtain the server's hardware signals. Thus, by combining multiple acquisitions with statistical analysis, the reliability of hardware signals can be improved, and misjudgments caused by noise can be reduced. Furthermore, the use of both percentage threshold and consecutive count threshold filtering logics can adapt to different types of signal fluctuations, enhancing the versatility of different scenarios.

[0109] Based on any of the above embodiments, the following, in conjunction with Figure 7 The hardware architecture for determining the hard drive information is described in detail.

[0110] Figure 7 This is a schematic diagram of the hardware architecture used to determine the hard disk information in an embodiment of this application. Please refer to [link / reference needed]. Figure 7 The system includes: a backplane programmable device, a hub unit, a hardware unit, a hard disk module, and a baseboard management controller. The backplane programmable device may include general-purpose input / output interfaces (e.g., GPIO), bus units (e.g., I2C bus), and physical location storage units. The hub unit may include multiple hard disk controllers and target storage modules. The hard disk controllers of the hub unit can connect to multiple SATA serial hard disks, and the hard disk modules can connect to multiple NVMe high-speed solid-state drives. The hardware unit may include multiple pins. The baseboard management controller may include a hard disk management module, a physical location to logical location mapping module, and a storage management module (e.g., an EEPROM management module). The backplane programmable device is connected to the hub unit, the hard disk module, and the baseboard management controller, respectively. The baseboard management controller can connect to the hardware unit through interfaces and the hub unit, respectively.

[0111] Specifically, the general-purpose input / output (GPIO) interface within the backplane programmable device (UPD) can monitor the presence status of the hard drives connected to the hub unit and the hard drives within the hard drive modules. The bus unit of the PPD can determine the hard drive interface type (e.g., SATA, NVMe) of the hard drives connected to the hub unit and the hard drives within the hard drive modules based on pin levels. The physical location storage unit of the PPD stores the presence status and interface type obtained from the GPIO and bus units and sends it to the hard drive management module of the baseboard management controller (BDC). The hard drive management module then sends it to the physical location to logical location mapping module. The storage management module of the BDC can obtain a policy set from the target storage module of the hub unit and hardware signals from the hardware unit, and send them to the physical location to logical location mapping module of the PPD. The physical location to logical location mapping module completes the logical and physical mapping of the hard drives based on the obtained policy set, hardware signals, presence status, and interface type. The physical location to logical location mapping module can display the logical and physical hard drive mapping relationships on the corresponding visual interface of the server based on the determined logical and physical mapping relationships. Simultaneously, it can use indicator lights to display different colors to indicate the hard drive type and status. Furthermore, it can generate log alarms based on the hard drive status and supports a remote management interface, providing query functions for remote maintenance personnel. Through the above description of the implementation methods, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented using software plus necessary general-purpose hardware platforms. Of course, they can also be implemented using hardware, but in many cases, the former is a better implementation method.

[0112] Figure 8 A schematic diagram of the structure of the hard disk information determination device provided in this application embodiment is shown. Figure 8 As shown, embodiments of this application also provide a hard disk information determination device 10, including an acquisition module 11, a first determination module 12, a second determination module 13, and a third determination module 14. The acquisition module 11 is used to acquire server hardware signals, a preset strategy set, and first information corresponding to multiple hard disks connected to the server. The first information indicates the physical location of the multiple hard disks within the server, and the preset strategy set includes the arrangement strategy of the multiple hard disks. The first determination module 12 is used to determine the index value corresponding to the multiple hard disks based on the hardware signals. The second determination module 13 is used to determine second information corresponding to the multiple hard disks based on the index value and the preset strategy set. The second information indicates the logical location of the multiple hard disks. The third determination module 14 is used to determine the hard disk information of the multiple hard disks based on the first and second information corresponding to the multiple hard disks. The hard disk information indicates the correspondence between the first and second information, and stores the hard disk information of the multiple hard disks in a preset storage space.

[0113] The hard disk information determination device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0114] In one possible design, the first determining module 12 is specifically used to determine a first level combination and a second level combination based on hardware signals. The first level combination is used to indicate the arrangement of multiple hard disks, and the second level combination is used to indicate the location of the hub unit in the server. Based on the first level combination and the second level combination, the index values ​​corresponding to the multiple hard disks are determined.

[0115] In one possible design, the first determining module 12 is specifically used to perform conversion processing on the first level combination to obtain the first index value corresponding to the first level combination; and to perform conversion processing on the second level combination to obtain the second index value corresponding to the second level combination.

[0116] In one possible design, the second determining module 13 is specifically used to: perform matching processing within a preset strategy set based on the first index value to obtain a first strategy set, the first strategy set including the hard disk layout scheme corresponding to the first index value; perform matching processing within the first strategy set based on the second index value to obtain a second strategy set, the second strategy set including the layout scheme of multiple hard disks when the hub unit is at the position corresponding to the second index value; and determine the second information corresponding to the multiple hard disks based on the second strategy set.

[0117] In one possible design, the second determining module 13 is specifically used to: determine a third level combination based on hardware signals, the third level combination being used to indicate the hard drive presence information of multiple preset slots connected to the server; determine the hard drive presence status of each slot based on the third level combination; determine a target slot among the multiple preset slots, the hard drive presence status of the target slot being that a hard drive is present; determine the port positions corresponding to the multiple hard drives based on the target slot; determine the position identifiers corresponding to the port positions corresponding to the multiple hard drives in a second policy set; and determine the port positions corresponding to the multiple hard drives and the position identifiers corresponding to the port positions corresponding to the multiple hard drives as the second information corresponding to the multiple hard drives.

[0118] In one possible design, the acquisition module 11 is further configured to acquire the set of policies to be verified from the target memory and perform verification processing on the set of policies to be verified.

[0119] In one possible design, the acquisition module 11 is further configured to: acquire a first verification value corresponding to the policy set to be verified; determine multiple bytes within the policy set to be verified, sum the multiple bytes to obtain a second verification value; when the first verification value and the second verification value are the same, determine the policy set to be verified as a preset policy set; when the first verification value and the second verification value are different, generate an error message, acquire a default policy, and determine the default policy as the preset policy set.

[0120] In one possible design, the acquisition module 11 is further configured to acquire the first signal of the server at multiple times according to a preset frequency; perform a consistency check on the first signal at multiple times to obtain the result of the consistency check; and when the result of the consistency check is that the signals are inconsistent, process the first signal at multiple times to obtain the hardware signal of the server.

[0121] In one possible design, the acquisition module 11 is further configured to determine whether a second signal exists within a first signal at multiple times, wherein the proportion of the second signal in the first signal at multiple times is greater than or equal to a first threshold; if it exists, the second signal is identified as a hardware signal of the server; if it does not exist, a third signal is identified within the first signal at multiple times, and the third signal is identified as a hardware signal of the server; wherein the number of consecutive occurrences of the third signal within the first signal at multiple times is greater than or equal to a second threshold.

[0122] The hard disk information determination device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0123] Figure 9 A schematic diagram of the structure of the electronic device provided in this application. Figure 9 As shown, the electronic device 90 provided in this embodiment includes at least one processor 901 and a memory 902. Optionally, the electronic device 90 further includes a communication component 903. The processor 901, memory 902, and communication component 903 are connected via a bus.

[0124] In a specific implementation, at least one processor 901 executes computer execution instructions stored in memory 902, causing at least one processor 901 to execute the above-described method embodiment for determining hard disk information.

[0125] The specific implementation process of processor 901 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0126] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0127] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0128] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0129] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the method for determining hard disk information when it is run.

[0130] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0131] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the method for determining hard disk information.

[0132] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above embodiments of the method for determining hard disk information.

[0133] Any of the components, modules, units, parts, methods, and operations described herein can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Alternatively or additionally, any functionality described herein can be executed at least in part by one or more hardware logic components, such as, but not limited to, a central processing unit (CPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), an application-specific standard product (ASSP), a system-on-a-chip (SoC), a complex programmable logic device (CPLD), a microprocessor (MCU), etc. The terms "system," "computing device," or "apparatus" as used herein encompass various means, devices, and machines for processing data, including, for example, one or more programmable processors, computers, SoCs, or combinations thereof. The apparatus may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, a protocol stack, a database management system, an operating system, a cross-platform runtime environment, a virtual machine, or one or more combinations thereof. The aforementioned computer program (also known as a program, software, software application, app, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, object, or other unit suitable for a computing environment.

[0134] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0135] The foregoing has provided a detailed description of the method for determining hard disk information, the electronic device, the storage medium, and the program product provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to help understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A method for determining hard disk information, characterized in that, include: The server's hardware signals, a set of preset strategies, and first information corresponding to multiple external hard drives are acquired. The first information is used to indicate the physical location of the multiple hard drives, and the set of preset strategies includes the arrangement strategy of the multiple hard drives. Based on the hardware signals, determine the index values ​​corresponding to the plurality of hard drives; Based on the index value and the preset strategy set, the second information corresponding to the plurality of hard disks is determined, and the second information is used to indicate the logical location of the plurality of hard disks within the server; Based on the first information and the second information corresponding to the plurality of hard drives, the hard drive information of the plurality of hard drives is determined, the hard drive information is used to indicate the correspondence between the first information and the second information, and the hard drive information of the plurality of hard drives is stored in a preset storage space.

2. The method according to claim 1, characterized in that, Determining the index values ​​corresponding to the plurality of hard drives based on the hardware signals includes: Based on the hardware signals, a first level combination and a second level combination are determined. The first level combination is used to indicate the arrangement of the plurality of hard disks, and the second level combination is used to indicate the location of the hub unit in the server. The index values ​​corresponding to the plurality of hard disks are determined based on the first level combination and the second level combination.

3. The method according to claim 2, characterized in that, The index value includes a first index value and a second index value; Determining the index values ​​corresponding to the plurality of hard disks based on the first level combination and the second level combination includes: The first level combination is converted to obtain the first index value corresponding to the first level combination; The second level combination is converted to obtain the second index value corresponding to the second level combination.

4. The method according to claim 3, characterized in that, Based on the index value and the preset strategy set, the second information corresponding to the plurality of hard drives is determined, including: Based on the first index value, a matching process is performed within the preset strategy set to obtain a first strategy set, which includes the hard disk layout scheme corresponding to the first index value. Based on the second index value, a matching process is performed within the first strategy set to obtain a second strategy set. The second strategy set includes the arrangement scheme of the multiple hard disks when the hub unit is at the position corresponding to the second index value. Based on the second set of strategies, the second information corresponding to the plurality of hard drives is determined.

5. The method according to claim 4, characterized in that, Based on the second set of strategies, the second information corresponding to the plurality of hard drives is determined, including: Based on the hardware signal, a third level combination is determined, which is used to indicate the presence information of hard drives in multiple preset slots connected to the server. The hard drive presence status of each slot is determined based on the third level combination. Among the plurality of preset slots, a target slot is determined, and the hard drive presence status of the target slot is that a hard drive is present. Based on the target slot, determine the port positions corresponding to the plurality of hard drives; In the second strategy set, the location identifiers corresponding to the port positions of the plurality of hard drives are determined respectively; The port locations corresponding to the plurality of hard drives and the location identifiers corresponding to the port locations of the plurality of hard drives are determined as the second information corresponding to the plurality of hard drives.

6. The method according to any one of claims 1-5, characterized in that, The set of preset strategies can also be obtained, including: Retrieve the set of policies to be verified from the target memory; The set of strategies to be verified is then validated.

7. The method according to claim 6, characterized in that, The validation process for the set of strategies to be validated includes: Obtain the first verification value corresponding to the set of strategies to be verified; Determine multiple bytes within the set of policies to be verified, sum the multiple bytes, and obtain a second verification value; When the first verification value and the second verification value are the same, the set of strategies to be verified is determined as the preset set of strategies; When the first check value and the second check value are different, an error message is generated, and a default policy is obtained, which is then determined as a preset policy set.

8. The method according to any one of claims 1-5, characterized in that, Acquiring server hardware signals also includes: According to a preset frequency, the first signal of the server at multiple times is acquired; Perform a consistency check on the first signals at the multiple time points to obtain the consistency check results; When the consistency check results in signal inconsistency, the first signal at the multiple time points is processed to obtain the server's hardware signal.

9. The method according to claim 8, characterized in that, Processing the first signals at the multiple time points to obtain the server's hardware signals includes: Determine whether a second signal exists within the first signal at the plurality of times, wherein the proportion of the second signal in the first signal at the plurality of times is greater than or equal to a first threshold. If it exists, the second signal is determined to be a hardware signal of the server; If it does not exist, a third signal is determined within the first signal at the plurality of times, and the third signal is determined as the hardware signal of the server. The number of times the third signal appears consecutively within the first signal at the plurality of times is greater than or equal to a second threshold.

10. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the method for determining hard disk information as described in any one of claims 1 to 9 when executing the computer program.