A method and device for querying hard disk VPD information in a BIOS stage

By selecting hard drives under the RAID card at the BIOS stage and using the RAID card to pass through VPD information query commands, the problems of deviation and character loss in hard drive information acquisition at the BIOS end are solved, the integrity and accuracy of hard drive information are achieved, and server management efficiency is improved.

CN120803549BActive Publication Date: 2025-12-12ANQING (TIANJIN) COMPUTER CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511299222.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-12
Publication Date
2025-12-12
Estimated Expiration
2045-09-12

AI Technical Summary

Technical Problem

Existing technologies suffer from information discrepancies and character loss when querying hard drive information under a RAID card using the standard SCSI Inquiry command during the BIOS stage. This makes it difficult to accurately obtain hard drive vendor information and key fields, thus failing to meet the requirements for completeness and accuracy.

Method used

During the BIOS phase, multiple enumerated hard drives using the SCSI protocol are obtained, and the target hard drive to be queried is filtered based on the device connection method. The VPD information query command is passed through using the RAID card to ensure that the hard drive information received by the BIOS is completely consistent with the local storage information of the hard drive.

Benefits of technology

It enables complete and accurate acquisition of hard drive VPD information under RAID card from the BIOS, improving the efficiency and convenience of server hardware diagnosis, asset inventory and fault diagnosis, and ensuring the reliability and accuracy of hard drive information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120803549B_ABST
    Figure CN120803549B_ABST
Patent Text Reader

Abstract

The application provides a method and device for querying hard disk VPD information in a BIOS stage, and belongs to the technical field of hard disk parameter acquisition. The method provided by the application comprises the following steps: in the BIOS stage, a plurality of enumerated hard disks are acquired; a target hard disk to be queried is screened from the enumerated hard disks based on the device connection mode of the enumerated hard disks, and the target hard disk to be queried is connected to a mainboard through a RAID card; a VPD information query instruction is sent by the BIOS end based on a SCSI protocol, and the RAID card forwards the query instruction to the target hard disk to be queried; the target hard disk to be queried returns hard disk information corresponding to the query instruction to the RAID card based on the SCSI protocol, and the hard disk information is sent to the BIOS end through the RAID card; and the received hard disk information is completely consistent with the hard disk information stored locally by the target hard disk to be queried. The method and device for querying hard disk VPD information in the BIOS stage provided by the application are used for realizing complete acquisition of hard disk information under the RAID card of the BIOS end.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of hard disk parameter acquisition, in particular to a method and device for querying hard disk VPD information in the BIOS stage. BACKGROUND

[0002] In the server hardware management and startup process, BIOS (Basic Input Output System) as the core firmware program connecting computer hardware and operating system, undertakes the key role of initializing hardware devices and obtaining hardware basic information, and the Raid card as an important component for managing multiple hard disks, realizing data redundancy and performance optimization in the server, the hard disk information under the Raid card is the core basis for server hardware diagnosis, asset inventory and troubleshooting, therefore, accurately obtaining the hard disk information under the Raid card in the BIOS stage is of great significance to ensure the stable startup of the server and subsequent operation and maintenance management.

[0003] However, when the current server BIOS obtains the hard disk information under the Raid card, it generally uses the SCSI pass through protocol based on the standard UEFI DriverModule to realize, first, the target identifier and logical unit number of the hard disk device under the Raid card are obtained through the SCSI pass through protocol, then the standard SCSI Inquiry command is sent according to the obtained target identifier and logical unit number, and finally the standard fields of the hard disk device are extracted from the command reply to complete the collection of the hard disk basic information.

[0004] However, when the BIOS queries through the standard SCSI Inquiry command, the actual interaction object is the Raid card rather than the hard disk itself, and the information reported by the Raid card firmware (Firmware) deviates from the real information of the hard disk, for example, when obtaining the hard disk vendor, the Raid card often returns ATA uniformly, which cannot reflect the real vendor information; at the same time, the SCSI standard command has a fixed length limit on the reply length, which causes the key fields such as product revision level, product identification and hard disk serial number to easily have character loss problem, and it is difficult to meet the requirement of obtaining the integrity and accuracy of the hard disk information under the Raid card in the BIOS stage. SUMMARY

[0005] Therefore, the present application provides a method and device for querying hard disk VPD information in the BIOS stage, to realize the complete acquisition of the hard disk information under the Raid card in the BIOS stage.

[0006] Specifically, the present application is realized by the following technical scheme:

[0007] The first aspect of the present application provides a method for querying hard disk VPD information in the BIOS stage, the method comprising:

[0008] In the BIOS stage, a plurality of enumerated hard disks of SCSI protocol are acquired;

[0009] A target hard disk to be queried is filtered from the SCSI enumerated hard disks based on a device connection mode of the enumerated hard disks, and the target hard disk to be queried is connected to a mainboard through a RAID card;

[0010] The BIOS end sends a VPD information query instruction based on SCSI protocol, and the RAID card forwards the query instruction to the target hard disk to be queried;

[0011] The target hard disk to be queried returns hard disk information corresponding to the query instruction to the RAID card based on the SCSI protocol, and the RAID card sends the hard disk information to the BIOS end, and the hard disk information received by the BIOS end is completely consistent with the hard disk information locally stored by the target hard disk to be queried.

[0012] The second aspect of the application provides a device for querying hard disk VPD information in the BIOS stage, and the device comprises an acquisition module, a query module and a transmission module; wherein,

[0013] The acquisition module is configured to acquire a plurality of enumerated hard disks of SCSI protocol in the BIOS stage;

[0014] The query module is configured to filter a target hard disk to be queried from the SCSI enumerated hard disks based on a device connection mode of the enumerated hard disks, and the target hard disk to be queried is connected to a mainboard through a RAID card;

[0015] The transmission module is configured to send a VPD information query instruction based on SCSI protocol by the BIOS end, and the RAID card forwards the query instruction to the target hard disk to be queried;

[0016] The transmission module is further configured to return hard disk information corresponding to the query instruction to the RAID card by the target hard disk to be queried based on the SCSI protocol, and the RAID card sends the hard disk information to the BIOS end, and the hard disk information received by the BIOS end is completely consistent with the hard disk information locally stored by the target hard disk to be queried.

[0017] The method and device for querying hard disk VPD information in the BIOS stage provided by the application, through obtaining multiple enumerated hard disks of SCSI protocol in the BIOS stage, screening out the target hard disk to be queried connected with the mainboard through the RAID card based on the device connection mode, then sending the VPD information query instruction based on the SCSI protocol by the BIOS end and transmitting to the target hard disk to be queried through the RAID card, finally receiving the hard disk information returned by the target hard disk to be queried and forwarded by the RAID card, which is completely consistent with the local storage of the hard disk, effectively solve the problem that the information deviation caused by the interactive object being the RAID card and the field character loss caused by the fixed-length reply when the BIOS queries through the standard SCSI Inquiry command in the prior art, realize the complete and accurate acquisition of the hard disk VPD information of the hard disk under the RAID card by the BIOS end, provide reliable hard disk information support for server hardware diagnosis, asset inventory, fault troubleshooting and stable startup, and at the same time, without relying on the operating system, the key hard disk information collection can be completed in the BIOS startup stage, and the efficiency and convenience of the server hardware management are improved. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 The flow chart of the method for querying hard disk VPD information in the BIOS stage provided by the application;

[0019] Figure 2 The structural schematic diagram of the device for querying hard disk VPD information in the BIOS stage provided by the application. DETAILED DESCRIPTION

[0020] The exemplary embodiments will be described in detail herein with reference to the attached drawings; figures, wherein like reference numerals refer to like elements throughout. The following detailed description is not intended to represent all embodiments in accordance with the present application. The following exemplary embodiments described herein will be described with reference to the attached figures.

[0021] The terms used in this application are only for the purpose of describing specific embodiments, and are not intended to limit the application. As used in this application, the singular forms "a," "an," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0022] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0023] The following specific embodiments are given to illustrate the technical solution of this application in detail.

[0024] Figure 1 This is a flowchart illustrating an embodiment of the method for querying hard disk VPD information at the BIOS stage provided in this application. Please refer to... Figure 1 The method provided in this embodiment may include:

