UEFI (Unified Extensible Firmware Interface) hot plug management method and device, electronic equipment and storage medium

By building a multi-level cache management mechanism and dynamic GOP protocol adaptation during the UEFI BIOS boot phase, the display abnormality problem caused by hot-plugging of monitors was solved, and seamless switching and system stability were achieved when the monitor was connected and disconnected.

CN121455873APending Publication Date: 2026-02-03JWIPC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511344080.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Traditional UEFI BIOS lacks effective dynamic management capabilities during the boot process when dealing with monitor hot-plugging operations, leading to problems such as screen flickering, system crashes, or display abnormalities when the monitor is connected or disconnected.

Method used

By configuring the current list cache, virtual external cache, and reserved cache, a display-compatible GOP protocol is generated to dynamically manage the display mode. This includes initializing the cache and rendering content when a display is connected, updating the cache when a new display is connected, and unloading the protocol and saving the display mode and content when the display is unplugged.

Benefits of technology

It achieves intelligent matching and conflict avoidance of display modes, ensuring the stability and continuity of the display system, and improving system stability and user experience in multi-monitor scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121455873A_ABST
    Figure CN121455873A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a UEF I hot plug management method and device, electronic equipment and a storage medium, and relates to the technical field of UEF I firmware management.The method comprises the steps that a current list cache region, a virtual external cache region and a reserved cache region are configured, and all display modes supported by a display card are inquired and stored in the current list cache region; when the access of the display is detected for the first time, an adaptive GOP protocol is generated based on a graphics card UEF I drive, a cache region is initialized, and display content rendering is completed; when a new display is accessed, dynamically updating the cache region and preferentially adopting an external or reserving a compatible mode in the cache region by comparing the coincidence between the display mode of the new display and the content of the current cache region, so as to ensure seamless switching of display; and when the display is pulled out, the system automatically unloads the corresponding GOP protocol, and if the display is the last display, the display mode and content of the display are stored in the reserved cache region. According to the invention, the problems of display interruption, protocol conflict and disordered multi-screen management in a traditional hot plug scheme are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of UEFI firmware management, and particularly relates to a UEFI hot plug management method and device, electronic equipment and storage medium. BACKGROUND

[0002] With the rapid development of information technology, computer systems are increasingly widely used in various fields, especially in complex display environments with multiple graphics cards and multiple displays, which puts forward higher requirements for the stability and flexibility of display management.

[0003] However, in the UEFI (Unified Extensible Firmware Interface) BIOS startup phase, the traditional GOP (Graphics Output Protocol) protocol management method is not capable of dealing with the display hot plug operation. The traditional GOP protocol management mechanism lacks effective dynamic management capability for the display insertion and removal operations in the UEFI BIOS startup process.

[0004] Specifically, when only one display is connected to the system and the display is removed, the graphics card hardware can detect the removal operation and attempt to unload the GOP protocol, but the BIOS or system program often fails to receive the notification that the GOP protocol has been unloaded in time, resulting in errors, screen flicker, system crashes and other serious problems when the protocol is subsequently called. In addition, in a multi-display environment, when a new display is connected, the BIOS or operating system only calls the existing declared GOP protocol, ignoring the correct initialization of the newly connected display, resulting in display abnormalities. That is, the traditional method cannot adjust the protocol state in real time according to the changes in the display environment when handling hot plug events, resulting in a decrease in system stability, and protocol conflicts between different graphics cards or displays also occur from time to time, further exacerbating the complexity of display management.

[0005] Therefore, there is an urgent need for a UEFI hot plug management method that can effectively manage the GOP protocol in the UEFI BIOS startup phase, realize dynamic response to display hot plug, and ensure the stability and reliability of the display system. SUMMARY

[0006] Embodiments of the present application provide a UEFI hot plug management method to solve the problem of GOP protocol management failure when a display is hot plugged in the UEFI, resulting in screen flicker, system crashes or display abnormalities of the new display. The technical solution is as follows:

[0007] According to one aspect of the present invention, a UEFI hot-swappable management method is provided, the method comprising: configuring a current list cache, a virtual external cache, and a reserved cache; querying all display modes supported by the graphics card and storing them in the current list cache; when a monitor is first detected to be connected, generating a GOP protocol corresponding to the monitor through the graphics card UEFI driver, initializing the current list cache and the virtual external cache according to the GOP protocol, and displaying content on the monitor; the display content includes data to be rendered to the screen; when a new monitor is detected to be connected, generating a newly installed GOP protocol through the graphics card UEFI driver, and processing based on the new GOP protocol according to the display modes supported by the new monitor and the states of the current list cache, the virtual external cache, and the reserved cache; the display modes include resolution and refresh rate; when a monitor is detected to be unplugged, unloading the corresponding GOP protocol and canceling its occupation, and updating the current list cache; if the unplugged monitor is the last one, saving the corresponding display mode and display content to the reserved cache.

[0008] In one embodiment, the current list cache is used to cache all currently supported display modes; the virtual external cache is used to cache externally set display modes; and the reserved cache is used to cache the display mode and display content being used when the last monitor is unplugged.

