A server PCIE link detection method, device and medium

By constructing error scenarios by calling BIOS logs and error injection scripts after server startup, the stability of the PCIe link is determined, solving the problem that existing technologies cannot comprehensively detect the connection stability of PCIe devices, and achieving more accurate link stability detection and recovery.

CN115168119BActive Publication Date: 2026-07-24INSPUR BUSINESS MACHINE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR BUSINESS MACHINE CO LTD
Filing Date
2022-06-24
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In existing technologies, judging the stability of PCIe device connections solely by determining whether the server can start normally cannot fully reflect the stability of the device connection, which may lead to connection interruptions during subsequent use and affect business operations.

Method used

After the server starts normally, the BIOS log is called to check if there are any errors. If there are no errors, an error scenario is constructed, and the error injection script is used to check whether the BIOS log contains error records and alarm information. If there are no errors, the PCIe link is confirmed to be stable. If there are errors, it is confirmed to be unstable, and recovery and resource allocation tests are performed if necessary.

Benefits of technology

It enables more comprehensive detection of PCIe link stability, avoids inaccurate detection due to randomness, and ensures the stability and business continuity of PCIe links in actual use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115168119B_ABST
    Figure CN115168119B_ABST
Patent Text Reader

Abstract

The application relates to the field of server bus design, and discloses a server PCIE link detection method and device and a medium, after normal starting of a server, BIOS logs are called, whether there is an error in the BIOS logs is determined to judge whether the PCIE link is stable. And in the case of no error, an error script is called to build an error scene, whether the BIOS logs contain error records and alarm information corresponding to the error scene is determined, so that the test of the server alarm capability is realized, if the BIOS logs can normally record errors, it is confirmed that the PCIE link is stable, otherwise, it is confirmed that the PCIE link is unstable. According to the technical scheme, after normal starting of the server, the BIOS logs are also called to determine whether there is an error in the server starting. When there is no error, an error scene is built, and whether the BIOS logs can normally record errors is verified, so that the stability of the PCIE link is more comprehensively verified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of server bus design, and in particular to a server PCIe link detection method, device, and medium. Background Technology

[0002] High-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCIe) devices are an essential component of servers. The performance, computing, and functions of servers are all related to PCIe devices. PCIe devices are also involved in the server's computing, storage, and networking, playing an important role in server use.

[0003] Current technology determines the stability of PCIe device connections by checking whether the server can start normally. However, simply checking whether the server can start does not fully reflect the stability of the device connection. In subsequent use of the device, connection interruptions may occur due to undetected errors, affecting business operations.

[0004] Therefore, how to comprehensively test the stability of PCIe device connection links is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide a server PCIe link detection method, apparatus, and medium for providing more comprehensive detection when testing the stability of PCIe links.

[0006] To address the aforementioned technical problems, this application provides a server PCIe link detection method, comprising:

[0007] After the server starts normally, a preset program is executed to access the BIOS log;

[0008] Determine if there are any errors in the BIOS log;

[0009] If no error is reported, a pre-set error-reporting script is invoked to construct an error scenario;

[0010] After running the registration script, determine whether the BIOS log contains error records and alarm information corresponding to the error scenario;

[0011] If yes, the PCIe link is confirmed to be stable; otherwise, the PCIe link is confirmed to be unstable.

[0012] Preferred options also include:

[0013] After obtaining the error record and alarm information corresponding to the error scenario, the PCIe link is restored and it is confirmed whether the PCIe link has been successfully restored.

[0014] If the recovery is successful, proceed to the step of confirming the stability of the PCIe link; if the recovery is unsuccessful, proceed to the step of confirming the instability of the PCIe link.

[0015] Preferably, if the error scenario comprises multiple recoverable error scenarios, then the step of restoring the PCIe link and confirming whether the PCIe link has been successfully restored includes:

[0016] Restart the server to restore the PCIe link or call a preset script to restore the PCIe link;

[0017] Determine whether the PCIe link has been successfully restored;

