Fault detection method and apparatus for external device

By injecting error information into external devices and BIOS and obtaining logs, and determining the operating status with standard data, the problem that external device fault positioning schemes in the prior art cannot effectively locate fault points, and efficient fault detection and processing are achieved.

WO2024250776A1PCT designated stage expired Publication Date: 2024-12-12INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
PCT/CN2024/081248
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-05
Filing Date
2024-03-12
Publication Date
2024-12-12

AI Technical Summary

Technical Problem

In the prior art, external equipment fault positioning schemes cannot effectively locate the fault points, resulting in high coupling and low efficiency in the fault testing process.

Method used

By injecting error information into external devices and obtaining the BIOS log, the operating status of the external device is determined in combination with standard register data; sending register data to the BIOS and obtaining the log, and determining the operating status of the BIOS with standard logs, the decoupling of fault detection is achieved.

Benefits of technology

Accurately positioning the fault location reduces the coupling degree of the fault testing process and improves the efficiency and reliability of the fault handling process of external equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024081248_12122024_PF_FP_ABST
    Figure CN2024081248_12122024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a fault detection method and apparatus for an external device. The method comprises: when target information comprises first error information, injecting the first error information into an external device, and when the target information comprises first register data, sending the first register data to a basic input / output system (BIOS), wherein the first register data is register data generated by a register, which simulates the external device, responding to second error information; acquiring a first log and / or a second log reported by the BIOS, wherein the second register data is register data generated by the register responding to the first error information; and according to the first log and standard register data corresponding to the first error information, determining a running state of the external device, and / or determining a running state of the BIOS according to the second log and a standard log corresponding to the first register data, wherein the running state is a fault state or a normal state.
Need to check novelty before this filing date? Find Prior Art

Description

External device fault detection method and device

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on June 5, 2023, with application number 202310657313.3 and application name “Fault Detection Method and Device for External Equipment”, all contents of which are incorporated by reference into this application. Technical Field

[0003] The embodiments of the present application relate to the field of computers, and specifically, to a method and apparatus for detecting a fault of an external device, a computer non-volatile readable storage medium, a processor, and a server fault detection system. Background Art

[0004] In recent years, PCIe (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) devices have been widely used in the server field due to their high-speed serial point-to-point dual-channel high-bandwidth transmission, support for active power management, error reporting, end-to-end reliable transmission, hot plugging, and Quality of Service (QoS) features. To address the various correctable and uncorrectable errors that may occur during PCIe device operation, the PCIe protocol specifies a series of error reporting and recovery mechanisms, including IIO (Integrated I / O module), AER (PCIe advanced error reporting), and edpc (downstream port containment). These comprehensive mechanisms enable BIOS solutions such as UEFI (Unified Extensible Firmware Interface) and Coreboot (an open-source firmware project) to implement a variety of PCIe fault handling processes based on the values ​​stored in corresponding registers. These include, but are not limited to, PCIe correctable error thresholds, uncorrectable error handling media such as the OS (Operating System) kernel or BIOS (Basic Input and Output System), and PCIe error reporting mechanisms, such as logging in the System Event Log (SEL) on the BMC (Baseboard Management Controller) or the elog (electronic logbook) on the OS kernel.

[0005] To implement and verify these complex PCIe fault handling processes, the industry's primary approach currently uses tools like XDP (eXpress Data Path) or einj to simulate error injection, observe whether the values ​​in the aforementioned registers respond correctly, and further verify the error handling, error reporting, and error recovery processes. This implementation relies on error injection tools, making test scripts difficult to integrate into systems. Furthermore, whether the values ​​in the aforementioned registers respond correctly after error injection (or when a real error occurs) often depends on the characteristics of the PCIe device itself or the CPU (Central Processing Unit). If the values ​​do not respond correctly, the fault point cannot be effectively located.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a method and apparatus for detecting a fault of an external device, a computer non-volatile readable storage medium, a processor, and a server fault detection system, so as to at least solve the problem in the related art that the fault location solution of the external device cannot effectively locate the fault point.

[0008] According to an optional embodiment of the present application, a fault detection method for an external device is provided, where the external device is communicatively connected to a BIOS, and the method includes: S1, executing a preset operation according to target information, wherein, when the target information includes first error information, executing a preset operation of injecting the first error information into the external device, and when the target information includes first register data, executing a preset operation of sending the first register data to the BIOS, where the first register data is register data generated by simulating a register of the external device in response to second error information; S2, obtaining a first log reported by the BIOS, and / or a second log, where the first log is a log obtained by the BIOS parsing the second register data, the second register data is register data generated by the register in response to the first error information, and the second log is a log obtained by the BIOS parsing the first register data; S3, determining the operating status of the external device according to the first log and the standard register data corresponding to the first error information, and / or determining the operating status of the BIOS according to the second log and the standard log corresponding to the first register data, where the operating status is a fault state or a normal state.

[0009] In some exemplary embodiments, before S1, the method also includes: when the BIOS is started, obtaining the flag information of the BIOS, the flag information being information representing the operating environment of the BIOS; when the flag information is a target flag, determining that the operating environment of the BIOS is a development environment; when the flag information is not a target flag, determining that the operating environment of the BIOS is a non-development environment.

[0010] In some exemplary embodiments, S1 includes: executing a preset operation according to target information when the operating environment of the BIOS is a development environment.

[0011] In some exemplary embodiments, when the operating environment of the BIOS is a non-development environment, the method further includes: continuously simulating and generating third error information of the external device using an error injection tool; after the cumulative number of third error information reaches a preset threshold value defined by the error suppression function of the BIOS, determining whether there is a new error log in the BMC log; if there is a new error log in the BMC log, determining that the external device has failed the test; if there is no new error log in the BMC log, determining that the external device has passed the test.

[0012] In some exemplary embodiments, S1 includes at least one of the following: calling a first test case including first error information and standard register data from a first test case library, and performing a preset operation of injecting the first error information into an external device based on the first test case, the first test case library including multiple first test cases, and different first test cases correspond to different first error information; calling a second test case including first register data and a standard log from a second test case library, and performing a preset operation of sending second register data to the BIOS based on the second test case, the second test case library including multiple second test cases, and different second test cases correspond to different first register data.

[0013] In some exemplary embodiments, before S3, the method further includes: calling a first test case to obtain standard register data corresponding to the first error information, and / or calling a second test case to obtain a standard log corresponding to the first register data.

[0014] In some exemplary embodiments, after S3, the method further includes: S4, calling a new first test case from the first test case library, and / or, calling a new second test case from the second test case library; a loop step, looping S4, S1, S2 and S3 a predetermined number of times until all first test cases are called from the first test case library, and / or, all second test cases are called from the second test case library.

[0015] In some exemplary embodiments, after the loop step, the method also includes at least one of the following: generating a first test report based on the operating status of the external device and the corresponding standard register data, and sending the first test report to the display terminal so that the display terminal displays the first test report; generating a second test report based on the operating status of the BIOS and the corresponding first register data, and sending the second test report to the display terminal so that the display terminal displays the second test report.

