Method for managing network card information and electronic device

By switching from the first boot mode to the second boot mode of the basic input/output system, loading and saving the network card's extensible firmware interface driver information, the problem of the network card configuration page being rudimentary is solved, enabling accurate differentiation of network card information and improving the user experience.

CN120909677BActive Publication Date: 2025-11-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511405612.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2025-11-28
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 switching to the second boot mode when the first boot mode is detected, loading information from the network card's extensible firmware interface driver, and saving it to the configuration table after reboot, the information on the network card configuration page is updated.

Benefits of technology

This improves the information on the network card configuration page in the first startup mode, reduces the risk of maintenance errors, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120909677B_ABST
    Figure CN120909677B_ABST
Patent Text Reader

Abstract

The application discloses a kind of management network card information method and electronic equipment, it is related to computer technical field, the application is by when the network card equipment information of needing to be loaded, if the start mode of basic input-output system is first start mode, start mode is switched to second start mode, can be realized with the network card equipment information saved in the network card extensible firmware interface drive is saved to first configuration table, and start mode is switched back to first start mode and restarts;After restarting, the network card equipment information saved in first configuration table is updated into second configuration table, realizes updating network card configuration page, wherein the state mark of the network card equipment information saved in the network card extensible firmware interface drive can be accurately known whether to carry out network card equipment information transfer when start mode switches, the control step of implementation is continuously executed when start mode switches and restarts, realizes automatic and perfect network card equipment information is transferred to the network card configuration page in first start mode, can be accurately distinguished network card.
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. However, 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 results in that the network card device information of a network card configuration page is simple and not convenient for a user to distinguish the network card physically, and increases the risk of maintenance error, which easily causes the user to be confused and reduces the user experience. To obtain the perfect network card device information 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 can identify the network card device information more perfectly, which causes difficulty in setting 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 perfect network card device information cannot be obtained when the start mode of the basic input / output system is the first start mode in the related art, which results in that the network card device information of the network card configuration page is simple and causes the network card to be easily distinguished incorrectly.

[0004] The present application provides a method for managing network card information, comprising:

[0005] 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;

[0006] Determining whether the network card configuration page needs to load the network card device information;

[0007] In response to the network card device information needing to be loaded, switching the start mode to the second start mode and restarting when the start mode is the 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;

[0008] 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 need to be reloaded, switching the start mode back to the first start mode and restarting;

[0009] 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.

[0010] 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 one of the network card information management methods.

[0011] 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 a network card extensible firmware interface driver are checked in a driver environment stage;

[0012] It is judged whether the network card configuration page needs to load network card device information;

[0013] In response to the network card device information needing to be loaded, 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;

[0014] 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, the startup mode is switched back to the first startup mode and restarted;

[0015] 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.

[0016] Through the present application, 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; after restarting through the first start mode, the network card device information saved in the first configuration table is updated to the second configuration table when the state flag is to be reloaded, realizing 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 know whether to perform network card device information reloading when the start mode is switched, realizing continuous execution of the control steps when the start mode is switched and restarted, realizing automatic transfer of the perfect network card device information to the network card configuration page in the first start mode, realizing accurate distinction of the network card, reducing the risk of maintenance errors, and improving the user experience. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0018] Figure 1 The principle diagram of the related art cannot obtain perfect information of the network card device in the first start mode;

[0019] Figure 2 The application environment diagram of the network card information management method in one embodiment of the present application;

[0020] Figure 3 The flowchart of the network card information management method in one embodiment of the present application;

[0021] Figure 4 The structure block diagram of the network card information management device in one embodiment of the present application;

[0022] Figure 5 The internal structure diagram of the computer device in one embodiment of the present application. DETAILED DESCRIPTION

[0023] 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 embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.

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

[0025] In order for those skilled in the art to better understand the present application, the present application will be further described in detail below in conjunction with the drawings and specific embodiments.

