Expansion card fault processing method and device, electronic equipment and medium
By loading the expansion card driver when the basic input and output system of the unified extensible firmware interface is started, obtaining the fault category and repairing it, the problem of delayed failure detection of expansion card is solved, and timely processing and cost reduction are achieved.
Patent Information
- Application Number
- CN202510652421.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-08-19
AI Technical Summary
In the prior art, the expansion card fault detection time is lagging, and repairing through system restart or firmware restart increases system downtime and maintenance costs.
When the basic input and output system of the unified extensible firmware interface is started, the expansion card driver is loaded for fault detection, obtain the fault category and repair it according to the pre-established fault repair strategy.
It realizes the timely handling of expansion card failures before the operating system is loaded, reduces system downtime and maintenance costs, and improves the efficiency and accuracy of fault detection.
Smart Images

Figure CN120508430A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an expansion card fault processing method, device, electronic equipment and medium. Background Art
[0002] Expansion cards, such as Redundant Array of Independent Disks Controller Card (RAID) cards, play a critical role in computer systems. Their proper operation is crucial to data storage, system performance, and overall reliability.
[0003] In practice, expansion card anomalies may occur. To address these issues, related technologies typically rely on command-line or graphical user interface (GUI) software within the operating system to perform fault diagnosis and repair. This method requires that the operating system be loaded before troubleshooting the expansion card, resulting in a relatively delayed detection time. Furthermore, once an expansion card failure is detected within the operating system, repairing the card requires a system or firmware reboot, increasing system downtime and maintenance costs.
[0004] Therefore, how to promptly handle expansion card failures and reduce system downtime and maintenance costs is a technical problem that people in this field urgently need to solve. Summary of the Invention
[0005] The purpose of the present invention is to provide an expansion card fault handling method, device, electronic device and medium to solve the problem that the time for expansion card fault detection is relatively delayed; and when repairing the expansion card fault, the expansion card fault is repaired by restarting the system or restarting the firmware, which increases the system downtime and maintenance costs.
[0006] To solve the above technical problems, the present invention provides a method for handling expansion card failures, comprising:
[0007] Obtaining an expansion card driver for performing fault detection on the expansion card; wherein the expansion card driver is firmware in an optional read-only memory on the expansion card;
[0008] When the unified extensible firmware interface basic input and output system is started, the expansion card driver is loaded to perform fault detection on the expansion card;
[0009] Obtaining the current fault category of the expansion card, and determining the current fault repair strategy corresponding to the current fault category based on a pre-established correspondence between the fault category and the fault repair strategy;
[0010] Repair the current fault of the expansion card according to the current fault repair strategy.
[0011] On the one hand, loading the expansion card driver to perform fault detection on the expansion card includes:
[0012] Load the expansion card driver to perform fault detection on the expansion card unified extensible firmware interface driver;
[0013] After obtaining the fault detection result of the unified extensible firmware interface driver of the expansion card, perform fault detection on the hardware and firmware of the expansion card.
[0014] On the other hand, the current failure categories for obtaining expansion cards include:
[0015] Determining whether the expansion card is a storage device that complies with the unified extensible firmware interface specification;
[0016] If not, determining that the current fault type of the expansion card is an expansion card unified extensible firmware interface driver fault, and that the fault type is unrepairable;
[0017] If so, obtaining a preset communication protocol between the expansion card driver and the expansion card;
[0018] When it is detected that the expansion card does not support the communication protocol, determining that the current fault type of the expansion card is an expansion card unified extensible firmware interface driver fault, and that the fault type is unrepairable;
[0019] When it is detected that the expansion card supports the communication protocol, fault detection is performed on the expansion card hardware and firmware to obtain a current fault category of the expansion card.
[0020] On the other hand, fault detection of expansion card hardware and firmware to obtain the current fault categories of the expansion card include:
[0021] Perform fault detection on the expansion card hardware and firmware, and obtain fault information carried by the communication protocol to characterize the expansion card hardware and firmware;
[0022] A current fault category of the expansion card is determined according to the fault information; wherein the current fault category is one of an automatically repairable fault category, a fault category requiring configuration for repair, or an unrepairable fault category.
[0023] On the other hand, the pre-established correspondence between fault categories and fault repair strategies includes:
[0024] When it is detected that the fault category is a fault category that can be automatically repaired, determining the fault repair strategy to be an automatic fault repair strategy;
[0025] When it is detected that the fault type is a fault type that requires configuration and repair, the fault repair strategy is determined to be a strategy of performing fault repair through the repair interface;
[0026] In the case where the fault category is detected to be an unrepairable fault category, the fault repair strategy is determined to be sending a message to the user indicating that the fault category is an unrepairable fault category, and prompting the user to replace the expansion card.
[0027] On the other hand, when the fault category is detected to be a fault category that can be automatically repaired, determining the fault repair strategy to be an automatic repair strategy includes:
[0028] If the automatically repairable fault is degradation of the independent redundant disk array caused by a hard disk failure detected during system startup, determining the automatic fault repair strategy to automatically start a reconstruction process of the independent redundant disk array and restore the integrity of the independent redundant disk array using a spare hard disk or by reconstructing data;
[0029] If the fault that can be automatically repaired is an abnormality occurring during the firmware update process of the expansion card, then determining the automatic fault repair strategy is to use the backup firmware to restore the operation of the expansion card and restore the settings of the expansion card from the non-volatile memory when the configuration is lost;
[0030] When a fault is detected that requires configuration and repair, the fault repair strategy is determined to be the fault repair strategy through the repair interface. The strategies include:
[0031] If the fault to be repaired is that the inserted hard disk is incompatible, then determining the fault repair strategy is to output a prompt message indicating that the inserted hard disk is incompatible to the user through a human-machine interface infrastructure; wherein the human-machine interface infrastructure is part of the unified extensible firmware interface specification;
[0032] If the fault to be repaired is an abnormal state of an independent redundant disk array, the fault repair strategy is to guide the user to check the current state through the human-machine interface infrastructure and output operation prompts so that the user can manually reconstruct or replace the hard disk according to the operation prompts;
[0033] When the fault type is detected as an unrepairable fault type, determining the fault repair strategy to send a message to the user indicating that the fault type is an unrepairable fault type and prompting the user to replace the expansion card includes:
[0034] The fault repair strategy is determined to be sending a message to the user through the human-machine interface infrastructure, indicating that the fault category is an unrepairable fault category, and prompting the user to replace the expansion card.
[0035] On the other hand, before loading the expansion card driver to perform fault detection on the expansion card, the following steps are also included:
[0036] Obtaining an inspection mode set in the expansion card; wherein the inspection mode set in the expansion card is obtained by issuing an inspection mode through a custom command of the communication protocol; the inspection mode includes at least a first inspection mode and a second inspection mode, and the inspection period of the first inspection mode is different from the inspection period of the second inspection mode;
[0037] Loading the expansion card driver to perform expansion card fault detection includes:
[0038] Load the expansion card driver in check mode to perform fault detection on the expansion card.
[0039] In order to solve the above technical problems, the present invention further provides an expansion card fault handling device, comprising:
[0040] An acquisition module, configured to acquire an expansion card driver for performing fault detection on the expansion card; wherein the expansion card driver is firmware in an optional read-only memory on the expansion card;
[0041] A loading module, used for loading the expansion card driver when the unified extensible firmware interface basic input and output system is started, so as to perform fault detection on the expansion card;
[0042] An acquisition and determination module is used to acquire the current fault category of the expansion card and determine the current fault repair strategy corresponding to the current fault category based on the pre-established correspondence between the fault category and the fault repair strategy;
[0043] The repair module is used to repair the current fault of the expansion card according to the current fault repair strategy.
[0044] In order to solve the above technical problems, the present invention further provides an electronic device, comprising:
[0045] memory for storing computer programs;
[0046] The processor is configured to implement the steps of the above-mentioned expansion card failure handling method when executing a computer program.
[0047] In order to solve the above technical problems, the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the above expansion card fault handling method are implemented.
[0048] The beneficial effects of the present invention are as follows: first, in the expansion card fault handling method provided by the present invention, when the unified extensible firmware interface (UEFI) BIOS is started, an expansion card driver for performing fault detection on the expansion card is loaded to perform fault detection on the expansion card; then, the current fault category of the expansion card is obtained, and the current fault repair strategy corresponding to the current fault category is determined based on a pre-established correspondence between the fault category and the fault repair strategy; finally, the current fault of the expansion card is repaired based on the current fault repair strategy. Thus, the method achieves fault repair for the expansion card; second, when the UEFI BIOS is started, the expansion card driver is loaded to perform fault detection on the expansion card. The expansion card driver is firmware in the optional read-only memory on the expansion card. Since the optional read-only memory can be loaded when the UEFI BIOS is started, when the expansion card driver is loaded, the optional read-only memory's original function of self-initialization and configuring the redundant array of independent disks during the system startup phase is retained, and it also has the function of detecting expansion card faults; since the UEFI BIOS is started before the operating system is loaded, the method provided by the present invention achieves fault handling for the expansion card before the operating system is loaded. Compared with the previous method of handling expansion card faults only after the operating system is loaded, the method provided by the present invention can handle expansion card faults in a timely manner; thirdly, in the method provided by the present invention, faults are classified, and the fault repair strategy is different for different fault categories, rather than using a restart method for all faults, thereby reducing system downtime and maintenance costs.
[0049] Furthermore, when loading an expansion card driver to perform fault detection on the expansion card, the expansion card's Unified Extensible Firmware Interface (UEFI) driver is first tested for faults. After obtaining the fault detection results for the UEFI driver, the expansion card's hardware and firmware are then tested for faults. This method can quickly locate the root cause of the problem, avoid unnecessary hardware checks, and save time and resources. This layered detection approach effectively reduces false positives and improves fault detection efficiency.
[0050] When obtaining the current fault category of the expansion card, the fault category is first determined based on whether the expansion card is a storage device that complies with the unified extensible firmware interface specification. After that, the fault category is determined based on whether the expansion card supports the pre-set communication protocol between the expansion card driver and the expansion card. Compared with the method of first judging based on the communication protocol and then judging the device category, the method provided by the present invention can quickly eliminate devices that do not meet the requirements and avoid unnecessary protocol checks on irrelevant devices, thereby saving time and resources. Secondly, after clarifying the device type, the protocol can be checked more specifically, reducing the possibility of misjudgment and improving the accuracy of diagnosis. In addition, this hierarchical diagnosis method is particularly effective in complex systems, because there may be multiple device types in complex systems. Determining the device type first can quickly narrow the scope of investigation and make the diagnosis process more efficient. In short, this method improves the efficiency and accuracy of fault diagnosis.
[0051] When fault detection is performed on the expansion card hardware and firmware, the current fault category of the expansion card (one of the following: automatically repairable fault category, fault category requiring configuration for repair, or unrepairable fault category) is determined through the fault information carried by the communication protocol to characterize the expansion card hardware and firmware, facilitating subsequent targeted fault handling.
[0052] For different fault types, corresponding fault repair strategies are set and adopted to perform fault repairs. That is, personalized response strategies are provided according to different fault scenarios, realizing flexible fault handling.
[0053] For fault categories that require configuration repair and non-repairable fault categories, the human-machine interface infrastructure enhances user participation, reduces the risk of data loss, and improves system recovery efficiency.
[0054] Pre-set inspection modes (either the primary or secondary inspection modes with different inspection intervals) allow users to easily select the appropriate inspection method based on their needs. This flexibility makes expansion card health monitoring more efficient and meets the maintenance needs of diverse users.
[0055] In addition, the present invention also provides an expansion card fault handling device, an electronic device, and a computer-readable storage medium, which have the same or corresponding technical features as the above-mentioned expansion card fault handling method and have the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0057] Figure 1 A schematic diagram of an expansion card fault handling system provided by an embodiment of the present invention;
[0058] Figure 2 A flowchart of a method for handling expansion card failures provided by an embodiment of the present invention;
[0059] Figure 3 A flowchart of a method for determining an expansion card fault category provided by an embodiment of the present invention;
[0060] Figure 4 A flowchart of a RAID card health check and fault repair method provided by an embodiment of the present invention;
[0061] Figure 5 This is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0062] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0063] The core of the present invention is to provide an expansion card fault handling method, device, electronic device and medium to solve the problem that the time of expansion card fault detection is relatively delayed; and when repairing the expansion card fault, the expansion card fault is repaired by restarting the system or restarting the firmware, which increases the system downtime and maintenance costs.
[0064] To detect and handle faults on expansion cards (such as RAID cards), related technologies perform these faults after the operating system is loaded, resulting in a relatively delayed detection and handling process. The present invention utilizes an Option ROM to provide expansion card health check and repair capabilities. It should be noted that in modern computer systems, many RAID cards use Option ROM to provide driver and configuration management software within the Unified Extensible Firmware Interface Basic Input / Output System (UEFI BIOS) environment. This implementation enables the RAID card to self-initialize and configure the RAID array during system startup, thereby identifying and managing connected storage devices before the operating system loads. This not only improves the performance and reliability of the storage system but also enhances the user experience, making it a crucial component of current RAID solutions. The present invention further utilizes the Option ROM to provide expansion card health check and repair capabilities.
[0065] Figure 1 A schematic diagram of an expansion card fault handling system provided by an embodiment of the present invention is provided. Figure 1 In the UEFI BIOS, expansion card firmware runs on the expansion card and includes the hardware driver, various firmware modules, the hardware monitoring module, and the firmware monitoring module. The expansion card driver is the firmware in the expansion card's Option ROM. It is loaded and run during the UEFI BIOS device enumeration phase and includes the expansion card driver and health check functions. The health check module includes a fault diagnosis module, a fault repair module, and a user interaction module.
[0066] Taking the expansion card as an example, the fault diagnosis module includes RAID card health check software, which uses the interface provided by the RAID card driver to automatically perform hardware and firmware health checks at system startup. The module provides comprehensive self-test capabilities, covering RAID card UEFI driver health checks, RAID card hardware fault detection, and firmware fault checks, to comprehensively evaluate the health status of the RAID card. During the UEFI BIOS phase, the fault repair module can automatically identify and repair common RAID card faults. User interaction modules, such as the Human Interface Infrastructure (HII), are used to provide user interaction functions during user-guided configuration repairs. Prompt information is provided when unrepairable errors occur, thereby improving the user experience.
[0067] In order to enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation methods. Figure 2 A flowchart of a method for handling an expansion card failure provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown, the method includes:
[0068] S10: Acquire an expansion card driver for performing fault detection on the expansion card; wherein the expansion card driver is firmware in an optional read-only memory on the expansion card;
[0069] S11: When the unified extensible firmware interface basic input and output system is started, the expansion card driver is loaded to perform fault detection on the expansion card;
[0070] S12: Obtaining the current fault category of the expansion card, and determining the current fault repair strategy corresponding to the current fault category based on a pre-established correspondence between the fault category and the fault repair strategy;
[0071] S13: Repair the current fault of the expansion card according to the current fault repair strategy.
[0072] In an embodiment of the present invention, expansion card fault detection includes fault detection of the expansion card's unified extensible firmware interface (UEFI) driver, hardware, and firmware. Because the expansion card driver has fault detection capabilities, to improve fault detection efficiency, in an embodiment of the present invention, the expansion card driver is loaded during UEFI BIOS startup to detect expansion card faults. Because the UEFI BIOS startup occurs before the operating system loads, this method implements fault handling for the expansion card before the operating system loads.
[0073] To improve the efficiency of fault detection, in practice, loading the expansion card driver to perform fault detection on the expansion card includes:
[0074] Load the expansion card driver to perform fault detection on the expansion card unified extensible firmware interface driver;
[0075] After obtaining the fault detection result of the unified extensible firmware interface driver of the expansion card, perform fault detection on the hardware and firmware of the expansion card.
[0076] In this method, when loading the expansion card driver to perform fault detection on the expansion card, the expansion card's Unified Extensible Firmware Interface (UFI) driver is first tested for faults. After obtaining the fault detection results for the UFI driver, the expansion card's hardware and firmware are tested for faults. This method can quickly locate the root cause of the problem, avoid unnecessary hardware checks, and save time and resources. This layered detection approach can effectively reduce false positives and improve fault detection efficiency.
[0077] After performing fault detection on the expansion card, the current fault type of the expansion card is obtained. Similarly, to improve the efficiency of fault handling, the current fault type of the expansion card is obtained including:
[0078] Determining whether the expansion card is a storage device that complies with the unified extensible firmware interface specification;
[0079] If not, determining that the current fault type of the expansion card is an expansion card unified extensible firmware interface driver fault, and that the fault type is unrepairable;
[0080] If so, obtaining a preset communication protocol between the expansion card driver and the expansion card;
[0081] When it is detected that the expansion card does not support the communication protocol, determining that the current fault type of the expansion card is an expansion card unified extensible firmware interface driver fault, and that the fault type is unrepairable;
[0082] When it is detected that the expansion card supports the communication protocol, fault detection is performed on the expansion card hardware and firmware to obtain a current fault category of the expansion card.
[0083] During implementation, fault detection is performed on the expansion card hardware and firmware to obtain the current fault categories of the expansion card, including:
[0084] Perform fault detection on the expansion card hardware and firmware, and obtain fault information carried by the communication protocol to characterize the expansion card hardware and firmware;
[0085] A current fault category of the expansion card is determined according to the fault information; wherein the current fault category is one of an automatically repairable fault category, a fault category requiring configuration for repair, or an unrepairable fault category.
[0086] It should be noted that, to determine whether the expansion card is a storage device that complies with the unified extensible firmware interface specification, that is, to determine whether the expansion card has the EfiPcilo Protocol installed. To determine whether the expansion card supports the pre-set communication protocol, that is, to determine whether the expansion card has the EfiNvmExpressPassThruProtocol installed. The fault information carried by the communication protocol is used to characterize the hardware and firmware of the expansion card. The RAID card driver and the RAID card controller in the embodiment of the present invention communicate through the Non-Volatile Memory Express (NVMe) protocol. When obtaining the controller fault information, the manufacturer's customized NVMe protocol is used. The manufacturer's customized NVMe protocol is formulated as shown in Table 1:
[0087] Table 1
[0088]
[0089] In order to make those skilled in the art better understand the method of determining the failure type of the expansion card, the following is again combined with the specific embodiment and Figure 3 This section explains how to determine the fault type of an expansion card. Figure 3 A flowchart of a method for determining an expansion card fault category provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, the method includes:
[0090] S14: Determine whether the expansion card is a storage device that complies with the unified extensible firmware interface specification; if not, proceed to step S15; if so, proceed to step S16;
[0091] S15: Determine that the current fault is an unrepairable fault;
[0092] S16: Determine whether the expansion card supports the pre-set communication protocol between the expansion card driver and the expansion card; if not, proceed to step S15; if so, proceed to step S17;
[0093] S17: Obtain controller fault information;
[0094] S18: Determine whether the expansion card is faulty based on the fault information; if not, proceed to step S19; if so, proceed to step S20;
[0095] S19: Determine the health of the expansion card;
[0096] S20: Obtain the fault category, which can be an automatically repairable fault category, a fault category requiring configuration for repair, or an unrepairable fault category.
[0097] It should be noted that steps S14 to S16 are health checks on the unified extensible firmware interface driver of the expansion card, and steps S17 to S20 are health checks on the hardware and firmware of the expansion card.
[0098] In this method, when obtaining the current fault category of the expansion card, the fault category is first determined based on whether the expansion card is a storage device that complies with the unified extensible firmware interface specification. Then, the fault category is determined based on whether the expansion card supports the pre-set communication protocol between the expansion card driver and the expansion card. Compared with the method of first judging based on the communication protocol and then judging the device category, the method provided by the present invention can quickly eliminate devices that do not meet the requirements and avoid unnecessary protocol checks on irrelevant devices, thereby saving time and resources. Secondly, after clarifying the device type, the protocol can be checked more specifically, reducing the possibility of misjudgment and improving the accuracy of diagnosis. In addition, this hierarchical diagnosis method is particularly effective in complex systems because there may be multiple device types in complex systems. Determining the device type first can quickly narrow the scope of investigation and make the diagnosis process more efficient. In short, this method improves the efficiency and accuracy of fault diagnosis; and the current fault category is a fault category that can be automatically repaired, a fault category that needs to be configured for repair, or a fault category that cannot be repaired, that is, accurate classification and accurate detection of faults are achieved.
[0099] In order to facilitate users to obtain the fault type, in implementation, the fault diagnosis module also includes:
[0100] A fault type identification unit, used to identify and determine the specific type of fault;
[0101] Fault type and interface mapping table, used to store the mapping relationship between different fault types and corresponding user interfaces;
[0102] An interface presenting unit, configured to search for a corresponding user interface in a fault type and interface mapping table according to the fault type determined by the fault type identifying unit, and present the user interface to the user;
[0103] The fault type and interface mapping table at least includes a fault type identifier, a user interface identifier, a fault description, and a repair strategy.
[0104] The fault type identifier is a code or name that uniquely identifies each fault type. The user interface identifier is the code or name of the user interface corresponding to each fault type. The fault description briefly describes each fault type to help users understand the specific fault situation.
[0105] When searching for the corresponding user interface, the interface presentation unit automatically loads and displays detailed information related to the fault type, including a description of the fault and suggested repairs, allowing users to quickly understand the fault and take appropriate remedial measures. The fault diagnosis module also records the results of each fault diagnosis, including information such as the fault type, diagnosis time, and user interface identifier, to facilitate subsequent fault analysis and system maintenance. The fault diagnosis module also communicates with external management systems, reporting fault diagnosis results and user interface presentation status to system administrators for centralized management and monitoring of system operation.
[0106] In this method, the fault type is quickly determined through the fault type identification unit, and then the fault type is accurately matched with the corresponding user interface using the interface mapping table, which can quickly provide users with intuitive fault information and repair suggestions, reducing the user's time and energy in troubleshooting.
[0107] After obtaining the current fault category of the expansion card, in order to repair the fault of the expansion card, the present invention determines the current fault repair strategy corresponding to the current fault category based on the pre-established correspondence between the fault category and the fault repair strategy; and then repairs the current fault of the expansion card according to the current fault repair strategy.
[0108] In implementation, the pre-established correspondence between fault categories and fault repair strategies includes:
[0109] When it is detected that the fault category is a fault category that can be automatically repaired, determining the fault repair strategy to be an automatic fault repair strategy;
[0110] When it is detected that the fault type is a fault type that requires configuration and repair, the fault repair strategy is determined to be a strategy of performing fault repair through the repair interface;
[0111] In the case where the fault category is detected to be an unrepairable fault category, the fault repair strategy is determined to be sending a message to the user indicating that the fault category is an unrepairable fault category, and prompting the user to replace the expansion card.
[0112] When the fault type is detected as a fault type that can be automatically repaired, determining the fault repair strategy as the automatic repair strategy includes:
[0113] If the automatically repairable fault is degradation of the independent redundant disk array caused by a hard disk failure detected during system startup, determining the automatic fault repair strategy to automatically start a reconstruction process of the independent redundant disk array and restore the integrity of the independent redundant disk array using a spare hard disk or by reconstructing data;
[0114] If the fault that can be automatically repaired is an abnormality occurring during the firmware update process of the expansion card, the automatic fault repair strategy is determined to use the backup firmware to restore the operation of the expansion card and restore the settings of the expansion card from the non-volatile memory when the configuration is lost.
[0115] Specifically, during the UEFI BIOS phase, the fault recovery module automatically identifies and repairs common RAID card faults. For example, if a hard drive failure is detected during system startup, resulting in a degraded RAID array, the module automatically initiates a RAID reconstruction process, restoring the array's integrity using a spare drive or by reconstructing the data. Furthermore, if an anomaly occurs during a RAID card firmware update, the system automatically recovers from the backup firmware to ensure proper operation of the card. If the configuration is lost, the RAID settings can be restored from non-volatile memory. These automatic repair features significantly improve system reliability and reduce the need for user intervention.
[0116] When a fault is detected that requires configuration and repair, the fault repair strategy is determined to be the fault repair strategy through the repair interface. The strategies include:
[0117] If the fault to be repaired is that the inserted hard disk is incompatible, then determining the fault repair strategy is to output a prompt message indicating that the inserted hard disk is incompatible to the user through a human-machine interface infrastructure; wherein the human-machine interface infrastructure is part of the unified extensible firmware interface specification;
[0118] If the fault to be repaired is an abnormal state of an independent redundant disk array, the fault repair strategy is to guide the user to check the current state through the human-machine interface infrastructure and output operation prompts so that the user can manually reconstruct or replace the hard disk according to the operation prompts;
[0119] When the fault type is detected as an unrepairable fault type, determining the fault repair strategy to send a message to the user indicating that the fault type is an unrepairable fault type and prompting the user to replace the expansion card includes:
[0120] The fault repair strategy is determined to be sending a message to the user through the human-machine interface infrastructure, indicating that the fault category is an unrepairable fault category, and prompting the user to replace the expansion card.
[0121] When a RAID card encounters a fault requiring manual user intervention, the fault recovery module alerts the user through the HII user interaction module. For example, if a user inserts an incompatible hard drive, the system prompts the user to check drive compatibility and provides specific recommendations. Similarly, if the RAID array status is abnormal, the system guides the user to check the current status and provides steps for manual reconstruction or drive replacement. This mechanism not only enhances user participation and control during the troubleshooting process, but also ensures data security and integrity.
[0122] In practice, users may have different maintenance requirements. To meet the maintenance requirements of different users, before loading the expansion card driver to perform fault detection on the expansion card, the following steps are also included:
[0123] Obtaining an inspection mode set in the expansion card; wherein the inspection mode set in the expansion card is obtained by issuing an inspection mode through a custom command of the communication protocol; the inspection mode includes at least a first inspection mode and a second inspection mode, and the inspection period of the first inspection mode is different from the inspection period of the second inspection mode;
[0124] Loading the expansion card driver to perform expansion card fault detection includes:
[0125] Load the expansion card driver in check mode to perform fault detection on the expansion card.
[0126] For example, the first check mode and the second check mode are referred to as the quick check mode and the deep check mode, respectively. This method also provides the option of a health check mode, and the user can select the quick check mode or the deep check mode as needed. Quick check mode: used for daily checks, with a short running time, covering basic health status, and convenient for users to monitor regularly. Deep check mode: used for regular maintenance, with a long running time, covering comprehensive health status, and suitable for in-depth analysis and maintenance. The setting of the health check mode is sent to the expansion card through the NVMe manufacturer's custom command. The NVMe manufacturer's custom command is shown in Table 2:
[0127] Table 2
[0128]
[0129] In order to make those skilled in the art better understand the above expansion card fault handling method, the following is combined with specific embodiments and Figure 4 The method of the present invention will be described again. Figure 4 A flowchart of a method for health check and fault repair of a RAID card provided by an embodiment of the present invention is shown as follows: Figure 4 As shown, the method includes:
[0130] S21: Read health check mode;
[0131] S22: Select quick inspection mode or deep inspection mode;
[0132] S23: Check health status;
[0133] S24: Determine whether the expansion card is healthy; if so, proceed to step S25; if not, proceed to step S26;
[0134] S25: Determine whether the expansion card is healthy;
[0135] S26: Determine whether automatic repair is possible; if so, proceed to step S27; if not, proceed to step S28;
[0136] S27: Execute automatic repair operation;
[0137] S28: Determine whether the configuration repair is possible; if so, proceed to step S29; if not, proceed to step S30;
[0138] S29: Enter the repair interface;
[0139] S30: Prompts the user that an irreparable problem has occurred and the expansion card needs to be replaced.
[0140] In practice, the process of diagnosing and repairing RAID card faults includes:
[0141] Step 1: Power on the RAID card and perform initialization. After initialization is complete, perform a health check based on the selected health check mode (quick check or deep check).
[0142] Step 2: Start the host and load the RAID card host driver software in the Option ROM to enable it to run on the host.
[0143] Step 3: Perform a health check. After the Option ROM runs on the host, it executes the fault diagnosis module to check the driver, RAID card hardware, and firmware. If the device is in good health, the health check completes and the RAID card status is displayed as "Healthy."
[0144] Step 4: Automated Repair. If the device is unhealthy and automated repair is possible, the appropriate automated recovery process will be executed based on the fault type. This includes resetting the device firmware. If resetting the firmware fails to resolve the issue, a hardware reboot will be performed to reinitialize the RAID controller card. Specific repair actions will be performed for the RAID array issue, such as rebuilding the array or repairing data consistency. After the repair is complete, a health check will be rerun to ensure the device is back to normal.
[0145] Step 5: Manual Repair. If the device is unhealthy and requires user intervention, the HII user interaction module is invoked to guide the user through manual repair. For example, if a RAID array is degraded, resulting in insufficient data security, the system prompts the user to manually add a disk for reconstruction. After the user completes the operation and the repair is complete, rerun the health check to ensure the device is back to normal.
[0146] Step 6: Unrecoverable Error: If the device status is unhealthy and cannot be repaired, the system will prompt the user to replace the RAID card in time.
[0147] The expansion card fault handling method provided by this invention implements RAID card health check and fault repair functions in the UEFI BIOS environment through Option ROM. This allows for automatic self-checks during system startup, avoiding the limitations of traditional solutions that require diagnostics only under the operating system, thereby improving the timeliness and accuracy of fault detection. The fault repair module features both automated and user-guided repair capabilities, enabling the selection of appropriate repair methods based on the fault type, enhancing user engagement, reducing the risk of data loss, and improving system recovery efficiency. It also provides two modes: quick check and in-depth check, allowing users to select the appropriate check method based on their specific needs. This flexibility makes RAID card health monitoring more efficient and meets the maintenance needs of diverse users.
[0148] In the above embodiments, a method for handling expansion card faults is described in detail. The present invention also provides corresponding embodiments of an expansion card fault handling device and an electronic device. It should be noted that the present invention describes the device embodiments from two perspectives: one based on functional modules and the other based on hardware.
[0149] The expansion card fault handling device provided in the embodiment of the present invention, based on the perspective of functional modules, includes:
[0150] An acquisition module, configured to acquire an expansion card driver for performing fault detection on the expansion card; wherein the expansion card driver is firmware in an optional read-only memory on the expansion card;
[0151] A loading module, used for loading the expansion card driver when the unified extensible firmware interface basic input and output system is started, so as to perform fault detection on the expansion card;
[0152] An acquisition and determination module is used to acquire the current fault category of the expansion card and determine the current fault repair strategy corresponding to the current fault category based on the pre-established correspondence between the fault category and the fault repair strategy;
[0153] The repair module is used to repair the current fault of the expansion card according to the current fault repair strategy.
[0154] In some embodiments, the loading module includes:
[0155] A loading submodule is used to load the expansion card driver to perform fault detection on the expansion card unified extensible firmware interface driver;
[0156] The fault detection module is used to perform fault detection on the expansion card hardware and firmware after obtaining the fault detection result of the expansion card unified extensible firmware interface driver.
[0157] The expansion card fault processing device includes a first acquisition module, which is used to obtain the current fault type of the expansion card;
[0158] The first acquisition module specifically includes:
[0159] a judgment module, configured to judge whether the expansion card is a storage device that complies with the unified extensible firmware interface specification; if not, triggering the first determination module; if so, triggering the second acquisition module;
[0160] A first determining module is configured to determine that the current fault type of the expansion card is an expansion card unified extensible firmware interface driver fault, which is an unrepairable fault type;
[0161] A second acquisition module is used to acquire a preset communication protocol between the expansion card driver and the expansion card;
[0162] A second determining module is configured to determine, when detecting that the expansion card does not support the communication protocol, that the current fault type of the expansion card is an expansion card unified extensible firmware interface driver fault, and that the fault type is unrepairable;
[0163] The detection and acquisition module is used to perform fault detection on the hardware and firmware of the expansion card to obtain the current fault category of the expansion card when it is detected that the expansion card supports the communication protocol.
[0164] In some embodiments, the detection and acquisition module includes:
[0165] A third acquisition module is used to perform fault detection on the expansion card hardware and firmware, and obtain fault information carried by the communication protocol and used to characterize the expansion card hardware and firmware;
[0166] The third determining module is configured to determine the current fault category of the expansion card according to the fault information; wherein the current fault category is one of a fault category that can be automatically repaired, a fault category that requires configuration for repair, or a fault category that cannot be repaired.
[0167] In some embodiments, the expansion card fault processing device further includes:
[0168] The fourth acquisition module is used to obtain the inspection mode set in the expansion card; wherein, the inspection mode set in the expansion card is obtained by sending the inspection mode by a custom command of the communication protocol; the inspection mode includes at least a first inspection mode and a second inspection mode, and the inspection period of the first inspection mode is different from the inspection period of the second inspection mode.
[0169] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, and they will not be repeated here.
[0170] Figure 5This is a structural diagram of an electronic device provided by an embodiment of the present invention. This embodiment is based on the hardware perspective, such as Figure 5 As shown, the electronic equipment includes:
[0171] Memory 20, for storing computer programs;
[0172] The processor 21 is configured to implement the steps of the expansion card failure handling method mentioned in the above embodiment when executing a computer program.
[0173] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented in at least one of the following hardware forms: a digital signal processor (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing content required to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is responsible for processing computing operations related to machine learning.
[0174] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the expansion card fault handling method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include but is not limited to the data involved in the above-mentioned expansion card fault handling method, etc.
[0175] In some embodiments, the electronic device may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0176] Those skilled in the art will understand that Figure 5 The structure shown in the figure does not constitute a limitation of the electronic device, and may include more or fewer components than shown in the figure.
[0177] The electronic device provided by the embodiment of the present invention includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: an expansion card failure processing method, which has the same effect as above.
[0178] The present invention further provides an embodiment corresponding to a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps described in the above method embodiment are implemented.
[0179] The present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above expansion card failure processing method when executed by a processor.
[0180] It is understood that if the methods in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage media include various media that can store program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.
[0181] The computer-readable storage medium provided by the present invention includes the above-mentioned expansion card fault processing method, and has the same effect as above.
[0182] The above is a detailed introduction to the expansion card fault handling method, device, electronic device and medium provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in several ways, and these improvements and modifications also fall within the scope of protection of the present invention.
[0183] It should also be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
Claims
1. A method for handling expansion card failures, characterized in that: include: Acquire an expansion card driver for performing fault detection on the expansion card; wherein the expansion card driver is firmware in an optional read-only memory on the expansion card; When the UEFI BIOS is started, the expansion card driver is loaded to perform fault detection on the expansion card; Obtaining the current fault category of the expansion card, and determining the current fault repair strategy corresponding to the current fault category based on a pre-established correspondence between the fault category and the fault repair strategy; Repair the current fault of the expansion card according to the current fault repair strategy.
2. The expansion card fault handling method according to claim 1, characterized in that: The step of loading the expansion card driver to perform fault detection on the expansion card includes: Loading the expansion card driver to perform fault detection on the expansion card unified extensible firmware interface driver; After obtaining the fault detection result of the unified extensible firmware interface driver of the expansion card, perform fault detection on the hardware and firmware of the expansion card.
3. The expansion card fault handling method according to claim 2, wherein: The current fault categories of the expansion card include: Determining whether the expansion card is a storage device that complies with the unified extensible firmware interface specification; If not, determining that the current fault type of the expansion card is an expansion card unified extensible firmware interface driver fault, and that the fault type is unrepairable; If yes, obtaining a preset communication protocol between the expansion card driver and the expansion card; In the case where it is detected that the expansion card does not support the communication protocol, determining that the current fault type of the expansion card is an expansion card unified extensible firmware interface driver fault, and that the fault type is unrepairable; When it is detected that the expansion card supports the communication protocol, fault detection is performed on the hardware and firmware of the expansion card to obtain a current fault category of the expansion card.
4. The expansion card fault handling method according to claim 3, characterized in that: The fault detection of the expansion card hardware and firmware to obtain the current fault category of the expansion card includes: Performing fault detection on the expansion card hardware and firmware, and obtaining fault information carried by the communication protocol for characterizing the expansion card hardware and firmware; A current fault category of the expansion card is determined according to the fault information; wherein the current fault category is one of an automatically repairable fault category, a fault category requiring configuration for repair, or an unrepairable fault category.
5. The expansion card fault handling method according to claim 4, characterized in that: The pre-established correspondence between fault categories and fault repair strategies includes: When it is detected that the fault category is a fault category that can be automatically repaired, determining the fault repair strategy to be an automatic fault repair strategy; When it is detected that the fault type is a fault type that requires configuration and repair, the fault repair strategy is determined to be a strategy of performing fault repair through the repair interface; In the case where the fault category is detected to be an unrepairable fault category, the fault repair strategy is determined to be sending a message to the user indicating that the fault category is an unrepairable fault category, and prompting the user to replace the expansion card.
6. The expansion card fault handling method according to claim 5, characterized in that: When the fault type is detected as a fault type that can be automatically repaired, determining the fault repair strategy as the automatic repair strategy includes: If the automatically repairable fault is degradation of the independent redundant disk array caused by a hard disk failure detected during system startup, determining the automatic fault repair strategy to automatically start a reconstruction process of the independent redundant disk array and restore the integrity of the independent redundant disk array using a spare hard disk or by reconstructing data; If the fault that can be automatically repaired is an abnormality occurring during the firmware update process of the expansion card, then determining the automatic fault repair strategy is to use the backup firmware to restore the operation of the expansion card and restore the settings of the expansion card from the non-volatile memory when the configuration is lost; When a fault is detected that requires configuration and repair, the fault repair strategy is determined to be the fault repair strategy through the repair interface. The strategies include: If the fault to be repaired is that the inserted hard disk is incompatible, then determining the fault repair strategy is to output a prompt message indicating that the inserted hard disk is incompatible to the user through a human-machine interface infrastructure; wherein the human-machine interface infrastructure is part of the unified extensible firmware interface specification; If the fault to be repaired is an abnormal state of an independent redundant disk array, the fault repair strategy is to guide the user to check the current state through the human-machine interface infrastructure and output operation prompts so that the user can manually reconstruct or replace the hard disk according to the operation prompts; When the fault type is detected as an unrepairable fault type, determining the fault repair strategy to send a message to the user indicating that the fault type is an unrepairable fault type and prompting the user to replace the expansion card includes: The fault repair strategy is determined to be sending a message to the user through the human-machine interface infrastructure, indicating that the fault category is an unrepairable fault category, and prompting the user to replace the expansion card.
7. The expansion card fault handling method according to any one of claims 3 to 6, characterized in that: Before loading the expansion card driver to perform fault detection on the expansion card, the method further includes: Obtaining an inspection mode set in the expansion card; wherein the inspection mode set in the expansion card is obtained by issuing an inspection mode by a custom command of the communication protocol; the inspection mode includes at least a first inspection mode and a second inspection mode, and the inspection period of the first inspection mode is different from the inspection period of the second inspection mode; The step of loading the expansion card driver to perform fault detection on the expansion card includes: The expansion card driver is loaded in a check mode to perform fault detection on the expansion card.
8. An expansion card fault handling device, characterized in that: include: An acquisition module, configured to acquire an expansion card driver for performing fault detection on the expansion card; wherein the expansion card driver is firmware in an optional read-only memory on the expansion card; A loading module, configured to load the expansion card driver when the UEFI BIOS is started, so as to perform fault detection on the expansion card; An acquisition and determination module is used to acquire the current fault category of the expansion card and determine the current fault repair strategy corresponding to the current fault category based on the pre-established correspondence between the fault category and the fault repair strategy; The repair module is used to repair the current fault of the expansion card according to the current fault repair strategy.
9. An electronic device, characterized in that: include: memory for storing computer programs; A processor is configured to implement the steps of the expansion card fault handling method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the expansion card failure processing method according to any one of claims 1 to 7 are implemented.