[0016] In some exemplary embodiments, the first test case further includes a method of injecting first error information.

[0017] In some exemplary embodiments, executing a preset operation of injecting the first error information into the external device includes: remotely logging into the operating system of the external device; and controlling the error injection tool to inject the first error information into the port of the external device when remotely logging into the operating system of the external device.

[0018] In some exemplary embodiments, executing a preset operation of sending the second register data to the BIOS includes: remotely logging into the BIOS; generating an interrupt instruction carrying the second register data when remotely logging into the BIOS; sending the interrupt instruction to the BIOS, so that the BIOS responds to the interrupt instruction, processes fault information of the external device, and generates a second log.

[0019] In some exemplary embodiments, remotely logging into the BIOS includes: logging into the BIOS through an SSH (Struts, Spring, Hibernate or SpringMVC, Spring, Hibernate) channel.

[0020] In some exemplary embodiments, the operating status of the external device is determined based on the first log and the standard register data corresponding to the first error information, including: extracting the second register data from the first log; when the second register data is different from the standard register data, determining that the operating status of the external device is a fault state; when the second register data is the same as the standard register data, determining that the operating status of the external device is a normal state.

[0021] In some exemplary embodiments, the operating status of the BIOS is determined based on the second log and the standard log corresponding to the first register data, including: when the second log is different from the standard log, determining that the operating status of the BIOS is a fault state; when the second log is the same as the standard log, determining that the operating status of the BIOS is a normal state.

[0022] In some exemplary embodiments, the operating status of the BIOS is determined based on the second log and the standard log corresponding to the first register data, including: extracting the actual location information of the faulty external device and the actual register data corresponding to the external device where the error occurs from the second log; extracting the standard error location information from the standard log; when the actual location information is different from the standard error location information, or the actual register data is different from the first register data, determining that the operating status of the BIOS is a fault state; when the actual location information is the same as the standard error location information, and the actual register data is the same as the first register data, determining that the operating status of the BIOS is a normal state.

[0023] In some exemplary embodiments, the external device includes a PCIe device.

[0024] According to another optional embodiment of the present application, a fault detection device for an external device is provided, wherein the external device is communicatively connected to a BIOS, and the device includes: an execution unit, configured to execute a preset operation according to target information, wherein, when the target information includes first error information, the preset operation of injecting the first error information into the external device is executed; when the target information includes first register data, the preset operation of sending the first register data to the BIOS is executed, wherein the first register data is register data generated by simulating a register of the external device in response to second error information; a first acquisition unit, configured to acquire a first log reported by the BIOS, and / or a second log, wherein the first log is a log obtained by the BIOS parsing the second register data, the second register data is register data generated by the register in response to the first error information, and the second log is a log obtained by the BIOS parsing the first register data; a first determination unit, configured to determine an operating status of the external device according to the first log and the standard register data corresponding to the first error information, and / or determine an operating status of the BIOS according to the second log and the standard log corresponding to the first register data, wherein the operating status is a fault state or a normal state.

[0025] According to another optional embodiment of the present application, a computer non-volatile readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the method embodiments when run.

[0026] According to yet another optional embodiment of the present application, a processor is further provided, wherein the processor is configured to run a program, wherein the steps of any one of the methods are executed when the program is run.

[0027] According to another optional embodiment of the present application, a server fault detection system is also provided, including: a PCIe device; a BIOS, which is in communication with the PCIe device, and the BIOS is configured to process fault information of the PCIe device and generate a log; a test device, including a memory and a processor, the memory storing a computer program, and the processor being configured to run the computer program to execute the steps of any method embodiment to detect the operating status of the PCIe device and / or the BIOS.

[0028] In some exemplary embodiments, the server further includes a BMC in communication with the BIOS, the BIOS is further configured to send a log to the BMC, and the BMC is configured to generate a BMC log based on the log.

[0029] Through the present application, the fault detection of external devices and BIOS is decoupled, that is, in the process of detecting external devices, if it is necessary to detect whether the external device has a fault, it is only necessary to inject the first error information into the external device, obtain the first log reported by the BIOS, and determine it based on the first log and the standard register data. If it is necessary to detect whether the BIOS has a fault, it is only necessary to send the first register data to the BIOS, obtain the second log reported by the BIOS, and determine it based on the second log and the standard log. This achieves the effect of accurately locating whether the error location is the BIOS or the external device itself, effectively solving the problem in the prior art that the fault location solution of the external device cannot effectively locate the fault point, reducing the coupling between faults in the fault testing process, and improving the efficiency and reliability of the external device fault handling process. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] FIG1 shows a hardware structure block diagram of a mobile terminal according to a method for detecting a fault of an external device provided in an embodiment of the present application;

[0031] FIG2 is a flow chart of a method for detecting a fault of an external device according to an embodiment of the present application;

[0032] FIG3 is a flow chart of a method for detecting a fault of an external device according to an embodiment of the present application;

[0033] FIG4 is a flowchart of another method for detecting a fault of an external device according to an embodiment of the present application;

[0034] FIG5 is a flowchart of another method for detecting a fault of an external device according to an embodiment of the present application;

[0035] FIG6 is a structural block diagram of a fault detection apparatus for an external device according to an embodiment of the present application.

[0036] The above drawings include the following reference numerals:

[0037] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. DETAILED DESCRIPTION

[0038] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0039] It should be noted that the terms "first", "second", etc. in the description, claims and drawings of this application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0040] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, FIG1 is a hardware structure block diagram of a mobile terminal of a method for fault detection of an external device in an embodiment of the present application. As shown in FIG1 , the mobile terminal may include one or more (only one is shown in FIG1 ) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU (Microcontroller Unit) or a programmable logic device FPGA (Field-Programmable Gate Array)) and a memory 104 configured to store data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 configured for a communication function. It will be understood by those skilled in the art that the structure shown in FIG1 is only for illustration and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than those shown in FIG1 , or have a configuration different from that shown in FIG1 .

[0041] The memory 104 can be configured to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the fault detection method of the external device in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the implementation method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may include a memory remotely located relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0042] The transmission device 106 is configured to receive or transmit data via a network. A specific example of a network may include a wireless network provided by the mobile terminal's telecommunications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may be a radio frequency (RF) module configured to communicate with the Internet wirelessly.

[0043] In an embodiment of the present application, a method for detecting a fault of an external device running on a mobile terminal is provided. The external device is in communication with the BIOS. FIG2 is a flow chart of the method for detecting a fault of an external device according to an embodiment of the present application. As shown in FIG2 , the flow includes the following steps:

[0044] Step S1, performing a preset operation based on target information, wherein, if the target information includes first error information, performing a preset operation of injecting the first error information into the external device, and if the target information includes first register data, performing a preset operation of sending the first register data to the BIOS, where the first register data is register data generated by simulating a register of the external device in response to second error information;