[0026] The basic input / output system (BIOS) is a firmware embedded on the motherboard of a computer, server, etc., responsible for initializing hardware and loading the operating system at startup. At computer startup, the BIOS performs a power-on self-test (POST) to check whether the basic hardware components (such as CPU, memory, hard disk, etc.) of the system are working properly. If an error is detected, a warning sound may be emitted or the startup process may be stopped. The BIOS is responsible for configuring various hardware resources in the system, such as interrupt request lines (IRQs), direct memory access channels (DMA channels), and memory address space, to ensure that various hardware devices can coexist harmoniously. Once the hardware detection is correct, the BIOS will find and load the first boot loader (such as MBR or UEFI boot sector) of the operating system from the 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. The BIOS provides a settings interface (usually entered by pressing a specific key such as Del, F2, etc. at startup), allowing users to modify system date and time, adjust startup order, enable or disable hardware devices, change security settings, etc. The BIOS supports ACPI (Advanced Configuration and Power Interface) standards, which can manage the power state of the system, implement energy-saving mode, 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.

[0027] NIC is a network interface controller, commonly known as a network card, which is a very important component in a computer system, responsible for connecting the computer to the network and implementing data transmission and reception functions between the network. 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 help handle burst traffic and provide stable services.

[0028] The importance of NIC in server systems is evident, as one of the important components in server systems, when designing and developing BIOS firmware, it is necessary to add a management configuration scheme for NIC. In the BIOS setup management interface, design NIC management control options to provide users with an interactive interface for manually configuring and managing NIC. The NIC management configuration interface lists each network card, and if it is a multi-port network card, it will enumerate all the ports. BIOS loads the network card driver to obtain the network card information during the DXE stage of the POST process, and uses the obtained network card name as the Title of each network card control option in the NIC management configuration interface to distinguish different network cards.

[0029] 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 typically not more than 1MB, which has become 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 in the NIC driver can be obtained by reading the network card data. NIC manufacturers store relevant information in the network card's UEFI standard-compliant driver. After reading the network card information, the required key information is extracted to create the NIC configuration management options.

[0030] In the Legacy mode, the information of the network card is read from the Option ROM of the NIC. The Option Rom is firmware run by the BIOS of the computer during platform initialization. However, the Option Rom technology is relatively outdated, and the function is relatively basic, and cannot provide rich device information like the EFI (Extensible Firmware Interface) driver. Therefore, the complete name of the NIC cannot be obtained, and the BIOS can only read the name such as "IBA 40G" from the Option ROM. If such information is used to create a NIC configuration management interface, it is not user-friendly for users. 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 trouble for users. Therefore, it is necessary to obtain the complete NIC information in the Legacy mode to create a NIC configuration management interface, which can display perfect NIC information, has strong readability and is easy to distinguish, and provides good functional experience for users. Based on the limitations of the traditional OptionROM technology, it is relatively difficult to achieve this.

[0031] Therefore, the current technical solution is to read the NIC EFI (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 limitations of the OptionROM technology, it is not possible to obtain perfect information of the NIC device, which causes the NIC information in the NIC configuration management interface to be simple and not convenient for users to distinguish the network card physically, increases the risk of maintenance errors, and easily causes trouble for users, and reduces the user experience.

[0032] As shown in Figure 1 When the perfect 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 perfect information of the network card device. After saving 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.

[0033] The method for managing the information of the network card provided in the application can be applied to, for example, Figure 2The application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 can set the state flag of the network card device information saved in the network card extensible firmware interface driver of the server 104, and the state flag is set to no need to be reprinted by default. Among them, the terminal 102 can be but not limited to various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices, and the server 104 can be realized 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, which leads to the inability to obtain perfect NIC device information; the mainstream NIC device basically supports EFI driver, and the manufacturer has saved the perfect information of the NIC in the EFI driver; However, the Legacy mode cannot read the EFI driver; 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 application solves the problem that the network card device information is not perfect in the NIC configuration management interface in the Legacy mode. The information in the NIC management configuration interface in the Legacy mode can also be consistent with the information stored in the network card EFI driver by the manufacturer, so that the user can distinguish the network card device through the network card information in the NIC management configuration interface, and the consistency of the BIOS 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.

[0034] As Figure 3 The embodiment of the application provides a network card information management method, which comprises the following steps:

[0035] Step S1, in response to detecting that the basic input and output system is powered 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 driving environment stage;

[0036] Step S2, judging whether the network card configuration page needs to load network card device information;

[0037] Step S3, in response to the need to load network card device information, the startup mode is switched to the second startup mode when the startup mode is the first startup mode, and the network card device information saved in the network card extensible firmware interface driver is loaded when the startup mode is the second startup mode;

[0038] 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 reprinted, switching the startup mode back to the first startup mode and restarting;

[0039] Step S5, 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 set to need to be transferred, modifying the state flag to have been transferred, and updating the network card configuration page according to the network card device information in the second configuration table.

[0040] The first startup mode is a Legacy mode, and the second startup mode is a UEFI mode. The Legacy mode has limited support for new hardware (such as an NVMe SSD and a multi-core processor), which can cause incomplete reading of network card information. The UEFI mode natively supports modern hardware and can more perfectly identify device information, including network card drivers and functions.

[0041] 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. The NIC configuration options are more clear and correspond to physical NIC devices, which reduces the difficulty of NIC management. The network card configuration page eliminates the differences between different modes. For users, the purpose is mainly configuration management, and the same function is presented uniformly, which is more friendly to users and brings better product use experience.

[0042] The state flag can be implemented by a hidden option, and a hidden NIC configuration option table (referred to as a first configuration table) can be implemented at the same time. The current network card configuration page content (referred to as a second configuration table) can be reused, but it should be hidden and not used to display to the setting interface.

[0043] In the embodiment, the method for managing network card information further includes:

[0044] In response to not needing to load the network card device information, a power-on self-test is directly performed.

[0045] In response to the network card device information not being successfully loaded, a warning information is sent.

[0046] The network card device information not being successfully loaded means that complete or valid device information cannot be obtained from the network card device within a specified time, or a verification error occurs in the loading process. The warning information includes but is not limited to displaying an error code or a prompt information on a display, sending an alarm sound through a buzzer, or recording an error log in 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).