[0025] S101. During the BIOS phase, obtain multiple enumerated hard drives for the SCSI protocol.

[0026] Specifically, the BIOS stage refers to the hardware initialization and firmware execution stage before the operating system loads during the computer startup process. The core carrier is the BIOS (Basic Input / Output System), a core firmware program integrated into the computer motherboard. The SCSI protocol is a small computer system interface protocol, the core communication protocol for data interaction and information retrieval between the BIOS and the hard drive. The BIOS scans all hard drives connected to the SCSI bus via the SCSI bus driver, identifies and records the SCSI protocol identification information of each hard drive, generates a SCSI enumeration hard drive list containing the SCSI protocol identification information, and explicitly confirms that each hard drive in the SCSI enumeration hard drive list supports the SCSI protocol.

[0027] Furthermore, when the BIOS boot process enters the hardware initialization and device enumeration stage, the BIOS first loads the preset SCSI bus driver. The SCSI bus driver needs to be compatible with the server hardware architecture and be able to support the standard data interaction logic of the SCSI protocol. After the SCSI bus driver is loaded, the SCSI bus scanning function will be started to traverse all storage devices physically connected to the SCSI bus. The storage devices include various types of hardware, such as hard drives directly connected through the motherboard interface and hard drives mounted through RAID cards. Each piece of hardware is checked to see if it supports the SCSI protocol.

[0028] For the detected hard disk determined to support the SCSI protocol, the BIOS end further identifies the SCSI protocol identification information specific to the hard disk. Each SCSI protocol identification information specific to the hard disk includes but is not limited to a hard disk device ID, a logical unit number, a target identifier, and the like, and is a core basis for locating a specific hard disk in a subsequent step. After completing the identification and identification record of all hard disks supporting the SCSI protocol, the BIOS end arranges the hard disks and their corresponding SCSI protocol identification information into a structured SCSI enumerated hard disk list, and stores the SCSI enumerated hard disk list in a temporary memory area of the BIOS end, so as to call the SCSI enumerated hard disk list in a subsequent step to carry out target hard disk screening work.

[0029] Further, in the BIOS phase, the specific implementation steps of obtaining the plurality of enumerated hard disks of the SCSI protocol include:

[0030] (1) The BIOS end scans all hard disks connected to the SCSI bus through the SCSI bus driver.

[0031] Specifically, the BIOS end performs a scanning operation on all storage devices physically connected to the SCSI bus through the loaded SCSI bus driver, iterates through all possible hard disks such as hard disks directly connected through a motherboard interface and hard disks mounted through a RAID card, to discover all hard disks connected to the SCSI bus.

[0032] Further, after the BIOS startup process enters the hardware initialization phase, the SCSI bus driver adapted to the hardware architecture of the server is first loaded, and the SCSI bus driver includes device detection and communication logic of the SCSI protocol. After the driver is loaded, the SCSI bus scanning mechanism is started, and the basic connection information of the device is obtained by sending a detection signal to iterate through all physical storage devices connected to the SCSI bus.

[0033] In the scanning process, for each detected hard disk, the BIOS end performs protocol compatibility verification through a SCSI protocol standard command, sends specific protocol identification instructions to each hard disk, and judges whether the hard disk supports the SCSI protocol according to the response of the hard disk. For the hard disk that passes the verification, the hard disk device ID (a code for uniquely identifying the device), the logical unit number (for locating a specific logical unit in a multi-device environment), the target device identifier, and the like are further read through the SCSI protocol command, and these information are stored in association with the physical connection path of the hard disk.

[0034] (2) Identify and record the SCSI protocol identification information of each hard disk, generate a SCSI enumerated hard disk list containing the SCSI protocol identification information, and each hard disk in the SCSI enumerated hard disk list supports the SCSI protocol.

[0035] Specifically, the scanned hard disks are detected one by one for SCSI protocol compatibility, and it is confirmed whether the hard disks support the SCSI protocol; for the hard disks supporting the SCSI protocol, corresponding SCSI protocol identification information is extracted and recorded; the hard disks supporting the SCSI protocol and the corresponding identification information are sorted into a structured SCSI enumerated hard disk list, so as to ensure that only hard disks conforming to the SCSI protocol are contained in the list. After the scanning and identification of all the hard disks are completed, the BIOS end filters out all the hard disks supporting the SCSI protocol, sorts them into a SCSI enumerated hard disk list according to a unified data structure (for example, an array or a linked list), wherein each list item contains SCSI protocol identification information and basic connection information of the hard disk, and stores the list to a temporary cache area of the BIOS for subsequent calling when a target hard disk to be queried is filtered out.

[0036] It should be noted that the SCSI protocol identification information at least includes a hard disk device ID, a logical unit number, a target identifier, etc., and the basic connection information refers to underlying information related to physical connection of the hard disk and the computer system, which is used to assist in locating a physical connection position and a connection mode of the hard disk, and includes a physical interface type, bus position information, a hard disk connection path, and a hard disk slot identifier, etc. The physical interface type is a hardware interface type used for accessing the system by the hard disk, for example, a SCSI interface, a SAS (Serial Attached SCSI) interface, a SATA interface, etc., which is used to distinguish different physical connection standards; the bus position information is a port number and a bus controller number of the hard disk connected to the SCSI bus, which is used to locate a physical connection node of the hard disk in the SCSI bus; the hard disk connection path is a complete connection link identifier recorded in the form of a string, and the connection mode of the hard disk can be directly judged through a characteristic field in the path; and the hard disk slot identifier is a slot number when the hard disk is accessed to the system through a physical slot, which is used to correspond to a physical installation position of the actual hardware.

[0037] Through the scanning and identification logic of the dedicated SCSI bus driver, the problems of insufficient protocol compatibility and incomplete device coverage when the traditional BIOS enumerates the hard disks are solved. On the one hand, the SCSI protocol compatibility detection ensures that only the hard disks supporting the SCSI protocol are contained in the enumeration list, and the interference of non-SCSI protocol devices is excluded, thereby laying a device foundation for subsequent information interaction based on the SCSI protocol; on the other hand, the SCSI protocol identification information of the hard disk is completely recorded, which provides a key basis for subsequent accurate positioning of the target hard disk under the RAID card, and avoids that the target device cannot be identified due to missing identification.

[0038] Meanwhile, the structured SCSI enumeration hard disk list improves the efficiency of the subsequent screening process, enables the BIOS end to quickly traverse and compare device information, and ensures that the target hard disk connected through the RAID card is accurately screened from the enumeration result, thereby providing a pre-protection for the accuracy and efficiency of the entire VPD information query process.

[0039] Optionally, the BIOS is connected with multiple hard disks, and the connection mode of the hard disks and the BIOS at least includes establishing a hardware link through a RAID card and a mainboard, and then realizing communication connection between the mainboard and the BIOS; or establishing communication connection between the BIOS and the mainboard through a SATA interface or a SAS interface on the mainboard.

[0040] Specifically, the connection mode of the BIOS and the multiple hard disks is realized based on the cooperation of the hardware link and the communication link, and specifically includes two core connection modes. One is the RAID card relay connection, in which the hard disk establishes a physical connection with a hard disk interface of the RAID card through a data cable (such as a SAS cable), forms a hardware link, the RAID card is connected with the mainboard through a PCIe slot and the like, the hard disk forms a complete communication link with the BIOS through the RAID card and the mainboard, all data interactions between the BIOS and the hard disk need to pass through the RAID card, and the RAID card plays a role of hardware connection and protocol conversion in the link. The other is the mainboard interface direct connection, in which the hard disk directly establishes a physical connection (such as the hard disk is inserted into a SATA slot of the mainboard and connected with a data line) through a SATA interface or a SAS interface on the mainboard, forms a hardware link from the hard disk to the mainboard, and the hardware link does not need other hardware relay and can directly communicate with the BIOS through an internal bus of the mainboard, so as to realize direct communication between the BIOS and the hard disk, and in the data interaction process, the mainboard interface only serves as a physical channel and does not intervene in data processing.

