Network card information management method and electronic equipment

By switching from the first boot mode to the second boot mode in the BIOS to load network card information and updating the configuration table after restarting, the problem of inadequate information on the network card configuration page is solved, enabling accurate acquisition and updating of network card device information and improving the user experience.

CN120909677AActive Publication Date: 2025-11-07INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511405612.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2025-11-07
Estimated Expiration
2045-09-29

AI Technical Summary

Technical Problem

In the first startup mode of the basic input/output system, complete information about the network card device cannot be obtained, resulting in rudimentary network card configuration page information, increasing the risk of maintenance errors and reducing user experience.

Method used

By detecting the BIOS boot mode, if it is the first boot mode, switch to the second boot mode, load the network card's expandable firmware interface driver information, and save the information to the configuration table after restarting, thereby updating the network card configuration page.

Benefits of technology

In the first startup mode, network card device information is automatically obtained and updated, reducing the risk of maintenance errors and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120909677A_ABST
    Figure CN120909677A_ABST
Patent Text Reader

Abstract

The invention discloses a network card information management method and electronic equipment, and relates to the technical field of computers.The method includes the steps that when network card equipment information needs to be loaded, if the starting mode of a basic input and output system is a first starting mode, the starting mode is switched to a second starting mode; network card equipment information stored in a network card extensible firmware interface driver can be stored in a first configuration table, and a starting mode is switched back to a first starting mode and restarted; after restarting, the network card equipment information stored in the first configuration table is updated to the second configuration table, the network card configuration page is updated, and whether network card equipment information transfer is carried out or not can be accurately known by utilizing the state mark of the network card equipment information stored in the network card extensible firmware interface driver when the starting mode is switched; the control steps are continuously executed when the starting mode is switched and restarted, complete network card equipment information is automatically transferred into the network card configuration page of the first starting mode, and the network cards can be accurately distinguished.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a method for managing network card information and an electronic device. BACKGROUND

[0002] When a computer starts, a basic input / output system (BIOS) performs a power-on self-test, but when the start mode of the basic input / output system of the computer is a first start mode (Legacy mode), the first start mode has limited support for new hardware, which leads to that the network card device information cannot be acquired completely in the first start mode, and the network card device information of a network card configuration page is simple, which is not convenient for a user to distinguish the network card physically, increases the risk of maintenance error, easily causes the user to be puzzled, and reduces the user experience. If the network card device information is acquired completely in the first start mode to set the network card device configuration information of the network card configuration page, the second start mode (UEFI mode) needs to be switched manually, the second start mode supports modern hardware, and the network card device information can be identified more completely, which leads to that it is difficult to set the network card device configuration information of the network card configuration page in the first start mode. SUMMARY

[0003] The present application provides a method for managing network card information and an electronic device, to at least solve the technical problem that the network card device information cannot be acquired completely in the first start mode of the basic input / output system in the related art, the network card device information of the network card configuration page is simple, and the network card is easily distinguished incorrectly.

[0004] The present application provides a method for managing network card information, comprising: In response to detecting that the basic input / output system is powered on, checking the start mode of the basic input / output system and a state flag of network card device information saved in a network card extensible firmware interface driver in a driver environment stage; Determining whether the network card configuration page needs to load the network card device information; In response to needing to load the network card device information, switching the start mode to a second start mode and restarting when the start mode is a first start mode, and loading the network card device information saved in the network card extensible firmware interface driver when the start mode is the second start mode; In response to that the network card device information is loaded successfully, saving the network card device information to a first configuration table, modifying the state flag to needing to be reloaded, switching the start mode back to the first start mode and restarting; In response to the basic input output system being restarted through the first startup mode, when the state flag is set to be reloaded, the network card device information saved in the first configuration table is updated into a second configuration table, and the state flag is modified to be reloaded, and the network card configuration page is updated according to the network card device information in the second configuration table.

[0005] The application further provides an electronic device, comprising a memory for storing a computer program, and a processor for executing the computer program to implement the steps of any of the network card information management methods. In response to detecting that the basic input output system is powered on, the startup mode of the basic input output system and a state flag of network card device information saved in the network card extensible firmware interface driver are checked in the driver environment stage; It is judged whether the network card configuration page needs to load network card device information; In response to needing to load network card device information, when the startup mode is the first startup mode, the startup mode is switched to the second startup mode and restarted, and when the startup mode is the second startup mode, the network card device information saved in the network card extensible firmware interface driver is loaded; In response to the network card device information being successfully loaded, the network card device information is saved into a first configuration table, the state flag is modified to be reloaded, and the startup mode is switched back to the first startup mode and restarted; In response to the basic input output system being restarted through the first startup mode, when the state flag is set to be reloaded, the network card device information saved in the first configuration table is updated into a second configuration table, and the state flag is modified to be reloaded, and the network card configuration page is updated according to the network card device information in the second configuration table.

[0006] Through the application, when network card device information needs to be loaded, if the startup mode of the basic input output system is the first startup mode, the startup mode is switched to the second startup mode, the network card device information saved in the network card extensible firmware interface driver is saved into a first configuration table, and the startup mode is switched back to the first startup mode and restarted; after being restarted through the first startup mode, when the state flag is set to be reloaded, the network card device information saved in the first configuration table is updated into a second configuration table, and the network card configuration page is updated, wherein the state flag of the network card device information saved in the network card extensible firmware interface driver is used to accurately know whether to perform network card device information reloading when the startup mode is switched, the control steps are continuously executed when the startup mode is switched and restarted, the perfect network card device information is automatically transferred into the network card configuration page of the first startup mode, the network card is accurately distinguished, the risk of maintenance errors is reduced, and the user experience is improved. BRIEF DESCRIPTION OF DRAWINGS