[0045] Optionally, the target information may include only the first error information, or only the first register data, or the first error information and the first register data. The first error information and the second error information are error data that do not conform to the code operation logic. The first error information and the second error information can be obtained from a case database formed by extracting and summarizing historical failure cases, or theoretically inferred from error data that may have errors. Under normal circumstances, when an external device fails, the register of the external device will respond to the error information and generate register data reflecting the error information. The first register data of the present application is the data obtained by simulating the register data generated when the register responds normally to the second error information. Similarly, the first register data can also be obtained from a case database formed by extracting and summarizing historical failure cases, or theoretically inferred from the register data corresponding to the error data that may have errors.

[0046] Step S2: Obtain a first log and / or a second log reported by the BIOS, where the first log is a log obtained by the BIOS parsing the second register data, the second register data is register data generated by the register in response to the first error information, and the second log is a log obtained by the BIOS parsing the first register data;

[0047] Optionally, when executing a preset operation of injecting a first error message into an external device, a first log reported by the BIOS is obtained; when executing a preset operation of sending first register data to the BIOS, a second log reported by the BIOS is obtained. The second register data is real register data generated by the register in response to the first error message. The BIOS transmits data and executes instructions through registers. The BIOS parses the corresponding register data to obtain information about the external device where the error occurred and information about the source of the error. A log is generated for the register data, the information about the external device where the error occurred, and the information about the source of the error and reported to the BMC or OS. The error source information includes the error type of the external device, such as types including repairable errors and unrepairable errors, and the information about the external device where the error occurred specifically includes information about the location of the external device where the error occurred.

[0048] Step S3, determining the operating status of the external device based on the first log and the standard register data corresponding to the first error information, and / or determining the operating status of the BIOS based on the second log and the standard log corresponding to the first register data, the operating status being a fault state or a normal state.

[0049] Optionally, the standard register data is register data generated in response to the first error information when the register is normal. The standard log is a log obtained by parsing the first register data according to the error handling process when the BIOS is in a normal state. In a specific application, the log information of the first log and the second log can be viewed by calling a log viewing tool.

[0050] Through the steps, firstly, a first error message is injected into the external device, and / or, first register data generated by the simulated register in response to the second error message is sent to the BIOS; then, a first log obtained by the BIOS parsing the second register data is obtained, where the second register data is data generated by the register in response to the first error message, and / or, a second log obtained by the BIOS parsing the first register data is obtained; finally, based on the first log and the standard register data, whether the external device is in a normal operating state is determined, and / or, based on the second log and the standard log, whether the BIOS is in a normal operating state is determined, thereby realizing the decoupling of fault detection of the external device and the BIOS, that is, in the process of detecting the external device, In the present invention, if it is necessary to detect whether an external device has failed, it is only necessary to inject a first error message into the external device, obtain a first log reported by the BIOS, and determine it based on the first log and the standard register data. If it is necessary to detect whether a BIOS has failed, it is only necessary to send a first register data to the BIOS, obtain a second log reported by the BIOS, and determine it based on the second log and the standard log. This achieves the effect of accurately locating whether the error location is the BIOS or the external device itself, effectively solving the problem in the prior art that the fault location solution of the external device cannot effectively locate the fault point, reducing the coupling between faults in the fault testing process, and improving the efficiency and reliability of the external device fault handling process.

[0051] It should be noted that the operating status of the external device is the operating status of the register of the external device, specifically whether the register can normally respond to the error information of the external device.

[0052] The application's determination of the register's operating status does not depend on whether the error-injection tool version matches, whether the BIOS configuration before the error-injection was correct, or whether the error-injection operation was correct. Similarly, the application's determination of the BIOS's operating status does not depend on the register's operating status, achieving decoupling of the external device fault handling process. This eliminates uncertainty in the entire process, enables accurate location of the fault, and achieves superior detection results.

[0053] Optionally, a register data structure may be created in an NVRAM (Non-Volatile Random Access Memory) area of ​​the BIOS, and each value in the first register data structure may be set according to actual historical failure cases to obtain first register data.

[0054] The execution subject of the steps may be a terminal, etc., but is not limited thereto.

[0055] In some exemplary embodiments, before S1, the method further includes: obtaining BIOS flag information when the BIOS is started, where the flag information is information indicating the operating environment of the BIOS; if the flag information is a target flag, determining that the operating environment of the BIOS is a development environment; if the flag information is not a target flag, determining that the operating environment of the BIOS is a non-development environment. Before performing external device fault detection, the operating environment of the BIOS is first determined, and then the fault detection solution is executed based on the operating environment.

[0056] On this basis, S1 includes: when the BIOS operating environment is a development environment, executing a preset operation according to the target information. In other words, this application is a solution for fault detection of external devices in a development environment.

[0057] Optionally, the target flag bit can be any flag information. The BIOS is configured to initialize external devices, including detecting whether the external devices are functioning properly, and configuring and initializing the external devices. After initializing the external devices, the BIOS performs a self-test, including detecting system information, checking hardware devices, and executing booting of the operating system.

[0058] According to some other embodiments, when the operating environment of the BIOS is a non-development environment, the method further includes: using an error injection tool to continuously simulate and generate third error information of the external device; after the cumulative number of third error information reaches a preset threshold value defined by the error suppression function of the BIOS, determining whether there is a new error log in the BMC log; if there is a new error log in the BMC log, determining that the external device has failed the test; if there is no new error log in the BMC log, determining that the external device has passed the test. In a non-development environment, the preset threshold value of the error suppression function item of the external device is parsed from the BIOS configuration file, the preset threshold value being the trigger value of the error suppression function of the BIOS. When the cumulative number of third error information of the external device reaches the trigger value, the BIOS no longer reports the third error information of the external device to the BMC.

[0059] Optionally, the third error message is a correctable error message of an external device. The keyword search function can be used to locate the preset threshold from the BIOS configuration file, and then a counter is used to record the number of all third error messages of the external device currently being simulated. When the number reaches the preset threshold, the log viewing tool is called. The log viewing tool collects the BMC log and filters out new error logs from the BMC log. New error logs refer to error logs generated by the BMC after the number of all third error messages of the external device reaches the preset threshold. Since the preset threshold is the trigger value of the error suppression function of the external device, the expected effect should be that the error suppression function of the BIOS has taken effect and there are no new error logs in the BMC log. Therefore, if the log viewing tool does not filter out the new error logs from the BMC log, it means that the error suppression function of the BIOS has taken effect. Otherwise, it means that the error suppression function of the BIOS has not taken effect and needs to be reset.

[0060] In some exemplary embodiments, S1 includes at least one of the following:

[0061] Step S1011: calling a first test case including first error information and standard register data from a first test case library, and executing a preset operation of injecting the first error information into an external device according to the first test case, wherein the first test case library includes a plurality of first test cases, and different first test cases correspond to different first error information;

[0062] Optionally, in the first test case library, different first test cases correspond to testing different types of errors in the external device. Different first error messages correspond to different standard register data. In addition to the first error message and standard register data, those skilled in the art can add information required for the external device fault detection process to the first test case as needed. For example, the first test case may also include a method for injecting the first error message. For another example, the first test case may also include information such as the version information of the error injection tool.