[0009] In one embodiment, generating a GOP protocol corresponding to the display is achieved through the following steps: generating a GOP protocol compatible with the display through the graphics card UEFI driver in the UEFI BIOS; checking whether the GOP protocol conforms to the GOP standard and whether it has been enabled by other drivers; the GOP protocol provides display mode query, setting, and basic transmission operations; if the GOP protocol conforms to the GOP standard and has not been enabled by other drivers, then the GOP protocol is enabled and used, and other drivers are notified that the GOP protocol cannot be used.

[0010] In one embodiment, the initialization of the current list cache and the virtual external cache according to the GOP protocol is achieved through the following steps: querying all display modes supported by the display according to the GOP protocol, storing all display modes one by one into the current list cache to form a linked list structure containing multiple display modes; receiving display mode setting requests from external drivers or UEFI applications through the virtual external cache, and saving the display modes in the setting requests.

[0011] In one embodiment, processing based on the new GOP protocol according to the display modes supported by the new display and the states of the current list cache, virtual external cache, and reserved cache is achieved through the following steps: Based on the new GOP protocol, compare whether the display modes supported by the new display overlap with the display modes in the current list cache; if there is overlap, retain the overlapping display modes in the current list cache and delete the display modes not supported by the new display; if there is no overlap, refuse to connect to the new display; if a display mode exists in the virtual external cache and is compatible with the new display, use the display mode in the virtual external cache; if a display mode exists in the reserved cache and is compatible with the new display, use the display mode in the reserved cache and display the content.

[0012] In one embodiment, updating the current list cache, if the removed monitor is the last one, saves the corresponding display mode and display content to the reserved cache through the following steps: remove the display mode corresponding to the removed monitor from the current list cache; if there are other monitors, use the display modes supported by the remaining monitors as the content of the current list cache; if there are no remaining monitors, clear the current list cache and save the current display mode and display content of the removed monitor to the reserved cache.

[0013] In one embodiment, the method further includes the following steps: after the current list cache is updated, the GOP protocol unified interface is reinstalled, the BIOS and OS are notified to update the display mode, and the interface is refreshed to match the new configuration; after the virtual external cache is updated, the GOP protocol is reinstalled to synchronize external settings, the associated components are notified to apply the new mode and the interface is redrawn; after the reserved cache is updated, the GOP protocol is reinstalled to maintain interface consistency and all drivers are notified, and the display content is restored from the reserved cache and displayed.

[0014] According to one aspect of the present invention, a UEFI hot-swappable management device includes: a buffer configuration module, configured to configure a current list buffer, a virtual external buffer, and a reserved buffer, query all display modes supported by the graphics card and store them in the current list buffer; an initialization module, configured to generate a GOP protocol corresponding to the display via the graphics card UEFI driver when a display is first detected to be connected, initialize the current list buffer and the virtual external buffer according to the GOP protocol, and display content on the display; the display content includes data to be rendered to the screen; a hot-swappable management module, configured to generate a newly installed GOP protocol via the graphics card UEFI driver when a new display is detected to be connected, and process the display modes supported by the new display and the states of the current list buffer, the virtual external buffer, and the reserved buffer based on the new GOP protocol; the display modes include resolution and refresh rate; and a hot-swappable management module, configured to unload the corresponding GOP protocol and cancel its occupation when a display is detected to be unplugged, and update the current list buffer; if the unplugged display is the last one, the corresponding display mode and display content are saved to the reserved buffer.

[0015] According to one aspect of the present invention, an electronic device includes at least one processor and at least one memory, wherein computer-readable instructions are stored on the memory; the computer-readable instructions are executed by one or more of the processors to cause the electronic device to implement the UEFI hot-plug management method as described above.

[0016] According to one aspect of the present invention, a storage medium has computer-readable instructions stored thereon, which are executed by one or more processors to implement the UEFI hot-plug management method as described above.

[0017] The beneficial effects of the technical solution provided by this invention are:

[0018] In the above technical solution, this invention constructs a multi-level display mode management mechanism by configuring the current list, virtual external display, and reserved cache. Upon initial detection of a monitor connection, an adapted GOP protocol is generated based on the graphics card UEFI driver, the cache is initialized, and the display content is rendered. When a new monitor is connected, the cache is dynamically updated by comparing its display mode with the current cache content, prioritizing compatible modes from the external or reserved cache to ensure seamless display switching. When a monitor is unplugged, the system automatically unloads the corresponding GOP protocol; if it is the last monitor, its display mode and content are stored in the reserved cache. This method achieves intelligent matching and conflict avoidance of display modes through cache state-driven protocol management. It also supports automatic reinstallation of the unified GOP protocol interface after cache updates, synchronously notifying the BIOS, OS, and related components to refresh the display configuration, ensuring rapid recovery of display content from the reserved cache. This effectively solves the problems of chaotic display mode management, frequent protocol conflicts, and display interruptions in existing UEFI hot-plug technology, significantly improving system stability and display continuity in multi-monitor scenarios, and providing an efficient and reliable solution for dynamic hardware adaptation in a UEFI environment. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating a UEFI hot-plug management method according to an exemplary embodiment;

[0021] Figure 2 This is a schematic diagram illustrating the device relationships in a multi-monitor scenario within an application context.

[0022] Figure 3 yes Figure 2 A functional diagram of the GOP protocol in the corresponding application scenario;

[0023] Figure 4 This is a flowchart illustrating the hot-plug event management process in another application scenario;

[0024] Figure 5 This is a block diagram illustrating a UEFI hot-plug management device according to an exemplary embodiment;