[0007] In order to more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. Obviously, the drawings described below only illustrate some of the embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0008] Figure 1 The schematic diagram of the principle that the related art cannot obtain the perfect information of the network card device in the first starting mode; Figure 2 The application environment diagram of the method for managing the network card information in one embodiment of the present application; Figure 3 The flowchart of the method for managing the network card information in one embodiment of the present application; Figure 4 The structure block diagram of the device for managing the network card information in one embodiment of the present application; Figure 5 The internal structure diagram of the computer device in one embodiment of the present application. DETAILED DESCRIPTION

[0009] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without any creative effort fall within the protection scope of the present application.

[0010] It should be noted that, in the description of the present application, the terms "comprise", "contain" or any other variants thereof are intended to cover the non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0011] In order to make the skilled in the art better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0012] BIOS (Basic Input Output System) is a firmware embedded in the motherboard of computers and servers, responsible for initializing hardware and loading the operating system during boot-up. During the startup of a computer, BIOS performs a POST (Power-On Self Test) to check if the basic hardware components (such as CPU, memory, hard disk, etc.) are working properly. If errors are detected, it may emit a warning sound or stop the boot process. BIOS is responsible for configuring various hardware resources in the system, such as IRQs (Interrupt Request Lines), DMA channels (Direct Memory Access channels), and memory address space, ensuring that all hardware devices can coexist harmoniously. Once the hardware detection is successful, BIOS will search for and load the first boot loader (such as MBR or UEFI boot sector) of the operating system from predefined boot devices (such as hard disk, optical drive, USB, etc.) according to user settings (usually configured through the BIOS settings interface), thus starting the operating system. BIOS provides a settings interface (usually entered by pressing a specific key such as Del, F2, etc. during startup), allowing users to modify system date and time, adjust boot order, enable or disable hardware devices, change security settings, etc. BIOS supports ACPI (Advanced Configuration and Power Interface) standards, which can manage the power state of the system, implement energy-saving modes, hibernation and wake-up functions, etc.; provides a unified interface for the underlying hardware for the operating system, so that the operating system does not have to write specific drivers for each hardware.

[0013] NIC is a network interface controller, commonly known as a network card, which is a very critical component in computer systems, responsible for connecting computers to networks and implementing data transmission and reception functions between computers and networks. NIC is almost used in all server application scenarios that require high-performance network communication capabilities. For example, data center servers: in cloud computing and big data centers, NIC is a core component, used to support high-density virtualization environments, storage area networks (SAN), and high-speed internal and external data exchange; high-performance computing (HPC) servers: HPC clusters require high-speed, low-latency network communication, so they are equipped with advanced NICs that support InfiniBand or high-speed Ethernet to optimize inter-node communication efficiency; database servers: servers that handle a large number of database queries and transactions rely on fast network responses, and NIC configuration emphasizes low latency and high throughput to ensure data access efficiency; web servers and application servers: servers that host websites and applications need to balance connection numbers and data transmission speed, and NICs here help cope with burst traffic and provide stable services.

[0014] It can be seen that the network card NIC plays an important role in the server system. As one of the important components in the server system, when designing and developing the BIOS firmware, it is necessary to add a management configuration scheme for the NIC. In the BIOS setting management interface, the NIC management control options are designed to provide users with an interactive interface for manual configuration and management of the NIC. The NIC management configuration interface lists the network cards one by one. If it is a multi-port network card, all the network ports will be enumerated one by one. In the DXE stage of the POST process, the BIOS loads the network card driver to obtain the information of the network card. The obtained network card name is used as the Title (name) of each network card control option in the NIC management configuration interface to distinguish different network cards.

[0015] Legacy BIOS and UEFI BIOS are two different types of computer startup firmware. Legacy BIOS is an earlier system firmware interface standard that runs in 16-bit real mode, limiting the addressable memory space to usually not more than 1MB, which becomes a bottleneck in modern systems. UEFI is a more advanced and flexible firmware interface standard that has significantly improved performance, security, scalability, and ease of use, and has become the preferred choice for new hardware platforms. However, for some old systems or specific needs, Legacy BIOS still has certain application scenarios. In UEFI mode, when creating the NIC management configuration interface, the network card information can be obtained by reading the NIC driver. The NIC manufacturer stores the relevant information in the network card's UEFI standard driver. After reading the network card information, the key information needed is extracted to create the NIC configuration management options.

[0016] In Legacy mode, the information of the network card is read from the Option ROM of the NIC. Option Rom is a firmware that is run by the computer BIOS during platform initialization. However, Option Rom technology is relatively outdated and has basic functions, and cannot provide rich device information like EFI (Extensible Firmware Interface) driver. Therefore, the complete name of the NIC cannot be obtained, and the BIOS can only read the name like "IBA 40G" from the Option ROM. If such information is used to create the NIC configuration management interface, it is not user-friendly, even for professional engineers, it is difficult to distinguish the network card from the "IBA 40G" name. It can be predicted that this will cause confusion to users. Therefore, it is necessary to obtain the complete NIC information in Legacy mode to create the NIC configuration management interface, which can display perfect NIC information, has strong readability and is easy to distinguish, and provides users with a good functional experience. Based on the limitations of the traditional OptionROM technology, it is relatively difficult to achieve.