[0018] If so, return to the step of calling the pre-set error-addressing script to construct the error scenario, until the construction of all the recoverable error scenarios is completed.

[0019] Preferably, if the error scenario is an unrecoverable error scenario, then restoring the PCIe link and confirming whether the PCIe link has been successfully restored includes:

[0020] A prompt message is issued to initiate manual recovery and to manually determine whether the PCIe link has been successfully restored.

[0021] Preferably, after confirming that the PCIe link has been successfully restored, the method further includes:

[0022] Call the resource allocation script to create various server resource allocation scenarios;

[0023] The stability of the PCIE link resource allocation is confirmed based on the resource allocation results.

[0024] Preferably, after confirming that the PCIe link has been successfully restored, the method further includes:

[0025] Determine whether the training and initialization of the PCIe link are normal. If they are normal, proceed to the step of confirming the stability of the PCIe link.

[0026] To address the aforementioned technical problems, this application also provides a server PCIe link detection device, which includes:

[0027] The calling module is used to execute a preset program to call the BIOS log after the server starts normally;

[0028] The first judgment module is used to determine whether there is an error in the BIOS log;

[0029] The module is used to call a pre-set error-addressing script to construct an error scenario if no error is reported.

[0030] The second judgment module is used to determine whether the BIOS log contains error records and alarm information corresponding to the error scenario after the registration script is run;

[0031] The confirmation module is used to confirm that the PCIe link is stable if it is, and to confirm that the PCIe link is unstable if it is not.

[0032] Preferred options also include:

[0033] The recovery module is used to recover the PCIe link and confirm whether the PCIe link has been successfully recovered after obtaining the error record and alarm information corresponding to the error scenario.

[0034] If the recovery is successful, proceed to the step of confirming the stability of the PCIe link; if the recovery is unsuccessful, proceed to the step of confirming the instability of the PCIe link.

[0035] Preferred options also include:

[0036] The resource allocation module is used to call the resource allocation script to create various server resource allocation scenarios after confirming that the PCIe link has been successfully restored; and to confirm the stability of the PCIe link resource allocation based on the resource allocation results.

[0037] Preferred options also include:

[0038] The training and initialization module is used to determine whether the training and initialization of the PCIe link are normal after confirming that the PCIe link has been successfully restored. If it is normal, the module proceeds to the step of confirming the stability of the PCIe link.

[0039] To solve the above-mentioned technical problems, this application also provides another server PCIE link detection device, which includes a memory for storing computer programs;

[0040] A processor is used to implement the steps of the server PCIE link detection method described above when executing the computer program.

[0041] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the server PCIE link detection method described above.

[0042] The server PCIe link detection method provided in this application, after the server starts normally, executes a preset program to call the BIOS log and determines the stability of the PCIe link based on the presence of errors in the BIOS log. Furthermore, in the absence of errors, a pre-set error-injection script is invoked to construct error scenarios. After running the script, it is determined whether the BIOS log contains error records and alarm information corresponding to the error scenarios, thereby testing the server's alarm capability. If the BIOS log can record errors normally, the PCIe link is confirmed to be stable; otherwise, the PCIe link is confirmed to be unstable. Compared to current technologies that determine PCIe link stability solely based on whether the server can start normally, which cannot comprehensively and accurately reflect the actual stability of the PCIe link, this technical solution, after the server starts normally, also calls the BIOS log to determine whether there are errors during server startup. Even when no errors are found, error scenarios are constructed to verify whether the BIOS log can record errors normally, providing a more comprehensive verification of PCIe link stability and avoiding inaccurate PCIe link detection due to randomness.

[0043] Furthermore, the server PCIE link detection device and media provided in this application correspond to the server PCIE link detection method described above, and have the same effect. Attached Figure Description

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

[0045] Figure 1 A flowchart illustrating a server PCIe link detection method provided in this application embodiment;

[0046] Figure 2 A structural diagram of a server PCIE link detection device provided in an embodiment of this application;