[0025] Figure 6 This is a hardware structure diagram of an electronic device according to an exemplary embodiment;

[0026] Figure 7This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0027] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0028] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this disclosure means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.

[0029] UEFI (Unified Extensible Firmware Interface) is used for hardware initialization and booting before the operating system starts. In graphics card hot-swapping management, UEFI provides the basic framework for the interaction between the graphics card driver and the system, ensuring that the driver can correctly identify and handle the connection and disconnection of the monitor, and realize flexible switching of display modes.

[0030] Hot-swapping refers to inserting or removing hardware devices (such as monitors) into or from a computer system without shutting down the system or disconnecting the power, while the system continues to function normally.

[0031] The GOP (Graphics Output Protocol) is a set of interfaces defined in the UEFI specification that provides graphics card drivers with functions such as display mode querying, setting, and basic transmission operations. This protocol specifies how graphics data is transmitted and displayed between the graphics card and the monitor, and also provides standard interfaces for easy access by the operating system and other drivers to achieve unified display management.

[0032] This invention provides a UEFI hot-swap management method. By constructing a multi-level buffer management mechanism and dynamic GOP protocol adaptation technology, it achieves intelligent matching and seamless switching of display modes in a UEFI environment. This solves the problems of display interruption, protocol conflict, and chaotic multi-screen management in traditional hot-swap solutions, significantly improving system stability and display continuity. This UEFI hot-swap management method is applicable to UEFI hot-swap management devices, which can be electronic devices. The UEFI hot-swap management method in this invention can be applied to various scenarios, such as UEFI hot-swap management.

[0033] Please see Figure 1 This invention provides a UEFI hot-plug management method, which is applicable to electronic devices.

[0034] In the following method embodiments, for ease of description, the execution subject of each step of the method is an electronic device, but this does not constitute a specific limitation.

[0035] like Figure 1 As shown, the method may include the following steps:

[0036] Step 110: Configure the current list cache, virtual external cache, and reserved cache; query all display modes supported by the graphics card and store them in the current list cache.

[0037] In one possible implementation, the current list cache is used to cache all currently supported display modes; the virtual external cache is used to cache display modes set externally; and the reserved cache is used to cache the display mode and content being used when the last monitor was unplugged.

[0038] Specifically, the current list cache area, as the core storage area for display modes, will comprehensively query and cache all display modes supported by the graphics card, including various resolution and refresh rate combinations, forming a detailed linked list structure for quick access and adjustment later.

[0039] Specifically, the virtual external cache acts as an external settings receiver, specifically for caching display mode setting requests from external drivers or UEFI applications. This design enables the system to flexibly respond to external customization needs for display modes, ensuring that display settings meet user expectations while also being compatible with the current hardware state.

[0040] Specifically, the cache is a thoughtful design feature that caches the display mode and content being used by the last monitor when it is unplugged. This feature is especially important when monitors need to be reconnected, as it can quickly restore the previous display state, providing users with a seamless visual experience while also enhancing the system's robustness and ease of use.

[0041] Step 120: When the monitor is first detected to be connected, the GOP protocol corresponding to the monitor is generated through the graphics card UEFI driver. The current list buffer and virtual external buffer are initialized according to the GOP protocol, and the content is displayed on the monitor.

[0042] The GOP protocol provides display mode query, setting, and basic transmission operations; the display content includes data that needs to be rendered to the screen, etc., which are not limited here.

[0043] In one possible implementation, a GOP protocol compatible with the monitor is generated by the graphics card UEFI driver in the UEFI BIOS. The GOP protocol is checked to see if it conforms to the GOP standard and if it has been enabled by other drivers. If the GOP protocol conforms to the GOP standard and has not been enabled by other drivers, the GOP protocol is enabled and used, and other drivers are notified that the GOP protocol cannot be used.

[0044] In one possible implementation, the system queries all display modes supported by the display according to the GOP protocol, stores all display modes one by one in the current list cache, forming a linked list structure containing multiple display modes; and receives display mode setting requests from external drivers or UEFI applications through a virtual external cache, and saves the display modes in the setting requests.

[0045] Specifically, upon the first detection of a monitor connection, the graphics card's UEFI driver is immediately triggered to generate a GOP protocol fully compatible with that monitor. This process is crucial because it not only ensures smooth communication between the graphics card and the monitor but also lays a solid foundation for subsequent display management.

[0046] Furthermore, after generating the GOP protocol, the system rigorously checks whether the protocol conforms to the GOP standard and confirms that it is not occupied by other drivers. Only protocols that conform to the standard and are not occupied will be officially opened and used. At the same time, other drivers will be notified that the protocol has been occupied to avoid conflicts. Subsequently, based on the generated GOP protocol, the system queries all display modes supported by the monitor in detail and stores these modes one by one and accurately into the current list cache, constructing a linked list structure containing multiple resolution and refresh rate options so that users or the system can flexibly select according to actual needs.

[0047] Simultaneously, the virtual external cache also comes into play. It receives display mode setting requests from external drivers or UEFI applications and securely saves these display modes for subsequent display customization. Ultimately, meticulously rendered screen data is displayed on the monitor, providing users with a clear and smooth visual experience.