[0063] Step S1012: Call the second test case including the first register data and the standard log from the second test case library, and according to the second test case, execute the preset operation of sending the second register data to the BIOS. The second test case library includes multiple second test cases, and different second test cases correspond to different first register data.

[0064] Optionally, in the second test case library, different second test cases correspond to testing different types of BIOS errors, and the first register data is different, and the corresponding standard logs are also different.

[0065] In an optional embodiment, the first error information required for testing the operating status of the external device and the corresponding standard register data are stored in the first test case library in the form of test cases. When testing is required, only the corresponding first test case needs to be called. Similarly, the first register data required for testing the operating status of the BIOS and the corresponding standard log are stored in the second test case library in the form of test cases. When testing is required, only the corresponding second test case needs to be called. This further simplifies the testing process and improves the testing efficiency of external device fault testing.

[0066] In an embodiment of the present application, before S3, the method further includes: calling a first test case to obtain standard register data corresponding to the first error information, and / or calling a second test case to obtain a standard log corresponding to the first register data.

[0067] In another optional solution, after S3, the method further includes: S4, calling a new first test case from the first test case library and / or calling a new second test case from the second test case library; and a loop step, looping S4, S1, S2, and S3 a predetermined number of times until all first test cases from the first test case library and / or all second test cases from the second test case library have been called. Through the loop step, different types of error handling processes of external devices are sequentially tested, thereby achieving complete fault detection of external devices and effectively screening external devices with error handling processes, and / or different types of error handling processes of the BIOS are sequentially tested, thereby achieving complete fault detection of the BIOS and effectively screening BIOS with error handling processes.

[0068] In order to further facilitate relevant personnel to know and view the test results, according to some exemplary embodiments of the present application, after the loop step, the method further includes at least one of the following: generating a first test report based on the operating status of the external device and the corresponding standard register data, and sending the first test report to the display terminal so that the display terminal displays the first test report; generating a second test report based on the operating status of the BIOS and the corresponding first register data, and sending the second test report to the display terminal so that the display terminal displays the second test report. This embodiment generates a corresponding test report based on the fault detection result and sends it to the display terminal for display, which makes it convenient for relevant personnel to know the test results and at the same time facilitates relevant personnel to promptly handle the faulty external device or BIOS based on the test results.

[0069] In some exemplary embodiments, executing a preset operation of injecting the first error message into the external device includes: remotely logging into the operating system of the external device; and, while remotely logged into the operating system of the external device, controlling an error injection tool to inject the first error message into a port of the external device. Remotely logging into the operating system of the external device enables communication with the external device, and then injecting the first error message into the port of the external device using the error injection tool, thereby ensuring that error injection of the external device can be performed relatively simply and quickly.

[0070] In actual use, the error injection tool is typically connected to the port using an error injection card. Remotely logging into the operating system of an external device can be achieved through an SSH channel. SSH communication with an external device is achieved through an SSH channel. The SSH protocol offers excellent reliability and security, ensuring secure remote communication. Furthermore, the SSH protocol is highly adaptable and can be run on nearly any platform.

[0071] Of course, in addition to the SSH communication method, the terminal of the fault detection method running in the present application can also establish a communication relationship with the external device through other communication methods, such as Telnet protocol (Telecommunication Network, remote terminal protocol) and VNC (Virtual Network Computing, virtual network computing) protocol.

[0072] To further achieve a simple and quick way to obtain the second log, thereby facilitating subsequent fault detection of the BIOS, according to some optional embodiments of the present application, a preset operation of sending the second register data to the BIOS is performed, including: remotely logging into the BIOS; while remotely logging into the BIOS, generating an interrupt instruction carrying the second register data; and sending the interrupt instruction to the BIOS, so that the BIOS responds to the interrupt instruction, processes fault information of the external device, and generates the second log. By remotely logging into the BIOS, communication with the BIOS is achieved, and then the interrupt instruction carrying the second register data is sent to the BIOS, further ensuring that fault detection of the BIOS can be performed relatively simply and quickly.

[0073] In some exemplary embodiments, remotely logging into the BIOS includes logging into the BIOS through an SSH channel. The SSH channel is used for remote communication with the BIOS. The SSH protocol has good reliability and security, ensuring secure remote communication. Furthermore, the SSH protocol is highly applicable and can be run on nearly any platform.

[0074] Optionally, in S3, the specific process of determining the operating status of the external device based on the first log and the standard register data corresponding to the first error message may be: extracting the second register data from the first log; if the second register data is different from the standard register data, determining that the operating status of the external device is a faulty state; if the second register data is the same as the standard register data, determining that the operating status of the external device is a normal state. In this embodiment, the second register data is obtained from a log obtained by the BIOS based on the second register data generated in response to the first error message, and the second register data is compared with the standard register data corresponding to the first error message. If the two are the same, it indicates that the register is normal, that is, the external device itself is in a normal state; otherwise, it indicates that the external device is in a faulty state.

[0075] Optionally, the second register data is actual register data generated by the register in response to the first error information. In addition to the error source information, register data, and information about the external device where the error occurred, the first log and the second log also include information such as the hardware slot number and the number of reported logs.

[0076] In an optional embodiment, in S3, determining the BIOS operating status based on the second log and the standard log corresponding to the first register data includes: if the second log differs from the standard log, determining that the BIOS operating status is a faulty state; if the second log and the standard log are the same, determining that the BIOS operating status is a normal state. In this embodiment, directly comparing the second log with the standard log to determine whether the BIOS is in a faulty state can further ensure high accuracy in BIOS fault diagnosis.

[0077] In addition to the method, in order to further simplify the fault detection process and further improve the efficiency of fault detection and processing, in some exemplary embodiments, the operating status of the BIOS is determined based on the second log and the standard log corresponding to the first register data, including: extracting the actual location information of the faulty external device and the actual register data corresponding to the external device where the error occurred from the second log; extracting the standard error location information from the standard log; if the actual location information is different from the standard error location information, or the actual register data is different from the first register data, determining that the operating status of the BIOS is a fault state; if the actual location information is the same as the standard error location information, and the actual register data is the same as the first register data, determining that the operating status of the BIOS is a normal state. This embodiment only compares whether the register data and error location information in the second log and the standard log are the same, and the comparison information is relatively small, thereby further ensuring that the comparison process can be completed relatively quickly.

[0078] Optionally, the error location information may specifically be an address of an external device. The actual register data is the register data recorded in a log reported by the BIOS.

[0079] In addition, the first log and the second log of the BIOS will be sent to the BMC or the OS. S2 can be specifically implemented in the following manner: obtaining the first log and / or the second log sent by the BIOS to the BMC by sending a redfish (a RESTful-based protocol, a standard for managing and monitoring hardware devices) command; logging into the OS through the SSH channel and entering the dmesg command (a program for displaying the latest information in the kernel ring buffer) to obtain the first log and / or the second log in the OS.