[0047] Figure 3 This is a structural diagram of another server PCIE link detection device provided in an embodiment of this application. Detailed Implementation

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

[0049] PCIe uses the industry-standard point-to-point serial connection. Compared to the shared parallel architecture of PCI and earlier computer buses, each device has its own dedicated connection, eliminating the need to request bandwidth from the entire bus. This allows for significantly higher data transfer rates, achieving bandwidth levels that PCI cannot provide. PCIe is the next-generation bus interface (commonly used in graphics cards, sound cards, and solid-state drives), designed to replace the PCI interface, which had reached its performance bottleneck. It offers extremely high bandwidth to meet system requirements. The PCIe bus supports bidirectional and multi-channel data transfer modes. Multi-channel data transfer modes include x1, x2, x4, x8, x12, and x16 multi-channel connections. A single-directional x1 connection can achieve a bandwidth of 250MB / s, while bidirectional connections can reach 500MB / s.

[0050] Currently, PCIe is the latest bus and interface standard in server bus design, including different bus widths such as x1, x4, x8, and x16. PCIe specifications range from 1 lane to 32 lanes, offering strong scalability to meet the varying data transmission bandwidth requirements of different system devices. To meet high scalability, PCIe has become an indispensable expansion interface, typically used to connect RAID cards, SAS cards, HBA cards, and other devices with PCIe interfaces to meet different customer needs. The signal quality of PCIe directly affects the functionality and performance of these external cards. To ensure the stable and efficient operation of external PCIe devices, the PCIe link and its stability must comply with the PCIe protocol specifications. In R&D testing, PCIe signal quality is indirectly reflected in the status and bandwidth of the PCIe link. The stability of the PCIe signal is usually verified by measuring key parameters such as PCIe link bandwidth and speed.

[0051] However, current tests determine the stability of PCIe device connections by judging whether the server can start normally. But simply judging whether it can start does not fully reflect the stability of the device connection. In subsequent use of the device, the connection may be interrupted due to undetected errors, affecting business operations.

[0052] The core of this application is to provide a server PCIe link detection method, apparatus, and medium for providing more comprehensive detection when testing the stability of PCIe links.

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

[0054] Figure 1A flowchart of a server PCIe link detection method provided in this application embodiment is shown below. Figure 1 As shown, the method includes:

[0055] S10: After the server starts normally, execute the default program to call the BIOS log.

[0056] In this embodiment, the execution subject can be a server PCIe link detection device in the server, which communicates with connected clients (e.g., RAID cards, SAS cards, HBA cards). It should be noted that before performing PCIe link detection, the external card should be inserted into the server in advance. Furthermore, to comprehensively test the server's PCIe links, interfaces of various bit widths on the server should be connected to the corresponding devices to cover all bandwidth and speed scenarios supported by the server.

[0057] The Basic Input Output System (BIOS) is a set of programs embedded in a ROM chip on the computer's motherboard. It stores the computer's most important basic input / output programs, the power-on self-test (POST) program, and the system boot program. It can read and write specific system settings from the CMOS. Its main function is to provide the lowest-level, most direct hardware settings and control for the computer. In addition, the BIOS provides some system parameters to the operating system. Changes to system hardware are hidden by the BIOS; programs use BIOS functions rather than directly controlling the hardware. Modern operating systems often bypass the abstraction layer provided by the BIOS and directly control hardware components.

[0058] In step S10, after the server starts normally, a preset program is invoked to automatically access the BIOS log and check for any error records. It's understandable that after inserting an external card, the server refreshes the BIOS image and boots up; during this process, the server also automatically checks log filtering, system commands, and key device tree parameters for preliminary environment checks. After the server starts normally, the BIOS log is accessed again to check for error records, further ensuring the stability of the server's operating environment.

[0059] Understandably, if the server fails to start or error messages are recorded in the BIOS log, it indicates a problem with the PCIe connection between the server and the client. The error information can be obtained from the BIOS log, eliminating the need for further steps. However, if no errors are recorded in the BIOS, it is necessary to verify whether the server can correctly report errors; therefore, proceed to step S12.