[0047] The method for managing network card information further includes: after the warning information is sent, attempting to continue to start with a default configuration or entering a recovery mode.

[0048] In the embodiment, the method for managing network card information further includes:

[0049] When it is detected that the network card device information fails to be correctly loaded for more than a preset number of times, the startup mode is fixed as the second startup mode, and the startup mode is prohibited from being switched to the first startup mode to prevent repeated failures.

[0050] In this embodiment, determining whether the network card configuration page needs to load the network card device information comprises:

[0051] determining whether a network card control option in the network card configuration page needs to update associated network card device configuration information;

[0052] In response to any network card control option in the network card configuration page needing to update associated network card device configuration information, it is determined that the network card configuration page needs to load the network card device information, otherwise it is determined that the network card configuration page does not need to load the network card device information.

[0053] The network card control option includes but is not limited to a network card MAC address, a port state, VLAN configuration, PXE startup setting, Wake-on-LAN setting, or network card firmware version information.

[0054] The determination of whether the network card control option needs to update the associated network card device configuration information comprises:

[0055] 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 the user manually triggers a network card information refresh operation in the network card setting interface.

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

[0057] 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;

[0058] After the network card device information is saved to the first configuration table, the state flag 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 flag is modified from need to be reloaded to has been reloaded.

[0059] That is, the state flag includes three states: no need to be reloaded, need to be reloaded, and has 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 has 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.

[0060] In the embodiment, when performing 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 in the driving environment stage, the method comprises:

[0061] In response to the startup mode being the second startup mode and the state flag being no need to relay, the method skips the judging of whether the network card configuration page needs to load the network card device information, and proceeds to the power-on self-test.

[0062] The driving environment stage refers to a hardware initialization and driving loading stage performed by the basic input output system or the unified extensible firmware interface firmware before the loading of the operating system.

[0063] The driving environment stage comprises but is not limited to the unified extensible firmware interface driving execution environment (DXE) stage or the basic input output system initialization stage.

[0064] The power-on self-test comprises but is not limited to the memory detection, the CPU initialization, the storage device detection, or the graphic device detection.

[0065] In the embodiment, in response to the need to load the network card device information, the method switches the startup mode to the second startup mode and restarts when the startup mode is the first startup mode, comprising:

[0066] Judging whether the startup mode is the first startup mode;

[0067] In response to the startup mode being the first startup mode, the method acquires the state flag, modifies the state flag from no need to relay to need to relay, adjusts the startup mode to the second startup mode and restarts.

[0068] In the embodiment, 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:

[0069] In response to the basic input output system starting through the second startup mode, when the state flag is detected as need to relay in the driving environment stage, the method acquires the network card device information and saves it 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.