[0041] Further, for the hard disk in the RAID card relay connection, the physical interface of the hard disk is connected to the hard disk interface of the RAID card through a dedicated data line, the PCIe interface of the RAID card is inserted into the PCIe slot of the mainboard, and a hardware link is formed; the BIOS communicates with the RAID card through the PCIe controller of the mainboard, the RAID card further communicates with the downstream hard disk through the firmware management of the RAID card, at this time, the logical address of the hard disk recognized by the BIOS is allocated by the RAID card, and the physical state of the hard disk needs to be reported to the BIOS through the RAID card; for the hard disk in the mainboard interface direct connection, the hard disk is directly inserted into the SATA or SAS interface of the mainboard, and a communication link is established between the BIOS and the hard disk through the SATA or SAS controller in the mainboard; the BIOS directly interacts with the hard disk through the loaded SATA or SAS bus driver, the logical address of the hard disk is allocated by the mainboard interface controller, and the physical state information of the hard disk does not need to pass through a third-party hardware relay and can be directly fed back to the BIOS by the hard disk.

[0042] By identifying the hardware link characteristics of the connection mode, the two types of hard disks can be accurately distinguished. For the hard disks connected through the RAID card, the interaction logic of the command is transmitted to the hard disk through the RAID card; for the hard disks directly connected to the motherboard, the direct communication logic is used. It is ensured that the VPD information query command can accurately reach the target hard disk, avoiding invalid query, and at the same time providing a link basis for the subsequent RAID card transparent transmission of raw information, ensuring that the hard disk information finally obtained by the BIOS is completely consistent with the local storage.

[0043] When the traditional BIOS enumerates the hard disk, it often faces problems such as poor protocol compatibility and incomplete enumeration, for example, it can only identify some hard disks that comply with a specific SCSI sub-protocol, and cannot fully cover all hard disks that support the SCSI protocol. Step S101 can ensure the complete enumeration of all hard disks that support the SCSI protocol, effectively excluding the interference of non-SCSI protocol devices on the subsequent process, and providing a comprehensive and complete enumeration basis for the subsequent accurate screening of hard disks under the RAID card, avoiding the omission of enumeration leading to the target hard disk under the RAID card not being included in the query range, and ensuring the coverage and accuracy of the subsequent query process.

[0044] S102, based on the device connection mode of the enumerated hard disk, screening the target hard disk to be queried from the SCSI enumerated hard disk, the target hard disk to be queried being connected to the motherboard through the RAID card.

[0045] Specifically, by identifying the differences in the device connection mode of the enumerated hard disk, the target hard disk to be queried is screened from the SCSI enumerated hard disk. The BIOS end has pre-stored characteristic information of the hard disk connected in a non-RAID card mode during the factory configuration or startup initialization phase. The characteristic information includes the device ID characteristics of the hard disk directly connected through the motherboard SATA interface and SAS interface (different direct connection interfaces usually have fixed device ID coding rules), and the connection path characteristics of the directly connected hard disk. The connection path characteristics of the directly connected hard disk refer to the exclusive identification presented in the connection path information when the hard disk directly communicates with the BIOS through the motherboard interface, and the BIOS end reads the device identification information and complete connection path information of each enumerated hard disk from the SCSI enumerated hard disk result one by one, and compares these information with the pre-stored characteristic information of the hard disk connected in a non-RAID card mode one by one.

[0046] If the device identification information of an enumerated hard disk meets the ID characteristics of the directly connected hard disk, or its connection path information contains the directly connected attribute field, it is determined that the hard disk is a directly connected hard disk connected through a non-RAID card, and it is excluded from the enumeration result; if the information of the enumerated hard disk does not match the non-RAID card connection characteristics, it is determined that the hard disk is a target hard disk to be queried connected to the motherboard through the RAID card, and the BIOS end marks this type of hard disk separately to form a list of target hard disks to be queried.

[0047] Further, the target hard disk to be queried is screened from the SCSI enumerated hard disks based on the device connection mode of the enumerated hard disks, and the specific implementation steps of the target hard disk connected to the mainboard through the RAID card include:

[0048] (1) The BIOS end pre-stores the hard disk identification information in a non-RAID card connection mode;

[0049] Specifically, the BIOS end pre-stores the characteristic identification information of the non-RAID card connected hard disk (i.e. the directly connected hard disk) in the firmware configuration stage before factory shipment or in the initialization process of the first start of the server, based on the mainboard hardware design parameters. The characteristic identification information of the non-RAID card connected hard disk includes the device ID characteristic code and the connection path characteristic string. The device ID characteristic code is the device ID of the directly connected hard disk when it is connected through the mainboard SATA / SAS interface, which will follow the coding rules of the mainboard interface controller. The BIOS end will store these fixed coding segments or prefixes as a non-RAID card connection identification library. The connection path characteristic string is the connection path of the directly connected hard disk, which will contain the mainboard interface exclusive identification. The BIOS end will store this kind of string as a characteristic identification associated with the device ID, forming a multi-dimensional non-RAID card connection identification system.

[0050] (2) Read the device identification information of each SCSI enumerated hard disk, and match the device identification information with the hard disk identification information in the non-RAID card connection mode;

[0051] Specifically, the device identification information of each enumerated hard disk is extracted one by one, including the complete device ID and the connection path string. First, compare the device ID of the enumerated hard disk with the device ID characteristic code in the non-RAID card connection identification library to determine whether there is a consistent prefix or coding segment. If the device ID comparison does not match, compare the connection path string with the preset directly connected path characteristic string (for example, judge whether the path contains the fields of “SATA_Slot” “SAS_Port” and the like). As long as any one of the device identification information in the device ID or the connection path matches successfully, it is determined that the identification information of the enumerated hard disk matches the non-RAID card connection identification.

[0052] (3) If the matching is successful, it is determined that the SCSI enumerated hard disk is a non-RAID card connected hard disk, and the SCSI enumerated hard disk is excluded. The SCSI enumerated hard disk that does not match the hard disk identification information in the non-RAID card connection mode is determined as the target hard disk to be queried.

[0053] Specifically, for the enumerated hard disk matched successfully, the BIOS end determines it as a non-RAID card connected hard disk directly connected through the motherboard SATA / SAS interface, removes it from the SCSI enumerated hard disk list, and avoids sending invalid RAID card transparent query instructions to such hard disk in the subsequent; for the enumerated hard disk not matched successfully, the BIOS end determines it as a target hard disk to be queried connected with the motherboard through the RAID card, and stores the SCSI protocol identification information of such hard disk to the target hard disk to be queried list separately, to make the object clear for the subsequent sending of VPD information query instruction.

[0054] In this way, on the one hand, the pre-stored direct connection hard disk identification information is designed based on the hardware connection attribute, ensuring the accuracy of the match and avoiding misjudging the direct connection hard disk as the RAID card mounted hard disk; on the other hand, the non-target hard disk is directly removed by the exclusion method, so that the subsequent query process is only for the target hard disk under the RAID card, which not only improves the screening accuracy, but also reduces the invalid query operation, lays an accurate target foundation for the directional acquisition of the VPD information of the hard disk under the RAID card, and also guarantees the pertinence and effectiveness of the subsequent instruction transparent transmission logic forwarded only through the RAID card.

[0055] In the traditional technology, the BIOS cannot accurately distinguish the direct connection hard disk from the RAID card mounted hard disk, and often misjudges the direct connection hard disk as the hard disk under the RAID card for query, resulting in low query efficiency and invalid information. The step S102 can filter out the target hard disk to be queried mounted by the RAID card by pre-storing the non-RAID card connection characteristics, reading the enumerated hard disk information and comparing, and excluding the non-target hard disk, which not only avoids the interference of the direct connection hard disk on the query process, but also reduces the invalid query operation, lays an accurate target foundation for the directional acquisition of the VPD information of the hard disk under the RAID card, and improves the efficiency and accuracy of the subsequent query process.

[0056] S103, the BIOS end sends a VPD information query instruction based on the SCSI protocol, and the RAID card forwards the query instruction to the target hard disk to be queried.

[0057] Specifically, the BIOS end generates a VPD information query instruction for the target hard disk to be queried according to the SCSI protocol, ensures that the instruction contains the key information of positioning the target hard disk and clearly querying the content; the RAID card receives the instruction, completes the analysis and format conversion of the query instruction, and accurately forwards the query instruction to the target hard disk to be queried, realizes the effective transparent transmission of the query instruction from the BIOS end to the target hard disk, and does not tamper with the core content of the instruction.