[0048] Step 130: When a new monitor is detected to be connected, a new installation GOP protocol is generated through the graphics card UEFI driver. Based on the new GOP protocol, the display mode supported by the new monitor and the status of the current list cache, virtual external cache and reserved cache are processed.

[0049] The display mode includes resolution, refresh rate, etc., which are not specified here.

[0050] In one possible implementation, the display modes supported by the new display are compared with the display modes in the current list cache based on the new GOP protocol to see if they overlap.

[0051] If there is overlap, the overlapping display modes are retained in the current list cache, and display modes not supported by the new monitor are deleted. If there is no overlap, the connection to the new monitor is refused. If a display mode exists in the virtual external cache and is compatible with the new monitor, the display mode in the virtual external cache is used. If a display mode exists in the reserved cache and is compatible with the new monitor, the display mode in the reserved cache is used and the content is displayed.

[0052] Specifically, once a new monitor is detected, the system quickly instructs the graphics card UEFI driver to generate a corresponding newly installed GOP protocol. This new protocol is a crucial bridge connecting the new monitor and the system, ensuring correct interaction between the two. Subsequently, based on this new GOP protocol, the system conducts an in-depth analysis of the display modes supported by the new monitor (covering key parameters such as resolution and refresh rate) and performs a detailed comparison with the display modes already stored in the current list cache.

[0053] Furthermore, if overlapping display modes are found during the comparison, these commonly supported display modes are intelligently retained in the current list cache, while modes not supported by the new monitor are removed to optimize the display configuration. Conversely, if no overlapping modes are found, the system will determine that the new monitor is incompatible with the current configuration and refuse its connection to maintain system stability and display quality.

[0054] In addition, the system will check the virtual external cache and reserved cache. If there are display modes compatible with the new display, these modes will be used first. The system may even restore the previous display content from the reserved cache to ensure that users have a consistent and personalized visual experience.

[0055] Step 140: When a monitor is detected to be unplugged, the corresponding GOP protocol is unloaded and its occupation is cancelled, and the current list cache is updated. If the unplugged monitor is the last one, the corresponding display mode and display content are saved to the reserved cache.

[0056] In one possible implementation, the display mode corresponding to the unplugged monitor is removed from the current list cache. If there are other monitors, the display modes supported by the remaining monitors are used as the content of the current list cache. If there are no remaining monitors, the current list cache is cleared, and the current display mode and display content of the unplugged monitor are saved to the reserved cache.

[0057] In one possible implementation, after the current list cache is updated, the GOP protocol unified interface is reinstalled, the BIOS and OS are notified to update the display mode, and the interface is refreshed to match the new configuration; after the virtual external cache is updated, the GOP protocol is reinstalled to synchronize external settings, the associated components are notified to apply the new mode and the interface is redrawn; after the reserved cache is updated, the GOP protocol is reinstalled to maintain interface consistency and all drivers are notified, and the display content is restored from the reserved cache and displayed.

[0058] Specifically, once a monitor is detected to have been unplugged, the unloading process is immediately initiated. This process precisely locates and unloads the GOP protocol corresponding to that monitor, while simultaneously releasing the system resources occupied by the protocol to ensure efficient resource utilization. Subsequently, the current list cache is updated, removing the display mode record corresponding to the unplugged monitor from it.

[0059] Furthermore, if other displays remain connected, the system will further filter out display modes commonly supported by these remaining displays and add them as new content to the current list cache to ensure compatibility and optimal display configuration. Conversely, if the unplugged display was the last connected device, the system will completely save its current display mode and content to a reserved cache for quick restoration in the future.

[0060] Furthermore, after each cache update, the GOP protocol unified interface is reinstalled to ensure that the BIOS and operating system can obtain the latest display mode information in a timely manner and trigger the interface refresh operation, so that the displayed content perfectly matches the new configuration. After the virtual external cache is updated, the GOP protocol is reinstalled to synchronize external settings, notify all related components to apply the new display mode and redraw the interface. After the reserved cache is updated, the GOP protocol is also reinstalled to maintain interface consistency and notify all drivers to restore the display content from the reserved cache and display it to the user.

[0061] Through the above process, this invention achieves comprehensive support and efficient processing of monitor hot-plug events during the UEFI BIOS boot phase by finely managing three core cache areas (current list cache area, virtual external cache area, and reserved cache area) and dynamically generating and unloading the GOP protocol. The system can intelligently identify monitor connection and disconnection, automatically adjust display mode configuration, and ensure the continuity and compatibility of displayed content. Simultaneously, the cache design preserves critical display states for quick recovery, improving user experience. Furthermore, reinstalling the unified GOP protocol interface and notifying relevant components to update the display mode ensures overall system coordination and stability. This invention effectively solves display anomalies that may occur during hot-plugging, providing strong technical support for domestically produced desktop computers and multi-GPU server computers.

[0062] In an application scenario, such as Figure 2 As shown, the system is equipped with multiple hardware components, including a CPU, graphics card 1, and graphics card 2. Each graphics card can connect to multiple monitors; for example, graphics card 1 connects to monitor 1-GOP1 and monitor 2-GOP2, and graphics card 2 connects to monitor 3-GOP3 and monitor 4-GOP4.

[0063] In this complex hardware environment, the system needs to efficiently manage the connection and disconnection of multiple displays during the UEFI boot phase to ensure the correctness and continuity of the displayed content. To achieve effective display management, the system employs the GOP protocol.