[0070] The network card device information is acquired through the firmware, comprising reading the network card hardware register through the unified extensible firmware interface protocol or the PCI configuration space.

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

[0072] 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, the network card device configuration information of the network card control options contained in the network card configuration page is obtained, and 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 the physical network card device is verified one by one whether it is in a normal working state;

[0073] 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 detecting that the physical network card device has a hardware fault, firmware exception or is inconsistent 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 stopped, and at the same time, the corresponding record in the second configuration table is marked as invalid, and is reloaded when the next system startup or when the configuration process is entered again;

[0074] In response to all network card control options contained in the network card configuration page having corresponding physical network card devices, 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, 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;

[0075] 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 the first configuration table and the second configuration table are respectively set with a synchronization identifier, the synchronization identifier being used to indicate that the first configuration table and the second configuration table maintain consistent content within the current system running period, and the synchronization identifier is cleared when any configuration table is changed subsequently;

[0076] 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 error records are written in the system log.

[0077] 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.

[0078] 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 (for example, "network card 1") with the actual network card device (for example, "network card with PCI bus / device / function number X").

[0079] 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).

[0080] 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.

[0081] 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.

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

[0083] 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.

[0084] 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.

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

[0086] 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.

[0087] 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.

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

[0089] 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.

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

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

[0092] 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.

[0093] 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.

[0094] 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.

[0095] 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.

[0096] 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.

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

[0098] 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.

[0099] The network card configuration page updating module 4 is configured to, in response to successful loading of the network card device information, save the network card device information to the first configuration table, modify the state flag to "to be transferred", switch the startup mode back to the first startup mode, and restart; in response to the basic input / output system being restarted through the first startup mode, update the network card device information saved in the first configuration table to the second configuration table when the state flag is "to be transferred", modify the state flag to "has been transferred", and update the network card configuration page according to the network card device information in the second configuration table.

[0100] In the embodiment, the information loading control module 3 is configured to, in response to no need to load the network card device information, directly perform a power-on self-test.

[0101] As shown in FIG. 1, the network card information management apparatus 10 further includes a fault management module 5, which is configured to: Figure 4

[0102] in response to the network card device information not being successfully loaded, issue a warning message.

[0103] In the embodiment, the fault management module 5 is configured to:

[0104] In response to the network card device information not being successfully loaded for more than a preset number of times, fix the startup mode to the second startup mode and prohibit the startup mode from being switched to the first startup mode, to prevent repeated failures.

[0105] In the embodiment, the determination of whether the network card configuration page needs to load the network card device information includes:

[0106] determining whether the network card control options in the network card configuration page need to update the associated network card device configuration information;

[0107] in response to any of the network card control options 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.

[0108] In the embodiment, as shown in FIG. 1, the network card information management apparatus 10 further includes a state flag management module 6, which is configured to: Figure 4

[0109] set 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 transfer", "to be transferred", and "has been transferred", and the state flag is set to "no need to transfer" by default;

[0110] after saving the network card device information to the first configuration table, modify the state flag from "no need to transfer" to "to be transferred"; and after updating the network card device information saved in the first configuration table to the second configuration table, modify the state flag from "to be transferred" to "has been transferred". ​​

[0111] In the embodiment, when performing 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 in the driving environment stage, it comprises:

[0112] In response to the startup mode being the second startup mode and the state flag being no need to relay, the judgment of whether the network card configuration page needs to load the network card device information is skipped, and the power-on self-test is performed.

[0113] In the 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, comprising:

[0114] Judging whether the startup mode is the first startup mode;

[0115] 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.

[0116] 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 comprises:

[0117] In response to the basic input / output system being restarted through the second startup mode, when it is detected in the driving 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.

[0118] In the embodiment, the network card configuration page updating module 4 is further used for:

[0119] In response to the updating of the network card control option information in the network card configuration page being completed according to the network card device information in the second configuration table, the network card device configuration information of the network card control option contained in the network card configuration page is obtained, whether the corresponding physical network card device can be obtained under the current hardware environment based on the network card device configuration information is judged one by one, and whether the physical network card device is in a normal working state is verified one by one;

[0120] 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 detecting 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, 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 the configuration process is entered again;