[0080] In this application, the external device may include any hardware device, such as a CPU, memory, hard disk, keyboard, and PCIe device. In an optional embodiment, the external device includes a PCIe device. In an optional embodiment, the external device is a PCIe device.

[0081] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a non-volatile readable storage medium (such as ROM (Read-Only Memory, Read-Only Memory) / RAM (Random Access Memory, Random Access Memory), a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0082] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the method for determining the water storage coefficient of the present application will be described in detail below with reference to specific embodiments.

[0083] This embodiment relates to a method for detecting a fault in an external device, wherein the external device is a PCIe. The method is applied to a test machine and includes the following two steps:

[0084] Part 1: As shown in Figure 3, check whether the PCIe device itself responds correctly, that is, check whether the register responds correctly:

[0085] S11: During the BIOS startup process of the tested machine, determine whether it is in the development environment according to the flag bit. If it is in the development environment, execute the following process; if not, detect PCIe faults according to the original detection process;

[0086] S12: The test script is run on the test machine, and one of the first test cases is called. According to the first test case, the test machine uses a fault injection tool to perform a specific fault injection on the PCIe device on the BIOS of the machine under test through a specific communication method (including but not limited to SSH communication);

[0087] S13: The register fault handling function of the PCIe device recognizes the injected first error information and generates second register data. The BIOS performs an error handling process according to the second register data, generates a first log, and reports it to the BMC or OS.

[0088] S14: The tester obtains the first log, extracts the second register data from the first log, reads the standard register data corresponding to the first error information from the first test case, compares the second register data with the standard register data, and confirms the test results. If the test results are the same, it is determined that the register is normal; otherwise, it is determined that the register is faulty.

[0089] S15: The test machine issues a test instruction for the next first test case, and summarizes the test results after all tests are completed.

[0090] Part 2: As shown in Figure 4, check whether the BIOS response is correct:

[0091] S16: During the BIOS startup process of the tested machine, determine whether it is in the development environment according to the flag bit. If it is in the development environment, execute the following process; if not, detect PCIe faults according to the original detection process;

[0092] S17: Running the test script on the test machine and calling one of the second test cases. Based on the second test case, the test machine sends an interrupt to the BIOS of the machine under test via a specific communication method (including but not limited to SSH communication). The interrupt carries the first register data, and the BIOS of the machine under test enters an error handling routine.

[0093] S18: The BIOS of the tested machine processes the PCIe device fault according to the assumed first register data, generates a second log, and reports it to the OS or BMC;

[0094] S19: The tester obtains the second log, extracts the location information of the faulty PCIe device and the actual register data from the second log, extracts the standard error location and the first register data from the second test case, compares the first register data with the actual register data, and compares the location information of the faulty PCIe device with the standard error location, and confirms the test results. If the test results are the same, the BIOS is determined to be normal; otherwise, the BIOS is determined to be faulty.

[0095] S20: The test machine issues a test instruction for the next second test case, and summarizes the test results after all tests are completed.

[0096] In addition, in a non-development environment, the process of detecting PCIe faults according to the original detection process is shown in Figure 5. The details are as follows:

[0097] S21: Use the error injection tool to continuously simulate and generate correctable errors, i.e., the third error information;

[0098] S22: After comparing the number of correctable errors (stored in one register) with the threshold (stored in another register), the BMC log is checked to determine whether the function passes the test.

[0099] S23: If there is a new error log in the BMC log, it is determined that the external device has failed the test; if there is no new error log in the BMC log, it is determined that the external device has passed the test.

[0100] In this embodiment, a fault detection device for an external device is also provided. The external device is communicatively connected to the BIOS. The device is configured to implement the embodiments and optional implementations, and the details already described are not repeated here. As used below, the term "module" can refer to software that implements a predetermined function, and / or a combination of hardware. Although the devices described in the following embodiments are preferably implemented in software, implementation using hardware, or a combination of software and hardware, is also possible and contemplated.

[0101] FIG6 is a structural block diagram of a fault detection device for an external device according to an embodiment of the present application. As shown in FIG6 , the device includes:

[0102] The execution unit 10 is configured to execute a preset operation based on the target information, wherein, if the target information includes first error information, the preset operation of injecting the first error information into the external device is executed; and if the target information includes first register data, the preset operation of sending the first register data to the BIOS is executed, where the first register data is register data generated by simulating a register of the external device in response to the second error information;

[0103] Optionally, the target information may include only the first error information, or only the first register data, or the first error information and the first register data. The first error information and the second error information are error data that do not conform to the code operation logic. The first error information and the second error information can be obtained from a case database formed by extracting and summarizing historical failure cases, or theoretically inferred from error data that may have errors. Under normal circumstances, when an external device fails, the register of the external device will respond to the error information and generate register data reflecting the error information. The first register data of the present application is the data obtained by simulating the register data generated when the register responds normally to the second error information. Similarly, the first register data can also be obtained from a case database formed by extracting and summarizing historical failure cases, or theoretically inferred from the register data corresponding to the error data that may have errors.

[0104] The first acquiring unit 20 is configured to acquire a first log reported by the BIOS and / or a second log, where the first log is a log obtained by the BIOS parsing the second register data, the second register data is register data generated by the register in response to the first error information, and the second log is a log obtained by the BIOS parsing the first register data;

[0105] Optionally, when executing a preset operation of injecting first error information into an external device, a first log reported by the BIOS is obtained; when executing a preset operation of sending first register data to the BIOS, a second log reported by the BIOS is obtained. The second register data is real register data generated by the register in response to the first error information. The BIOS transmits data and executes instructions through registers. The BIOS parses the corresponding register data to obtain information about the external device where the error occurred and information about the source of the error. A log is generated for the register data, the information about the external device where the error occurred, and the information about the source of the error and reported to the BMC or OS, wherein the error source information includes the error type of the external device, such as types including repairable errors and unrepairable errors, and the information about the external device where the error occurred includes information about the location of the external device where the error occurred.

[0106] The first determination unit 30 is configured to determine the operating status of the external device based on the first log and the standard register data corresponding to the first error information, and / or determine the operating status of the BIOS based on the second log and the standard log corresponding to the first register data, and the operating status is a fault state or a normal state.

[0107] Optionally, the standard register data is register data generated in response to the first error information when the register is normal. The standard log is a log obtained by parsing the first register data according to the error handling process when the BIOS is in a normal state. In a specific application, the log information of the first log and the second log can be viewed by calling a log viewing tool.