[0064] like Figure 2 As shown. The GOP protocol provides the following core functions: Querying supported display modes: The system can use this interface to query the display modes supported by each monitor, including key parameters such as resolution and refresh rate; Setting display modes: Based on the queried display mode information, the system can set the monitor's working mode to ensure consistency and compatibility of displayed content across different devices; Manipulating display content: This interface also allows the system to directly manipulate the displayed content, such as rendering and refreshing screen data, to provide a smooth user experience.

[0065] The system utilizes the GOP protocol to communicate efficiently with different displays, enabling flexible configuration of display modes and dynamic adjustment of displayed content. To further optimize display management performance, a buffer management mechanism is introduced.

[0066] Specifically, the current display mode cache stores information about the display modes supported by all currently available monitors. For example, for GOP1, the stored display modes are 800x600, 1024x768, and 1920x1080; for GOP2, the corresponding display modes are 800x600, 1024x768, 1600x900, and 1920x1080; and for GOP3, the corresponding display modes are 800x600, 1024x768, 1920x1080, and 3840x2160. When a new monitor is connected or an existing monitor is unplugged, the system updates this cache promptly to accurately reflect the latest display mode configuration.

[0067] Specifically, the virtual external cache: This cache is primarily used to store display mode information set externally, such as display mode requests from the operating system or applications. With this cache, the system can flexibly respond to external customization needs for display modes and maintain coordination with the current hardware state. During the process, the system integrates the display mode information in the current list cache into the virtual external GOP mode cache. For example, after integration, the display modes may be 800x600 or 1024x768, enabling unified display mode management and response to external requests.

[0068] During the initialization phase, the system stores the information in the current GOP display mode cache into the virtual external GOP mode cache area according to different displays to establish the initial display mode configuration.

[0069] The hot-swap management of this system may specifically include the following steps:

[0070] Step 1: System initialization and cache configuration.

[0071] Specifically, when a multi-GPU server computer boots to the UEFI stage, the BIOS first configures the graphics card's PCI resources and loads the graphics card's UEFI driver. The BIOS then loads the GOP protocol management driver, which is responsible for subsequent GOP protocol generation, unloading, and cache management. It initializes all current GOP display mode caches and virtual external GOP mode caches, pre-storing known display mode information in these caches.

[0072] Specifically, the system environment is initialized to ensure that the graphics card driver and GOP protocol management driver are loaded correctly, laying the foundation for subsequent monitor hot-swapping management. By configuring the buffer, the system can quickly adjust the display mode when the monitor is connected or disconnected, ensuring the continuity and compatibility of the displayed content.

[0073] In the above process, the embodiments of the present invention initialize the system environment and configure the cache area, enabling the system to respond quickly to display hot-plug events, providing a flexible display mode management foundation, and achieving efficient preparation during the system startup phase.

[0074] Step 2: Initial display connection and GOP protocol generation.

[0075] Specifically, when a monitor is first detected as connected, the graphics card UEFI driver generates a GOP protocol compatible with the monitor. The GOP protocol management support program checks whether the newly generated GOP protocol conforms to the GOP standard and confirms that it is not being used by other drivers. If the protocol is valid and not in use, it is enabled and used, while notifying other drivers that the protocol is already in use to avoid conflicts. Based on the GOP protocol, all display modes supported by the monitor are queried and stored in the current GOP display mode cache, while the virtual external GOP mode cache is updated.

[0076] Ensuring smooth communication between the graphics card and the monitor lays the foundation for subsequent display management. Checking protocol validity and usage avoids protocol conflicts and ensures system stability. Storing the display modes supported by the monitor provides a basis for subsequent display mode adjustments.

[0077] In the above process, the embodiments of the present invention ensure the compatibility and stability between the graphics card and the monitor by generating and verifying the GOP protocol, providing a reliable basis for display mode query, and realizing smooth communication when the monitor is first connected.

[0078] Step 3: Handling monitor hot-plug events.

[0079] Specifically, when a new monitor is detected, the graphics card UEFI driver generates a new GOP protocol. It compares the display modes supported by the new monitor with the display modes in the current GOP display mode cache, retaining overlapping modes and deleting unsupported modes. If a display mode compatible with the new monitor exists in the virtual external GOP mode cache, that mode will be used preferentially for display.

[0080] Specifically, when a monitor is detected as being unplugged, the corresponding GOP protocol is unloaded and its usage is released, freeing up system resources. The display mode corresponding to the unplugged monitor is removed from the current GOP display mode cache. If other monitors exist in the system, the display modes commonly supported by the remaining monitors are used as the new content of the current GOP display mode cache; if no monitors remain, the current GOP display mode cache is cleared, and the current display mode and display content of the unplugged monitor are saved to the reserved cache area.

[0081] When a new monitor is connected, the display mode is compared and adjusted to ensure that the new monitor can display content normally, while maintaining the compatibility and optimality of the system display configuration. When the monitor is unplugged, the corresponding protocol is promptly unloaded and the cache is updated to avoid resource waste and display abnormalities, while retaining critical display states for quick recovery.

[0082] In the above process, the embodiments of the present invention intelligently process display hot-plug events, dynamically adjust the display mode and cache content, ensure the continuity and compatibility of system display, provide an efficient display management strategy, and realize seamless switching during hot-plugging.