[0058] Further, the BIOS end extracts the logical unit number in the SCSI protocol identifier of each target hard disk based on the determined target hard disk list to be queried. The logical unit number is a unique positioning parameter for distinguishing different devices in the multiple hard disks managed by the RAID card, ensuring accurate pointing to the specific target hard disk. At the same time, according to the actual query requirements (such as obtaining the hard disk serial number, firmware version, supplier information, etc.), the VPD page identifier to be queried is determined. It should be noted that different VPD information corresponds to different page identifiers, for example, the serial number corresponds to the 00h page, and the firmware version corresponds to the 80h page.

[0059] Further, the BIOS end generates VPD information query instructions in accordance with the SCSI protocol specification. The SCSI protocol identifier is set in the query instruction header to specify the instruction protocol type. The query instruction body includes the logical unit number of the target hard disk and the VPD page identifier to be queried, which are used to locate the hard disk and specify the query content, respectively. The query instruction tail adds a check field to ensure the integrity of the query instruction during transmission and avoid data loss or errors. After receiving the VPD information query instruction sent by the BIOS end, the RAID card verifies the integrity of the instruction through the tail check field, confirms that it is correct, parses the logical unit number in the query instruction body, and determines the target hard disk to be queried corresponding to the logical unit number by combining the logical unit number mapping table in its own firmware. Since the interface protocol between the RAID card and the target hard disk may differ from the SCSI protocol of the BIOS end, the RAID card converts the query instruction in SCSI protocol format into a format suitable for the interface protocol of the target hard disk. During the conversion process, the logical unit number and VPD page identifier and other core information are preserved, and only the data encapsulation format is adjusted to meet the interface communication requirements. The RAID card forwards the converted query instruction to the target hard disk through the physical link between the RAID card and the target hard disk to be queried, completing the instruction transparent transmission.

[0060] Further, the query instruction also includes the ID hardware address and the UID software interface address. The ID hardware address is the unique hardware code corresponding to the target hard disk to be queried in the physical hardware link, which is an unmodifiable identifier written by the manufacturer into the hardware chip when the hard disk is manufactured. It represents the physical device address of the hard disk and is used to distinguish different hard disks from the physical connection layer. If the target hard disk to be queried is connected to the RAID card through the SAS interface, the ID hardware address is the physical port address of the SAS interface (for example, RAID_SAS_Port0_HDD1). If the target hard disk is connected through the SCSI interface, the ID hardware address is the device physical address of the SCSI bus (including bus number and target device number, format: SCSI_Bus0_Target1). The device physical address is directly bound to the physical connection position of the hard disk and is not affected by software configuration or protocol conversion, which is a hard identifier for locating the physical entity of the hard disk.

[0061] The UID software interface address refers to a logical software identifier allocated by the BIOS end for a target hard disk to be queried when interacting with the RAID card through a software protocol, and is used to establish a unique mapping relationship between the BIOS and the target hard disk from the software communication layer; the UID software interface address is generated based on the SCSI protocol specification, and specifically represents a combination of the logical identifier of the hard disk in the SCSI protocol. For example, in an embodiment, it is composed of the RAID card logical controller ID + the logical unit identifier (LUN extension) of the hard disk under the RAID card + the SCSI protocol version identifier, and the format is "RAID_Controller0_LUN1_SCSIv6"; in some scenarios, the UUID (Universal Unique Identifier) of the hard disk can also be used, which is dynamically generated by the BIOS end based on the hardware information (such as ID hardware address, factory serial number) of the hard disk and stored in the logical mapping table of the RAID card firmware.

[0062] Further, the BIOS end extracts the SCSI protocol identifier information of the target hard disk to be queried from the list of the target hard disk to be queried, synchronously reads the basic connection information (including the physical interface type and bus location information) thereof; based on the basic connection information, the ID hardware address is parsed (such as "RAID_SAS_Port0_HDD1" is extracted from the connection path of "RAID card SAS port 0 - hard disk 1"); the logical identifier generation interface of the SCSI protocol is called, and the RAID card controller ID, the logical unit number of the hard disk, and the protocol version are combined to generate the UID software interface address (such as "RAID_Controller0_LUN1_SCSIv6"); the ID hardware address and the UID software interface address are written into the extension positioning field of the VPD information query instruction, and together with the original logical unit number, the positioning information is formed to ensure that the instruction can accurately point to the target hard disk.

[0063] After the RAID card receives the VPD information query instruction, it first parses the UID software interface address in the instruction, verifies whether the UID belongs to the hard disk managed by the current RAID card through the software identifier mapping table (which records the correspondence between the UID and the logical unit number of all mounted hard disks) in its own firmware, and excludes invalid instructions across RAID cards; after verification, the RAID card further parses the ID hardware address, combines the hardware configuration of its own physical port, and confirms whether the hard disk corresponding to the hardware address is in an online available state, so as to avoid sending instructions to a faulty or unconnected hard disk; when both the double address verifications pass, the RAID card will convert the VPD information query instruction into an interface protocol format suitable for the target hard disk, and forward it to the target hard disk to be queried through the physical link corresponding to the ID hardware address; in the forwarding process, the RAID card will append the check code of the ID hardware address in the hardware check field of the instruction to ensure that the target hard disk can confirm that the instruction is a valid request for itself after receiving it.

[0064] Further, the BIOS end sends a VPD information query instruction based on the SCSI protocol, and the RAID card forwards the query instruction to the target hard disk to be queried, and the implementation steps include:

[0065] (1) According to the SCSI protocol identification information of the target hard disk to be queried, a VPD information query instruction conforming to the SCSI protocol specification is generated, and the VPD information query instruction contains the logical unit number of the target hard disk to be queried and the VPD page identification to be queried.

[0066] Specifically, based on the SCSI protocol identification information of the target hard disk to be queried, the BIOS end constructs the VPD information query instruction according to the instruction format specification of the SCSI protocol.

[0067] Further, the logical unit number is extracted from the SCSI protocol identification information of the target hard disk to be queried, and the logical unit number is allocated by the RAID card and is the unique logical identification of the target hard disk in the management range of the RAID card; at the same time, the VPD page identification is determined according to the query requirement; further, according to the specification of the SCSI protocol for the "INQUIRY VPD" command, the parameters are encapsulated into an instruction frame, the operation code (0x12, the fixed operation code of the INQUIRY command in the SCSI protocol) is set in the header of the instruction; the logical unit number field (usually occupying 6 bits, used to specify the target logical unit); followed by the page identification field (1 byte, such as 0x00 indicating the query serial number page); finally, the data length field (specifying the expected returned information length); finally, the CRC check code is added at the tail of the instruction frame, which is used to verify whether data error occurs in the transmission process of the RAID card and the target hard disk, and ensure the integrity of the instruction.

[0068] (2) The RAID card receives the VPD information query instruction, parses the logical unit number in the VPD information query instruction, converts the VPD information query instruction into a device interface protocol format adapted to the target hard disk to be queried, and forwards it to the target hard disk to be queried through the physical link between the RAID card and the target hard disk to be queried.

[0069] Specifically, after the RAID card receives the VPD information query instruction, the logical unit number (LUN) in the instruction is parsed, the corresponding target hard disk to be queried is determined through the mapping relationship between the LUN in the firmware and the physical hard disk, and the query instruction in the SCSI protocol format is converted into a format adapted to the interface protocol of the hard disk (such as SAS protocol frame or SATA command format), and the core content (LUN and VPD page identification) of the instruction is kept unchanged in the conversion process; the converted instruction is forwarded to the target hard disk to be queried through the physical link between the RAID card and the target hard disk, and the transparent transmission of the instruction is completed.

[0070] In the conventional scheme, the query instruction of the BIOS directly interacts with the RAID card, the RAID card processes the instruction by itself and returns tampered information, so that the BIOS cannot obtain the real VPD information of the hard disk. In step S103, the RAID card only bears the functions of instruction analysis, format conversion and forwarding, does not intervene in the core content of the instruction, ensures that the target hard disk can accurately receive the original query requirement of the BIOS end, on the one hand, the addition of the LUN ensures that the instruction can accurately locate the target hard disk and avoid misdelivery, on the other hand, the RAID card does not modify the query content, which fundamentally solves the problem of interception and tampering of the instruction, and provides reliable instruction transmission guarantee for obtaining the real VPD information of the hard disk.