[0108] Through the scheme, the execution unit injects the first error information into the external device, and / or sends the first register data generated by the simulated register in response to the second error information to the BIOS; the first acquisition unit acquires the first log obtained by the BIOS parsing the second register data, the second register data being the data generated by the register in response to the first error information, and / or the second log obtained by the BIOS parsing the first register data is acquired; the first determination unit determines whether the external device is in a normal operating state according to the first log and the standard register data, and / or determines whether the BIOS is in a normal operating state according to the second log and the standard log, thereby realizing the decoupling of the fault detection of the external device and the BIOS, that is, when the external device is in a normal operating state, the fault detection of the external device is performed. During the detection process, if it is necessary to detect whether an external device has failed, it is only necessary to inject the first error information into the external device, obtain the first log reported by the BIOS, and determine it based on the first log and the standard register data. If it is necessary to detect whether the BIOS has failed, it is only necessary to send the first register data to the BIOS, obtain the second log reported by the BIOS, and determine it based on the second log and the standard log. This achieves the effect of accurately locating whether the error location is the BIOS or the external device itself, effectively solving the problem in the prior art that the fault location solution of the external device cannot effectively locate the fault point, reduces the coupling between faults in the fault testing process, and improves the efficiency and reliability of the external device fault handling process.

[0109] It should be noted that the operating status of the external device is the operating status of the register of the external device, specifically whether the register can normally respond to the error information of the external device.

[0110] The application's determination of the register's operating status does not depend on whether the error-injection tool version matches, whether the BIOS configuration before the error-injection was correct, or whether the error-injection operation was correct. Similarly, the application's determination of the BIOS's operating status does not depend on the register's operating status, achieving decoupling of the external device fault handling process. This eliminates uncertainty in the entire process, enables accurate location of the fault, and achieves superior detection results.

[0111] Optionally, a register data structure may be created and stored in an NVRAM area of ​​the BIOS, and each value in the first register data structure may be set according to an actual historical failure case to obtain first register data.

[0112] The execution subject of the device may be a terminal, etc., but is not limited thereto.

[0113] In some exemplary embodiments, the apparatus further includes: a second acquiring unit configured to, before S1, when the BIOS is started, acquire flag information of the BIOS, the flag information being information indicating the operating environment of the BIOS; a second determining unit configured to, if the flag information is a target flag, determine that the operating environment of the BIOS is a development environment; and a third determining unit configured to, if the flag information is not a target flag, determine that the operating environment of the BIOS is a non-development environment. Before performing fault detection on the external device, the operating environment of the BIOS is first determined, and then the fault detection solution is executed based on the operating environment.

[0114] On this basis, the execution unit includes: an execution module, which is configured to execute preset operations according to target information when the BIOS operating environment is a development environment. In other words, this application is a solution for fault detection of external devices in a development environment.

[0115] Optionally, the target flag bit can be any flag information. The BIOS is configured to initialize external devices, specifically including detecting whether the external devices are functioning properly, and configuring and initializing the external devices. After initializing the external devices, the BIOS performs a self-test, including detecting system information, checking hardware devices, and executing booting of the operating system.

[0116] According to some other embodiments, the device further includes: a first generating unit configured to continuously simulate and generate the third error information of the external device using an error injection tool when the operating environment of the BIOS is a non-development environment; a fourth determining unit configured to determine whether there is a new error log in the BMC log after the cumulative number of the third error information reaches a preset threshold value defined by the error suppression function of the BIOS; a fifth determining unit configured to determine that the external device has failed the test when there is a new error log in the BMC log; and a sixth determining unit configured to determine that the external device has passed the test when there is no new error log in the BMC log. In a non-development environment, the preset threshold value of the error suppression function item of the external device is parsed from the BIOS configuration file. The preset threshold value is the trigger value of the error suppression function of the BIOS. When the cumulative number of the third error information of the external device reaches the trigger value, the BIOS no longer reports the third error information of the external device to the BMC.

[0117] Optionally, the third error message is a correctable error message of an external device. The keyword search function can be used to locate the preset threshold from the BIOS configuration file, and then a counter is used to record the number of all third error messages of the external device currently being simulated. When the number reaches the preset threshold, the log viewing tool is called. The log viewing tool collects the BMC log and filters out new error logs from the BMC log. New error logs refer to error logs generated by the BMC after the number of all third error messages of the external device reaches the preset threshold. Since the preset threshold is the trigger value of the error suppression function of the external device, the expected effect should be that the error suppression function of the BIOS has taken effect and there are no new error logs in the BMC log. Therefore, if the log viewing tool does not filter out the new error logs from the BMC log, it means that the error suppression function of the BIOS has taken effect. Otherwise, it means that the error suppression function of the BIOS has not taken effect and needs to be reset.

[0118] In some exemplary embodiments, the execution unit includes at least one of the following:

[0119] a first calling module configured to call a first test case including first error information and standard register data from a first test case library, and execute a preset operation of injecting the first error information into an external device according to the first test case, wherein the first test case library includes a plurality of first test cases, and different first test cases correspond to different first error information;

[0120] Optionally, in the first test case library, different first test cases correspond to testing different types of errors in the external device. Different first error messages correspond to different standard register data. In addition to the first error message and standard register data, those skilled in the art can add information required for the external device fault detection process to the first test case as needed. For example, the first test case may also include a method for injecting the first error message. For another example, the first test case may also include information such as the version information of the error injection tool.

[0121] The second calling module is configured to call a second test case including first register data and a standard log from a second test case library, and according to the second test case, execute a preset operation of sending the second register data to the BIOS. The second test case library includes multiple second test cases, and different second test cases correspond to different first register data.

[0122] Optionally, in the second test case library, different second test cases correspond to testing different types of BIOS errors, and the first register data is different, and the corresponding standard logs are also different.

[0123] In an embodiment of the present application, the first error information required for testing the operating status of the external device and the corresponding standard register data are stored in the first test case library in the form of test cases. When testing is required, only the corresponding first test case needs to be called. Similarly, the first register data required for testing the operating status of the BIOS and the corresponding standard log are stored in the second test case library in the form of test cases. When testing is required, only the corresponding second test case needs to be called. This further simplifies the testing process and improves the testing efficiency of external device fault testing.

[0124] In an embodiment of the present application, the device also includes: a first calling unit, configured to call the first test case before S3 to obtain standard register data corresponding to the first error information; and / or, a second calling unit, configured to call the second test case to obtain a standard log corresponding to the first register data.

[0125] In another optional solution, the device further includes: a third calling unit configured to execute S4 after S3 to call a new first test case from the first test case library and / or a new second test case from the second test case library; a looping unit configured to loop through steps S4, S1, S2, and S3 for a predetermined number of times until all first test cases are called from the first test case library and / or all second test cases are called from the second test case library. Through the looping steps, different types of error handling processes of external devices are sequentially tested, thereby achieving complete fault detection of external devices, further achieving effective screening of external devices with error handling processes, and / or, different types of error handling processes of BIOS are sequentially tested, thereby achieving complete fault detection of BIOS, further achieving effective screening of BIOS with error handling processes.