[0017] Therefore, the current technical solution is to read the NIC EFI (network card extensible firmware interface) driver in the UEFI mode to obtain the information of the network card. The current mainstream device can obtain the NIC information through this way, and then create a NIC configuration management interface. However, in the Legacy mode, due to the limitation of the OptionROM technology, it is not possible to obtain the complete information of the NIC device, resulting in that the NIC information in the NIC configuration management interface is simple and not convenient for users to distinguish the network card physically, increasing the risk of maintenance errors, easily causing users to be confused, and reducing the user experience.

[0018] As shown in Figure 1 , when the complete information of the network card device cannot be obtained in the Legacy mode, it is necessary to switch to the UEFI mode to read the complete information of the network card device, save the NIC information, switch back to the Legacy mode to obtain the saved NIC information, and update the configuration information of the NIC configuration management interface through the saved NIC information.

[0019] The method for managing the network card information provided in the present application can be applied in an application environment as shown in Figure 2 . The terminal 102 communicates with the server 104 through a network. The terminal 102 can set a state mark for the network card device information saved in the server 104. The state mark is set as no need to be reprinted by default. The terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers. The current pain point is that the OptionROM technology used in the Legacy mode has great limitations due to the outdated technology, resulting in that the complete NIC device information cannot be obtained. The mainstream NIC device basically supports the EFI driver, and the manufacturer has saved the complete NIC information in the EFI driver. However, the EFI driver cannot be read in the Legacy mode. In the UEFI mode, the information in the NIC EFI driver can be read. Therefore, the system is started from the UEFI mode, so that the network card information data saved in the EFI driver can be obtained. The present application solves the problem that the network card device information is not complete in the NIC configuration management interface in the Legacy mode. The information in the NIC management configuration interface in the Legacy mode can be kept consistent with the information stored in the network card EFI driver by the manufacturer, so that the user can distinguish the network card device in the NIC management configuration interface, and the consistency of the information presented to the user in the UEFI mode and the Legacy mode is realized, which is convenient for system management and maintenance, and improves the user experience.

[0020] As Figure 3 shown, the embodiment of the present application provides a network card information management method, comprising the following steps: Step S1, in response to detecting basic input and output system power-on, checking the startup mode of the basic input and output system and the state flag of the network card device information saved in the network card extensible firmware interface driver in the execution of the driver environment stage; Step S2, judging whether the network card configuration page needs to load network card device information; Step S3, in response to the need to load network card device information, switching the startup mode to the second startup mode when the startup mode is the first startup mode and restarting, and loading the network card device information saved in the network card extensible firmware interface driver when the startup mode is the second startup mode; Step S4, in response to the successful loading of the network card device information, saving the network card device information to the first configuration table, modifying the state flag to need to be reloaded, switching the startup mode back to the first startup mode and restarting; Step S5, in response to the basic input and output system restarting through the first startup mode, updating the network card device information saved in the first configuration table to the second configuration table when the state flag is need to be reloaded, modifying the state flag to have been reloaded, and updating the network card configuration page according to the network card device information in the second configuration table.

[0021] Among them, the first startup mode is the Legacy mode (legacy mode), and the second startup mode is the UEFI mode (Unified Extensible Firmware Interface mode). The Legacy mode has limited support for new hardware (such as NVMe SSD, multi-core processor), which may result in incomplete network card information reading. The UEFI mode natively supports modern hardware and can better identify device information, including network card drivers and functions.

[0022] The present application can obtain NIC information in the EFI driver in the Legacy mode, which is used for configuration management of the network card configuration page; makes the NIC configuration options clearer and more clearly corresponds to the physical NIC device, reducing the difficulty of NIC management. The network card configuration page eliminates the differentiation under different modes. For users, the purpose is mainly configuration management, and the same function uses unified presentation, which is more friendly to users and brings better product use experience.

[0023] Among them, the state flag can be realized by a hidden option, and a hidden NIC configuration option table (referred to as the first configuration table) can be realized at the same time, and the current network card configuration page content (referred to as the second configuration table) can be reused, but pay attention to hide it, and not used to display to the setting interface.

[0024] In the embodiment, the network card information management method further comprises: In response to no need to load the network card device information, directly performing a power-on self-test; In response to the network card device information not being loaded successfully, issuing a warning information.

[0025] The network card device information not being loaded successfully means that complete or valid device information cannot be obtained from the network card device within a specified time, or a verification error occurs during the loading process. The warning information includes but is not limited to: displaying an error code or prompt information on a display, sounding an alarm through a buzzer, or recording an error log into a non-volatile memory. The warning information can also be sent to a remote management system through a network management interface (such as IPMI or BMC).

[0026] The method of managing network card information further includes, after the warning information is issued, attempting to continue starting with a default configuration or entering a recovery mode.

[0027] In this embodiment, the method of managing network card information further includes: When it is detected that the network card device information fails to be correctly loaded more than a preset number of times, the start mode is fixed to the second start mode, and the start mode is prohibited from being switched to the first start mode, to prevent repeated failures.

[0028] In this embodiment, determining whether the network card configuration page needs to load the network card device information includes: Determining whether a network card control option in the network card configuration page needs to update associated network card device configuration information; In response to any network card control option in the network card configuration page needing to update the associated network card device configuration information, determining that the network card configuration page needs to load the network card device information, otherwise determining that the network card configuration page does not need to load the network card device information.