[0083] Step 4: Update the cache and reinstall the GOP protocol.

[0084] Specifically, after all current GOP display mode caches or virtual external GOP mode caches are updated, the GOP protocol unified interface is reinstalled. The BIOS and operating system are notified to update the display mode, triggering a UI refresh to match the new configuration. After the virtual external GOP mode cache is updated, the GOP protocol is reinstalled to synchronize external settings, notifying all related components to apply the new display mode and redraw the UI.

[0085] By reinstalling the GOP protocol unified interface, the BIOS and operating system can obtain the latest display mode information in a timely manner, maintaining the accuracy and consistency of the system display. Related components are notified to update the display mode and redraw the interface, improving user experience and ensuring the real-time performance and accuracy of the displayed content.

[0086] In the above process, the embodiments of the present invention ensure the real-time performance and accuracy of the system display by updating the cache and reinstalling the GOP protocol, providing an efficient display update mechanism and realizing the rapid recovery and optimization of the system display after hot-plugging.

[0087] Through the above process, this invention proposes a comprehensive and efficient solution to the problem of monitor hot-swapping management during the UEFI boot phase of multi-GPU server computers. By introducing a virtual GOP interface protocol and a fine-grained buffer management mechanism, the system can intelligently handle monitor access and removal events, dynamically adjust the display mode, and ensure the continuity and compatibility of displayed content. This solution not only improves system stability and user experience but also provides strong technical support for display management in multi-GPU environments, possessing broad application prospects and practical value.

[0088] In another application scenario, during the UEFI boot phase of a multi-GPU server computer, the system needs to manage hot-plug events of multiple monitors to ensure the correctness and continuity of the displayed content.

[0089] likeFigure 3 As shown, when a display device is inserted or removed, the system detects a hot-plug event. This event serves as the trigger point for the entire process, guiding the system to enter the corresponding processing logic.

[0090] Specifically, when a display device is plugged in, the connected graphics card first installs its own GOP protocol. This is the basic protocol for communication between the graphics card and the display device and for outputting display content.

[0091] Furthermore, the GOP protocol management driver supports query operations to check whether the GOP protocol installed on the graphics card can be managed by the GOP protocol management driver. This step is to ensure that the system can effectively control and coordinate the newly installed GOP protocol.

[0092] Furthermore, the GOP protocol management driver begins operation. If the query result is "yes," meaning the GOP protocol can be managed, then the GOP protocol management driver begins subsequent operations.

[0093] Further, configure the GOP mode: First, locate the virtual external GOP mode buffer, which stores previously set or reserved display mode information. Then, process the display content in the reserved buffer to ensure correct display when a display device is inserted.

[0094] Specifically, when the display device is unplugged, the associated graphics card will also perform its own GOP protocol installation operation (updating or resetting the protocol state).

[0095] Furthermore, the GOP protocol management driver stops operations by determining whether any other display devices exist. If so, it means the system still needs to manage the display output of other display devices, and the GOP protocol management driver continues to perform related operations; if not, it means all display devices have been unplugged, and then proceeds to the next step.

[0096] Furthermore, the system retains the display mode and content of the last display device in the buffer when no other display device is available. This allows for a quick restoration of the previous display state when a new display device is subsequently inserted.

[0097] Finally, after configuring the GOP mode, the system notifies other modules or users that the display mode has changed so that the relevant components can make corresponding adjustments.

[0098] By handling hot-swapping events of display devices through the above process, the system can ensure stable operation even with frequent display device plugging and unplugging, avoiding system crashes or display abnormalities caused by display device changes. It can flexibly switch display modes according to different display device configurations and user needs, providing optimal display effects. The display state is retained after a display device is unplugged and quickly restored when a new device is plugged in, reducing user waiting time and improving the overall user experience. This achieves effective management and response to display device changes.

[0099] The following are embodiments of the apparatus of the present invention, which can be used to execute the UEFI hot-plug management method involved in the present invention. For details not disclosed in the embodiments of the apparatus of the present invention, please refer to the method embodiments of the UEFI hot-plug management method involved in the present invention.

[0100] Please see Figure 5 This invention provides a UEFI hot-swap management device 800.

[0101] The UEFI hot-swap management device 800 includes, but is not limited to: a buffer configuration module 810, an initialization module 830, a hot-swap management module 850, and a hot-swap management module 870.

[0102] The cache configuration module 810 is used to configure the current list cache, the virtual external cache, and the reserved cache, and to query all display modes supported by the graphics card and store them in the current list cache.

[0103] The initialization module 830 is used to generate a GOP protocol corresponding to the monitor through the graphics card UEFI driver when the monitor is first detected to be connected. It initializes the current list buffer and the virtual external buffer according to the GOP protocol and displays the content on the monitor. The displayed content includes the data that needs to be rendered to the screen.

[0104] The hot-swap management module 850 is used to generate a new installation GOP protocol through the graphics card UEFI driver when a new monitor is detected. Based on the new GOP protocol, it processes the new monitor according to the display mode supported by the new monitor and the status of the current list cache, virtual external cache and reserved cache. The display mode includes resolution and refresh rate.

[0105] The hot-swap management module 870 is used to unload the corresponding GOP protocol and cancel its occupation when a monitor is detected to be unplugged, and update the current list cache. If the unplugged monitor is the last one, the corresponding display mode and display content are saved to the reserved cache.