[0060] S11: Check if there are any errors in the BIOS log. If there are no errors, proceed to step S12.

[0061] S12: Invoke a pre-set error-addressing script to construct an error scenario.

[0062] In step S12, when no errors are found in the BIOS log, a pre-set error injection script is invoked to construct an error scenario. In this embodiment, error scenarios are constructed to inject errors into the PCIe link to determine whether the server can report errors normally, thereby achieving server alarm detection. In specific implementations, multiple error scenarios can be constructed based on the error injection script to achieve a more comprehensive server alarm detection capability.

[0063] S13: After running the registration script, determine whether the BIOS log contains error records and alarm information corresponding to the error scenario. If yes, proceed to step S14; otherwise, proceed to step S15.

[0064] S14: Confirm PCIe link is stable.

[0065] S15: PCIe link confirmed to be unstable.

[0066] In step S13, the server's alarm capability is verified by determining whether the BIOS log contains error records and alarm information corresponding to the constructed error scenario, thus demonstrating the stability of the PCIe link. Understandably, if the BIOS log records an error when a construction error scenario is encountered, the error should be corrected to detect other error scenarios.

[0067] The server PCIe link detection method provided in this application, after the server starts normally, executes a preset program to call the BIOS log and determines the stability of the PCIe link based on the presence of errors in the BIOS log. Furthermore, in the absence of errors, a pre-set error-injection script is invoked to construct error scenarios. After running the script, it is determined whether the BIOS log contains error records and alarm information corresponding to the error scenarios, thereby testing the server's alarm capability. If the BIOS log can record errors normally, the PCIe link is confirmed to be stable; otherwise, the PCIe link is confirmed to be unstable. Compared to current technologies that determine PCIe link stability solely based on whether the server can start normally, which cannot comprehensively and accurately reflect the actual stability of the PCIe link, this technical solution, after the server starts normally, also calls the BIOS log to determine whether there are errors during server startup. Even when no errors are found, error scenarios are constructed to verify whether the BIOS log can record errors normally, providing a more comprehensive verification of PCIe link stability and avoiding inaccurate PCIe link detection due to randomness.

[0068] In practice, after the BIOS log records the error corresponding to the error scenario, the error needs to be repaired in order to allow the PCIe link to be used subsequently.

[0069] Based on the above embodiments, this embodiment further includes:

[0070] After obtaining the error records and alarm information corresponding to the error scenario, the PCIe link is restored and it is confirmed whether the PCIe link has been restored successfully.

[0071] If the recovery is successful, proceed to the step of confirming the stability of the PCIe link; if the recovery is unsuccessful, proceed to the step of confirming the instability of the PCIe link.

[0072] This embodiment, after restoring the PCIe link to eliminate errors, can be used for subsequent applications. However, in actual implementation, to achieve comprehensive testing of the PCIe link, there may be multiple error scenarios. Therefore, after successfully restoring the PCIe link, it is necessary to return to the step of calling the pre-set error injection script to construct error scenarios, and perform tests on other error scenarios until all error scenarios are constructed.

[0073] To better reflect real-world usage and more accurately test PCIe link stability, the constructed errors include both recoverable and unrecoverable errors. Recoverable errors are those that the server can automatically correct, such as through a reboot. Unrecoverable errors, however, cannot be recovered from by a server reboot and require manual intervention. By constructing both recoverable and unrecoverable errors, PCIe link stability is tested in a way that more closely resembles real-world usage.

[0074] In practice, if the error scenario involves multiple recoverable error scenarios, then restoring the PCIe link and confirming whether the PCIe link has been successfully restored includes:

[0075] Restart the server to restore the PCIe link or call a preset script to restore the PCIe link;

[0076] Determine if the PCIe link has been successfully restored;

[0077] If so, return to the step of calling the pre-set error-addressing script to build the error scenario, until all recoverable error scenarios have been built.