[0029] The network card control option includes but is not limited to: a network card MAC address, a port state, a VLAN configuration, a PXE start setting, a network wake-up (Wake-on-LAN) setting, or a network card firmware version information.

[0030] The determination of whether the network card control option needs to update the associated network card device configuration information includes: Comparing whether the current configuration of the network card control option is inconsistent with the actually detected network card device information, or detecting that a new network card device is installed or an existing network card device is removed, or detecting that a user manually triggers a network card information refresh operation in a network card setting interface.

[0031] In this embodiment, the method of managing network card information further includes: Setting a state flag for the network card device information saved in the network card extensible firmware interface driver, wherein the state flag includes no need to be reloaded, need to be reloaded, and has been reloaded, and the state flag is set as no need to be reloaded by default. After the network card device information is saved to the first configuration table, the state mark is modified from no need to be reloaded to need to be reloaded; after the network card device information saved in the first configuration table is updated to the second configuration table, the state mark is modified from need to be reloaded to have been reloaded.

[0032] That is, the state mark includes three states: "no need to be reloaded", "need to be reloaded", and "have been reloaded"; wherein "no need to be reloaded" indicates that the network card configuration page does not need to be updated, "need to be reloaded" indicates that the network card information needs to be reloaded in subsequent startup, and "have been reloaded" indicates that the information in the first configuration table has been synchronized to the second configuration table and the configuration page update is completed.

[0033] In the embodiment, when performing the driver environment stage check on the startup mode of the basic input output system and the state mark of the network card device information saved in the network card extensible firmware interface driver, it includes: In response to the startup mode being the second startup mode and the state mark being no need to be reloaded, the judgment on whether the network card configuration page needs to load the network card device information is skipped, and the power-on self-test is performed.

[0034] The driver environment stage refers to a hardware initialization and driver loading stage performed by the basic input output system or the unified extensible firmware interface firmware before the operating system is loaded.

[0035] The driver environment stage includes but is not limited to: a unified extensible firmware interface driver execution environment (DXE) stage or a basic input output system initialization stage.

[0036] The power-on self-test includes but is not limited to: memory detection, CPU initialization, storage device detection, or graphics device detection.

[0037] In the embodiment, in response to the need to load the network card device information, when the startup mode is the first startup mode, the startup mode is switched to the second startup mode and restarted, including: Judging whether the startup mode is the first startup mode; In response to the startup mode being the first startup mode, obtaining the state mark, modifying the state mark from no need to be reloaded to need to be reloaded, adjusting the startup mode to the second startup mode and restarting.

[0038] In the embodiment, loading the network card device information saved in the network card extensible firmware interface driver when the startup mode is the second startup mode includes: In response to the basic input output system starting through the second startup mode, when the driver environment stage detects that the state mark is need to be reloaded, the network card device information is obtained and saved in the first configuration table, so as to update the network card configuration page according to the network card device information saved in the first configuration table subsequently.

[0039] The network card device information is acquired by firmware, including reading a network card hardware register by a unified extensible firmware interface protocol or a PCI configuration space.

[0040] In the embodiment, the method for managing network card information further includes: In response to updating the network card control option information in the network card configuration page according to the network card device information in the second configuration table being completed, acquiring the network card device configuration information of the network card control options contained in the network card configuration page, judging whether the corresponding physical network card device can be acquired under the current hardware environment based on the network card device configuration information one by one, and verifying whether the physical network card device is in a normal working state one by one; In response to any network card control option being unable to acquire the corresponding physical network card device, or the network card control option being able to acquire the corresponding physical network card device and the physical network card device being detected to have a hardware fault, firmware exception or inconsistency with the configuration information saved in the network card configuration page, recording error information and stopping copying the information saved in the second configuration table into the first configuration table, and simultaneously marking the corresponding entry in the second configuration table as an invalid state, and waiting to be reloaded when the next system startup or when the configuration process is entered again; In response to all the network card control options contained in the network card configuration page having the corresponding physical network card device, and the hardware information and firmware information of each physical network card device being consistent with the network card device configuration information, and all being in a normal working state, generating first check data based on the hash calculation or the cyclic redundancy check calculation of the network card device information in the second configuration table, generating second check data based on the hash calculation or the cyclic redundancy check calculation of the network card device information in the first configuration table, and comparing the first check data with the second check data; In response to the comparison result of the first check data and the second check data being consistent, copying the information saved in the second configuration table into the first configuration table, and setting a synchronization identifier for the first configuration table and the second configuration table respectively, the synchronization identifier being used to indicate that the first configuration table and the second configuration table maintain consistent content in the current system running period, and the synchronization identifier being cleared when any configuration table is changed subsequently; In response to the comparison result of the first check data and the second check data being inconsistent, triggering a rollback mechanism, restoring the first configuration table to the state before copying, and writing error records in the system log.