[0106] It should be noted that the UEFI hot-swap management provided in the above embodiments is only an example of the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed. That is, the internal structure of the UEFI hot-swap management device will be divided into different functional modules to complete all or part of the functions described above.

[0107] Furthermore, the UEFI hot-swap management device and the UEFI hot-swap management method provided in the above embodiments belong to the same concept, and the specific way in which each module performs operations has been described in detail in the method embodiments, and will not be repeated here.

[0108] Figure 6 A schematic diagram of the structure of an electronic device according to an exemplary embodiment is shown.

[0109] It should be noted that this electronic device is merely an example adapted to the present invention and should not be construed as providing any limitation on the scope of use of the present invention. Furthermore, this electronic device should not be interpreted as requiring or depending on having... Figure 6 One or more components of the exemplary electronic device 2000 shown.

[0110] The hardware structure of electronic devices 2000 can vary significantly due to differences in configuration or performance, such as... Figure 6 As shown, the electronic device 2000 includes: a power supply 210, an interface 230, at least one memory 250, and at least one central processing unit (CPU) 270.

[0111] Specifically, power supply 210 is used to provide operating voltage for various hardware devices on electronic device 2000.

[0112] Interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Of course, in other examples adapted to this invention, interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input / output interface 235, and at least one USB interface 237, etc. Figure 6 As shown, this does not constitute a specific limitation.

[0113] The memory 250 serves as a carrier for resource storage and can be a read-only memory, random access memory, disk, or optical disk, etc. The resources stored on it include the operating system 251, application programs 253, and data 255, etc., and the storage method can be temporary storage or permanent storage.

[0114] The operating system 251 is used to manage and control the various hardware devices and application programs 253 on the electronic device 2000, so as to enable the central processing unit 270 to perform calculations and processing on the massive data 255 in the memory 250. It can be Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0115] Application 253 is a computer-readable instruction based on operating system 251 that performs at least one specific task, and may include at least one module ( Figure 6 (Not shown), each module may contain computer-readable instructions for electronic device 2000. For example, the UEFI hot-swap management device can be considered as application 253 deployed on electronic device 2000.

[0116] Data 255 may be signal information, etc., and is stored in memory 250.

[0117] The central processing unit 270 may include one or more processors and is configured to communicate with the memory 250 via at least one communication bus to read computer-readable instructions stored in the memory 250, thereby performing operations and processing on massive amounts of data 255 stored in the memory 250. For example, the UEFI hot-plug management method can be implemented by the central processing unit 270 reading a series of computer-readable instructions stored in the memory 250.

[0118] Furthermore, the present invention can also be implemented through hardware circuits or a combination of hardware circuits and software. Therefore, the implementation of the present invention is not limited to any specific hardware circuit, software, or combination thereof.

[0119] Please see Figure 7 This invention provides an electronic device 4000, which may include: a desktop computer, a laptop computer, a server, etc., with sensor recognition capabilities.

[0120] exist Figure 7 In this context, the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.

[0121] The data interaction between the processor 4001 and the memory 4003 can be achieved through at least one communication bus 4002. This communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0122] Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.

[0123] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. Processor 4001 may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0124] The memory 4003 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program instructions or code in the form of instructions or data structures and accessible by the electronic device 4000, but not limited thereto.

[0125] The memory 4003 stores computer-readable instructions, and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002.

[0126] The computer-readable instructions are executed by one or more processors 4001 to implement the UEFI hot-plug management method in the above embodiments.

[0127] Furthermore, this embodiment of the invention provides a storage medium storing computer-readable instructions, which are executed by one or more processors to implement the UEFI hot-plug management method as described above.

[0128] This invention provides a computer program product including computer-readable instructions stored in a storage medium. One or more processors of an electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, thereby enabling the electronic device to implement the UEFI hot-plug management method as described above.

[0129] Compared with related technologies, the beneficial effects of the present invention are:

[0130] 1. This invention features efficient display mode management. By configuring three core caches (current GOP mode list cache, virtual external GOP mode cache, and reserved GOP mode cache), the system can dynamically manage and update display mode information. When the display device changes, the system can quickly find and match a suitable display mode, avoiding display anomalies and compatibility issues, and improving system stability and user experience.

[0131] 2. This invention ensures the continuity and consistency of displayed content. By retaining the display mode and content of the last monitor in a buffer, the system can restore the display content from the buffer when a new monitor is connected, ensuring that the user's interface remains consistent with the previous one. This mechanism is particularly suitable for scenarios requiring frequent monitor plugging and unplugging, such as server debugging and multi-screen display, improving work efficiency and user satisfaction.

[0132] 3. This invention features flexible external display mode customization capabilities; through a virtual external GOP mode cache, the system can receive and store display mode requests from the operating system or applications. This mechanism enables the system to flexibly respond to external demands for display mode customization while maintaining coordination with the current hardware state, providing users with a more personalized and flexible display experience.

[0133] 4. This invention has broad applicability and scalability; the solution is mainly applied to domestically produced desktop computers and multi-graphics card server computers, and is also applicable to other computer systems that support UEFI boot and hot-swapping functions. With the continuous development of display technology and computer hardware, this solution can be easily expanded and upgraded to adapt to new hardware and display requirements, maintaining its technological leadership and applicability.