[0126] In order to further facilitate relevant personnel to know and view the test results, according to some exemplary embodiments of the present application, the device also includes at least one of the following: a second generating unit, configured to generate a first test report according to the operating status of the external device and the corresponding standard register data after the loop step, and send the first test report to the display terminal so that the display terminal displays the first test report; a third generating unit, configured to generate a second test report according to the operating status of the BIOS and the corresponding first register data, and send the second test report to the display terminal so that the display terminal displays the second test report. This embodiment generates a corresponding test report based on the fault detection result and sends it to the display terminal for display, which makes it convenient for relevant personnel to know the test results and at the same time facilitates relevant personnel to promptly handle the faulty external device or BIOS according to the test results.

[0127] In some exemplary embodiments, the execution unit includes: a first login module configured to remotely log into the operating system of the external device; and a control module configured to, while remotely logging into the operating system of the external device, control the error injection tool to inject a first error message into a port of the external device. By remotely logging into the operating system of the external device to enable communication with the external device, and then injecting the first error message into the port of the external device via the error injection tool, error injection of the external device can be further simplified and facilitated.

[0128] In actual use, the error injection tool is typically connected to the port in the form of an error injection card. The first login module includes a first login submodule configured to log in to the operating system of the external device through an SSH channel. Remote communication with the external device is achieved through the SSH channel. The SSH protocol offers excellent reliability and security, ensuring secure remote communication. Furthermore, the SSH protocol is highly adaptable and can be run on nearly any platform.

[0129] Of course, in addition to the SSH communication method, the terminal of the fault detection device running in the present application can also establish a communication relationship with the external device through other communication methods, such as Telnet protocol and VNC protocol.

[0130] In order to further achieve a simple and quick acquisition of the second log, thereby further facilitating subsequent fault detection of the BIOS, according to some optional embodiments of the present application, the execution unit includes: a second login module, configured to remotely log into the BIOS; a generation module, configured to generate an interrupt instruction carrying the second register data when remotely logging into the BIOS; and a first sending module, configured to send the interrupt instruction to the BIOS, so that the BIOS responds to the interrupt instruction, processes fault information of the external device, and generates the second log. By remotely logging into the BIOS, communication with the BIOS is achieved, and then the interrupt instruction carrying the second register data is sent to the BIOS, further ensuring that fault detection of the BIOS can be relatively simple and quick.

[0131] In some exemplary embodiments, the second login module includes a second login submodule configured to log in to the BIOS via an SSH channel. Remote communication with the BIOS is performed via the SSH channel. The SSH protocol has excellent reliability and security, ensuring secure remote communication. Furthermore, the SSH protocol is highly adaptable and can be implemented on nearly any platform.

[0132] Optionally, the first determination unit may include: a first extraction module configured to extract the second register data from the first log; a first determination module configured to determine that the operating state of the external device is a faulty state if the second register data is different from the standard register data; and a second determination module configured to determine that the operating state of the external device is a normal state if the second register data is the same as the standard register data. In this embodiment, the second register data is obtained from a log obtained by the BIOS based on the second register data generated in response to the first error message, and the second register data is compared with the standard register data corresponding to the first error message. If the two are the same, it indicates that the register is normal, that is, the external device itself is in a normal state; otherwise, it indicates that the external device is in a faulty state.

[0133] Optionally, the second register data is actual register data generated by the register in response to the first error information. In addition to the error source information, register data, and information about the external device where the error occurred, the first log and the second log also include information such as the hardware slot number and the number of reported logs.

[0134] In an optional embodiment, the first determination unit includes: a third determination module configured to determine that the BIOS is in a faulty state if the second log differs from a standard log; and a fourth determination module configured to determine that the BIOS is in a normal state if the second log matches the standard log. In this embodiment, directly comparing the second log with the standard log to determine whether the BIOS is in a faulty state further ensures high accuracy in BIOS fault diagnosis.

[0135] In addition to the method, in order to further simplify the fault detection process and further improve the efficiency of fault detection and processing, in some exemplary embodiments, the first determination unit includes: a second extraction module, configured to extract the actual location information of the faulty external device and the actual register data corresponding to the external device where the error occurred from the second log; a third extraction module, configured to extract the standard error location information from the standard log; a fifth determination module, configured to determine that the BIOS operating state is a fault state when the actual location information is different from the standard error location information or the actual register data is different from the first register data; and a sixth determination module, configured to determine that the BIOS operating state is a normal state when the actual location information is the same as the standard error location information and the actual register data is the same as the first register data. This embodiment only compares the register data and error location information in the second log and the standard log to see if they are the same, and the comparison information is relatively small, thereby further ensuring that the comparison process can be completed relatively quickly.

[0136] Optionally, the error location information may specifically be an address of an external device. The actual register data is the register data recorded in a log reported by the BIOS.

[0137] In addition, the first log and the second log of the BIOS will be sent to the BMC or the OS. The first acquisition unit includes at least one of the following: a second sending module, configured to obtain the first log and / or the second log sent by the BIOS to the BMC by sending a redfish instruction; a third login module, configured to log in to the OS through an SSH channel and enter the dmesg command to obtain the first log and / or the second log in the OS.

[0138] In this application, the external device may include any hardware device, such as a CPU, memory, hard disk, keyboard, and PCIe device. In an optional embodiment, the external device includes a PCIe device. In an optional embodiment, the external device is a PCIe device.

[0139] It should be noted that each module can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: all modules are located in the same processor; or, each module is located in different processors in any combination.

[0140] An embodiment of the present application further provides a computer non-volatile readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any one of the method embodiments when running.

[0141] In some exemplary embodiments, the computer non-volatile readable storage medium may include, but is not limited to, various non-volatile readable storage media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0142] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any one of the method embodiments.

[0143] In some exemplary embodiments, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0144] An embodiment of the present application also provides a server fault detection system, which includes: a PCIe device; a BIOS, which is in communication with the PCIe device, and the BIOS is configured to process fault information of the PCIe device and generate a log; a test device, which includes a memory and a processor, and the memory stores a computer program, and the processor is configured to run the computer program to execute the steps of any method embodiment to detect the operating status of the PCIe device and / or the BIOS.

[0145] In some exemplary embodiments, the server further includes a BMC in communication with the BIOS, the BIOS is further configured to send a log to the BMC, and the BMC is configured to generate a BMC log based on the log.

[0146] For specific examples in this embodiment, reference may be made to the examples described in the embodiments and exemplary implementations, and this embodiment will not be described in detail here.

[0147] Obviously, those skilled in the art should understand that the modules or steps of the present application can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented using program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be performed in a different order than herein, or they can be made into separate integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0148] The above are merely optional embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may be subject to various modifications and variations. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A method for detecting a fault of an external device, wherein the external device is in communication with a basic input / output system BIOS, characterized in that: The method comprises: S1, executing a preset operation according to target information, wherein, when the target information includes first error information, executing the preset operation of injecting the first error information into an external device, and when the target information includes first register data, executing the preset operation of sending the first register data to the BIOS, wherein the first register data is register data generated by simulating a register of the external device in response to second error information; S2, obtaining a first log reported by the BIOS and / or a second log, wherein the first log is a log obtained by the BIOS parsing second register data, the second register data is register data generated by the register in response to the first error information, and the second log is a log obtained by the BIOS parsing the first register data; S3, determining the operating status of the external device according to the first log and the standard register data corresponding to the first error information, and / or determining the operating status of the BIOS according to the second log and the standard log corresponding to the first register data, the operating status being a fault state or a normal state.