[0121] If all network card control options included in the network card configuration page have corresponding physical network card devices, and the hardware information, firmware information and network card device configuration information of each physical network card device are consistent with the network card device configuration information, and all are in a normal working state, then a first verification data is generated based on the network card device information in the second configuration table by performing hash calculation or cyclic redundancy check calculation, and a second verification data is generated based on the network card device information in the first configuration table by performing hash calculation or cyclic redundancy check calculation, and the first verification data and the second verification data are compared.

[0122] 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.

[0123] 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.

[0124] 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:

[0125] 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;

[0126] The integrity of the information in the second configuration table is verified by comparing the checksums when the basic input / output system is started again.

[0127] In this embodiment, the information verification module 7 is used for:

[0128] 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.

[0129] 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.

[0130] In this embodiment, the information verification module 7 is used for:

[0131] 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.

[0132] 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 to 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 can accurately know whether the network card device information needs to be 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.

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

[0134] Embodiments of the present application also provide an electronic device, comprising 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.

[0135] 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 external terminals through network connection. The computer program is executed by the processor to implement a management network card information method.

[0136] 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:

[0137] In response to detecting that the basic input output system is powered on, checking a state flag of a network card device information saved in the network card extensible firmware interface driver and a start mode of the basic input output system in an execution environment stage;

[0138] Determining whether the network card configuration page needs to load the network card device information;

[0139] In response to the network card device information needing to be loaded, switching the start mode to the second start mode and restarting when the start mode is the 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;

[0140] In response to the network card device information being successfully loaded, saving the network card device information to a first configuration table, modifying the state flag to needing to be transferred, 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 start 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 transferred, modifying the state flag to having been transferred, and updating the network card configuration page according to the network card device information in the second configuration table.

[0141] 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.

[0142] 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:

[0143] In response to detecting that the basic input output system is powered on, checking a state flag of a network card device information saved in the network card extensible firmware interface driver and a start mode of the basic input output system in an execution environment stage;

[0144] Determining whether the network card configuration page needs to load the network card device information;

[0145] In response to the network card device information needing to be loaded, switching the start mode to the second start mode and restarting when the start mode is the 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;

[0146] In response to the network card device information being successfully loaded, saving the network card device information to a first configuration table, modifying the state flag to needing to be transferred, 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 start 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 transferred, modifying the state flag to having been transferred, and updating the network card configuration page according to the network card device information in the second configuration table.

[0147] In response to the basic input output system being restarted through the first startup mode, when the state flag is set as needing to be reloaded, the network card device information saved in the first configuration table is updated into the second configuration table, and the state flag is modified as having been reloaded, and the network card configuration page is updated according to the network card device information in the second configuration table.

[0148] Embodiments of the present application also provide another computer program product, comprising a non-volatile computer readable storage medium, the non-volatile 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:

[0149] In response to detecting that the basic input output system is powered on, 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 are checked in the driver environment phase;

[0150] It is determined whether the network card configuration page needs to load the network card device information;

[0151] In response to needing 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, 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;

[0152] In response to the network card device information being successfully loaded, the network card device information is saved into the first configuration table, the state flag is modified as needing to be reloaded, the startup mode is switched back to the first startup mode and restarted;

[0153] In response to the basic input output system being restarted through the first startup mode, when the state flag is set as needing to be reloaded, the network card device information saved in the first configuration table is updated into the second configuration table, and the state flag is modified as having been reloaded, and the network card configuration page is updated according to the network card device information in the second configuration table.

[0154] Those skilled in the art will further appreciate that the steps of the example methods described in connection with the embodiments disclosed herein can be embodied in electronic hardware, computer software, or combinations of both, and that the various examples described can generally be divided into components and steps for ease of description, and that such components and steps can be implemented in hardware and / or software. The particular application of the disclosed technology depends on the specific implementation and the design constraints imposed by the particular application. Those skilled in the art can implement the described features in varying ways for each particular application, but such implementation should not be construed to limit the scope of the present application.

[0155] The above describes in detail the method for managing network card information and the electronic device provided by the application. The principles and implementation manners of the application are described by using specific examples, and the above description of the embodiments is only applicable to helping understand the method of the application and the core idea thereof. It should be pointed out that, for those skilled in the art, some improvements and modifications can be made to the application without departing from the principles of the application, and these improvements and modifications also fall within the protection scope of the 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

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

    CN120196569A