A network card link layer discovery protocol configuration method, device, equipment and medium
By combining a pre-defined unified network interface card (NIC) configuration interface with differentiated configuration functions, the problems of code redundancy and low reusability in NIC LLDP function configuration are solved, achieving efficient NIC link layer discovery protocol configuration, simplifying engineering logic and reducing maintenance costs and project risks.
Patent Information
- Application Number
- CN202310415946.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-13
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2043-04-13
AI Technical Summary
The existing network interface card (NIC) LLDP function configuration suffers from problems such as high code redundancy, low reusability, difficult maintenance, significant time and cost waste, and increased project interaction risks.
By using a pre-defined unified network interface card (NIC) configuration interface, NIC information from different manufacturers is aggregated into an aggregation function. Differentiated configuration functions are then used to configure the NIC's link layer discovery protocol switch status and operating mode. The execution results are then called through the intelligent platform management interface.
It simplifies engineering logic, reduces code redundancy, improves reusability, reduces subsequent maintenance difficulty and code familiarization costs, shortens the development cycle, and reduces project delivery risks.
Smart Images

Figure CN116389257B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a network card link layer discovery protocol configuration method, device, equipment and medium. BACKGROUND
[0002] LLDP(Link Layer Discovery Protocol, link layer discovery protocol) is used to enable devices of different manufacturers to discover each other in the network and interact with each other's system and configuration information. IPMI(Intelligent Platform Management Interface, intelligent platform management interface) is a basic core function subsystem of a server. With the assistance of IPMI, a user can remotely start, reinstall, mount an ISO image, etc. on a closed server. A network card is one of the important peripherals of a server. BMC(Baseboard Management Controller, baseboard management controller) is a core component in IPMI, and needs to configure the LLDP function of the network card. However, since the LLDP configuration methods of network cards of different manufacturers are different, the BMC needs to be adapted one by one according to the specific situation to realize the configuration of the LLDP function switch and the working mode of the network card through the BMC. However, the existing technology often has code redundancy, low actual reuse degree, difficult post-maintenance, large time cost waste, and high project interaction risk.
[0003] Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present. SUMMARY
[0004] Therefore, the purpose of the present application is to provide a network card link layer discovery protocol configuration method, device, equipment and medium, which can reduce code redundancy and improve reuse degree according to user needs and specific configuration methods of network cards. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a network card link layer discovery protocol configuration method applied to a baseboard management controller, comprising:
[0006] obtaining a network card configuration request initiated by a current user for a preset unified network card configuration interface, and determining a network card configuration type corresponding to the network card configuration request; wherein the preset unified network card configuration interface is an interface in which network card information of different manufacturers is converged into an aggregation function in advance;
[0007] executing a corresponding differentiated configuration function in the aggregation function according to the network card configuration type, so as to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card by using the differentiated configuration function;
[0008] When the link layer discovery protocol switch state and the link layer discovery protocol working mode configuration are completed, an execution result is obtained, so that the target management interface calls according to the execution result through an intelligent platform management interface command.
[0009] Optionally, the preset unified network card configuration interface is determined by:
[0010] Corresponding manufacturer identifiers of different manufacturers of the network card are obtained, and the network card and the manufacturer identifiers are counted to determine attribute information of the network card.
[0011] Corresponding link layer discovery protocol switch states and configuration modes of link layer discovery protocol working modes for link layer discovery protocol configuration of the network card are obtained.
[0012] The configuration mode and the attribute information are matched to obtain a network card configuration table, and the preset unified network card configuration interface is determined according to the network card configuration table.
[0013] Optionally, the network card link layer discovery protocol configuration method further includes:
[0014] An update configuration file uploaded by the current user is obtained, and the update configuration file is stored in a staging directory.
[0015] The update configuration file is verified for legality, if the update configuration file passes the legality verification, the update configuration file in the staging directory is moved to the network card configuration table to update the network card configuration table, and if the update configuration file does not pass the legality verification, the current user is instructed to delete the update configuration file in the staging directory.
[0016] Optionally, the network card configuration type corresponding to the network card configuration request is determined by:
[0017] The network card configuration type corresponding to the network card configuration request is determined as an I2C operation register mode.
[0018] Or, the network card configuration type corresponding to the network card configuration request is determined as a generated configuration file mode.
[0019] Optionally, the corresponding differentiated configuration function in the aggregation function is executed according to the network card configuration type, so that the differentiated configuration function is used to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card, including:
[0020] If the network card configuration type is the I2C operation register mode, a preset register address configuration table is acquired, and the preset register address configuration table is polled and matched to determine a target register address corresponding to the network card;
[0021] The configuration content of the current user is written into a register according to the target register address, so as to configure a link layer discovery protocol switch state of the network card and a link layer discovery protocol working mode of the network card.
[0022] Optionally, the performing of the differentiated configuration function in the aggregation function according to the network card configuration type is configured to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card by using the differentiated configuration function, and the method comprises the following steps of:
[0023] If the network card configuration type is the generation of a configuration file, a preset file configuration table is acquired, and a current configuration file name is determined according to network card information corresponding to the configuration of the current user; wherein the preset file configuration table is determined by configuration file names of configuration files stored in different positions.
[0024] The preset file configuration table is traversed and matched by using the current configuration file name, the file position of the current configuration file is determined, and then a corresponding configuration file is created by using a file function according to the current configuration file name based on the file position, so as to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card.
[0025] Optionally, when the link layer discovery protocol switch state and the link layer discovery protocol working mode are configured, an execution result is acquired, so that a target management interface calls an intelligent platform management interface command according to the execution result.
[0026] When the link layer discovery protocol switch state and the link layer discovery protocol working mode are configured, the execution result is normalized and a normalized execution result is acquired, so that a Restful interface or a Redfish interface calls an intelligent platform management interface command according to the normalized execution result.
[0027] In a second aspect, the present application discloses a network card link layer discovery protocol configuration device applied to a baseboard management controller, and comprising:
[0028] A network card configuration request acquisition module is configured to acquire a network card configuration request initiated by a current user for a preset unified network card configuration interface.
[0029] The network card configuration type determination module is configured to determine a network card configuration type corresponding to the network card configuration request; wherein the preset unified network card configuration interface is an interface in which network card information of different manufacturers is converged into an aggregation function in advance;
[0030] The differentiated configuration module is configured to execute a corresponding differentiated configuration function in the aggregation function according to the network card configuration type, so as to configure a link layer discovery protocol switch state of a network card and a link layer discovery protocol working mode of the network card by using the differentiated configuration function.
[0031] The interface calling module is configured to obtain an execution result when the link layer discovery protocol switch state and the link layer discovery protocol working mode configuration are completed, so that a target management interface calls according to the execution result through an intelligent platform management interface command.
[0032] In a third aspect, the present application discloses an electronic device, comprising a processor and a memory; wherein the memory is configured to store a computer program, the computer program is loaded and executed by the processor to realize the network card link layer discovery protocol configuration method as described above.
[0033] In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program is executed by a processor to realize the network card link layer discovery protocol configuration method as described above.
[0034] The application provides a network card link layer discovery protocol configuration method, which is applied to a baseboard management controller and includes the following steps: obtaining a network card configuration request initiated by a current user for a preset unified network card configuration interface, and determining a network card configuration type corresponding to the network card configuration request; the preset unified network card configuration interface is an interface in which network card information of different manufacturers is converged into an aggregation function; performing a corresponding differentiated configuration function in the aggregation function according to the network card configuration type, so as to configure a link layer discovery protocol switch state of a network card and a link layer discovery protocol working mode of the network card by using the differentiated configuration function; and obtaining an execution result when the link layer discovery protocol switch state and the link layer discovery protocol working mode are configured, so that a target management interface calls according to the execution result by an intelligent platform management interface command. It can be seen that the application provides an engineering framework with high multiplexity and clear architecture, different network card information of different network card manufacturers is converged into an aggregation function as a network card configuration interface for calling by an external target management interface, engineering logic is simplified, code architecture is clearer, common requests and business logic are extracted according to customer needs and specific network card configuration modes, code redundancy is reduced, multiplexity is improved, and the difficulty of subsequent maintenance and the cost of code familiarization and analysis are also reduced. In addition, the configuration of the link layer discovery protocol switch state and the link layer discovery protocol working mode of different network cards is performed only by the differentiated configuration function in the aggregation function, which can shorten the research and development cycle of research and development personnel for the full process adaptation of new network card manufacturers from name to function, and reduce coding omissions and other problems caused by large code amount and unclear structure, thereby reducing the project delivery risk to a certain extent.
[0035] In addition, the application provides a network card link layer discovery protocol configuration device, equipment and storage medium, which correspond to the network card link layer discovery protocol configuration method and have the same effects. BRIEF DESCRIPTION OF DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description only belong to the embodiments of the application, and those skilled in the art can obtain other drawings according to the provided drawings without any creative effort.
[0037] Figure 1 A network card link layer discovery protocol configuration method flow chart disclosed by the application;
[0038] Figure 2 A network card link layer discovery protocol configuration implementation user operation schematic diagram disclosed by the application;
[0039] Figure 3 A specific network card link layer discovery protocol configuration method flow chart disclosed by the application;
[0040] Figure 4 A network card link layer discovery protocol update configuration schematic diagram disclosed by the application;
[0041] Figure 5 A specific network card link layer discovery protocol configuration method flow chart disclosed by the application;
[0042] Figure 6 A schematic diagram of providing a unified interface operation to the outside disclosed by the application;
[0043] Figure 7 A network card link layer discovery protocol configuration device structure schematic diagram disclosed by the application;
[0044] Figure 8 An electronic equipment structure diagram disclosed by the application. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the application will be clearly and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the application.
[0046] As a server core control system, the BMC needs to configure the LLDP function of the network card. At present, the main ways to configure the LLDP function of the network card through the BMC are: 1. According to the technical documents provided by the network card manufacturer, the network card model is matched through ID information to identify; 2. Analyze the LLDP mode of the network card: a. For onboard network cards, according to user configuration, generate a configuration file to / ncsi / LldpStatus, and then configure the network card LLDP function switch through reading and writing LLDP Status; b. According to the user configuration, use I2C (Inter-Integrated Circuit, I2C bus) to directly read and write the register, and write the corresponding data to the LLDP switch register and mode register of some external network cards, so as to configure the LLDP function switch and network card LLDP transceiver mode; c. Through MCTP (Management Component Transport Protocol) over PCI-E (Peripheral Component Interface Express) to obtain external network card information, and according to user configuration to generate a file to / var / lldp_set, realize the LLDP function configuration of the network card; 3. BMC R&D personnel develop and write function function code according to the switch mode of network cards of different manufacturers to realize the adaptation of data flow and function module.
[0047] However, the above configuration methods have the following disadvantages: first, according to customer needs, the network card manufacturer type and adaptation classification need to be determined one by one by referring to the technical documents, and the repeated execution of similar structure programming is accompanied by high redundancy, which has the characteristics of high code reusability but low actual reuse degree; second, for different network cards, different functions and data flow directions need to be written according to the LLDP function configuration mode of different network card manufacturers, and the engineering logic branches are increasingly complex according to the increase in the number of adaptation of different network card manufacturers, which greatly hinders subsequent maintenance, and the cost of familiarizing and combing the code will also be greatly improved; third, with the continuous iteration of business, the function module code will gradually accumulate, and at the later stage, it will form problems such as large code size, many branches and complex customized definition, and once the function needs to be debugged and problem located, it will cause a lot of time cost waste for R&D personnel and occupy R&D human resources; fourth, the whole process of adaptation from name to specific function needs to be performed for each newly added network card manufacturer, and when the project is urgent, there are problems such as time being tight, code amount being large, and coding being prone to omissions due to unclear structure, which increases the project delivery risk and engineering quality problem to some extent.
[0048] Therefore, the present application provides a network card link layer discovery protocol configuration scheme, which can reduce code redundancy and improve reusability according to user needs and specific configuration methods of network cards.
[0049] The embodiment of the application discloses a network card link layer discovery protocol configuration method, which is applied to a baseboard management controller, and refers to Figure 1 The method comprises the following steps:
[0050] In step S11, a network card configuration request initiated by a current user for a preset unified network card configuration interface is acquired, and a network card configuration type corresponding to the network card configuration request is determined; wherein the preset unified network card configuration interface is an interface in which network card information of different manufacturers is converged into an aggregation function in advance.
[0051] With the development of network technology, the types of devices accessing the network are more and more, the configuration is more and more complex, and devices from different device manufacturers often increase their own unique functions, which leads to the fact that there are often many devices with different characteristics from different manufacturers in a network. In order to facilitate the management of such a network, it is necessary to enable devices from different manufacturers to discover and interact with each other's system and configuration information in the network. Link Layer Discovery Protocol (LLDP) is a protocol for this purpose. LLDP is defined in 802.1ab and is a layer 2 protocol that provides a standard link layer discovery method. LLDP protocol enables a device accessing a network to send its main capabilities such as management address, device identification, interface identification and other information to other devices accessing the same local network. When a device receives the information of other devices from the network, it stores the information in the form of MIB.
[0052] In the embodiments of the present application, the application is applied to a baseboard management controller (BMC). It can be understood that the BMC and the IPMI are basic core function subsystems of a server, responsible for core functions such as hardware state management, operating system management, health state management, and power consumption management of the server. The IPMI is an on-board component that can operate independently of the host system CPU (Central Processing Unit / Processor), BIOS (Basic Input Output System), UEFI (Unified Extensible Firmware Interface), and OS (Operating System), and therefore, the interaction with other components such as the BIOS / UEFI, CPU, and the like is completed via the IPMI. The BMC, as a core component of the IPMI, often needs to configure the LLDP of the important peripheral network card of the server. In order to overcome the high redundancy caused by repeatedly performing programming of similar structures to adapt to network cards of different manufacturers, the embodiments of the present application provide services to the outside in the form of a preset unified network card configuration interface with network card information of different manufacturers. A user can initiate a configuration network card LLDP request to the preset unified network card configuration interface, so as to simplify the code logic.
[0053] It should be noted that the preset unified network card configuration interface is an interface in which network card information of different manufacturers is converged into an aggregation function, wherein the network card information can include not only configuration information of network cards of different manufacturers, but also configuration information of different configuration methods when configuring the LLDP of different network cards. The configuration information is converged into the aggregation function as the network card configuration interface, wherein only a part of the differentiated function implementation modules are retained, that is, the modules for performing the network card configuration type corresponding to different network card configuration requests are executed for the network card configuration request initiated by the current user.
[0054] Step S12: performing a differentiated configuration function corresponding to the aggregation function according to the network card configuration type, so as to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card by using the differentiated configuration function.
[0055] In the embodiment of the present application, the differential function implementation module for performing the different network card configuration requests corresponding to the network card configuration types is reserved in the aggregation function, and mainly through the differential configuration function, the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card are configured. It can be understood that configuring the link layer discovery protocol switch state of the network card means setting the state to on or off; configuring the link layer discovery protocol working mode of the network card means setting the working mode to Tx (only sending but not receiving), Rx (only receiving but not sending) or TxRx (both receiving and sending).
[0056] Step S13: When the link layer discovery protocol switch state and the link layer discovery protocol working mode configuration are completed, the execution result is obtained, so that the target management interface calls according to the execution result through the intelligent platform management interface command.
[0057] In the embodiment of the present application, if the current user configuration is completed, the user can initiate a request to read the LLDP function state, which is convenient for other users to understand the network card function state when using, and also makes it convenient for operation and maintenance personnel to understand the function state of the network card. At the same time, the execution result after configuring the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card is returned to the preset unified network card configuration interface, so that the BMC and the bottom layer of each type of network card are interacted by the differential configuration function, and the execution result is standardized and returned to the network card configuration interface, which realizes the unity of the code architecture except the differential configuration module, and presents the unified result echo of different network cards to the user.
[0058] It should be pointed out that the embodiment of the present application matches the IPMI command that can be executed out-of-band for the preset unified network card configuration interface, and directly provides the restful or redfish interface call to simplify the code logic. Specifically, when the link layer discovery protocol switch state and the link layer discovery protocol working mode configuration are completed, the execution result is standardized and the standardized execution result is obtained, so that the Restful interface or the Redfish interface calls according to the standardized execution result through the intelligent platform management interface command.
[0059] As Figure 2 shown is a full flow diagram for realizing user operation. In the baseboard management controller, the network card LLDP is configured by using the preset unified network card configuration interface, and the function is transplanted to the restful or redfish interface to realize the full flow of user operation.
[0060] The application provides a network card link layer discovery protocol configuration method applied to a baseboard management controller, including: obtaining a network card configuration request initiated by a current user for a preset unified network card configuration interface, and determining a network card configuration type corresponding to the network card configuration request; wherein the preset unified network card configuration interface is an interface in which network card information of different manufacturers is converged into an aggregation function in advance; a corresponding differentiated configuration function in the aggregation function is executed according to the network card configuration type, so as to configure a link layer discovery protocol switch state of a network card and a link layer discovery protocol working mode of the network card by using the differentiated configuration function; when the link layer discovery protocol switch state and the link layer discovery protocol working mode are configured, an execution result is obtained, so that a target management interface calls according to the execution result through an intelligent platform management interface command. It can be seen that the application scheme proposes a set of engineering framework with high multiplexity and clear architecture, different network card manufacturer link layer discovery protocol function configuration modes are written, different network card information is converged into an aggregation function as a network card configuration interface for calling by an external target management interface, engineering logic is simplified, code architecture is clearer, public requests and business logic are extracted according to customer needs and specific network card configuration modes, code redundancy is reduced, multiplexity is improved, and subsequent maintenance difficulty and code familiarization and sorting cost can also be reduced. In addition, only the differentiated configuration function in the aggregation function is used to execute the configuration of the link layer discovery protocol switch state and the link layer discovery protocol working mode of different network cards, which can shorten the research and development cycle of research and development personnel for the full process adaptation of new network card manufacturers from name to function, and reduce coding omissions and other problems caused by large code amount and unclear structure, thereby reducing project delivery risk to a certain extent.
[0061] In a specific embodiment, referring to Figure 3 The application is applied to a baseboard management controller, wherein the preset unified network card configuration interface is determined, including:
[0062] Step S21: obtaining respective manufacturer identifiers of network cards of different manufacturers, and counting the network cards and the manufacturer identifiers to determine attribute information of the network cards.
[0063] In the application embodiment, different manufacturer network cards are stored as an information configuration table to determine attribute information of the network cards. The table contains network card ID (Identity document, identity number) information for matching the network cards, and contains manufacturer information (Vendor ID) of the network cards, specific models, network port numbers, network port types and network port rates, etc. The network card information matching display is a public business logic, and the BMC extracts and perfects it into a unified module.
[0064] Step S22: Obtain the respective link layer discovery protocol switch state and the configuration mode of the link layer discovery protocol working mode when the link layer discovery protocol configuration is performed for the network card.
[0065] In the embodiments of the present application, different network cards have different configuration methods. Therefore, for the user to perform the network card device LLDP function operation through the BMC, the BMC combines the configuration methods of different network card manufacturers. When the user performs a request to configure the network card LLDP, the user LLDP setting content should include the LLDP switch state and the LLDP working mode. After the analysis, the attribute information of the network card is transmitted to the preset unified network card configuration interface.
[0066] Step S23: Match the configuration mode with the attribute information to obtain the network card configuration table, and then determine the preset unified network card configuration interface according to the network card configuration table.
[0067] In the embodiments of the present application, after obtaining the attribute information of the network card and the configuration mode of different network cards, the network card configuration table is determined by matching. In this way, the preset unified network card configuration interface is determined according to the network card configuration table, and the network card information to be matched by the current user is determined by cyclically matching the network card configuration table.
[0068] It should be pointed out that on the basis of the network card configuration table, an additional external configuration file reading sub-function module is provided. As shown in Figure 4 As shown in FIG. 6, the user can upload the configuration file through the web, and can also upload the configuration file through the redfish interface using the SFTP (Secure File Transfer Protocol) server. The user uploads the configuration file to the temporary directory, and the BMC checks the configuration file uploaded by the user in the temporary directory. Specifically, the legality is checked by the file size, file format, character type and string length. After the verification, the configuration file is moved to the configuration file storage directory. If the verification is not passed, the user will be prompted that the file is illegal and the file in the temporary directory will be deleted.
[0069] Specifically, an update configuration file uploaded by the current user is acquired and stored in a staging directory; legality verification is performed on the update configuration file, if the legality verification of the update configuration file passes, the update configuration file under the staging directory is moved to the network card configuration table to update the network card configuration table; if the legality verification of the update configuration file does not pass, the current user is instructed to delete the update configuration file under the staging directory. It can be seen that the user only needs to upload an update configuration file by himself to add network card information to the configuration table, so that the BMC automatically reads the configuration table to update the network card information, and then completes the new network card LLDP function deployment. In this way, the development agility and the rapid adaptation of the user's needs are improved.
[0070] The embodiment of the application discloses a specific network card link layer discovery protocol configuration method, which is applied to a baseboard management controller, as shown in Figure 5 The method comprises the following steps:
[0071] Step S31: A network card configuration request initiated by a current user for a preset unified network card configuration interface is acquired, and it is determined that a network card configuration type corresponding to the network card configuration request is an I2C operation register mode; or, it is determined that the network card configuration type corresponding to the network card configuration request is a configuration file generation mode.
[0072] In the embodiment of the application, for different manufacturer network cards, only a part of differentiated function implementation modules is retained in an aggregation function of the unified network card configuration interface provided externally, which is mainly divided into two categories, namely, an I2C operation register mode and a configuration file generation mode.
[0073] Step S32: If the network card configuration type is the I2C operation register mode, a preset register address configuration table is acquired, and the preset register address configuration table is polled and matched to determine a target register address corresponding to the network card.
[0074] For the configuration mode of the I2C operation register, because the device address and the specific register address of different manufacturer network cards are different, a register address configuration table is maintained in the embodiment of the application, and the register information of the network card of this type is stored in the form of a structure array. When a user request action is executed, data reaches the function, and I2C BUS polling matching of the network card device address is performed. It can be understood that there are many BUSs under the server, and the network card can be inserted into many zone card slots, and the position is uncertain, so the specific position of the network card is determined by polling, and after the position of the network card is located, the register address of the network port corresponding to the network port number modified by the user is matched.
[0075] Step S33: write the configuration content of the current user into the register according to the target register address, so as to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card.
[0076] In the embodiment of the application, after the position of the network card is located, the register address of the corresponding network port is matched according to the network port serial number modified by the user, and then the write_buf is used to write the register according to the user configuration content. The operation is divided into two steps, the first step is the LLDP switch attribute register operation, and the second step is the LLDP working mode attribute register operation.
[0077] Step S34: if the network card configuration type is the generated configuration file mode, a preset file configuration table is obtained, and the current configuration file name is determined according to the network card information configured by the current user.
[0078] For the generated configuration file mode, there is no big difference in the file content in the generated configuration file mode, mainly including the LLDP switch attribute and the LLDP function mode. The difference mainly lies in the generated configuration file name and the storage position, so in the embodiment of the application, a file configuration table of the configuration file is maintained. The preset file configuration table is determined by the configuration file name of the configuration file stored in different positions. The network card manufacturer and the model are matched according to the user request content, and the current configuration file name is determined.
[0079] Step S35: the preset file configuration table is matched through the current configuration file name, the file position of the current configuration file is determined, and then based on the file position, the corresponding configuration file is created according to the current configuration file name by using the file function, so as to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card.
[0080] In the embodiment of the application, the current configuration file name is used to match the preset file configuration table, the file position of the current configuration file is determined, and then the file in the configuration file table of the corresponding network card is created by using the file function, and the user LLDP configuration content is written.
[0081] As Figure 6 As shown in the whole network card LLDP configuration schematic diagram, the unified preset network card information configuration interface is used to match the IPMI command to provide services externally, and in the internal part, different configuration modes are executed by using the differentiated configuration function, the execution result is returned to the interface after the execution is completed, the engineering logic is simplified by using the scheme, the code architecture is more clear, and the difficulty of subsequent maintenance and the cost of code familiarization and carding are reduced.
[0082] Step S36: When the link layer discovery protocol switch state and the link layer discovery protocol working mode configuration are completed, an execution result is obtained, so that the target management interface calls according to the execution result through an intelligent platform management interface command.
[0083] More specific processes about the above step S36 can refer to the corresponding contents disclosed in the foregoing embodiments, and will not be described here in detail.
[0084] The application provides a network card link layer discovery protocol configuration method applied to a baseboard management controller, including: obtaining a network card configuration request initiated by a current user for a preset unified network card configuration interface, and determining that a network card configuration type corresponding to the network card configuration request is an I2C operation register mode; or, determining that the network card configuration type corresponding to the network card configuration request is a configuration file generation mode; if the network card configuration type is the I2C operation register mode, obtaining a preset register address configuration table, and performing polling matching on the preset register address configuration table to determine a target register address corresponding to the network card; writing configuration content of the current user into a register according to the target register address, so as to configure a link layer discovery protocol switch state of the network card and a link layer discovery protocol working mode of the network card; if the network card configuration type is the configuration file generation mode, obtaining a preset file configuration table, and determining a current configuration file name according to network card information corresponding to the current user; performing traversal matching on the preset file configuration table through the current configuration file name, determining a file position of the current configuration file, and then creating a corresponding configuration file according to the current configuration file name based on the file position by using a file function, so as to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card; when the link layer discovery protocol switch state and the link layer discovery protocol working mode are configured, an execution result is obtained, so that a target management interface calls according to the execution result through an intelligent platform management interface command. It can be seen that the application scheme proposes an engineering framework with high multiplexity and clear architecture, different network card manufacturer link layer discovery protocol function configuration modes are written, different network card information is converged into an aggregation function as a network card configuration interface for calling of an external target management interface, engineering logic is simplified, code architecture is clearer, public requests and business logic are extracted according to customer demand and specific network card configuration mode, code redundancy is reduced, multiplexity is improved, and subsequent maintenance difficulty and code familiarization and analysis cost can also be reduced. In addition, only by executing configuration of the link layer discovery protocol switch state and the link layer discovery protocol working mode of different network cards through a differentiated configuration function in the aggregation function, the research and development cycle of a research and development personnel for full-process adaptation from name to function of a newly added network card manufacturer can be shortened, and coding omissions and other problems caused by large code amount and unclear structure are reduced, and project delivery risk is reduced to a certain extent.
[0085] Correspondingly, the application also discloses a network card link layer discovery protocol configuration device, referring to Figure 7 The device includes:
[0086] The network card configuration request obtaining module 11 is configured to obtain a network card configuration request initiated by a current user for a preset unified network card configuration interface.
[0087] The network card configuration type determining module 12 is configured to determine a network card configuration type corresponding to the network card configuration request; wherein the preset unified network card configuration interface is an interface in which network card information of different manufacturers is converged into an aggregation function in advance.
[0088] The differential configuration module 13 is configured to execute a corresponding differential configuration function in the aggregation function according to the network card configuration type, so as to configure a link layer discovery protocol switch state of a network card and a link layer discovery protocol working mode of the network card by using the differential configuration function.
[0089] The interface calling module 14 is configured to obtain an execution result when the link layer discovery protocol switch state and the link layer discovery protocol working mode configuration are completed, so that a target management interface calls according to the execution result through an intelligent platform management interface command.
[0090] The more specific working processes of the above-mentioned various modules can refer to the corresponding contents disclosed in the foregoing embodiments, and will not be described here again.
[0091] It can be seen that by the above scheme of the embodiment, the substrate management controller comprises: obtaining a network card configuration request initiated by a current user for a preset unified network card configuration interface, and determining a network card configuration type corresponding to the network card configuration request; wherein the preset unified network card configuration interface is an interface in which network card information of different manufacturers is converged into an aggregation function; a corresponding differentiated configuration function in the aggregation function is executed according to the network card configuration type, so as to configure a link layer discovery protocol switch state of a network card and a link layer discovery protocol working mode of the network card by using the differentiated configuration function; when the link layer discovery protocol switch state and the link layer discovery protocol working mode are configured, an execution result is obtained, so that a target management interface calls according to the execution result by an intelligent platform management interface command. It can be seen that the application scheme proposes an engineering framework with high multiplexing degree and clear architecture, and different network card information of different network card manufacturers is converged into an aggregation function as a network card configuration interface for calling by an external target management interface, which simplifies engineering logic, makes code architecture more clear, realizes extraction of public requests and business logic according to customer demand and specific configuration mode of the network card, reduces code redundancy, improves multiplexing degree, and also reduces subsequent maintenance difficulty and code familiarization and sorting cost. In addition, only the differentiated configuration function in the aggregation function is used to execute configuration of the link layer discovery protocol switch state and the link layer discovery protocol working mode of different network cards, which can shorten the research and development cycle of research and development personnel for full-process adaptation from name to function of the added network card manufacturer, and reduce coding omissions and other problems caused by large code amount and unclear structure, thereby reducing project delivery risk to a certain extent.
[0092] Further, the application embodiment further discloses an electronic device, Figure 8 FIG. 1 is a structural diagram of an electronic device 20 according to an example embodiment, and the contents in the figure cannot be considered as any limitation on the use range of the application.
[0093] Figure 8 A structural schematic diagram of an electronic device 20 provided by the embodiment of the application is shown. The electronic device 20 can specifically include at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26. The memory 22 is used to store a computer program, the computer program is loaded and executed by the processor 21 to realize related steps in the network card link layer discovery protocol configuration method, specifically including:
[0094] Step S11: obtaining a network card configuration request initiated by a current user for a preset unified network card configuration interface, and determining a network card configuration type corresponding to the network card configuration request; wherein the preset unified network card configuration interface is an interface in which network card information of different manufacturers is converged into an aggregation function in advance;
[0095] Step S12: executing a corresponding differentiated configuration function in the aggregation function according to the network card configuration type, so as to configure a link layer discovery protocol switch state of a network card and a link layer discovery protocol working mode of the network card by using the differentiated configuration function;
[0096] Step S13: when the link layer discovery protocol switch state and the link layer discovery protocol working mode are configured, obtaining an execution result, so that a target management interface calls according to the execution result through an intelligent platform management interface command. In addition, the electronic device 20 in the embodiment can be a computer. The technology and scheme can also meet the needs of server other component function and protocol adaptive configuration.
[0097] In a specific embodiment, the preset unified network card configuration interface is determined by:
[0098] Obtaining respective manufacturer identifiers corresponding to network cards of different manufacturers, and counting the network cards and the manufacturer identifiers to determine attribute information of the network cards;
[0099] Obtaining respective configuration modes of a link layer discovery protocol switch state and a link layer discovery protocol working mode when the link layer discovery protocol is configured for the network cards;
[0100] Matching the configuration modes with the attribute information to obtain a network card configuration table, and then determining the preset unified network card configuration interface according to the network card configuration table.
[0101] In a specific embodiment, the network card link layer discovery protocol configuration method further includes:
[0102] Obtaining an update configuration file uploaded by the current user, and storing the update configuration file in a staging directory;
[0103] Performing a legality check on the update configuration file, if the legality check on the update configuration file passes, moving the update configuration file in the staging directory to the network card configuration table to update the network card configuration table, and if the legality check on the update configuration file does not pass, instructing the current user to delete the update configuration file in the staging directory.
[0104] In a specific embodiment, the determination of the network card configuration type corresponding to the network card configuration request includes:
[0105] determining that the network card configuration request corresponds to an I2C operation register mode;
[0106] Or, determining that the network card configuration request corresponds to a configuration file generation mode.
[0107] In a specific embodiment, the execution of the corresponding differentiated configuration function in the aggregation function according to the network card configuration type is configured to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card by using the differentiated configuration function, including:
[0108] If the network card configuration type is the I2C operation register mode, a preset register address configuration table is obtained, and the preset register address configuration table is polled and matched to determine the target register address corresponding to the network card;
[0109] The configuration content of the current user is written into the register according to the target register address, so as to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card.
[0110] In a specific embodiment, the execution of the corresponding differentiated configuration function in the aggregation function according to the network card configuration type is configured to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card by using the differentiated configuration function, including:
[0111] If the network card configuration type is the configuration file generation mode, a preset file configuration table is obtained, and the current configuration file name is determined according to the network card information corresponding to the configuration of the current user; wherein the preset file configuration table is determined by the configuration file name of the configuration file stored in different positions;
[0112] The preset file configuration table is traversed and matched through the current configuration file name to determine the file position of the current configuration file, and then based on the file position, the corresponding configuration file is created by using a file function according to the current configuration file name, so as to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card.
[0113] In a specific embodiment, when the link layer discovery protocol switch state and the link layer discovery protocol working mode configuration are completed, an execution result is obtained, so that the target management interface calls the intelligent platform management interface command according to the execution result, including:
[0114] When the link layer discovery protocol switch state and the link layer discovery protocol working mode configuration are completed, the execution result is normalized to obtain a normalized execution result, so that a Restful interface or a Redfish interface calls according to the normalized execution result through an intelligent platform management interface command.
[0115] In the embodiment, the power supply 23 is configured to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 is configured to create a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which is not limited specifically herein; the input / output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application requirements, which is not limited specifically herein.
[0116] In addition, the memory 22 as a carrier of resource storage can be a read-only memory, a random access memory, a magnetic disk or an optical disk, and the resources stored thereon can include an operating system 221, a computer program 222 and data 223, etc., and the data 223 can include various data. The storage mode can be temporary storage or permanent storage.
[0117] The operating system 221 is configured to manage and control each hardware device and the computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of completing the network card link layer discovery protocol configuration method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include a computer program capable of completing other specific work.
[0118] Further, the embodiment of the present application further discloses a computer readable storage medium, which includes a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a magnetic disk or an optical disk, or any other form of storage medium known in the technical field. The computer program is executed by the processor to realize the steps of the foregoing network card link layer discovery protocol configuration method.
[0119] Specifically, the computer program is executed by the processor to realize the steps of the foregoing network card link layer discovery protocol configuration method as follows:
[0120] Step S11: Obtain a network card configuration request initiated by a current user for a preset unified network card configuration interface, and determine a network card configuration type corresponding to the network card configuration request; wherein the preset unified network card configuration interface is an interface in which network card information of different manufacturers is converged into an aggregation function in advance.
[0121] Step S12: According to the network card configuration type, execute a corresponding differentiated configuration function in the aggregation function, so as to configure a link layer discovery protocol switch state of a network card and a link layer discovery protocol working mode of the network card by using the differentiated configuration function.
[0122] Step S13: When the link layer discovery protocol switch state and the link layer discovery protocol working mode are configured, obtain an execution result, so that a target management interface calls according to the execution result through an intelligent platform management interface command.
[0123] In a specific embodiment, the preset unified network card configuration interface is determined, comprising:
[0124] Obtain respective manufacturer identifiers corresponding to network cards of different manufacturers, and count the network cards and the manufacturer identifiers to determine attribute information of the network cards;
[0125] Obtain respective configuration modes of a link layer discovery protocol switch state and a link layer discovery protocol working mode when the link layer discovery protocol is configured for the network cards;
[0126] Match the configuration modes with the attribute information to obtain a network card configuration table, and then determine the preset unified network card configuration interface according to the network card configuration table.
[0127] In a specific embodiment, the network card link layer discovery protocol configuration method further comprises:
[0128] Obtain an update configuration file uploaded by the current user, and store the update configuration file in a staging directory;
[0129] Perform a legality check on the update configuration file, if the legality check on the update configuration file passes, move the update configuration file in the staging directory to the network card configuration table to update the network card configuration table, and if the legality check on the update configuration file does not pass, instruct the current user to delete the update configuration file in the staging directory.
[0130] In a specific embodiment, the determination of the network card configuration type corresponding to the network card configuration request comprises:
[0131] The network card configuration type corresponding to the network card configuration request is determined as an I2C operation register mode.
[0132] Or, determine the network card configuration request corresponding to the network card configuration type is the generation of configuration file mode.
[0133] In a specific embodiment, the execution of the corresponding differentiated configuration function in the aggregation function according to the network card configuration type is to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card by using the differentiated configuration function, including:
[0134] If the network card configuration type is the I2C operation register mode, a preset register address configuration table is obtained, and the preset register address configuration table is polled and matched to determine the target register address corresponding to the network card;
[0135] According to the target register address, the configuration content of the current user is written into the register to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card.
[0136] In a specific embodiment, the execution of the corresponding differentiated configuration function in the aggregation function according to the network card configuration type is to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card by using the differentiated configuration function, including:
[0137] If the network card configuration type is the generation of configuration file mode, a preset file configuration table is obtained, and the current configuration file name is determined according to the network card information corresponding to the configuration of the current user; wherein the preset file configuration table is determined by the configuration file name of the configuration file stored in different positions;
[0138] The preset file configuration table is traversed and matched through the current configuration file name to determine the file position of the current configuration file, and then based on the file position, the corresponding configuration file is created by using the file function according to the current configuration file name, so as to configure the link layer discovery protocol switch state of the network card and the link layer discovery protocol working mode of the network card.
[0139] In a specific embodiment, when the link layer discovery protocol switch state and the link layer discovery protocol working mode configuration are completed, an execution result is obtained, so that the target management interface calls according to the execution result through the intelligent platform management interface command, including:
[0140] When the link layer discovery protocol switch state and the link layer discovery protocol working mode configuration are completed, the execution result is normalized to obtain a normalized execution result, so that a Restful interface or a Redfish interface calls according to the normalized execution result through an intelligent platform management interface command.
[0141] The various embodiments described in the specification are progressive in nature, and each embodiment highlights the differences from other embodiments. The same or similar parts between embodiments can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part.
[0142] The steps of the network card link layer discovery protocol configuration or algorithm described in combination with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0143] Finally, it should be noted that, in this document, relational terms such as first and second, and the like, are used solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without more limitations, an element defined by the statement "comprising a" does not exclude the existence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0144] The above describes in detail the network card link layer discovery protocol configuration method, device, equipment and medium provided by the application. The principles and implementation modes of the application are described by specific examples. The above embodiment description is only used to help understand the method and core idea of the application. For those skilled in the art, according to the idea of the application, the specific implementation mode and application range can be changed. In summary, the content of the specification should not be understood as a limitation of the application.
Claims
1. A method for configuring a network interface card (NIC) link layer discovery protocol, characterized in that, Applications to baseboard management controllers include: The system obtains network interface card (NIC) configuration requests initiated by the current user to a preset unified NIC configuration interface and determines the NIC configuration type corresponding to the NIC configuration request; wherein, the preset unified NIC configuration interface is an interface that pre-converges NIC information from different manufacturers into an aggregation function; the NIC configuration type includes I2C register operation mode and configuration file generation mode; Execute the corresponding differential configuration function within the aggregation function according to the network interface card (NIC) configuration type, so as to configure the NIC's link layer discovery protocol switch status and the NIC's link layer discovery protocol working mode using the differential configuration function; Once the link layer discovery protocol switch status and the link layer discovery protocol working mode are configured, the execution result is obtained so that the target management interface can be invoked based on the execution result through the intelligent platform management interface command. The step of executing the corresponding differentiated configuration function within the aggregation function according to the network interface card (NIC) configuration type, so as to configure the NIC's link layer discovery protocol (LLP) on / off state and the NIC's LLP operating mode using the differentiated configuration function, includes: If the network card configuration type is the I2C operation register mode, then the preset register address configuration table is obtained, and the preset register address configuration table is polled and matched to determine the target register address corresponding to the network card; The configuration content of the current user is written into the register according to the target register address, so as to configure the link layer discovery protocol switch status and the link layer discovery protocol working mode of the network card; If the network card configuration type is the generated configuration file method, then a preset file configuration table is obtained, and the current configuration file name is determined according to the network card information configured for the current user; wherein, the preset file configuration table is determined by the configuration file names stored in different locations. The preset file configuration table is traversed and matched by the current configuration file name to determine the file location of the current configuration file. Then, based on the file location, the corresponding configuration file is created using the file function according to the current configuration file name, so as to configure the link layer discovery protocol switch status and the link layer discovery protocol working mode of the network card. Determining the preset unified network interface card configuration interface includes: Obtain the manufacturer identifiers corresponding to network cards from different manufacturers, and perform statistics on the network cards and the manufacturer identifiers to determine the attribute information of the network cards; The configuration method for the link layer discovery protocol switch status and link layer discovery protocol working mode when configuring the link layer discovery protocol for the network interface card; The configuration method is matched with the attribute information to obtain the network card configuration table, and then the preset unified network card configuration interface is determined according to the network card configuration table.
2. The network interface card link layer discovery protocol configuration method according to claim 1, characterized in that, Also includes: Obtain the update configuration file uploaded by the current user and store the update configuration file in the temporary storage directory; The validity of the updated configuration file is verified. If the validity of the updated configuration file passes the verification, the updated configuration file in the temporary storage directory is moved to the network card configuration table to update the network card configuration table. If the validity of the updated configuration file fails the verification, the current user is instructed to delete the updated configuration file in the temporary storage directory.
3. The network interface card link layer discovery protocol configuration method according to claim 1, characterized in that, Determining the network interface card (NIC) configuration type corresponding to the NIC configuration request includes: The network interface card (NIC) configuration type corresponding to the NIC configuration request is determined to be I2C register operation mode; Alternatively, determine that the network interface configuration type corresponding to the network interface configuration request is the configuration file generation method.
4. The network interface card link layer discovery protocol configuration method according to any one of claims 1 to 3, characterized in that, Once the link layer discovery protocol switch state and the link layer discovery protocol working mode are configured, the execution result is obtained so that the target management interface can be invoked based on the execution result through the intelligent platform management interface command, including: Once the link layer discovery protocol switch state and the link layer discovery protocol working mode are configured, the execution result is normalized and the normalized execution result is obtained so that the Restful interface or Redfish interface can be invoked based on the normalized execution result through the intelligent platform management interface command.
5. A network interface card (NIC) link layer discovery protocol configuration device, characterized in that, Applications to baseboard management controllers include: The network interface card (NIC) configuration request acquisition module is used to acquire NIC configuration requests initiated by the current user for the preset unified NIC configuration interface. The network interface card (NIC) configuration type determination module is used to determine the NIC configuration type corresponding to the NIC configuration request; wherein, the preset unified NIC configuration interface is an interface that pre-converges NIC information from different manufacturers into an aggregation function; the NIC configuration type includes I2C register operation mode and configuration file generation mode; The differential configuration module is used to execute the corresponding differential configuration function within the aggregation function according to the network interface card (NIC) configuration type, so as to configure the NIC's link layer discovery protocol switch status and the NIC's link layer discovery protocol working mode using the differential configuration function; The interface invocation module is used to obtain the execution result after the link layer discovery protocol switch status and the link layer discovery protocol working mode are configured, so that the target management interface can be invoked according to the execution result through the intelligent platform management interface command; Specifically, the differentiated configuration module is used for: If the network card configuration type is the I2C operation register mode, then the preset register address configuration table is obtained, and the preset register address configuration table is polled and matched to determine the target register address corresponding to the network card; The configuration content of the current user is written into the register according to the target register address, so as to configure the link layer discovery protocol switch status and the link layer discovery protocol working mode of the network card; If the network card configuration type is the generated configuration file method, then a preset file configuration table is obtained, and the current configuration file name is determined according to the network card information configured for the current user; wherein, the preset file configuration table is determined by the configuration file names stored in different locations. The preset file configuration table is traversed and matched by the current configuration file name to determine the file location of the current configuration file. Then, based on the file location, the corresponding configuration file is created using the file function according to the current configuration file name, so as to configure the link layer discovery protocol switch status and the link layer discovery protocol working mode of the network card. The network interface card link layer discovery protocol configuration device is further used for: Obtain the manufacturer identifiers corresponding to network cards from different manufacturers, and perform statistics on the network cards and the manufacturer identifiers to determine the attribute information of the network cards; The configuration method for the link layer discovery protocol switch status and link layer discovery protocol working mode when configuring the link layer discovery protocol for the network interface card; The configuration method is matched with the attribute information to obtain the network card configuration table, and then the preset unified network card configuration interface is determined according to the network card configuration table.
6. An electronic device, characterized in that, The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, which is loaded and executed by the processor to implement the network interface card link layer discovery protocol configuration method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein the computer programs, when executed by a processor, implement the network interface card link layer discovery protocol configuration method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Message processing method, device and system
CN112152940A
Configuration method and assembly of LLDP working mode
CN113676352A