[0071] In step S104, the target hard disk to be queried returns the hard disk information corresponding to the query instruction to the RAID card based on the SCSI protocol, and sends the hard disk information to the BIOS end through the RAID card. The hard disk information received by the BIOS end is completely consistent with the hard disk information stored locally by the target hard disk to be queried.

[0072] Specifically, the target hard disk to be queried retrieves the locally stored VPD information according to the query instruction, encapsulates the VPD information according to the SCSI protocol specification, and returns the VPD information to the RAID card. The RAID card completes the format conversion and forwards the VPD information to the BIOS end.

[0073] Further, after receiving the VPD information query instruction forwarded by the RAID card, the target hard disk to be queried analyzes the instruction through its own firmware, extracts the VPD page identifier therein, determines the type of VPD information required by the BIOS end, retrieves the multi-dimensional hard disk information corresponding to the VPD page identifier from the non-volatile storage area specially storing hardware parameters in the hard disk (the area is written with VPD information by the hard disk manufacturer during production, and the information is stable and cannot be modified at will during use), for example, the page identifier 00h corresponds to the retrieval of hard disk serial number, device identifier, supplier information and other fields.

[0074] Further, the target hard disk to be queried processes the retrieved multi-dimensional hard disk information according to the response format specified by the SCSI protocol, refers to the field offset and length specification of the VPD information response in the SCSI protocol, sequentially splices the multi-dimensional information in the preset order, ensures that the position and length of each field meet the protocol standard, and avoids subsequent parsing errors; after splicing, a data packet containing complete VPD information is generated, a check field is appended to the tail of the data packet, and the data packet is returned to the RAID card through the physical link of the RAID card.

[0075] Further, after receiving the data packet, the RAID card verifies the data integrity through the tail check field, and after confirming that there is no error, since the BIOS end only recognizes the SCSI protocol format data, the RAID card converts the data packet from the hard disk interface protocol format to the SCSI protocol format, strictly maintains the data length unchanged during the conversion process, and does not modify any VPD information field (does not truncate, does not replace, does not omit), ensuring that the original information is completely retained. The RAID card sends the converted SCSI protocol format data packet to the BIOS end through the communication link with the motherboard, and the BIOS end receives and stores it in the specified memory area for subsequent parsing.

[0076] Further, after returning the hard disk information corresponding to the query instruction to the RAID card, comprising:

[0077] (1) initialize the mapping table structure, the mapping table structure includes a device identification field, a connection path field, a VPD information storage address field and a state identification field;

[0078] Specifically, the initialization of the mapping table structure defines a structured data model for managing the target hard disk to be queried, and clearly defines the key information dimensions that need to be recorded. The BIOS end opens a continuous storage area in the memory, initializes the mapping table as an array type structure, each element corresponds to a management entry of the target hard disk to be queried, and defines four core fields and their data formats, including: the device identification field uses a string format to store the SCSI protocol core identifier of the target hard disk, ensuring that it can uniquely identify the hard disk; the connection path field uses a string format to store the physical connection path of the target hard disk and the RAID card, which is used to trace the hardware link; the VPD information storage address field uses a 32-bit / 64-bit memory address format to record the starting address of the memory area where the VPD information of the hard disk is stored; the state identification field uses an enumeration type (1 byte) and only contains two state values of not received and received, which is used to mark the receiving state of the VPD information. The initial length of the mapping table is dynamically allocated according to the number of target hard disks to be queried (for example, if five target hard disks are detected, five entries are initialized), and a table tail check bit is set to ensure the integrity of the structure.

[0079] (2) fill the SCSI protocol identifier information of the target hard disk to be queried and the connection path information of the RAID card into the corresponding fields of the mapping table;

[0080] Specifically, the BIOS end reads the information of each hard disk from the target hard disk list one by one, fills it into the corresponding entry of the mapping table in order, and after filling is completed, the BIOS end indexes and sorts the mapping table through the device identification field (such as ascending order of LUN), which facilitates subsequent quick query matching.

[0081] (3) Assign an independent memory storage area to each target hard disk to be queried, record the start address of the memory storage area to the VPD information storage address field of the mapping table, and initialize the state identification field to not received;

[0082] Specifically, the BIOS end queries the current available memory area (usually a reserved memory block managed by BIOS), assigns a block of continuous independent memory area to each target hard disk to be queried according to the maximum possible length of the VPD information, ensures no overlap between the areas to avoid information overlap, writes the start address of the assigned memory area (such as 0x000A0000) to the "VPD information storage address field" of the mapping table entry corresponding to the hard disk, forms a direct mapping of "hard disk identification-storage location", and uniformly sets the state identification field of all entries to not received, indicating that the VPD information returned by the hard disk has not been received. For example, the memory area 0x000A0000-0x000A0400 is assigned to the hard disk of LUN1, and the VPD information storage address field of the mapping table entry is recorded as 0x000A0000, and the state is 0x00.

[0083] (4) When the BIOS end receives the hard disk information sent by the RAID card, the corresponding entry in the mapping table is matched according to the SCSI protocol identification information of the hard disk, and the state identification field is updated to received.

[0084] Specifically, after the IOS end receives the hard disk information data packet forwarded by the RAID card, the SCSI protocol identification information in the data packet header is parsed, the LUN and device ID are extracted from the SCSI protocol identification information, the parsed identification information is compared with the device identification field in the mapping table one by one, and the completely matched entry is found (such as LUN1, device ID=100000123456 is parsed, and the corresponding entry is matched); according to the start address recorded in the VPD information storage address field of the matched entry, the VPD information (such as serial number "SN12345678", firmware version "V2.5") in the data packet is written to the corresponding memory area; the "state identification field" of the entry is updated from not received to received, indicating that the VPD information of the hard disk has been successfully stored. If the reception times out or the information verification fails, the BIOS end can quickly identify the hard disk that has not successfully returned the information (the state is still 0x00) by traversing the state identification field of the mapping table, and trigger the retry mechanism.

[0085] In this way, an independent memory area is assigned to each hard disk and the address is recorded, completely solving the information overlap problem and ensuring the complete preservation of VPD information. Through the not received / received state identification, the BIOS can master the query progress in real time, quickly locate the hard disk that has not returned the information and handle the exception (such as timeout retry), and improve the reliability and efficiency of VPD information query in the multi-hard disk scenario.

[0086] Further, the target hard disk to be queried returns hard disk information corresponding to the query instruction to the RAID card based on the SCSI protocol, and the implementation step of sending the hard disk information to the BIOS end via the RAID card comprises:

[0087] (1) parsing the VPD information query instruction, and extracting a VPD page identifier to be queried;

[0088] Specifically, after receiving the VPD information query instruction forwarded by the RAID card, the controller of the target hard disk to be queried starts an internal firmware instruction parsing module. The instruction parsing module first parses the instruction in layers according to the instruction frame structure (including operation code, LUN, page identifier, data length, etc.) specified by the SCSI protocol, verifies whether the operation code is the “INQUIRY VPD” command (operation code 0x12) defined in the SCSI protocol, and confirms the legality of the instruction type; then verifies whether the instruction is for itself (to avoid confusion with instructions of other hard disks under the RAID card) by parsing the LUN field; and finally extracts the VPD page identifier to be queried from a specific offset of the instruction.

[0089] It should be noted that the VPD page identifier is a 1-byte binary code, and different codes correspond to different categories of hard disk information (such as 0x00 corresponding to a “basic identifier page”, containing a serial number, manufacturer information; 0x80 corresponding to a “firmware information page”, containing a firmware version, update date; 0x83 corresponding to a “capacity information page”, containing total capacity, available capacity, etc.). By accurately extracting the identifier, the hard disk can clearly understand the query requirements of the BIOS end, providing a unique basis for subsequent targeted retrieval of information and avoiding redundant retrieval of invalid data.

[0090] (2) retrieving a plurality of dimensional hard disk information corresponding to the VPD page identifier from the VPD information stored in the hard disk, wherein the plurality of dimensional hard disk information correspond to fields of different functional attributes in the VPD information;