[0041] That is, in response to updating the network card control option information in the network card configuration page according to the network card device information in the second configuration table being completed, further performing a verification and synchronization operation, wherein the verification and synchronization operation includes the following steps: first, obtaining the network card device configuration information of all network card control options contained in the network card configuration page, for each network card control option, judging one by one whether the corresponding physical network card device can be obtained under the current hardware environment based on the network card device configuration information, and further verifying whether the physical network card device is in a normal working state; if the judgment result shows that a certain network card control option cannot obtain the corresponding physical network card device, or although the corresponding device can be obtained, but the device is detected to have hardware failure, firmware exception or inconsistency with the configuration information saved in the network card configuration page, then record the error information and stop the subsequent copying step, at the same time, mark the corresponding entry in the second configuration table as invalid state, and reload when the next system startup or when entering the configuration process again; if the judgment result shows that all network card control options have corresponding physical network card devices, and the hardware information, firmware information and network card device configuration information of each device are consistent, and are all in a normal working state, then copy all the information saved in the second configuration table to the first configuration table to realize the consistency of the first configuration table and the second configuration table; wherein before performing the copying operation, it also includes generating a check data, the check data is obtained by hash calculation or cyclic redundancy check calculation based on the network card device information in the second configuration table, and is temporarily stored in the cache, after completing the copying operation, the generated check data is compared with the check data recalculated in the first configuration table, if the comparison result is consistent, it is confirmed that the copying operation is successful, if the comparison result is inconsistent, the rollback mechanism is triggered to restore the first configuration table to the state before copying, and write error record in the system log; after the copying operation is confirmed to be successful, it also includes setting a synchronization identifier for the first configuration table and the second configuration table respectively, the synchronization identifier is used to indicate that the two configuration tables maintain consistent content within the current system running period, and the synchronization identifier is cleared when any configuration table is changed subsequently, so as to trigger difference comparison and re-copy when executing the configuration process next time, thereby ensuring the integrity and consistency of the configuration table information between different running stages.

[0042] Among them, the network card device information saved in the first configuration table can be converted into information corresponding to the association of the network card control option and the target network card device, including: establishing a mapping table to associate the option configured by the user in the first startup mode (such as "network card 1") with the actual network card device (such as "network card with PCI device ID X").

[0043] Among them, the association of the network card control option in the network card configuration page and the network card device is bound by the unique identifier of the network card device (such as PCI bus / device / function number or MAC address).

[0044] The updating of the network card control option information in the network card configuration page according to the network card device information in the second configuration table comprises: filling the latest network card device information in the second configuration table into the corresponding display field of the network card configuration page, such as displaying the current MAC address, port state, etc.

[0045] The data structure of the first configuration table and the second configuration table both comprises: a network card unique identification field, a network card model field, a firmware version field, a MAC address field, a port state field, and a user-defined configuration field.

[0046] In the embodiment, the method for managing network card information further comprises: After successfully updating the network card device information saved in the first configuration table into the second configuration table each time, a check value is generated and stored in the non-volatile memory; When the basic input / output system is started next time, the integrity of the information in the second configuration table is verified by comparing the check value.

[0047] In the embodiment, the method for managing network card information further comprises: Before loading the network card device information, the number of network cards recorded in the firmware is compared with the number of currently detected network cards; In response to the change of the number of network cards, the state flag is set as needing to be reloaded, and the first configuration table and / or the second configuration table is regenerated.

[0048] In the embodiment, the method for managing network card information further comprises: When it is detected that the data in the second configuration table is inconsistent with the data in the first configuration table, the state flag is updated as needing to be reloaded, so as to ensure that the configuration page and the firmware data are consistent.

[0049] In the embodiment, the method for managing network card information further comprises:

[0050] In the embodiment, the method for managing network card information further comprises: A "restore default settings" option is provided in the network card configuration page, and when the option is triggered, the state flag is set as needing to be reloaded, and all customized network card configuration information is cleared.

[0051] In the above method for managing network card information, by switching the startup mode to the second startup mode when the basic input / output system is in the first startup mode when the network card device information needs to be loaded, the network card device information saved in the network card extensible firmware interface driver can be saved to the first configuration table, and the startup mode is switched back to the first startup mode and restarted; in response to the basic input / output system being restarted through the first startup mode, the network card device information saved in the first configuration table is updated to the second configuration table when the state flag is set to need to be reloaded, thereby updating the network card configuration page, wherein the state flag of the network card device information saved in the network card extensible firmware interface driver can accurately determine whether the network card device information needs to be reloaded when the startup mode is switched, the control steps are continuously executed when the startup mode is switched and restarted, the perfect network card device information is automatically transferred to the network card configuration page in the first startup mode, the network cards are accurately distinguished, the risk of maintenance errors is reduced, and the user experience is improved.

[0052] From the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software on a general hardware platform as necessary, and of course, it can also be implemented by hardware, but in many cases, the former is a better implementation.

[0053] In one embodiment, as shown in Figure 4 A device 10 for managing network card information is provided, which includes a system power-on checking module 1, a loading judgment module 2, an information loading control module 3, and a network card configuration page updating module 4.

[0054] The system power-on checking module 1 is configured to, in response to detecting that the basic input / output system is powered on, check the startup mode of the basic input / output system and the state flag of the network card device information saved in the network card extensible firmware interface driver in the driver environment stage.

[0055] The loading judgment module 2 is configured to judge whether the network card configuration page needs to load the network card device information.

[0056] The information loading control module 3 is configured to, in response to the network card device information needing to be loaded, switch the startup mode to the second startup mode and restart when the startup mode is the first startup mode, and load the network card device information saved in the network card extensible firmware interface driver when the startup mode is the second startup mode.

[0057] The network interface card (NIC) configuration page update module 4 is used to, in response to the successful loading of NIC device information, save the NIC device information to the first configuration table, modify the status mark to "re-load", switch the startup mode back to the first startup mode and restart; in response to the basic input / output system restarting through the first startup mode, when the status mark is "re-load", update the NIC device information saved in the first configuration table to the second configuration table, modify the status mark to "re-loaded", and update the NIC configuration page according to the NIC device information in the second configuration table.