[0078] Understandably, when there are multiple recoverable error scenarios, the server can restore the PCIe link by restarting or calling a preset script to eliminate the error. The PCIe link restoration process does not require manual intervention. Therefore, a corresponding program can be configured to, after successful PCIe link restoration, return to the step of calling a pre-set error-addressing script to construct the error scenario, thus testing other error scenarios until all recoverable error scenarios are constructed.

[0079] The server PCIe link detection method provided in this application embodiment can recover the PCIe link by restarting the server or calling a preset script for multiple recoverable error scenarios. After the PCIe link is successfully recovered, other error scenarios can still be constructed, which improves the testing efficiency of the server PCIe link and more accurately detects the stability of the server PCIe link through multiple tests.

[0080] It is understandable that manual recovery is required when the error scenario is unrecoverable. However, in practice, the steps in the above embodiments can be automatically performed by setting corresponding running programs.

[0081] Therefore, in this embodiment, when the error scenario is an unrecoverable error scenario, restoring the PCIe link and confirming whether the PCIe link has been successfully restored includes:

[0082] A prompt message is sent to guide manual recovery and to manually determine whether the PCIe link has been successfully restored.

[0083] This embodiment prompts technicians to manually restore the PCIe link by providing a prompt message, so as to test the stability of the PCIe link when the error is unrecoverable.

[0084] In practice, in addition to testing server alarms and PCIe link connectivity, other tests can also be performed.

[0085] For example, after confirming successful PCIe link recovery, a resource allocation script can be invoked to create various server resource allocation scenarios; the stability of PCIe link resource allocation can then be confirmed based on the allocation results. After confirming successful PCIe link recovery, it can also be determined whether PCIe link training and initialization are normal. If normal, the process proceeds to confirming PCIe link stability.

[0086] It should be noted that all tests disclosed in this embodiment were conducted after the PCIe link was successfully repaired and all errors were confirmed to be resolved on the server. By testing PCIe link resource allocation, PCIe link training, and initialization, a more comprehensive assessment of PCIe link stability is achieved.

[0087] The server PCIe link detection method has been described in detail in the above embodiments. This application also provides embodiments corresponding to the server PCIe link detection device. It should be noted that this application describes the device embodiments from two perspectives: one is based on functional modules, and the other is based on hardware.

[0088] Figure 2 A structural diagram of a server PCIE link detection device provided in this application embodiment is shown below. Figure 2 As shown, the device includes:

[0089] Module 10 is invoked to execute a preset program to call the BIOS log after the server starts normally.

[0090] The first judgment module 11 is used to determine whether there is an error in the BIOS log;

[0091] Module 12 is used to call a pre-set error-addressing script to construct an error scenario if no error is reported.

[0092] The second judgment module 13 is used to determine whether the BIOS log contains error records and alarm information corresponding to the error scenario after the registration script is run;

[0093] The confirmation module 14 is used to confirm that the PCIe link is stable if it is, and to confirm that the PCIe link is unstable if it is not.

[0094] It should be noted that, Figure 2 The structure shown does not constitute a limitation on the server PCIe link detection device. In other embodiments, the server PCIe link detection device may further include:

[0095] The recovery module is used to recover the PCIe link and confirm whether the PCIe link has been successfully recovered after obtaining the error record and alarm information corresponding to the error scenario.

[0096] If the recovery is successful, proceed to the step of confirming the stability of the PCIe link; if the recovery is unsuccessful, proceed to the step of confirming the instability of the PCIe link.

[0097] The resource allocation module is used to call the resource allocation script to create various server resource allocation scenarios after confirming that the PCIe link has been successfully restored; and to confirm the stability of the PCIe link resource allocation based on the resource allocation results.

[0098] The training and initialization module is used to determine whether the training and initialization of the PCIe link are normal after confirming that the PCIe link has been successfully restored. If it is normal, the module proceeds to the step of confirming the stability of the PCIe link.

[0099] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.