[0091] Specifically, in the non-volatile storage area (usually EEPROM or flash chip) inside the hard disk, the complete VPD (Vendor Specific Product Data, vendor-specific product data) information written by the manufacturer during the production stage is solidified. These information are stored in a page-field hierarchical structure (each page contains a plurality of functionally related fields), when the hard disk determines the VPD page identifier to be queried, the firmware will access the storage area through the hardware interface, locate the starting address of the corresponding page, and then retrieve the plurality of dimensional information under the page according to the field offset; for example, for the 0x00 page, the manufacturer ID, product model, serial number, production batch, etc. fields will be retrieved; for the 0x80 page, the firmware version number, firmware release date, compatibility identifier, etc. fields will be retrieved.

[0092] (3) The multiple dimensions of hard disk information are sequentially spliced according to the response format and data structure requirements of the VPD page specified by the SCSI protocol, and an information data packet is generated and returned to the RAID card.

[0093] Specifically, after the hard disk retrieves the multi-dimensional information, it needs to be standardized and packaged according to the format requirements of the VPD response data packet of the SCSI protocol to ensure that the RAID card and the BIOS end can correctly parse it.

[0094] Further, the SCSI protocol has fixed provisions for the length of each field (such as 8 bytes for manufacturer ID and 16 bytes for serial number), and if the actual information length is insufficient, the hard disk will fill it with spaces or null characters to the specified length; if the information is too long (rare case), it will be truncated according to the protocol (ensuring that the core information is retained); according to the page data structure defined by the protocol, the fields are spliced in the order of page header-main field-extension field. For example, the splicing order of 0x00 page is page identification-page length-manufacturer ID-product model-serial number-...-reserved field (filled to the total length). After splicing, the hard disk will calculate the CRC check value (cyclic redundancy check) of the entire data packet and attach it to the end of the data packet for detecting data errors during transmission; finally, a response frame that conforms to the SCSI protocol specification is formed, which is sent to the RAID card through the physical link connected to the RAID card.

[0095] (4) After the RAID card receives the information data packet, it converts the information data packet into a SCSI protocol data format that is recognizable by the BIOS end and forwards it to the BIOS end through the communication link between the RAID card and the motherboard. The data length of the information data packet before and after conversion remains unchanged.

[0096] Specifically, the RAID card first extracts the CRC check value at the tail of the data packet, compares it with the check result calculated by itself, and if they are consistent, it confirms that the data packet has not been tampered with or damaged; if they are not consistent, it sends a retransmission request to the hard disk to avoid incorrect information from being transmitted into the BIOS; Since the interface protocol between the hard disk and the RAID card may have differences in encapsulation formats (such as different data frame structures and check methods) from the SCSI protocol supported by the BIOS side, the RAID card will start the protocol conversion module, which will disassemble the data packet in the hard disk interface protocol format into original fields (such as manufacturer ID, serial number, etc.), and then re-encapsulate these fields according to the response frame structure of the SCSI protocol. During the conversion process, the content and length of each field are strictly maintained, and only the encapsulation form of the data (such as frame header identification and check field format) is adjusted. After the conversion is completed, the RAID card forwards the data packet in the SCSI protocol format to the specified memory receiving buffer of the BIOS side through the PCIe bus (or other high-speed communication link) connected to the motherboard. The SCSI protocol identification information of the hard disk is attached during the forwarding process, which facilitates the BIOS side to match the corresponding target hard disk to be queried.

[0097] During the entire process, the RAID card only acts as a protocol converter and data forwarding channel, does not modify any field content, and strictly maintains the data length unchanged (to avoid field truncation or padding), ensuring that the information received by the BIOS side is completely consistent with the VPD information stored locally by the hard disk, solving the core problem of tampering with hard disk information by the RAID card in the traditional solution.

[0098] In addition, after being sent to the BIOS side through the RAID card, the hard disk information data packet includes:

[0099] (1) The BIOS side verifies whether the data packet format of the hard disk information conforms to the response specification of the SCSI protocol;

[0100] Specifically, after receiving the hard disk information data packet forwarded by the RAID card, the BIOS side first starts the format verification mechanism to ensure that the data packet meets the specification requirements of the SCSI protocol for VPD response; checks whether the data packet contains the necessary fields of the SCSI response frame (such as response operation code, status code, data length, page identifier, etc.), and the field order conforms to the protocol definition; verifies whether the length of the key field matches the protocol (for example, the page identifier should be 1 byte, the data length should be a 2-byte unsigned integer, and the total data length should not exceed the maximum value of 255 bytes specified by the protocol); extracts the CRC check value at the tail of the data packet, compares it with the check result recalculated by the BIOS side, and confirms that the data has not been tampered with or lost during transmission; if any of the above verifications fails, it is determined that the data packet format does not conform to the specification, and the error handling process is entered.

[0101] (2) If it does not conform, trigger the error retry mechanism;

[0102] Specifically, when the data packet format verification fails, the BIOS end immediately triggers a preset error retry mechanism to obtain correct information as much as possible. The error retry mechanism can include limited retries, hierarchical error recording, and timeout termination, etc. The limited retries are default retries of 3 times (which can be adjusted by BIOS configuration), and each retry interval is 50 ms (to avoid bus congestion caused by frequent requests). When retrying, the VPD information query instruction is sent to the RAID card again, and the instruction parameters are consistent with the first sending. The hierarchical error recording is to record a slight format error log (including error field position, actual value and expected value) if the first retry fails. If the three retries all fail, a serious transmission error log is recorded, and the LUN and device ID of the target hard disk are marked for subsequent hardware troubleshooting. The timeout termination is to terminate the retry immediately if the RAID card or hard disk is detected to be unresponsive during the retry process, and mark the hard disk information acquisition failure to avoid occupying system resources for unlimited waiting. It should be noted that in the above description of the error retry mechanism, the values of the number of times and the time are set according to actual needs, and in the present embodiment, they are not limited.

[0103] (3) If it is consistent, the effective field in the hard disk information is positioned according to the standard format of the SCSI protocol, and the target analysis protocol is matched according to the effective field;

[0104] Specifically, according to the structure definition of the VPD response data of the SCSI protocol, all effective fields (excluding invalid data such as padding bits and reserved bits) are extracted from the data packet through preset offset and length parameters. The VPD page identifier (used to confirm the information category) and the field type identifier (containing 1 byte type code in front of some fields, such as 0x01 indicating string type and 0x02 indicating numerical type) are extracted as key indexes for matching the analysis protocol. The target analysis protocol is matched through the analysis protocol large table.

[0105] It should be noted that the analysis protocol large table is a mapping table of page identifier-field analysis rule pre-stored at the BIOS end, and its core function is to provide standardized analysis logic for the effective fields of different VPD pages. For example, when the extracted page identifier is 0x00, the analysis protocol large table will point to the basic identification page analysis protocol; when the page identifier is 0x80, the analysis protocol large table will point to the firmware information page analysis protocol.

[0106] (4) Analyzing the effective field based on the target analysis protocol to obtain the VPD information of the hard disk to be queried.

[0107] Specifically, based on the international standard of SCSI protocol (such as SPC-5 specification defined by T10 committee), the parsing rules of the predefined general VPD page are as follows: a unique index is assigned to each standard page identifier (such as 0x00, 0x80, 0x83, etc.); for each field contained in the page, a five-tuple of field name-offset-data type-length-conversion rule is defined; and a standard protocol version number is stored, which is used for subsequent compatibility judgment.

[0108] Further, considering that different hard disk manufacturers may add private VPD pages (such as 0x81 for a hardware health page of a certain manufacturer) outside the standard page, the parsing protocol table needs to reserve an expansion area, which can be integrated with the manufacturer's rules in the following way:

[0109] 1. Collect the private VPD page definition documents of mainstream hard disk manufacturers, and extract the private page identifier and field parsing rules;

[0110] 2. Assign a composite index of manufacturer code + page identifier to the private page to avoid conflicts with standard pages;

[0111] 3. Define special parsing rules for private fields.

[0112] Further, when the BIOS is started for the first time, it will perform integrity checking on the parsing protocol table (check if the field definition conflicts, and if the conversion rule is valid), and after the checking is passed, the table will be loaded into the cache; if a manufacturer's firmware update is detected (such as obtaining the hard disk firmware version change through a RAID card), the table will be updated incrementally (only the private rules of the corresponding manufacturer will be updated), to ensure that the parsing logic is synchronized with the actual VPD information format of the hard disk.