[0058] In this embodiment, the information loading control module 3 is used to directly perform a power-on self-test if there is no need to load network card device information.

[0059] like Figure 4 As shown, the network interface card information management device 10 also includes a fault management module 5, which is used for: If the network interface card (NIC) device information fails to load, a warning message will be issued.

[0060] In this embodiment, the fault management module 5 is used for: When the network card device information fails to load correctly more than a preset number of times, the boot mode will be fixed to the second boot mode, and the boot mode will be prevented from switching to the first boot mode to prevent repeated failures.

[0061] In this embodiment, determining whether the network card configuration page needs to load network card device information includes: Determine whether the network interface card (NIC) control options in the NIC configuration page need to update the associated NIC device configuration information; If any network interface card (NIC) control option on the NIC configuration page requires updating the associated NIC device configuration information, then the NIC configuration page is determined to need to load the NIC device information; otherwise, the NIC configuration page is determined not to need to load the NIC device information.

[0062] In this embodiment, as Figure 4 As shown, the network interface card information management device 10 also includes a status flag management module 6, which is used for: Set status flags for network card device information stored in the network card extensible firmware interface driver. The status flags include no need to re-transfer, need to re-transfer, and already re-transferred. Set the status flag to no need to re-transfer by default. After saving the network card device information to the first configuration table, the status flag is changed from "not required to be re-transferred" to "re-transferred"; after updating the network card device information saved in the first configuration table to the second configuration table, the status flag is changed from "re-transferred" to "re-transferred".

[0063] In this embodiment, when checking the boot mode of the basic input / output system and the status flags of the network card device information stored in the network card extensible firmware interface driver during the execution of the driver environment phase, the following steps are included: In response to the startup mode being the second startup mode and the state flag being no need to relay, the determination whether the network card configuration page needs to load the network card device information is skipped, and a power-on self-test is performed.

[0064] In this embodiment, in response to the need to load the network card device information, the startup mode is switched to the second startup mode and restarted when the startup mode is the first startup mode, including: determining whether the startup mode is the first startup mode; In response to the startup mode being the first startup mode, the state flag is obtained, the state flag is modified from no need to relay to need to relay, the startup mode is adjusted to the second startup mode and restarted.

[0065] In this embodiment, loading the network card device information saved in the network card extensible firmware interface driver when the startup mode is the second startup mode includes: In response to the basic input output system being restarted through the second startup mode, when it is detected in the execution of the driver environment stage that the state flag is need to relay, the network card device information is obtained through the firmware and saved in the first configuration table, and the network card configuration page is updated according to the network card device information saved in the first configuration table.

[0066] In this embodiment, the network card configuration page updating module 4 is further used for: In response to the network card control option information in the network card configuration page being updated according to the network card device information in the second configuration table, the network card device configuration information of the network card control options contained in the network card configuration page is obtained, it is determined one by one whether the corresponding physical network card device can be obtained under the current hardware environment based on the network card device configuration information, and it is verified one by one whether the physical network card device is in a normal working state; In response to any network card control option being unable to obtain the corresponding physical network card device, or the network card control option being able to obtain the corresponding physical network card device and it being detected that the physical network card device has a hardware fault, firmware exception or inconsistency with the configuration information saved in the network card configuration page, error information is recorded and the copying of the information saved in the second configuration table into the first configuration table is terminated, and at the same time, the corresponding flag in the second configuration table is recorded as an invalid state, and is reloaded when the next system startup or configuration process is entered again; In response to all the network card control options contained in the network card configuration page having corresponding physical network card devices, and the hardware information, firmware information and network card device configuration information of each physical network card device being consistent and being in a normal working state, first check data is generated based on the hash calculation or cyclic redundancy check calculation of the network card device information in the second configuration table, second check data is generated based on the hash calculation or cyclic redundancy check calculation of the network card device information in the first configuration table, and the first check data and the second check data are compared; If the comparison results of the first verification data and the second verification data are consistent, the information stored in the second configuration table is copied into the first configuration table. A synchronization flag is set for the first configuration table and the second configuration table respectively. The synchronization flag is used to indicate that the contents of the first configuration table and the second configuration table remain consistent during the current system operation cycle. When any configuration table is changed in the future, the synchronization flag is cleared. If the comparison results of the first verification data and the second verification data are inconsistent, the rollback mechanism is triggered to restore the first configuration table to its state before copying and write an error record to the system log.

[0067] In this embodiment, as Figure 4 As shown, the network interface card (NIC) information management device 10 also includes an information verification module 7, which is used for: After each successful update of the network card device information saved in the first configuration table to the second configuration table, a check value is generated and stored in non-volatile memory; The integrity of the information in the second configuration table is verified by comparing the checksum value when the basic input / output system is started again.

[0068] In this embodiment, the information verification module 7 is used for: Before loading the network interface card (NIC) device information, compare the number of NICs recorded in the firmware with the number of NICs currently detected. In response to a change in the number of network interface cards (NICs), the status flag is set to require retransmission, and the first configuration table and / or the second configuration table are regenerated.

[0069] In this embodiment, the information verification module 7 is used for: When an inconsistency is detected between the data in the second configuration table and the first configuration table, the status flag is updated to indicate that a rewrite is required, in order to ensure that the configuration page and firmware data remain consistent.