[0100] The server PCIe link detection device provided in this application, after the server starts normally, executes a preset program to call the BIOS log and determines the stability of the PCIe link based on the presence of errors in the BIOS log. Furthermore, in the absence of errors, a pre-set error-injection script is invoked to construct error scenarios. After running the script, it is determined whether the BIOS log contains error records and alarm information corresponding to the error scenarios, thereby testing the server's alarm capability. If the BIOS log can record errors normally, the PCIe link is confirmed to be stable; otherwise, the PCIe link is confirmed to be unstable. Compared to current technologies that rely solely on whether the server can start normally to determine the stability of the PCIe link, which cannot comprehensively and accurately reflect the actual stability of the PCIe link, this technical solution, after the server starts normally, also calls the BIOS log to determine whether there are errors during server startup. Even when no errors are found, error scenarios are constructed to verify whether the BIOS log can record errors normally, providing a more comprehensive verification of the PCIe link's stability and avoiding inaccurate PCIe link detection due to randomness.

[0101] Figure 3 A structural diagram of another server PCIE link detection device provided in the embodiments of this application is shown below. Figure 3 As shown, the device includes: a memory 20 for storing computer programs;

[0102] The processor 21 is used to execute computer programs to implement the steps of the server PCIE link detection method as described in the above embodiments.

[0103] The server PCIE link detection device provided in this embodiment can include, but is not limited to, smartphones, tablets, laptops, or desktop computers.

[0104] 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 using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0105] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the server PCIE link detection method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, preset programs, error-checking scripts, etc.

[0106] In some embodiments, the server PCIe link detection 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.

[0107] Those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the server PCIe link detection device and may include more or fewer components than shown.

[0108] The server PCIe link detection device provided in this application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following methods: after the server starts normally, it executes a preset program to call the BIOS log; it determines whether there is an error in the BIOS log; if there is no error, it calls a pre-set error injection script to construct an error scenario; after running the registration script, it determines whether the BIOS log contains error records and alarm information corresponding to the error scenario; if so, it confirms that the PCIe link is stable; if not, it confirms that the PCIe link is unstable.

[0109] The server PCIe link detection device provided in this application, after the server starts normally, executes a preset program to call the BIOS log and determines the stability of the PCIe link based on the presence of errors in the BIOS log. Furthermore, in the absence of errors, a pre-set error-injection script is invoked to construct error scenarios. After running the script, it is determined whether the BIOS log contains error records and alarm information corresponding to the error scenarios, thereby testing the server's alarm capability. If the BIOS log can record errors normally, the PCIe link is confirmed to be stable; otherwise, the PCIe link is confirmed to be unstable. Compared to current technologies that rely solely on whether the server can start normally to determine the stability of the PCIe link, which cannot comprehensively and accurately reflect the actual stability of the PCIe link, this technical solution, after the server starts normally, also calls the BIOS log to determine whether there are errors during server startup. Even when no errors are found, error scenarios are constructed to verify whether the BIOS log can record errors normally, providing a more comprehensive verification of the PCIe link's stability and avoiding inaccurate PCIe link detection due to randomness.

[0110] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.

[0111] It is understood that if the methods in the above embodiments are implemented as 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 this application, in essence, or the part 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 the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0112] The computer-readable storage medium provided in this application, after the server starts normally, executes a preset program to call the BIOS log and determines the stability of the PCIe link based on the presence of errors in the BIOS log. Furthermore, in the absence of errors, a pre-set error-injection script is invoked to construct error scenarios. After running the script, it is determined whether the BIOS log contains error records and alarm information corresponding to the error scenarios, thereby testing the server's alarm capability. If the BIOS log can record errors normally, the PCIe link is confirmed to be stable; otherwise, the PCIe link is confirmed to be unstable. Compared to current technologies that determine PCIe link stability solely based on whether the server can start normally, which cannot comprehensively and accurately reflect the actual stability of the PCIe link, this technical solution, after the server starts normally, also calls the BIOS log to determine whether there are errors during server startup. Even when no errors are found, error scenarios are constructed to verify whether the BIOS log can record errors normally, providing a more comprehensive verification of PCIe link stability and avoiding inaccurate PCIe link detection due to randomness.