[0113] For example, in an embodiment, taking the parsing of 0x00 page (basic identifier page) as an example, the BIOS side matches the 0x00 page parsing protocol from the table, and obtains the five-tuple of the fields of the page; according to the rule, the ASCII string "Seagate" is directly extracted by extracting the manufacturer ID field with "offset = 0, length = 8"; the serial number field is extracted with "offset = 24, length = 16", and after removing the trailing spaces, "Z1D2XXXX" is obtained; after parsing all the fields in turn, the results are integrated into structured VPD information (such as { "manufacturer": "Seagate", "serial number": "Z1D2XXXX",...} ), and stored in the VPD information storage address of the corresponding hard disk in the mapping table.

[0114] Further, after being sent to the BIOS side through the RAID card, it further includes:

[0115] (1) BIOS side, after completing the analysis of the hard disk information, transmits the VPD information of the target hard disk to be queried obtained by the analysis to the BMC, and the BMC, after receiving the VPD information, calls a display driver interface and outputs on a terminal display device in a preset format; wherein the preset format includes a corresponding list of hard disk number, connection path of the hard disk through the RAID card and the motherboard, hard disk serial number, firmware version and health status parameter;

[0116] Specifically, after the BIOS side completes the hard disk information analysis, as the information collection and analysis subject, the structured VPD information after the analysis is transmitted to the BMC (baseboard management controller) through the standardized hardware communication interface (such as the system management bus based on the IPMI protocol, the LPC bus or the I2C bus) inside the server. The VPD information transmitted here has completed the format regularization and contains key fields such as hard disk number (such as HD-01), RAID card connection path (such as RAID_Card_LSI9400_Port2→Motherboard_PCIe3.0), hard disk serial number (such as Z1D2XXXX), firmware version (such as SN03), health status parameter (such as good / warning), and the field format conforms to the hardware information specification (such as string encoding, numerical range, etc.) that can be recognized by the BMC, ensuring that the BMC can be directly used for display after receiving without secondary analysis.

[0117] Further, the BMC calls the display driver interface (such as the LCD driver adapted to the local server management panel, the graphic driver supporting remote KVM, or the display protocol driver adapted to the Web management interface) integrated by itself, and the display driver interface needs to be compatible with the resolution and display protocol of the terminal display device, and the VPD information is typeset according to the preset corresponding list format, for example, in the form of a table, the table header is "hard disk number, connection path, serial number, firmware version, health status", and each row corresponds to the complete parameters of a target hard disk to be queried; at the same time, through fixed column width (such as the connection path column occupies 40 characters, and the serial number column occupies 20 characters), the field alignment is ensured, and the display confusion caused by the parameter length difference is avoided; if the health status parameter of a hard disk is warning or failure, the BMC will mark the target as yellow or red through the display driver, which directly prompts the hardware risk and facilitates the operation and maintenance personnel to quickly locate the abnormal hard disk.

[0118] (2) When there are multiple target hard disks to be queried, the BMC displays the VPD information corresponding to each target hard disk to be queried in turn according to the sorting of each target hard disk to be queried in the SCSI enumeration list.

[0119] Specifically, when there are multiple target hard disks to be queried, the BMC strictly follows the principle of being consistent with the BIOS enumeration order for sorting and displaying. When the BIOS enumerates SCSI protocol hard disks, it generates a SCSI enumeration list according to the SCSI bus scanning order, and synchronously transmits the sorting information of the SCSI enumeration list to the BMC. After receiving the sorting information, the BMC arranges the multi-hard disk VPD information according to the rule of first enumeration, first display. If the number of hard disks exceeds the upper limit of single-screen display (for example, the local LCD panel can only display 6 hard disks), the BMC will automatically enable the paging function, with the current page / total page number marked at the top of each page, and the enumeration order maintained within each page to avoid user confusion caused by paging.

[0120] Further, the display order is strictly synchronized with the SCSI enumeration list, which means that if the physical connection of the hard disk is adjusted (such as adding or removing a hard disk) and re-enumerated, the display order will be automatically updated to match the current hardware connection state, avoiding management errors caused by disordered order. Users can quickly correspond the device identifier in the SCSI enumeration list through the display order, and then trace back the underlying information such as the storage address and connection path of the hard disk by combining the mapping table, providing efficient visual support for server hardware inventory and troubleshooting.

[0121] The method for querying hard disk VPD information in the BIOS stage provided in the embodiment completely solves the problems of information deviation and field loss. In the traditional scheme, when the BIOS queries through the standard SCSI Inquiry command, the interactive object is the RAID card, which causes the information reported by the RAID card, such as the supplier, to be deviated, and the fixed-length reply easily causes the loss of key fields such as the serial number. In the embodiment, the RAID card only transmits the VPD information query instruction and the hard disk return information of the SCSI protocol without tampering with the core content, so that the hard disk information received by the BIOS is completely consistent with the local storage of the target hard disk to be queried, and the complete and accurate acquisition of the hard disk VPD information under the RAID card is realized. Secondly, independent information collection is realized in the BIOS stage, without relying on the subsequent operating system. In the BIOS stage of hardware initialization and firmware running, the hard disks are enumerated through the SCSI bus driver, the target hard disks mounted by the RAID card are screened, the instruction sending and information receiving are completed, the server hardware management efficiency is greatly improved, the pre-information support is provided for the hardware diagnosis and asset inventory in the server startup stage, and the stable startup of the server is ensured. Further, it can also adapt to multiple scenarios and ensure the orderliness of management. By initializing the mapping table containing the device identifier, the connection path, the storage address, and the state identifier, independent storage and receiving state tracking of the multi-hard disk VPD information are realized to avoid information overlap. With the pre-stored analysis protocol table, the SCSI standard VPD page and the manufacturer's private page are compatible to ensure the effective analysis of the information of different brands of hard disks. Finally, the information is displayed in the preset format, and in the multi-hard disk scenario, the information is sorted according to the SCSI enumeration order to improve the readability of the information and the convenience of operation and maintenance.

[0122] Corresponding to the foregoing method embodiment for querying hard disk VPD information in the BIOS stage, the application further provides an apparatus embodiment for querying hard disk VPD information in the BIOS stage.

[0123] Figure 2 The structural schematic diagram of the apparatus embodiment one for querying hard disk VPD information in the BIOS stage provided by the application is shown in FIG. 2. Figure 2 The apparatus provided by the embodiment comprises an acquisition module 210, a query module 220 and a transmission module 230; wherein,

[0124] The acquisition module 210 is configured to acquire a plurality of enumerated hard disks of the SCSI protocol in the BIOS stage.

[0125] The query module 220 is configured to filter a target hard disk to be queried from the SCSI enumerated hard disks based on the device connection mode of the enumerated hard disks, and the target hard disk to be queried is connected to the mainboard through a RAID card.

[0126] The transmission module 230 is configured to send a VPD information query instruction based on the SCSI protocol at the BIOS end, and the RAID card forwards the query instruction to the target hard disk to be queried.

[0127] The transmission module 230 is further configured to return hard disk information corresponding to the query instruction to the RAID card based on the SCSI protocol at the target hard disk to be queried, and send the hard disk information to the BIOS end through the RAID card, wherein the hard disk information received by the BIOS end is completely consistent with the hard disk information locally stored by the target hard disk to be queried.

[0128] The apparatus of the embodiment can be used to execute the steps of the method embodiment shown in FIG. 1, and the specific implementation principle and implementation process are similar, which will not be described here again. Figure 1

[0129] The implementation process of the functions and roles of each unit in the apparatus is specifically described in the implementation process of the corresponding steps in the above method, which will not be described here again.