[0134] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0135] The above description is only a partial embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A UEF hot-swap management method, characterized in that, The method includes: Configure the current list cache, virtual external cache, and reserved cache; query all display modes supported by the graphics card and store them in the current list cache. When a monitor is first detected to be connected, a GOP protocol corresponding to the monitor is generated through the graphics card UEFI driver. The current list cache and virtual external cache are initialized according to the GOP protocol, and the content is displayed on the monitor. The displayed content includes data that needs to be rendered to the screen. When a new monitor is detected, a new installation GOP protocol is generated through the graphics card UEFI driver. Based on the new GOP protocol, the system processes the new monitor according to its supported display modes and the status of the current list cache, virtual external cache, and reserved cache. The display modes include resolution and refresh rate. When a monitor is detected to be unplugged, the corresponding GOP protocol is unloaded and its occupation is cancelled, and the current list cache is updated. If the unplugged monitor is the last one, the corresponding display mode and display content are saved to the reserved cache.

2. The UEF I hot-swap management method as described in claim 1, characterized in that, The current list cache is used to cache all currently supported display modes; the virtual external cache is used to cache externally set display modes; and the reserved cache is used to cache the display mode and content being used when the last monitor is unplugged.

3. The UEF I hot-swap management method as described in claim 1, characterized in that, The generation of the GOP protocol corresponding to the display includes: The graphics card UEF I driver in UEF IB IOS generates a GOP protocol compatible with the display, and checks whether the GOP protocol conforms to the GOP standard and whether it has been enabled by other drivers; the GOP protocol provides display mode query, setting and basic transmission operations; If the GOP protocol conforms to the GOP standard and has not been enabled by other drivers, then the GOP protocol is enabled and used, and other drivers are notified that the GOP protocol cannot be used.

4. The UEF I hot-swap management method as described in claim 1, characterized in that, The initialization of the current list cache and the virtual external cache according to the GOP protocol includes: According to the GOP protocol, query all display modes supported by the display, and store all display modes one by one into the current list cache area to form a linked list structure containing multiple display modes; The virtual external cache area receives display mode setting requests from external drivers or UEFI applications and saves the display mode in the setting request.

5. The UEF I hot-swap management method as described in claim 1, characterized in that, The processing based on the new GOP protocol, according to the display modes supported by the new display and the states of the current list cache, virtual external cache, and reserved cache, includes: Based on the new GOP protocol, compare whether the display modes supported by the new display overlap with the display modes in the current list cache. If there is overlap, the overlapping display modes are retained in the current list cache, and the display modes not supported by the new display are deleted; if there is no overlap, the connection to the new display is refused. If a display mode exists in the virtual external cache area and is compatible with the new display, then the display mode in the virtual external cache area is used; if a display mode exists in the reserved cache area and is compatible with the new display, then the display mode in the reserved cache area is used and the content is displayed.

6. The UEF I hot-swap management method as described in claim 1, characterized in that, The step of updating the current list cache, if the unplugged monitor is the last one, involves saving the corresponding display mode and display content to the reserved cache, including: Remove the display mode corresponding to the unplugged monitor from the current list cache. If there are other monitors, use the display modes supported by the remaining monitors as the content of the current list cache. If there are no remaining displays, the current list cache is cleared, and the current display mode and display content of the unplugged display are saved to the reserved cache.

7. The UEF I hot-swap management method as described in claim 1, characterized in that, The method further includes: After the current list cache is updated, the GOP protocol unified interface is reinstalled, the BIOS and OS are notified to update the display mode, and the interface is refreshed to match the new configuration. After the virtual external cache is updated, the GOP protocol is reinstalled to synchronize external settings, and related components are notified to apply the new mode and the interface is redrawn. After the reserved cache is updated, the GOP protocol is reinstalled to maintain interface consistency and all drivers are notified. The display content is then restored from the reserved cache and displayed.

8. A UEF I hot-swap management device, characterized in that, The device includes: The cache configuration module is used to configure the current list cache, the virtual external cache, and the reserved cache, and to query all display modes supported by the graphics card and store them in the current list cache. The initialization module is used to generate a GOP protocol corresponding to the display through the graphics card UEFI driver when the display is first detected to be connected, initialize the current list cache and the virtual external cache according to the GOP protocol, and display the content on the display; the displayed content includes data that needs to be rendered to the screen. The hot-swap management module is used to generate a new installation GOP protocol through the graphics card UEFI driver when a new monitor is detected. Based on the new GOP protocol, it processes the new monitor according to the display mode supported by the new monitor and the status of the current list cache, virtual external cache, and reserved cache. The display mode includes resolution and refresh rate. The hot-swap management module is used to unload the corresponding GOP protocol and cancel its occupation when a monitor is detected to be unplugged, and update the current list cache. If the unplugged monitor is the last one, the corresponding display mode and display content are saved to the reserved cache.

9. An electronic device, characterized in that, include: At least one processor and at least one memory, wherein, The memory stores computer-readable instructions; The computer-readable instructions are executed by one or more of the processors, causing the electronic device to implement the UEF I hot-plug management method as described in any one of claims 1 to 7.

10. A storage medium having computer-readable instructions stored thereon, characterized in that, The computer-readable instructions are executed by one or more processors to implement the UEF I hot-plug management method as described in any one of claims 1 to 7.