[0113] The server PCIe link detection method, apparatus, and medium provided in this application have been described in detail above. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

[0114] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A method for detecting PCIe links in a server, characterized in that, The server has a PCIe device pre-installed; The server PCIe link detection method includes: After the server starts normally, a preset program is executed to access the BIOS log; Determine if there are any errors in the BIOS log; If no error is reported, a pre-set error-reporting script is invoked to construct an error scenario; After running the error injection script, it is determined whether the BIOS log contains error records and alarm information corresponding to the error scenario, in order to verify the alarm capability of the server. If yes, then the PCIe link is confirmed to be stable; otherwise, the PCIe link is confirmed to be unstable. Also includes: After obtaining the error record and alarm information corresponding to the error scenario, the PCIe link is restored and it is confirmed whether the PCIe link has been successfully restored. If the recovery is successful, proceed to the step of confirming the stability of the PCIe link; if the recovery is unsuccessful, proceed to the step of confirming the instability of the PCIe link. If the error scenario is one of multiple recoverable error scenarios, then the step of restoring the PCIe link and confirming whether the PCIe link has been successfully restored includes: Restart the server to restore the PCIe link or call a preset script to restore the PCIe link; Determine whether the PCIe link has been successfully restored; If so, return to the step of calling the pre-set error-addressing script to construct the error scenario, until the construction of all the recoverable error scenarios is completed; If the error scenario is an unrecoverable error scenario, then the step of restoring the PCIe link and confirming whether the PCIe link has been successfully restored includes: A prompt message is issued to initiate manual recovery and to manually determine whether the PCIe link has been successfully restored.

2. The server PCIe link detection method according to claim 1, characterized in that, After confirming that the PCIe link has been successfully restored, the process also includes: Call the resource allocation script to create various server resource allocation scenarios; The stability of the PCIE link resource allocation is confirmed based on the resource allocation results.

3. The server PCIe link detection method according to claim 2, characterized in that, After confirming that the PCIe link has been successfully restored, the process also includes: Determine whether the training and initialization of the PCIe link are normal. If they are normal, proceed to the step of confirming the stability of the PCIe link.

4. A server PCIe link detection device, characterized in that, PCIe devices were pre-installed on the server; The server PCIe link detection device includes: The calling module is used to execute a preset program to call the BIOS log after the server starts normally; The first judgment module is used to determine whether there is an error in the BIOS log; The module is used to call a pre-set error-addressing script to construct an error scenario if no error is reported. The second judgment module is used to determine whether the BIOS log contains error records and alarm information corresponding to the error scenario after the error injection script is run, so as to verify the alarm capability of the server. The confirmation module is used to confirm that the PCIe link is stable if it is, and to confirm that the PCIe link is unstable if it is not. The server PCIe link detection device also includes: The recovery module is used to recover the PCIe link and confirm whether the PCIe link has been successfully recovered after obtaining the error record and alarm information corresponding to the error scenario; if the recovery is successful, the module proceeds to the step of confirming the stability of the PCIe link; if the recovery is unsuccessful, the module proceeds to the step of confirming the instability of the PCIe link. If the error scenario is one of multiple recoverable error scenarios, then the recovery module is specifically used for: Restart the server to restore the PCIe link or call a preset script to restore the PCIe link; Determine whether the PCIe link has been successfully restored; If so, return to the step of calling the pre-set error-addressing script to construct the error scenario, until the construction of all the recoverable error scenarios is completed; If the error scenario is an unrecoverable error scenario, then the recovery module is specifically used for: A prompt message is issued to initiate manual recovery and to manually determine whether the PCIe link has been successfully restored.

5. A server PCIe link detection device, characterized in that, Includes memory used to store computer programs; A processor, configured to implement the steps of the server PCIE link detection method as described in any one of claims 1 to 3 when executing the computer program.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the server PCIE link detection method as described in any one of claims 1 to 3.