[0130] ​For the apparatus embodiment, since it basically corresponds to the method embodiment, the relevant part can be seen from the part of the method embodiment. The apparatus embodiment described above is only illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purpose of the application according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0131] The above only describes the preferred embodiments of the present application and is not used to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for querying hard disk VPD information in a BIOS stage, characterized in that, The method comprises: In the BIOS stage, a plurality of enumerated hard disks of SCSI protocol are acquired; A target hard disk to be queried is screened from the SCSI enumerated hard disks based on the device connection mode of the enumerated hard disks, and the target hard disk to be queried is connected to the mainboard through a RAID card; A BIOS end sends a VPD information query instruction based on SCSI protocol, and the RAID card forwards the query instruction to the target hard disk to be queried; The BIOS end extracts SCSI protocol identification information of the target hard disk to be queried from a list of target hard disks to be queried, and synchronously reads basic connection information thereof; According to the SCSI protocol identification information of the target hard disk to be queried, a VPD information query instruction conforming to SCSI protocol specification is generated, and the VPD information query instruction contains a logical unit number of the target hard disk to be queried and a VPD page identification to be queried; The RAID card receives the VPD information query instruction, parses the logical unit number in the VPD information query instruction, converts the VPD information query instruction into a device interface protocol format adapted to the target hard disk to be queried, and forwards the VPD information query instruction to the target hard disk to be queried through a physical link between the RAID card and the target hard disk to be queried; Based on the basic connection information, an ID hardware address is parsed; a logical identification generation interface of SCSI protocol is called, and a RAID card controller ID, a hard disk logical unit number, and a protocol version are combined to generate a UID software interface address; the ID hardware address and the UID software interface address are written into an extended positioning field of the VPD information query instruction, and together with the original logical unit number, form positioning information; The target hard disk to be queried returns hard disk information corresponding to the query instruction to the RAID card based on the SCSI protocol, and the RAID card sends the hard disk information to the BIOS end, and the hard disk information received by the BIOS end is completely consistent with the hard disk information locally stored by the target hard disk to be queried. The method comprises:

2. The method of claim 1, wherein, The BIOS end scans all hard disks connected to the SCSI bus through SCSI bus driving; SCSI protocol identification information of each hard disk is identified and recorded, and a SCSI enumerated hard disk list containing the SCSI protocol identification information is generated, and each hard disk in the SCSI enumerated hard disk list supports SCSI protocol. The BIOS is connected with a plurality of hard disks, and the connection mode of the hard disks and the BIOS at least includes establishing a hardware link through a RAID card and a mainboard, and then realizing communication connection between the mainboard and the BIOS; or establishing communication connection between the BIOS and the mainboard through a SATA interface or a SAS interface on the mainboard.

3. The method of claim 1, wherein, The target hard disk to be queried is screened from the SCSI enumerated hard disks based on the device connection mode of the enumerated hard disks, and the target hard disk to be queried is connected to the mainboard through a RAID card; comprising:

4. The method of claim 1, wherein, The BIOS end pre-stores hard disk identification information of a non-RAID card connection mode; The BIOS end pre-stores hard disk identification information of a non-RAID card connection mode; reading device identification information of each SCSI enumerated hard disk, matching the device identification information with hard disk identification information of the non-RAID card connection mode; if the matching is successful, determining that the SCSI enumerated hard disk is a hard disk connected with the non-RAID card, excluding the SCSI enumerated hard disk, and determining a SCSI enumerated hard disk that is not matched with the hard disk identification information of the non-RAID card connection mode as a target hard disk to be queried.

5. The method of claim 1, wherein, The target hard disk to be queried returns hard disk information corresponding to the query instruction to the RAID card based on the SCSI protocol, and sends the hard disk information to the BIOS end through the RAID card; the method comprises the following steps of: parsing the VPD information query instruction, and extracting a VPD page identifier to be queried; calling a plurality of dimensional hard disk information corresponding to the VPD page identifier from the VPD information stored by itself, wherein the plurality of dimensional hard disk information correspond to fields of different functional attributes in the VPD information; sequentially splicing the plurality of dimensional hard disk information according to a response format and a data structure requirement of the VPD page specified by the SCSI protocol, and generating an information data packet to return to the RAID card; After the RAID card receives the information data packet, the RAID card converts the information data packet into a SCSI protocol data format that can be recognized by the BIOS end, and forwards the information data packet to the BIOS end through a communication link between the RAID card and the motherboard, and the data length of the information data packet before and after the conversion is unchanged.

6. The method of claim 1, wherein, After the information data packet is sent to the BIOS end through the RAID card, the method comprises the following steps of: The BIOS end verifies whether the data packet format of the hard disk information conforms to the response specification of the SCSI protocol; if not, triggering an error retry mechanism; if so, locating an effective field in the hard disk information according to a standard format of the SCSI protocol, and matching a target analysis protocol according to the effective field; analyzing the effective field based on the target analysis protocol to obtain VPD information of the hard disk to be queried.

7. The method of claim 1, wherein, After the hard disk information corresponding to the query instruction is returned to the RAID card, the method comprises the following steps of: initializing a mapping table structure, wherein the mapping table structure comprises a device identification field, a connection path field, a VPD information storage address field and a state identification field; filling SCSI protocol identification information of the target hard disk to be queried and connection path information of the RAID card into corresponding fields of the mapping table respectively; allocating an independent memory storage area for each target hard disk to be queried, recording a starting address of the memory storage area to the VPD information storage address field of the mapping table, and initializing the state identification field as not received; when the BIOS end receives the hard disk information sent through the RAID card, matching a corresponding entry in the mapping table according to SCSI protocol identification information of the hard disk, and updating the state identification field as received.

8. The method of claim 6, wherein, After the information data packet is sent to the BIOS end through the RAID card, the method further comprises the following steps of: After the BIOS end completes the analysis of the hard disk information, the VPD information of the target hard disk to be queried obtained by the analysis is transmitted to the BMC, and after the BMC receives the VPD information, a display driver interface is called to output on a terminal display device in a preset format; wherein the preset format includes a corresponding list of hard disk number, connection path of the hard disk to the mainboard through the RAID card, hard disk serial number, firmware version and health status parameter; When there are multiple target hard disks to be queried, the BMC displays the VPD information corresponding to each target hard disk to be queried in turn according to the order of each target hard disk to be queried in the SCSI enumeration list.

9. An apparatus for querying hard disk VPD information in a BIOS phase, characterized in that, The device includes an acquisition module, a query module and a transmission module; wherein, The acquisition module is configured to acquire multiple enumerated hard disks of the SCSI protocol in the BIOS stage; The query module is configured to filter target hard disks to be queried from the SCSI enumerated hard disks based on the device connection mode of the enumerated hard disks, and the target hard disks to be queried are connected to the mainboard through the RAID card; The transmission module is configured to send a VPD information query instruction by the BIOS end based on the SCSI protocol, and the RAID card forwards the query instruction to the target hard disk to be queried; Wherein, the BIOS end sends a VPD information query instruction based on the SCSI protocol, and the RAID card forwards the query instruction to the target hard disk to be queried; including: The BIOS end extracts SCSI protocol identification information of the target hard disk to be queried from the list of target hard disks to be queried, and synchronously reads its basic connection information; According to the SCSI protocol identification information of the target hard disk to be queried, a VPD information query instruction conforming to the SCSI protocol specification is generated, and the VPD information query instruction contains the logical unit number of the target hard disk to be queried and the VPD page identification to be queried; The RAID card receives the VPD information query instruction, analyzes the logical unit number in the VPD information query instruction, converts the VPD information query instruction into a device interface protocol format suitable for the target hard disk to be queried, and forwards it to the target hard disk to be queried through the physical link between the RAID card and the target hard disk to be queried; Based on the basic connection information, the ID hardware address is parsed; the logical identification generation interface of the SCSI protocol is called, the RAID card controller ID, the hard disk logical unit number and the protocol version are combined to generate the UID software interface address; the ID hardware address and the UID software interface address are written into the extension positioning field of the VPD information query instruction, and the original logical unit number is used to form the positioning information together; The transmission module is also configured to return the hard disk information corresponding to the query instruction to the RAID card based on the SCSI protocol by the target hard disk to be queried, and send it to the BIOS end through the RAID card, wherein the hard disk information received by the BIOS end is completely consistent with the hard disk information stored locally by the target hard disk to be queried.

Citation Information

Patent Citations

  • Obtaining method, device and system for hardware physics serial number

    CN105183388A

  • Physical disk management method and system under RAID (Redundant Array of Independent Disks) controller

    CN115145492A

  • Parameter configuration method and computing device

    CN119621170A