[0070] In the above management network card information device, by switching the start mode to the second start mode when the start mode of the basic input / output system is the first start mode when the network card device information needs to be loaded, the network card device information saved in the network card extensible firmware interface driver can be saved to the first configuration table, and the start mode is switched back to the first start mode and restarted; in response to the basic input / output system being restarted through the first start mode, the network card device information saved in the first configuration table is updated into the second configuration table when the state flag is to be reloaded, the network card configuration page is updated, and the state flag of the network card device information saved in the network card extensible firmware interface driver is used to accurately know whether the network card device information is reloaded when the start mode is switched, the control steps are continuously executed when the start mode is switched and restarted, the perfect network card device information is automatically transferred to the network card configuration page of the first start mode, the network cards are accurately distinguished, the risk of maintenance error is reduced, and the user experience is improved.

[0071] The features of the embodiments of the management network card information device can be referred to the related descriptions of the embodiments of the management network card information method, which will not be repeated here.

[0072] Embodiments of the present application also provide an electronic device, including a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above management network card information method embodiments.

[0073] In one embodiment, the electronic device can be a server, and its internal structure diagram can be as shown in Figure 5 The electronic device includes a processor, a memory, a network interface and a database connected through a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the electronic device is used to store management network card information data. The network interface of the electronic device is used to communicate with the external terminal through the network connection. The computer program is executed by the processor to implement a management network card information method.

[0074] Embodiments of the present application also provide a computer readable storage medium, which stores a computer program, wherein the computer program is configured to run to perform the steps in any of the above management network card information method embodiments: In response to detecting that the basic input / output system is powered on, the start mode of the basic input / output system and the state flag of the network card device information saved in the network card extensible firmware interface driver are checked in the driving environment stage; determining whether the network card configuration page needs to load the network card device information; in response to the network card device information needing to be loaded, switching the startup mode to the second startup mode and restarting when the startup mode is the first startup mode, and loading the network card device information saved in the network card extensible firmware interface driver when the startup mode is the second startup mode; in response to the network card device information being successfully loaded, saving the network card device information to the first configuration table, modifying the state flag to be reloaded, switching the startup mode back to the first startup mode and restarting; in response to the basic input output system being restarted through the first startup mode, updating the network card device information saved in the first configuration table to the second configuration table when the state flag is to be reloaded, modifying the state flag to have been reloaded, and updating the network card configuration page according to the network card device information in the second configuration table.

[0075] In an example embodiment, the computer readable storage medium described above can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0076] Embodiments of the present application also provide a computer program product, the computer program product comprising a computer program, the computer program being executed by a processor to implement the steps in any of the above network card information management method embodiments: in response to detecting that the basic input output system is powered on, checking the startup mode of the basic input output system and the state flag of the network card device information saved in the network card extensible firmware interface driver in the driver environment phase; determining whether the network card configuration page needs to load the network card device information; in response to the network card device information needing to be loaded, switching the startup mode to the second startup mode and restarting when the startup mode is the first startup mode, and loading the network card device information saved in the network card extensible firmware interface driver when the startup mode is the second startup mode; in response to the network card device information being successfully loaded, saving the network card device information to the first configuration table, modifying the state flag to be reloaded, switching the startup mode back to the first startup mode and restarting; in response to the basic input output system being restarted through the first startup mode, updating the network card device information saved in the first configuration table to the second configuration table when the state flag is to be reloaded, modifying the state flag to have been reloaded, and updating the network card configuration page according to the network card device information in the second configuration table.

[0077] The embodiment of the present application further provides another computer program product, comprising a nonvolatile computer readable storage medium, the nonvolatile computer readable storage medium storing a computer program, the computer program being executed by a processor to implement the steps in any of the above network card information management method embodiments: In response to detecting that the basic input output system is powered on, checking a startup mode of the basic input output system and a state flag of network card device information saved in the network card extensible firmware interface driver in the performing of the driver environment stage; Determining whether the network card configuration page needs to load the network card device information; In response to the network card device information needing to be loaded, switching the startup mode to the second startup mode and restarting when the startup mode is the first startup mode, and loading the network card device information saved in the network card extensible firmware interface driver when the startup mode is the second startup mode; In response to the network card device information being loaded successfully, saving the network card device information to the first configuration table, modifying the state flag to needing to be reloaded, switching the startup mode back to the first startup mode and restarting; In response to the basic input output system being restarted through the first startup mode, updating the network card device information saved in the first configuration table to the second configuration table and modifying the state flag to having been reloaded when the state flag is needing to be reloaded, and updating the network card configuration page according to the network card device information in the second configuration table.

[0078] Those skilled in the art will further appreciate that the steps of the examples described in connection with the embodiments disclosed herein can be embodied in electronic hardware, computer software, or combinations of both. The description of the various examples is intended to cover any and all modifications and variations from the example embodiments disclosed herein. Therefore, it is intended that the embodiments disclosed herein be considered in all respects as illustrative and not restrictive. It is therefore understood that numerous modifications and variations could be made by those skilled in the art without departing from the scope of the application.

[0079] The above provides a method for managing network card information and an electronic device. The principles and implementation manners of the present application are described by using specific examples. The above description of the embodiments is only used to help understand the method and core idea of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the present application.

Claims

