Network card management method, device, equipment and medium
By performing type matching and data collection and processing based on preset strategies through the network card information in the pre-configured configuration file, the problem of inflexible network card data collection and processing in the existing technology is solved, efficient and accurate network card data management is achieved, and the performance and reliability of the network system are improved.
Patent Information
- Application Number
- CN202510839000.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-06-20
AI Technical Summary
The existing technology is difficult to flexibly adjust the data collection and data processing methods according to the actual type of network card and business needs, and is unable to efficiently obtain and process network card data.
Type matching is performed through the network card information in the pre-configured configuration file, data is collected using the preset collection strategy, and the target data is processed based on the preset data processing strategy to ensure that the collected data meets business needs.
It realizes efficient and accurate data collection and processing of diverse network card types in a complex and changing network environment, improves the efficiency and accuracy of network card data processing, and ensures the reliability and stability of the network system.
Smart Images

Figure CN120378321B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a network card management method, device, equipment and medium. Background Art
[0002] With the continuous advancement of information technology, various network application scenarios are becoming increasingly complex and diverse, placing higher demands on the functionality and performance of network cards (NICs). Different application scenarios, such as data centers, enterprise office networks, and the Industrial Internet, often require different types and specifications of NICs to meet specific needs. Furthermore, different NIC types and business requirements may require different data collection strategies and processing methods when collecting and processing NIC data. Currently, NIC management methods make it difficult to flexibly adjust data collection and processing methods based on the actual NIC type and business needs, resulting in inefficient acquisition and processing of NIC data. Summary of the Invention
[0003] The present application provides a network card management method, device, equipment and medium to at least solve the problem in related technologies that it is difficult to flexibly adjust data collection and data processing methods according to the actual type of network card and business needs, and it is impossible to efficiently obtain and process network card data.
[0004] In a first aspect, the present application provides a network card management method, comprising:
[0005] Obtaining a preset configuration file, wherein the preset configuration file includes network card information;
[0006] Determining whether the network card type of the target network card matches the network card type in the network card information according to the network card information;
[0007] In response to determining that the network card type of the target network card matches the network card type in the network card information, data is collected from the target network card according to a preset collection strategy in the network card information to obtain target data;
[0008] The target data is processed based on a preset data processing strategy in the network card information.
[0009] In a second aspect, the present application further provides a network card management device, comprising:
[0010] An acquisition module, configured to acquire a preset configuration file, wherein the preset configuration file includes network card information;
[0011] a matching module, configured to determine, based on the network card information, whether the network card type of the target network card matches the network card type in the network card information;
[0012] a collection module, configured to, in response to determining that the network card type of the target network card matches the network card type in the network card information, collect data from the target network card according to a preset collection strategy in the network card information to obtain target data;
[0013] A processing module is used to process the target data based on a preset data processing strategy in the network card information.
[0014] In a third aspect, the present application further provides an electronic device, comprising:
[0015] Memory for storing computer programs;
[0016] A processor is configured to implement the steps of any one of the methods of the first aspect when executing a computer program.
[0017] In a fourth aspect, the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein when the computer program is executed by a processor, the steps of any method of the first aspect are implemented.
[0018] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which implements the steps of any one of the methods of the first aspect when executed by a processor.
[0019] This application provides a network card management method, apparatus, device, and medium. This method matches network card types using network card information in a pre-configured configuration file to ensure that the target network card meets the requirements. When the target network card matches the network card type in the network card information, data is collected according to a preset collection strategy in the network card information to ensure that the collected target data meets business requirements. The collected target data is then processed based on a preset data processing strategy in the network card information, ensuring the efficiency and accuracy of network card data processing. This method can cope with complex and changing network environments and diverse network card types. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] Figure 1 An application scenario diagram corresponding to a network card management method provided in one embodiment of the present application;
[0022] Figure 2 A flowchart of a network card management method provided in one embodiment of the present application;
[0023] Figure 3 A flowchart of a network card management method provided in another embodiment of the present application;
[0024] Figure 4 A schematic diagram of the structure of a network card management device provided in one embodiment of the present application;
[0025] Figure 5 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0027] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0028] In today's era of rapid digital development, computer networks, as the core infrastructure for information transmission and interaction, are crucial for their stability and performance. Network adapters (NICs), the bridge connecting computers to the network, undertake critical tasks such as data transmission, reception, and transmission. Their operational status and performance directly impact the reliability of the entire network system. With the continuous advancement of information technology, various network application scenarios are becoming increasingly complex and diverse, placing higher demands on the functionality and performance of NICs. Different application scenarios, such as data centers, enterprise office networks, and the Industrial Internet, often require different types and specifications of NICs to meet specific needs. Furthermore, different NIC types and business requirements may require different data collection strategies and processing methods. However, existing NIC management solutions are difficult to flexibly adjust to the actual NIC conditions and business needs. Consequently, they are unable to efficiently acquire and process NIC data, making it difficult to accurately monitor NIC performance.
[0029] Therefore, when facing the technical problems of the above-mentioned related technologies, in order to be able to flexibly adjust the data collection and processing methods to meet different network card types and business needs. First, in response to the problem of diverse network card types, a configuration file can be pre-configured. The preset configuration file contains network card information to provide a basis for subsequent matching and operations. Then, by comparing the type of the target network card with the network card type in the configuration file, it can be accurately determined whether the target network card meets the requirements; secondly, in order to meet the requirements of different business needs for data collection and processing methods, a method based on preset collection strategies and preset data processing strategies can be adopted. When the target network card matches the network card type in the configuration file, data collection is performed according to the preset collection strategy in the network card information to ensure that the collected target data can meet the business needs; at the same time, the collected target data is processed based on the preset data processing strategy in the network card information to improve the efficiency and accuracy of data processing.
[0030] Figure 1 Schematic diagram of an application scenario corresponding to a network card management method provided in an embodiment of the present application. Figure 1 As shown in , the application scenario includes: a user device 10, a network card management device 11, and a network card 12. The user device 10 is in communication with the network card management device 11, and the network card 12 is in communication with the network card management device 11. Specifically, when network card management is required, the user sends a compiled configuration file to the network card management device 11 via the user device 10, where the configuration file includes network card information. After obtaining the configuration file, the network card management device 11 obtains the network card type of the network card 12 and compares the network card type with the network card type in the configuration file. If the comparison is successful, data is collected from the network card according to the preset collection policy in the configuration file to obtain collected data. The collected data is then processed according to the preset data processing policy in the configuration file.
[0031] Optionally, the network card management device may be a baseboard management controller (BMC). Optionally, the network card may be a smart network card.
[0032] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0033] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or module, which can be electrical, mechanical or other forms.
[0034] Figure 2 A flowchart of a network card management method provided in one embodiment of the present application is shown as follows: Figure 2 As shown, the execution subject of this embodiment is a network card management device, which can be implemented by a computer program or a medium storing a relevant computer program, such as a USB flash drive and / or an optical disk; or it can be implemented by a physical device integrated or installed with a relevant computer program, such as a chip or electronic device. The electronic device can be a computer or a server. The network card management method provided in this embodiment includes the following steps:
[0035] S201: Obtain a preset configuration file, where the preset configuration file includes network card information.
[0036] Optionally, in actual applications, the preset configuration file may be stored in a local server, a cloud storage device, or other accessible storage media.
[0037] Optionally, the preset configuration file may be a JSON file.
[0038] Pre-configured configuration files are files pre-set or compiled by administrators or technical personnel based on the characteristics and application requirements of different network interface cards (NICs). For example, an enterprise network environment may coexist with multiple brands and models of NICs, each with different hardware architectures and performance characteristics. Pre-configured configuration files establish detailed information for each type of NIC, enabling NIC management devices to quickly identify and understand the characteristics and capabilities of each NIC.
[0039] Optionally, the network card information may include the type of network card, such as Ethernet, wireless, or fiber optic. It may also include parameters such as the model, supported communication protocols, and data transfer rate. It should be noted that the network card information describes the basic attributes and functional characteristics of the network card, providing basic data for subsequent accurate management of the network card.
[0040] S202: Determine, based on the network card information, whether the network card type of the target network card matches the network card type in the network card information.
[0041] Specifically, after obtaining the network card information in the preset configuration file, it is first determined whether the network card type of the target network card matches the network card type in the network card information, thereby providing reliable protection for subsequent data collection and data processing.
[0042] Alternatively, the target network card's type can be determined by reading its hardware identification or software configuration information. For example, for an Ethernet network card, its type can be determined by identifying its media access control address prefix, device driver information, etc.; for a wireless network card, its type can be determined based on the wireless network standards it supports and the wireless communication chip model.
[0043] Optionally, the type of the target network card is compared with the network card types recorded in the preset configuration file one by one to determine whether the two match. Only by accurately identifying the network card type can an appropriate management policy be selected for the target network card.
[0044] It should be noted that the NIC type matching process may also include comparing the NIC's hardware identifier, driver version, and other information to ensure accurate matching. For example, only when the hardware identifier of a NIC is detected to be consistent with the identifier of a specific NIC type in the NIC information is the NIC type of the target NIC considered to match the NIC type in the NIC information.
[0045] S203 : In response to determining that the network card type of the target network card matches the network card type in the network card information, data is collected from the target network card according to a preset collection strategy in the network card information to obtain target data.
[0046] Specifically, when the network card type of the target network card matches the network card type in the preset configuration file, data collection will be performed on the target network card according to the collection strategy preset in the configuration file to obtain target data.
[0047] Preset collection strategies are developed based on the data transmission characteristics and application scenario requirements of different types of network cards. For example, for fiber-optic network cards with high data transmission rates and large data flows, the preset collection strategy may set a higher collection frequency and a larger collection packet size to ensure timely and comprehensive acquisition of network data. For wireless network cards, considering their signal stability and bandwidth fluctuations, the preset collection strategy may focus on reasonably adjusting the collection frequency while ensuring data integrity, avoiding excessive network resource consumption due to excessive collection. By adopting an adaptive preset collection strategy, the accuracy and effectiveness of data collection can be improved, ensuring that the collected target data truly reflects the operating status of the target network card and network communication status.
[0048] Optionally, the preset collection policy may include, but is not limited to, the following: the type of data to be collected, such as traffic statistics, the number of error packets, network connection status, etc.; and the collection interval, such as once per second, once per minute, etc. For example, taking traffic statistics as an example, the preset collection policy may stipulate that the upload and download traffic of the target network card needs to be monitored in real time, with a collection cycle of every ten milliseconds, accurately recording the traffic changes within each cycle, thereby providing high-resolution raw data for network traffic analysis and facilitating the timely detection of abnormal fluctuations in network traffic. Specifically, this embodiment does not limit the specific method of the preset collection policy, and it can be flexibly set according to actual needs.
[0049] The target data is the data obtained by collecting data from the target network card according to the preset collection strategy.
[0050] S204: Process the target data based on the preset data processing strategy in the network card information.
[0051] Specifically, after the target data is acquired, the target data is further processed based on the preset data processing strategy in the network card information.
[0052] Preset data processing strategies are pre-set based on the network card type and data collection characteristics. For example, for data collected from Ethernet network cards, since the data format is relatively fixed, the pre-set data processing strategy can focus on data filtering, verification, and protocol conversion to remove invalid data and ensure data accuracy and compatibility. For data collected from wireless network cards, considering the potential for data errors caused by wireless signal interference, the pre-set data processing strategy can add data error correction and redundancy processing to improve data reliability. Pre-set data processing strategies enable efficient and accurate processing of collected target data, meeting the data requirements of different application scenarios.
[0053] Optionally, the preset data processing strategy may include multiple operations such as data cleaning, data conversion, and data aggregation. For example, during the data cleaning phase, noise information in the collected data can be removed, such as abnormal traffic peaks occasionally generated by network card hardware failures; during the data conversion phase, traffic data can be converted from its original bit rate format to byte rate format; during the data aggregation phase, traffic data from multiple time periods can be summarized to generate hourly or daily traffic statistics reports. Specifically, this embodiment does not limit the specific method of the preset data processing strategy, and it can be flexibly configured according to actual needs.
[0054] The network card management method provided in the embodiments of the present application matches the network card type using the network card information in a pre-configured configuration file to ensure that the target network card meets the requirements. When the target network card matches the network card type in the network card information, data is collected according to the preset collection strategy in the network card information to ensure that the collected target data meets the business requirements. The collected target data is then processed based on the preset data processing strategy in the network card information, ensuring the efficiency and accuracy of network card data processing. This network card management method can cope with complex and changing network environments and diverse network card types.
[0055] As an optional implementation manner, based on any of the above embodiments, determining whether the network card type of the target network card matches the network card type in the network card information according to the network card information specifically includes the following steps:
[0056] First, obtain the target network card identifier of the target network card.
[0057] The target NIC identifier is information that uniquely identifies the target NIC, such as the NIC's media access control address, device serial number, or hardware ID. NIC identifiers are typically assigned by the NIC manufacturer during the production process and stored in the NIC's hardware chip or driver. The target NIC identifier can be obtained by calling the operating system's network interface API (Application Programming Interface) or a specific driver interface.
[0058] Secondly, the target network card identifier is compared with the preset network card identifier in the network card information.
[0059] Optionally, the network card information in the preset configuration file also includes a preset network card identifier corresponding to each network card type. The preset identifier is pre-set during the configuration phase, and the obtained target network card identifier is compared byte by byte or field by field with the preset network card identifier in the preset configuration file to determine whether the two are the same.
[0060] Optionally, an exact match or a fuzzy match may be used during the comparison process, depending on the design requirements and the format of the preset configuration file.
[0061] Optionally, when a new network card type is added, it is only necessary to modify the preset network card identifier of the network card information.
[0062] Finally, when the target network card identifier is the same as the preset network card identifier, it is determined that the network card type of the target network card matches the network card type in the network card information.
[0063] Specifically, if the comparison result shows that the target network card identifier is completely consistent with a preset network card identifier in the preset configuration file, it can be determined that the type of the target network card matches the network card type corresponding to the preset network card identifier.
[0064] It should be noted that since network card identifiers are typically unique and unaffected by factors such as the network card driver version and operating system environment, identifier-based matching offers high accuracy and reliability, ensuring accurate identification of the target network card type and providing a reliable basis for subsequent data collection and processing.
[0065] The network card management method provided in the embodiment of the present application obtains the target network card identifier and compares it with the preset network card identifier. When the two are the same, the network card type match is determined. The identifier-based comparison method is simple, direct, accurate and reliable, and can quickly complete the network card type matching, providing an accurate basis for subsequent operations, effectively ensuring the accuracy and efficiency of network card management.
[0066] As an optional implementation manner, based on any of the above embodiments, the preset collection strategy includes a preset collection target and a preset collection period.
[0067] Specifically, data collection is performed on the target network card according to the preset collection strategy in the network card information to obtain target data, which specifically includes the following steps:
[0068] First, the collection data type is determined according to the preset collection target in the network card information; wherein the collection data type includes threshold sensor data, discrete sensor data and non-sensor data;
[0069] The preset acquisition target is a preset data direction that needs to be acquired from the target network card. Specifically, the acquisition data type includes threshold sensor data, discrete sensor data, and non-sensor data.
[0070] Among them, threshold sensor data refers to data related to specific thresholds monitored by various sensors built into the target network card. For example, the temperature data collected by the network card operating temperature sensor, when the temperature exceeds the preset threshold, this data plays an important role in evaluating the working status of the network card and warning of potential failures. Among them, discrete sensor data, such as the data generated by the network card connection status sensor, its status is discrete, such as connected, disconnected, etc., and is used to reflect the network connection status of the network card in real time. Among them, non-sensor data includes but is not limited to business data transmitted by the network card, network protocol control data, etc. The network card management device filters out the corresponding collection data type from the numerous data outputs of the target network card based on the preset collection target to ensure that the collected data meets the application requirements.
[0071] Secondly, based on the collected data type and the preset collection period, periodic data collection is performed on the target network card to obtain target data.
[0072] The preset collection period is a period that is pre-set based on the changing characteristics of different collection data types and the application's requirements for data real-time performance.
[0073] Optionally, for threshold sensor data such as the network card operating temperature, which changes more slowly, the preset collection period can be relatively long, such as collecting data every five minutes. This can not only meet the needs of monitoring the network card temperature status, but also avoid excessive collection and occupation of system resources. For discrete sensor data such as the network card connection status, since its status changes more frequently and has high real-time requirements, the preset collection period will be set to be shorter, such as collecting data multiple times per second. For non-sensor data, if the application scenario has high real-time requirements for data, such as network data monitoring for real-time video transmission, a shorter collection period will be set to ensure timely acquisition of data changes. If the real-time requirements are lower, such as the collection of some regularly backed-up file transfer data, the collection period can be appropriately extended. By combining the collection data type and the preset collection period for periodic collection, the network card management device can efficiently and accurately obtain target data, providing a data basis for subsequent data processing.
[0074] The network card management method provided in the embodiments of this application accurately determines the type of data to be collected by pre-setting collection targets and rationally arranges the collection frequency based on a pre-set collection cycle, thus avoiding data redundancy or loss. For example, different collection cycles are used for threshold sensor data, discrete sensor data, and non-sensor data with different characteristics. This ensures that the collected data truly and accurately reflects the operating status of the network card and network communication status, thereby improving the accuracy and reliability of data collection.
[0075] As an optional implementation manner, based on any of the above embodiments, the preset data processing strategy includes preset data matching rules and preset mapping rules.
[0076] The target data is processed based on the preset data processing strategy in the network card information, specifically including the following steps:
[0077] First, determine the data type of the target data.
[0078] Specifically, after obtaining the target data, the collected target data is first analyzed to determine whether it belongs to threshold sensor data, discrete sensor data, or non-sensor data based on information such as the source, format, and characteristics of the data.
[0079] For example, continuous numerical data with temperature unit identifiers can be determined as threshold sensor data; data in the form of specific status codes can be determined as discrete sensor data, such as 0 for disconnected and 1 for connected; data that conforms to a specific network protocol format can be determined as non-sensor data.
[0080] Specifically, when the target data is monitoring data from a threshold sensor, data judgment or data matching is performed on the target data according to preset data matching rules to obtain a matching result, and the matching result is written to the baseboard management controller sensor interface. The preset data matching rules include any one or more of threshold comparison, interval judgment, and regular expression matching.
[0081] When the target data is monitoring data from a threshold sensor, the network card management device processes it according to a preset data matching rule, wherein the preset data matching rule includes any one or more of threshold comparison, interval judgment, and regular expression matching.
[0082] For example, for monitoring data from a network card temperature sensor, a threshold comparison rule can be set to compare the current temperature value with a preset temperature threshold (e.g., 75°C). If the preset temperature threshold is exceeded, a high temperature warning match result is generated. Alternatively, a range judgment rule can be set to divide temperature values into different ranges (e.g., 0-40°C is the normal range, 41°C-60°C is the caution range, 61°C-80°C is the warning range, and 81°C and above is the danger range). The current temperature range is determined and a corresponding match result is generated. Furthermore, for threshold sensor data containing information in a specific format, regular expression matching rules can be used to extract and process the information within the data. Once the matching result is generated, it is written to the baseboard management controller (BMC) sensor interface, allowing the BMC to monitor and manage the network card's operating status in real time and promptly detect and address potential hardware failures.
[0083] Specifically, when the target data is monitoring data of a discrete sensor, the target data is converted into a corresponding state value according to a preset mapping rule, and the state value is written to the baseboard management controller sensor interface.
[0084] When the target data is the monitoring data of a discrete sensor, the network card management device converts it into a corresponding status value according to a preset mapping rule. It should be noted that the preset mapping rule presets the correspondence between the original character string and the standardized status value, for example, mapping "Warning" to 0 and mapping "Critical" to 1. Through mapping conversion, discrete sensor data from different network card manufacturers or different models of network cards can be unified into standardized status values, which facilitates unified management and processing. The converted status value is written to the BMC sensor interface, so that the BMC can accurately obtain the connection status information of the network card, providing support for network management and troubleshooting.
[0085] Specifically, when the target data is non-sensor data, the target data is written into a predefined database bus interface.
[0086] When the target data is non-sensor data, it is written directly to a pre-defined database bus interface. Non-sensor data is typically business data or protocol control data generated by the network card during data transmission. Non-sensor data is critical to network applications and services. The database bus interface is a pre-configured data storage channel that efficiently transmits non-sensor data to a backend database for storage and processing. By writing non-sensor data to the database bus interface, centralized management and analysis of network data is possible.
[0087] The network card management method provided in the embodiment of the present application can standardize network card data of different types and formats through preset data matching rules and preset mapping rules. For threshold sensor data, standardized matching results are generated through unified judgment or matching rules; for discrete sensor data, it is converted into a unified state value through preset mapping rules; for non-sensor data, it can be written to a pre-defined database bus interface. The processed network card data is written to the BMC sensor interface, so that the BMC can obtain the working status information of the target network card in real time, including parameters such as temperature and connection status, which helps to promptly discover potential hardware failures and abnormal conditions of the target network card and ensure the reliability and stability of the network system.
[0088] As an optional implementation manner, based on any of the above embodiments, the network card management method further includes the following steps:
[0089] First, obtain the network card slot information.
[0090] Alternatively, NIC slot information can be obtained through a hardware interface, system bus, or dedicated management chip. In a server environment, the physical slot status can be queried using the baseboard management controller (BMC) or intelligent platform management interface (IPMI). For example, the electrical connection status of each physical slot can be determined by reading the link status register of the PCIe bus or the device detection signal of the I2C bus. In a virtualized environment, the logical slot information corresponding to the virtual NIC can be obtained through the hypervisor's API.
[0091] Secondly, based on the network card slot information, it is determined whether the target network card is installed in the network card slot.
[0092] After obtaining the network card slot information, a hardware presence check is performed based on the obtained slot information to determine whether the target network card is installed. Optionally, for a physical network card, the hardware presence check may include: electrical signal detection, which determines the network card connection status by detecting the PCIe slot's reference clock, power status, and link training signals; hardware ID scanning, which sends a configuration space read command to the slot to check whether a valid device vendor ID and device ID are returned; and power consumption monitoring, which uses a current sensor to monitor changes in slot power consumption to determine whether a device is connected.
[0093] Finally, when the target network card is installed in the network card slot, it is determined according to the network card information whether the network card type of the target network card matches the network card type in the network card information.
[0094] The network card management method provided in the embodiments of the present application first obtains the network card slot information and determines whether a network card is installed in the network card slot when the target network card needs to be managed, thereby avoiding invalid operations on empty network card slots. By first detecting whether a network card is installed in the network card slot and then matching the network card type, invalid type identification and data collection operations are avoided for non-existent network card slots, thereby ensuring the efficiency of network card management.
[0095] As an optional implementation manner, based on any of the above embodiments, the preset configuration file includes multiple network card information, and multiple target network cards are set.
[0096] Determining whether the network card type of the target network card matches the network card type in the network card information according to the network card information includes: comparing the network card type of the current target network card with the network card types in the multiple network card information one by one to determine whether the network card type of the current target network card matches the network card type in the network card information.
[0097] First, one of the multiple target network cards is selected as the current processing target, i.e., the current target network card. Optionally, a priority or order rule can be used to ensure that all target network cards are checked. For example, in a server system with multiple network cards, the network cards can be sorted by their physical location or logical number in the server system, and the multiple target network cards can be processed sequentially in this order.
[0098] Next, network card information is read from the pre-set configuration file, one by one. Each piece of network card information contains detailed characteristics of a particular network card type, which may include parameters such as the card's hardware identifier, supported protocols, and transmission rate. Furthermore, one or more characteristics are determined from these detailed characteristics to form a comparison standard.
[0099] Finally, after extracting the network card type features, the target card's actual type features are compared against the extracted ones. For example, the target card's hardware identifier is compared character by character with the preset identifier. The system also checks to see if the supported protocols are identical and if the transmission rate is within the preset range. This ensures that a match is only considered successful when the target card's type is exactly the same as the preset type.
[0100] Specifically, if a matching record is found in the preset configuration file for the target network card type, the target network card type is determined to be consistent with the preset type. The network card management device can then perform subsequent operations on the target network card according to the preset collection and data processing policies in the network card information. If no matching record is found, the device will re-check and analyze the possible causes.
[0101] The network card management method provided in an embodiment of the present application, when multiple target network cards are configured, compares the network card type of the current target network card with each piece of network card information in a preset configuration file until a matching network card type is found or the entire preset configuration file is traversed. If a record matching the current target network card type is found in the preset configuration file, it can be determined that the network card type of the target network card matches the network card type in the preset configuration file, thereby ensuring that subsequent data collection and processing can be accurately applied to the target network card, thereby achieving efficient network card management.
[0102] As an optional implementation manner, based on any of the above embodiments, the network card management method further includes the following steps:
[0103] First, the working status of the target network card is determined based on the processed target data.
[0104] Specifically, by analyzing the processed target data and evaluating various performance indicators of the target network card, the operating status of the target network card is determined, such as whether the target network card is in normal operation, a minor fault, or a serious fault state. For example, temperature status evaluation determines whether the temperature value in the threshold sensor data exceeds the normal operating range; connection status evaluation determines whether the network card is connected properly based on the connection status value in the discrete sensor data; performance status evaluation evaluates the transmission performance of the network card by analyzing indicators such as throughput and packet loss rate in non-sensor data.
[0105] Secondly, when the working state of the target network card meets the preset fault condition, the communication connection with the faulty target network card is disconnected, and the communication connection with the standby network card is established.
[0106] Specifically, the work status assessment results are compared with preset fault conditions. When a network card failure is determined, the communication connection with the faulty network card is disconnected and a connection with the backup network card is established. Optionally, the configuration information of the faulty network card is synchronized to the backup network card to ensure network service continuity. This network card switching function is particularly important in some business scenarios, such as financial transaction systems and medical equipment network systems. It can effectively reduce business interruption time caused by network failures and improve system reliability.
[0107] The preset fault condition is a pre-set condition for determining whether the target network card is faulty, and may be a temperature threshold, a throughput threshold, a packet loss rate threshold, etc. In this embodiment, the preset fault condition is not specifically limited.
[0108] Finally, a network card fault log is generated; the network card fault log includes the fault time, slot ID and fault type.
[0109] Specifically, after detecting a target network card failure, a detailed fault log is generated, recording key information about the failure event. For example, the failure time: a millisecond-accurate timestamp indicating when the failure occurred; the slot ID: the physical or logical slot number where the failed network card is located; and the failure type: a fault type automatically classified based on the failure characteristics (e.g., overtemperature, connection interruption, etc.). Recording the failure time helps analyze the frequency and temporal patterns of failures, providing a basis for subsequent fault prevention. The slot ID allows for quick location of the specific failed network card, facilitating timely replacement or repair by maintenance personnel. Recording the failure type helps analyze the cause of the failure, such as whether it is due to a damaged network card chip, driver incompatibility, or other network issues.
[0110] Optionally, the network card management device periodically evaluates the working status of the network card. When a status that meets the preset fault conditions is detected, the following processing flow can be triggered: fault confirmation, ensuring that the fault is not a temporary fluctuation through multiple sampling; sending email, SMS or message alarms to the administrator based on the severity of the fault; switching the network card to ensure the continuity of network services; generating a detailed fault log for subsequent analysis and troubleshooting; and notifying the relevant monitoring system and operation and maintenance platform of the fault event.
[0111] The network card management method provided in the embodiment of the present application determines the working status of the target network card based on the processed target data. When it is determined that the working status of the target network card meets the preset fault condition, the operation of disconnecting the communication connection with the faulty target network card and establishing a communication connection with the backup network card is executed. This setting can ensure the continuity and stability of network communication. When a target network card fails, it can be quickly identified and switched to the backup network card, avoiding the problem of the entire network communication being paralyzed due to a single point of failure. In addition, the generated log information provides data support for subsequent network maintenance and fault handling, allowing maintenance personnel to quickly and accurately solve problems.
[0112] For the purpose of understanding the solution of the present application, in this embodiment, the network card management device is a BMC, the network card is a smart network card, and multiple smart network cards are provided as an example for introduction. In addition, in this embodiment, the Redfish protocol is used to establish two-way data interaction between the BMC and the smart network card. Figure 3 A flowchart of a network card management method provided in another embodiment of the present application is shown below. Figure 3 As shown in , the execution subject of this embodiment is the BMC, and the network card management method of this embodiment specifically includes the following steps:
[0113] Step S301: Obtain a preset configuration file.
[0114] Optionally, the preset configuration file uses JSON format. For example, "Present" can indicate the presence status of a network card slot, "BoardInfo" can indicate the identifier of the network card in the slot, and "NicBoardInfo" is used to obtain the type of the network card in the slot. Specifically, the JSON-formatted configuration file can contain additional parameter codes, which are not listed in this embodiment. Users can configure and edit them according to their actual needs.
[0115] Optionally, users can add or delete functions for different types of network cards by modifying a preset configuration file.
[0116] Optionally, the preset configuration file may also include GPIO interface configuration and I2C interface configuration. Specifically, the GPIO interface can be used to perform communication operations such as in-place status detection and signal reading on the SmartNIC. Specifically, the I2C bus can be used to enable low-level data exchange between the BMC and the SmartNIC, including writing configuration / control data and reading status / information data.
[0117] Step S302: Acquire information of multiple network card slots.
[0118] Step S303: Determine whether the target network card is installed in the multiple network card slots based on the multiple network card slot information.
[0119] Step S304: If a target network card is installed in the network card slot, obtain a target network card identifier of the target network card.
[0120] Step S305: Compare the current target network card identifier with the preset network card identifiers in the plurality of network card information pieces one by one.
[0121] Step S306: When the current target network card identifier is identical to the preset network card identifier in any piece of network card information, determine that the network card type of the target network card matches the network card type in the network card information.
[0122] Step S307: Determine the collection data type according to the preset collection target in the network card information.
[0123] Step S308: Periodically collect data from the target network card based on the collected data type and the preset collection period to obtain target data.
[0124] Step S309: Determine the data type of the target data.
[0125] Step S310 : When the target data is monitoring data of a threshold sensor, data judgment or data matching is performed on the target data according to a preset data matching rule to obtain a matching result, and the matching result is written to the baseboard management controller sensor interface.
[0126] Step S311 : when the target data is monitoring data of a discrete sensor, convert the target data into a corresponding state value according to a preset mapping rule, and write the state value to the baseboard management controller sensor interface.
[0127] Step S312: When the target data is non-sensor data, the target data is written into a predefined database bus interface.
[0128] Step S313: Determine the working status of the target network card based on the processed target data.
[0129] Step S314: When the working state of the target network card meets the preset fault condition, disconnect the communication connection with the faulty target network card and establish a communication connection with the standby network card.
[0130] Step S315: Generate a network card failure log.
[0131] It should be noted that the technical effects of the network card management method adopted in this embodiment have been explained in the embodiments of other network card management methods mentioned above, and therefore, they will not be repeated in this embodiment.
[0132] Figure 4 A schematic diagram of the structure of a network card management device provided in one embodiment of the present application is shown in FIG. Figure 4 As shown, the network card management device provided in this embodiment is located in an electronic device and includes: an acquisition module 41 , a matching module 42 , a collection module 43 and a processing module 44 .
[0133] Specifically, the acquisition module 41 is used to obtain a preset configuration file, which includes network card information; the matching module 42 is used to determine whether the network card type of the target network card matches the network card type in the network card information based on the network card information; the collection module 43 is used to collect data from the target network card according to the preset collection strategy in the network card information in response to determining that the network card type of the target network card matches the network card type in the network card information to obtain target data; the processing module 44 is used to process the target data based on the preset data processing strategy in the network card information.
[0134] Optionally, when determining whether the network card type of the target network card matches the network card type in the network card information based on the network card information, the matching module 42 is specifically used to: obtain a target network card identifier of the target network card; compare the target network card identifier with a preset network card identifier in the network card information; and when the target network card identifier is the same as the preset network card identifier, determine that the network card type of the target network card matches the network card type in the network card information.
[0135] Optionally, the preset acquisition strategy includes a preset acquisition target and a preset acquisition cycle.
[0136] Optionally, when the acquisition module 43 performs data acquisition on the target network card according to the preset acquisition strategy in the network card information to obtain target data, it is specifically used to: determine the acquisition data type according to the preset acquisition target in the network card information; wherein the acquisition data type includes threshold sensor data, discrete sensor data and non-sensor data; and perform periodic data acquisition on the target network card based on the acquisition data type and the preset acquisition period to obtain target data.
[0137] Optionally, the preset data processing strategy includes preset data matching rules and preset mapping rules.
[0138] Optionally, when processing the target data based on the preset data processing strategy in the network card information, the processing module 44 is specifically used to: determine the data type of the target data; when the target data is monitoring data of a threshold sensor, perform data judgment or data matching on the target data according to preset data matching rules to obtain a matching result, and write the matching result to the baseboard management controller sensor interface; wherein the preset data matching rules include any one or more of threshold comparison, interval judgment, and regular expression matching; when the target data is monitoring data of a discrete sensor, convert the target data into a corresponding state value according to a preset mapping rule, and write the state value to the baseboard management controller sensor interface; when the target data is non-sensor data, write the target data to a predefined database bus interface.
[0139] Optionally, the acquisition module 41 is further used to: obtain network card slot information; determine whether the network card slot is installed with a target network card based on the network card slot information; the matching module is further used to: when the target network card is installed in the network card slot, determine whether the network card type of the target network card matches the network card type in the network card information based on the network card information.
[0140] Optionally, the preset configuration file includes multiple network card information, and multiple target network cards are set.
[0141] Optionally, when determining whether the network card type of the target network card matches the network card type in the network card information based on the network card information, the matching module 42 is specifically used to: compare the network card type of the current target network card with the network card types in multiple network card information one by one to determine whether the network card type of the current target network card matches the network card type in the network card information.
[0142] Optionally, the network card management device further includes: a determination module, a communication management module, and a generation module.
[0143] Optionally, the determination module is used to determine the working status of the target network card based on the processed target data; the communication management module is used to disconnect the communication connection with the faulty target network card and establish a communication connection with the backup network card when the working status of the target network card meets the preset fault conditions; the generation module is used to generate a network card fault log; the network card fault log includes the fault time, slot ID and fault type.
[0144] It should be noted that the technical effects of the network card management device in this embodiment have been explained in the embodiment of the above-mentioned network card management method, and therefore will not be repeated in this embodiment.
[0145] Figure 5 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application is shown in FIG. Figure 5 As shown, the electronic device 50 provided in an embodiment of the present application includes: a memory 51 and a processor 52.
[0146] The memory 51 stores a computer program, and the processor 52 is configured to run the computer program to execute the steps in any of the above-mentioned network card management method embodiments.
[0147] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned network card management method embodiments when running.
[0148] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0149] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above network card management method embodiments are implemented.
[0150] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above-mentioned network card management method embodiments are implemented.
[0151] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0152] The above is a detailed introduction to the network card management method, device, equipment and medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A network card management method, characterized in that: include: Obtaining a preset configuration file, wherein the preset configuration file includes network card information; wherein the preset configuration file is a file pre-set or compiled according to the characteristics and application requirements of different types of network cards; Determining whether the network card type of the target network card matches the network card type in the network card information according to the network card information; In response to determining that the network card type of the target network card matches the network card type in the network card information, data is collected from the target network card according to a preset collection strategy in the network card information to obtain target data; wherein the preset collection strategy is formulated based on data transmission characteristics and application scenario requirements of different types of network cards; The target data is processed based on a preset data processing strategy in the network card information; wherein the preset data processing strategy is a strategy preset according to the network card type and data acquisition characteristics.
2. The method according to claim 1, characterized in that The determining, based on the network card information, whether the network card type of the target network card matches the network card type in the network card information includes: Obtaining a target network card identifier of the target network card; Comparing the target network card identifier with a preset network card identifier in the network card information; In a case where the target network card identifier is identical to the preset network card identifier, it is determined that the network card type of the target network card matches the network card type in the network card information.
3. The method according to claim 1, characterized in that The preset acquisition strategy includes a preset acquisition target and a preset acquisition cycle; The step of collecting data from the target network card according to the preset collection strategy in the network card information to obtain target data includes: Determining a collection data type according to a preset collection target in the network card information; wherein the collection data type includes threshold sensor data, discrete sensor data, and non-sensor data; Periodically collect data from the target network card based on the collected data type and a preset collection period to obtain target data.
4. The method according to claim 1, wherein The preset data processing strategy includes preset data matching rules and preset mapping rules; The processing of the target data based on the preset data processing strategy in the network card information includes: determining a data type of the target data; In the case where the target data is monitoring data of a threshold sensor, performing data judgment or data matching on the target data according to a preset data matching rule to obtain a matching result, and writing the matching result to a baseboard management controller sensor interface; The preset data matching rules include any one or more of threshold comparison, interval judgment and regular expression matching; In the case where the target data is monitoring data of a discrete sensor, converting the target data into a corresponding state value according to a preset mapping rule, and writing the state value to a baseboard management controller sensor interface; In a case where the target data is non-sensor data, the target data is written into a predefined database bus interface.
5. The method according to claim 1, wherein The method also includes: Get network card slot information; Determine whether the target network card is installed in the network card slot based on the network card slot information; In a case where the target network card is installed in the network card slot, it is determined according to the network card information whether the network card type of the target network card matches the network card type in the network card information.
6. The method according to any one of claims 1 to 5, characterized in that The preset configuration file includes multiple pieces of network card information, and the target network card is set to multiple; The determining, based on the network card information, whether the network card type of the target network card matches the network card type in the network card information includes: The network card type of the current target network card is compared one by one with the network card types in the plurality of network card information to determine whether the network card type of the current target network card matches the network card type in the network card information.
7. The method according to any one of claims 1 to 5, characterized in that The method also includes: Determining the operating status of the target network card based on the processed target data; When the working state of the target network card meets the preset fault condition, disconnecting the communication connection with the faulty target network card and establishing a communication connection with the standby network card; Generate a network card fault log; the network card fault log includes the fault time, slot ID and fault type.
8. A network card management device, characterized in that: include: An acquisition module is used to acquire a preset configuration file, wherein the preset configuration file includes network card information; wherein the preset configuration file is a file pre-set or compiled according to the characteristics and application requirements of different types of network cards; a matching module, configured to determine, based on the network card information, whether the network card type of the target network card matches the network card type in the network card information; a collection module, configured to, in response to determining that the network card type of the target network card matches the network card type in the network card information, collect data from the target network card according to a preset collection strategy in the network card information to obtain target data; wherein the preset collection strategy is formulated based on data transmission characteristics and application scenario requirements of different types of network cards; A processing module is used to process the target data based on a preset data processing strategy in the network card information; wherein the preset data processing strategy is a strategy preset according to the network card type and data acquisition characteristics.
9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the network card management method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the network card management method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Network card starting method and device, and storage medium
CN111221581A
Network traffic acquisition method and device, electronic equipment and storage medium
CN116915667A