2. The method according to claim 1, characterized in that Before S1, the method further includes: When the BIOS is started, obtaining flag information of the BIOS, where the flag information is information representing an operating environment of the BIOS; When the flag information is a target flag, determining that the operating environment of the BIOS is a development environment; When the flag information is not the target flag, it is determined that the operating environment of the BIOS is a non-development environment.

3. The method according to claim 2, characterized in that The S1 includes: When the operating environment of the BIOS is the development environment, the preset operation is performed according to the target information.

4. The method according to claim 2, characterized in that: In the case where the operating environment of the BIOS is a non-development environment, the method further includes: Utilizing an error injection tool to continuously simulate and generate third error information of the external device; After the accumulated number of the third error information reaches a preset threshold value defined by the error suppression function of the BIOS, determining whether there is a new error log in the baseboard management controller BMC log; In a case where the newly added error log exists in the BMC log, determining that the external device fails the test; When the newly added error log does not exist in the BMC log, it is determined that the external device passes the test.

5. The method according to claim 1, characterized in that The S1 includes at least one of the following: calling a first test case including the first error information and the standard register data from a first test case library, and executing the preset operation of injecting the first error information into the external device according to the first test case, wherein the first test case library includes a plurality of the first test cases, and different first test cases correspond to different first error information; A second test case including the first register data and the standard log is called from a second test case library, and according to the second test case, the preset operation of sending the second register data to the BIOS is executed, wherein the second test case library includes multiple second test cases, and different second test cases correspond to different first register data.

6. The method according to claim 5, characterized in that Before S3, the method further includes: calling the first test case to obtain the standard register data corresponding to the first error information, and / or calling the second test case to obtain the standard log corresponding to the first register data.

7. The method according to claim 5, characterized in that After S3, the method further includes: S4, calling a new first test case from the first test case library, and / or calling a new second test case from the second test case library; A loop step, looping and executing S4, S1, S2 and S3 for a predetermined number of times until all the first test cases are called from the first test case library and / or all the second test cases are called from the second test case library.

8. The method according to claim 7, characterized in that After the cycling step, the method further comprises at least one of the following: Generate a first test report according to the operating state of the external device and the corresponding standard register data, and send the first test report to the display terminal so that the display terminal displays the first test report; A second test report is generated according to the running state of the BIOS and the corresponding first register data, and the second test report is sent to the display terminal so that the display terminal displays the second test report.

9. The method according to any one of claims 5 to 8, characterized in that The first test case also includes a method for injecting the first error information.

10. The method according to any one of claims 1 to 8, characterized in that Executing the preset operation of injecting the first error information into the external device includes: Remotely log in to the operating system of the external device; In case of remotely logging into the operating system of the external device, the error injection tool is controlled to inject the first error information into the port of the external device.

11. The method according to any one of claims 1 to 8, characterized in that Executing the preset operation of sending the second register data to the BIOS includes: Remotely log into the BIOS; In the case of remotely logging into the BIOS, generating an interrupt instruction carrying the second register data; The interrupt instruction is sent to the BIOS, so that the BIOS processes the fault information of the external device in response to the interrupt instruction and generates the second log.

12. The method according to claim 11, characterized in that Remotely log into the BIOS, including: Log into the BIOS through the SSH channel.

13. The method according to any one of claims 1 to 8, characterized in that Determining the operating state of the external device according to the first log and the standard register data corresponding to the first error information includes: Extracting the second register data from the first log; In a case where the second register data is different from the standard register data, determining that the operating state of the external device is the fault state; When the second register data is identical to the standard register data, it is determined that the operating state of the external device is the normal state.

14. The method according to any one of claims 1 to 8, characterized in that Determining the running state of the BIOS according to the second log and a standard log corresponding to the first register data includes: When the second log is different from the standard log, determining that the running state of the BIOS is the fault state; When the second log is the same as the standard log, it is determined that the running state of the BIOS is the normal state.

15. The method according to any one of claims 1 to 8, characterized in that Determining the running state of the BIOS according to the second log and a standard log corresponding to the first register data includes: Extracting from the second log the actual location information of the external device where the fault occurs and the actual register data corresponding to the external device where the error occurs; Extracting standard error location information from the standard log; When the actual position information is different from the standard error position information, or the actual register data is different from the first register data, determining that the running state of the BIOS is the fault state; When the actual position information is the same as the standard error position information, and the actual register data is the same as the first register data, it is determined that the running state of the BIOS is the normal state.

16. The method according to any one of claims 1 to 8, characterized in that The external device includes a high-speed serial computer expansion bus standard PCIe device.

17. A fault detection device for an external device, wherein the external device is communicatively connected to the BIOS, characterized in that: The device comprises: an execution unit configured to execute a preset operation according to the target information, wherein, when the target information includes first error information, the preset operation of injecting the first error information into the external device is executed, and when the target information includes first register data, the preset operation of sending the first register data to the BIOS is executed, wherein the first register data is register data generated by simulating a register of the external device in response to second error information; a first acquiring unit, configured to acquire a first log reported by the BIOS, and / or a second log, wherein the first log is a log obtained by the BIOS parsing second register data, the second register data is register data generated by the register in response to the first error information, and the second log is a log obtained by the BIOS parsing the first register data; The first determination unit is configured to determine the operating status of the external device according to the first log and the standard register data corresponding to the first error information, and / or to determine the operating status of the BIOS according to the second log and the standard log corresponding to the first register data, wherein the operating status is a fault state or a normal state.

18. A computer non-volatile readable storage medium, characterized in that: The computer non-volatile readable storage medium stores a computer program, wherein the computer program implements the steps of the method according to any one of claims 1 to 16 when executed by a processor.

19. A processor, characterized in that: The processor is configured to run a program, wherein the program performs the steps of the method according to any one of claims 1 to 16 when running.

20. A server fault detection system, characterized in that: include: PCIe devices; BIOS, connected to the PCIe device for communication, the BIOS being configured to process fault information of the PCIe device and generate a log; A test device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in any one of claims 1 to 16 when executing the computer program, so as to detect the operating status of the PCIe device and / or the BIOS.

Citation Information

Patent Citations

  • Method for automatically diagnosing boot failure of server

    CN104391765A

  • Fault locating method, fault locating device and fault locating system

    CN108768752A

  • Server fault location method, device, apparatus, and computer-readable storage medium

    CN109086155A

  • A system and a method for recording the fault of a server PCIe device

    CN109542752A

  • Fault positioning system and method for abnormal operation of mcu

    CN112286707A

Cited By

  • Fault injection test method and device, computer equipment and storage medium

    CN120596322A

  • Fault injection test method and device, computer device and storage medium

    CN120596322B

  • Processor lag monitoring method and device

    CN121008952A