1. A method of managing network card information, the method comprising: receiving a request for network card information; and providing the network card information in response to the request. The method comprises: in response to detecting basic input / output system power-on, checking a startup mode of the basic input / output system and a state flag of network card device information saved in a network card extensible firmware interface driver during a driver environment stage; determining whether the network card configuration page needs to load the network card device information; in response to the network card device information needing to be loaded, switching the startup mode to a second startup mode and restarting when the startup mode is a first startup mode, and loading the network card device information saved in the network card extensible firmware interface driver when the startup mode is the second startup mode; in response to the network card device information being loaded successfully, saving the network card device information to a first configuration table, modifying the state flag to needing to be reloaded, switching the startup mode back to the first startup mode and restarting; in response to the basic input / output system being restarted through the first startup mode, updating the network card device information saved in the first configuration table to a second configuration table when the state flag is needing to be reloaded, modifying the state flag to having been reloaded, and updating the network card configuration page according to the network card device information in the second configuration table.

2. The method of claim 1, wherein, The determination of whether the network card configuration page needs to load the network card device information comprises: determining whether a network card control option in the network card configuration page needs to update associated network card device configuration information; in response to any network card control option in the network card configuration page needing to update associated network card device configuration information, determining that the network card configuration page needs to load the network card device information, otherwise determining that the network card configuration page does not need to load the network card device information.

3. The method of claim 1, wherein, The method further comprises: setting a state flag for the network card device information saved in the network card extensible firmware interface driver, wherein the state flag comprises not needing to be reloaded, needing to be reloaded, and having been reloaded, and the state flag is set as not needing to be reloaded by default; after saving the network card device information to the first configuration table, modifying the state flag from not needing to be reloaded to needing to be reloaded; and after updating the network card device information saved in the first configuration table to the second configuration table, modifying the state flag from needing to be reloaded to having been reloaded.

4. The method of claim 3, wherein, The checking of the startup mode of the basic input / output system and the state flag of the network card device information saved in the network card extensible firmware interface driver during the driver environment stage comprises: in response to the startup mode being the second startup mode and the state flag being not needing to be reloaded, skipping the determination of whether the network card configuration page needs to load the network card device information, and performing a power-on self-test.

5. The method of claim 3, wherein, The switching of the startup mode to the second startup mode and the restarting in response to the network card device information needing to be loaded comprises: determining whether the startup mode is the first startup mode; in response to the startup mode being the first startup mode, obtaining the state flag, modifying the state flag from not needing to be reloaded to needing to be reloaded, adjusting the startup mode to the second startup mode and restarting.

6. The method of claim 5, wherein, The loading of the network card device information saved in the network card extensible firmware interface driver when the startup mode is the second startup mode comprises: In response to the basic input / output system being started through the second starting mode, when it is detected in the execution of the driver environment stage that the state flag is to be reloaded, the network card device information is obtained through the firmware and saved in the first configuration table.

7. The method of claim 1, wherein, The method further comprises: In response to the updating of the network card control option information in the network card configuration page according to the network card device information in the second configuration table being completed, the network card device configuration information of the network card control options contained in the network card configuration page is obtained, it is judged one by one whether the corresponding physical network card device can be obtained under the current hardware environment based on the network card device configuration information, and it is verified one by one whether the physical network card device is in a normal working state; In response to any network card control option being unable to obtain the corresponding physical network card device, or the network card control option being able to obtain the corresponding physical network card device and it being detected that the physical network card device has a hardware fault, firmware exception or inconsistency with the configuration information saved in the network card configuration page, error information is recorded and the copying of the information saved in the second configuration table into the first configuration table is aborted, and the corresponding flag in the second configuration table is set to an invalid state, so as to be reloaded when the system is started next time or when the configuration process is entered again; In response to all the network card control options contained in the network card configuration page having the corresponding physical network card device, and the hardware information and firmware information of each physical network card device being consistent with the network card device configuration information and being in a normal working state, first check data is generated based on the hash calculation or cyclic redundancy check calculation of the network card device information in the second configuration table, second check data is generated based on the hash calculation or cyclic redundancy check calculation of the network card device information in the first configuration table, and the first check data and the second check data are compared; In response to the comparison result of the first check data and the second check data being consistent, the information saved in the second configuration table is copied into the first configuration table, and a synchronization identifier is set for the first configuration table and the second configuration table respectively, the synchronization identifier being used to indicate that the first configuration table and the second configuration table maintain consistent content in the current system running period, and the synchronization identifier is cleared when any configuration table is changed subsequently; In response to the comparison result of the first check data and the second check data being inconsistent, a rollback mechanism is triggered, the first configuration table is restored to the state before copying, and an error record is written in the system log.

8. The method of claim 1, wherein, The method further comprises: After the network card device information saved in the first configuration table is successfully updated into the second configuration table each time, a check value is generated and stored in the non-volatile memory; When the basic input / output system is started next time, the integrity of the information in the second configuration table is verified by comparing the check value.

9. The method of claim 1, wherein, The method further comprises: Before the network card device information is loaded, the number of network cards recorded in the firmware is compared with the number of network cards currently detected; In response to the number of network cards changing, the state flag is set to be reloaded, and the first configuration table and / or the second configuration table is regenerated.

10. An electronic device, comprising: It comprises: a memory for storing a computer program; a processor for implementing the steps of the method for managing network card information according to any one of claims 1 to 9 when executing the computer program.

Citation Information

Patent Citations

  • Linkage setting method and device for BIOS page options, equipment and medium

    CN114911532A

  • Method, device and equipment for generating starting item in traditional starting guide mode

    CN115878198A

  • DPU intelligent network card working component switching method, DPU chip, DPU intelligent network card and electronic equipment

    CN120196569A

  • Information processor, method for starting information processor and program

    JP2012174031A