A method, apparatus and medium for controlling an LLDP enabled state

By using an LLDP enable status monitoring thread created by BMC, the LLDP enable status of the network interface can be modified out-of-band in bare-metal mode, which solves the problem of difficult LLDP function control in bare metal mode and improves the user experience.

CN116048642BActive Publication Date: 2026-04-21JINAN INSPUR DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINAN INSPUR DATA TECH CO LTD
Filing Date
2023-01-30
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In a bare-metal state, existing technologies cannot effectively control LLDP functions, resulting in a poor user experience.

Method used

The LLDP enable status monitoring thread created by BMC modifies the LLDP enable status of the network interface in an out-of-band manner. This includes confirming that an LLDP enable status modification request has been received, obtaining relevant information about the modification request, identifying the target network interface, and sending a modification data packet to the network card to set the LLDP enable status.

Benefits of technology

It enables modification of the LLDP enable state in bare metal mode, increases the diversity of LLDP function control, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116048642B_ABST
    Figure CN116048642B_ABST
Patent Text Reader

Abstract

The application relates to the computer technical field and discloses a control method and device of an LLDP enabling state and a medium, which are applied to an LLDP enabling state monitoring thread created by a BMC and comprise the following steps: when it is determined that an LLDP enabling state modification request is received and it is determined that a network card meets an LLDP enabling state modification condition, a target interface is called to obtain modification request related information; then, a target network port is determined according to the modification request related information; and after a modification data packet is encapsulated, the modification data packet is sent to the network card, so that the network card sets a corresponding LLDP enabling state of the target network port. Therefore, the LLDP enabling state monitoring thread created by the BMC realizes modification of the LLDP enabling state of the network port in an out-of-band mode, the operation system does not need to be installed with an LLDP client for operation, the modification of the LLDP enabling state can be realized in a bare machine state, and the diversity of LLDP function control is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus and medium for controlling the LLDP enable state. Background Technology

[0002] Server network interface cards (NICs) typically have a Link Layer Discovery Protocol (LLDP) function. LLDP enables unified management of devices on the link by sending LLDP messages to the switch.

[0003] In different application scenarios, it is necessary to enable or disable LLDP. Currently, the main approach is to enable or disable the LLDP function of the network port in an in-band manner. That is, an LLDP client is installed on the operating system, and the LLDP enable status of the network port is controlled through the LLDP client.

[0004] However, in certain special scenarios, such as when users need to configure LLDP functionality on a bare metal network, the LLDP functionality cannot be operated because the bare metal does not have any operating system or corresponding proxy software installed, resulting in a poor user experience.

[0005] Therefore, it is evident that how to control the LLDP enable state in different scenarios, increase the diversity of LLDP function control, meet different user needs, and improve user experience is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] The purpose of this application is to provide a method, device, and medium for controlling the LLDP enable state, enabling control of the LLDP enable state in different scenarios, increasing the diversity of LLDP function control, meeting different user needs, and improving user experience.

[0007] To address the aforementioned technical problems, this application provides a method for controlling the LLDP enable state, applied to an LLDP enable state monitoring thread created by BMC, comprising:

[0008] Once it is determined that an LLDP enable state modification request has been received and that the network interface card meets the LLDP enable state modification conditions, the target interface is called to obtain relevant information about the modification request.

[0009] The target network port is determined based on the information related to the modification request;

[0010] After encapsulating and modifying the data packet, the modified data packet is sent to the network card so that the network card sets the target network port to the corresponding LLDP enabled state.

[0011] Preferably, determining that an LLDP enable state modification request has been received includes:

[0012] Determine whether a temporary file exists for storing information related to the modification request; wherein, the information related to the modification request includes the LLDP enable status modification instruction and the target network interface MAC address;

[0013] If it exists, then it is determined that the LLDP enable state modification request has been received.

[0014] Preferably, determining that the network interface card meets the LLDP enable state modification conditions includes:

[0015] Obtain pre-stored network card information from EEPROM; wherein, the network card information includes at least the network card manufacturer, network card model, and whether LLDP enable state modification flag information is supported;

[0016] After establishing communication with the network card, obtain the current network card information;

[0017] Determine whether the pre-stored network card information is consistent with the current network card information;

[0018] If they match, determine whether the network card supports LLDP enable state modification. If it does, determine that the network card meets the LLDP enable state modification conditions. If it does not support it, record the log information that the network card does not support LLDP enable state modification.

[0019] If there is a discrepancy, log information indicating that the current network card information is inconsistent with the pre-stored network card information will be recorded.

[0020] Preferably, the step of calling the target interface to obtain information related to the modification request includes:

[0021] The target interface is determined based on the network card manufacturer;

[0022] The modification request information is obtained from the temporary file through the target interface.

[0023] Preferably, determining the target network interface based on the modification request information includes:

[0024] Iterate through the MAC addresses of each port of the network card in sequence;

[0025] Each time a network interface MAC address is traversed, it is determined whether it is the same as the target network interface MAC address in the temporary file;

[0026] If they are the same, then the network interface with the same MAC address is determined as the target network interface.

[0027] Preferably, the method for controlling the LLDP enable state further includes:

[0028] Determine whether the number of log messages recording changes to the LLDP enable status of the network card exceeds a preset value;

[0029] If the preset value is exceeded, log information with earlier storage time will be cleared.

[0030] Preferably, the network interface card (NIC) setting the target NIC to the corresponding LLDP enabled state includes:

[0031] Upon receiving the modified data packet, the modified data packet is parsed to determine the LLDP enable state modification instruction;

[0032] The LLDP enable state of the target network interface is set according to the LLDP enable state modification instruction.

[0033] To address the aforementioned technical problems, this application also provides a control device for the LLDP enable state, applied to an LLDP enable state monitoring thread created by BMC, comprising:

[0034] The calling module is used to call the target interface to obtain information related to the modification request when it is determined that an LLDP enable state modification request has been received and the network card meets the LLDP enable state modification conditions.

[0035] The determination module is used to determine the target network interface based on the information related to the modification request;

[0036] The sending module is used to send the modified data packet to the network card after encapsulating the modified data packet, so that the network card sets the target network port to the corresponding LLDP enabled state.

[0037] The control device for the LLDP enabled state also includes:

[0038] The first processing module is used to determine whether there is a temporary file for storing information related to the modification request; wherein, the information related to the modification request includes the LLDP enable state modification instruction and the target network interface MAC address. If it exists, it is determined that the LLDP enable state modification request has been received.

[0039] The first acquisition module is used to acquire pre-stored network card related information from the EEPROM; wherein, the network card related information includes at least the network card manufacturer, network card model, and whether LLDP enable state modification flag information is supported;

[0040] The second acquisition module is used to acquire current network card information after establishing communication with the network card;

[0041] The second processing module is used to determine whether the pre-stored network card information is consistent with the current network card information. If they are consistent, it determines whether the network card supports LLDP enable state modification. If it supports it, it determines that the network card meets the LLDP enable state modification conditions. If it does not support it, it records log information indicating that the network card does not support LLDP enable state modification. If they are inconsistent, it records log information indicating that the current network card information is inconsistent with the pre-stored network card information.

[0042] The query module is used to determine the target interface based on the network card manufacturer;

[0043] The third acquisition module is used to obtain information related to the modification request from the temporary file through the target interface.

[0044] The traversal module is used to sequentially traverse the MAC addresses of each network port of the network card;

[0045] The third processing module is used to determine whether each network port MAC address is the same as the target network port MAC address in the temporary file. If they are the same, the network port with the same MAC address is determined to be the target network port.

[0046] The fourth processing module is used to determine whether the number of log messages recorded indicating that the network card does not support LLDP enable status modification exceeds a preset value. If it exceeds the preset value, the log messages with earlier storage times are cleared.

[0047] The parsing module is used to parse the modified data packet after receiving it to determine the LLDP enable state modification instruction;

[0048] The configuration module is used to set the LLDP enable state of the target network interface according to the LLDP enable state modification instruction.

[0049] To address the aforementioned technical problems, this application also provides a control device for the LLDP enable state, including a memory for storing a computer program;

[0050] A processor, used to implement the steps of the control method for the LLDP enable state when executing the computer program.

[0051] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the control method for the LLDP enable state.

[0052] This invention provides a method for controlling the LLDP enable state, applied to an LLDP enable state monitoring thread created by a BMC. The method includes: upon determining that an LLDP enable state modification request has been received and that the network interface card (NIC) meets the LLDP enable state modification conditions, calling the target interface to obtain modification request information; then, determining the target network interface based on the modification request information; and after encapsulating the modification data packet, sending the modification data packet to the NIC so that the NIC sets the target network interface to the corresponding LLDP enable state. Therefore, the technical solution provided in this application, through an LLDP enable state monitoring thread created by a BMC, enables out-of-band modification of the LLDP enable state of the network interface. This eliminates the need to install an LLDP client on the operating system, allowing modification of the LLDP enable state in a bare-metal state, increasing the diversity of LLDP function control, meeting different user needs, and thus improving the user experience.

[0053] In addition, this application also provides a control device and medium for the LLDP enabled state, which corresponds to the above-mentioned control method for the LLDP enabled state and has the same effect. Attached Figure Description

[0054] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 A flowchart illustrating a method for controlling the LLDP enable state provided in an embodiment of this application;

[0056] Figure 2 A structural diagram of a control device for an LLDP enabled state provided in an embodiment of this application;

[0057] Figure 3 This is a structural diagram of a control device for an LLDP enabled state provided in another embodiment of this application. Detailed Implementation

[0058] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0059] The core of this application is to provide a method, device, and medium for controlling the LLDP enable state. By using an LLDP enable state monitoring thread created by BMC, the LLDP enable state of the network port can be modified out of band, increasing the diversity of LLDP function control and improving the user experience.

[0060] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0061] Server network interface cards (NICs) typically have LLDP functionality. LLDP enables unified management of devices on the link by sending LLDP messages to the switch. In different application scenarios, it is necessary to enable or disable LLDP. Currently, the main approach is to enable or disable the LLDP function of the network port using an in-band method. That is, an LLDP client is installed on the operating system, and the LLDP enable status of the network port is controlled through the LLDP client.

[0062] However, in certain special scenarios, such as when users need to configure LLDP functionality on a bare metal network, the LLDP functionality cannot be operated because the bare metal does not have any operating system or corresponding proxy software installed, resulting in a poor user experience.

[0063] To address the aforementioned technical issues, enable control of the LLDP enable state in different scenarios, increase the diversity of LLDP function control, meet diverse user needs, and enhance user experience, this application provides a method for controlling the LLDP enable state. This method monitors the LLDP enable state through an LLDP enable state monitoring thread created by the Baseboard Manager Controller (BMC). Specifically, when a user needs to modify the LLDP enable state, the BMC modifies the LLDP enable state of the network port out-of-band, eliminating the need to install an LLDP client on the operating system. This allows for modification of the LLDP enable state in a bare-metal state, increasing the diversity of LLDP function control.

[0064] Figure 1 A flowchart illustrating a method for controlling the LLDP enable state provided in this application embodiment is shown. This method is applied to an LLDP enable state monitoring thread created by BMC, such as... Figure 1 As shown, the method includes:

[0065] S10: When it is determined that an LLDP enable state modification request has been received and that the network card meets the LLDP enable state modification conditions, the target interface is called to obtain the modification request information.

[0066] It should be noted that the technical solution provided in this application is applied to the LLDP enable state monitoring thread created by BMC. This thread is used to monitor whether a user's LLDP enable state modification request is obtained, and to modify the LLDP enable state according to the user's request.

[0067] In this embodiment, when a user needs to modify the LLDP enable state and the system does not have an LLDP client installed on the operating system, the user can send an LLDP enable state modification request to the Web module or Redfish in the BMC via a browser. Redfish is a management standard based on HTTPS services. After confirming that the Web module or Redfish has received the user's LLDP enable state modification request, the LLDP enable state monitoring thread determines whether the network card meets the conditions for modifying the LLDP enable state. If the conditions are met, it calls the target interface to obtain relevant information about the modification request.

[0068] In determining whether a network interface card (NIC) meets the conditions for modifying its LLDP enable state, the LLDP enable state monitoring thread first retrieves pre-stored NIC-related information from the EEPROM. This information includes at least the NIC manufacturer, NIC model, and whether it supports LLDP enable state modification. Then, it establishes communication with the NIC to obtain its current information and compares it with the pre-stored information. If they match, the NIC is deemed to meet the conditions for modifying its LLDP enable state.

[0069] It is worth noting that the modification request information is the result obtained by the Web module or Redfish after receiving the user's LLDP enable status modification request, parsing the request, and storing the relevant information in a temporary file. This modification request information includes the LLDP enable status modification command and the target network interface MAC address.

[0070] It is understandable that after the LLDP enable state monitoring thread determines that it has received an LLDP enable state modification request, it can directly obtain the relevant information of the modification request from the temporary file.

[0071] S11: Determine the target network interface based on the information in the modification request;

[0072] Furthermore, after the LLDP enable status monitoring thread obtains the modification request information from the temporary file, it can determine the MAC address of the network interface to be modified, that is, it can determine the target network interface MAC address. In implementation, each network interface on the network card is traversed sequentially, and it is determined whether the traversed network interface has the target network interface MAC address. The network interface with the same MAC address as the target network interface is designated as the target network interface, which is the network interface whose LLDP enable status needs to be modified.

[0073] S12: After encapsulating the modified data packet, send the modified data packet to the network card so that the network card sets the target network interface to the corresponding LLDP enabled state.

[0074] After determining the target network interface, a modification data packet is encapsulated. This modification data packet can be an MCTP data packet or other types of data packets; this application does not limit this. The encapsulated modification data packet is then sent to the network interface card (NIC). Upon receiving the modification data packet, the NIC parses it to determine the target network interface and the LLDP enable state modification instruction. Then, based on the LLDP enable state modification instruction, the LLDP enable state of the target network interface is modified.

[0075] The LLDP enable state control method provided in this application embodiment is applied to an LLDP enable state monitoring thread created by the BMC. It includes: upon determining that an LLDP enable state modification request has been received and that the network card meets the LLDP enable state modification conditions, calling the target interface to obtain modification request information; then, determining the target network interface based on the modification request information; and after encapsulating the modification data packet, sending the modification data packet to the network card so that the network card sets the target network interface to the corresponding LLDP enable state. Therefore, the technical solution provided in this application, through the LLDP enable state monitoring thread created by the BMC, enables out-of-band modification of the LLDP enable state of the network interface. This eliminates the need to install an LLDP client on the operating system, allowing modification of the LLDP enable state in a bare-metal state, increasing the diversity of LLDP function control, meeting different user needs, and thus improving the user experience.

[0076] In a specific embodiment, when a user needs to modify the LLDP enable status, they send an LLDP enable status modification command to the Web module or Redfish in the BMC via a browser. The Web module or Redfish parses the received LLDP enable status modification command to obtain modification request information, namely, the LLDP enable status modification command and the target network interface MAC address, and stores the modification request information in a temporary file. The LLDP enable status modification command is used to modify the LLDP enable status of the network interface; for example, this command is used to change the LLDP enable status of the network interface to "on". The target network interface MAC address is used to determine the target network interface that the user needs to modify.

[0077] It should be noted that after each LLDP enable state modification, the temporary file storing the modification request information is deleted. Therefore, when the LLDP enable state monitoring thread determines whether it has received an LLDP enable state modification request, it checks whether a temporary file storing the modification request information exists. If it does, it confirms that the user's LLDP enable state modification request has been received.

[0078] The LLDP enable state control method provided in this application determines whether a user's LLDP enable state modification request has been received when an LLDP enable state modification request is received, based on the existence of a temporary file used to store information related to the modification request. Therefore, the LLDP enable state monitoring thread can determine whether a user's LLDP enable state modification request has been received based on the presence of a temporary file, and modify the LLDP enable state according to the monitoring results. This enables modification of the LLDP enable state even on bare metal, improving the user experience.

[0079] Based on the above embodiments, after the LLDP enable status monitoring thread determines that it has received a user's LLDP enable status modification request by checking for the existence of a temporary file, it needs to determine whether the network card meets the LLDP enable status modification conditions. Therefore, in a preferred embodiment, determining that the network card meets the LLDP enable status modification conditions includes:

[0080] Retrieve pre-stored network card information from the EEPROM; the network card information includes at least the network card manufacturer, network card model, and whether LLDP enable status modification flag is supported.

[0081] After establishing communication with the network card, obtain the current network card information;

[0082] Determine whether the pre-stored network card information is consistent with the current network card information;

[0083] If they match, determine whether the network card supports LLDP enable state modification. If it does, determine whether the network card meets the conditions for LLDP enable state modification. If it does not support it, record the log information that the network card does not support LLDP enable state modification.

[0084] If there is a discrepancy, log information indicating that the current network card information is inconsistent with the pre-stored network card information will be recorded.

[0085] It is understandable that when a network card leaves the factory, network card information such as the network card manufacturer and network card model is stored in the EEPROM. Therefore, when determining whether the current network card meets the LLDP enable state modification conditions, the pre-stored network card information is first obtained from the EEPROM through the I2C link, and communication is established with the current network card. Then, the current network card information is obtained.

[0086] It should be noted that the network card information includes at least the network card manufacturer, network card model, and whether it supports LLDP enable status modification information. The LLDP enable status modification information can be numbers, letters, or other symbols, and this application does not limit this.

[0087] Next, compare the pre-stored network card information with the current network card information. If they match, further determine whether the network card supports LLDP enable state modification based on the network card information. If it does, determine that the network card meets the conditions for LLDP enable state modification.

[0088] If the pre-stored network card information is inconsistent with the current network card information, or if it is determined from the network card information that the network card does not support LLDP enable state modification, then the network card does not meet the conditions for LLDP enable state modification. In this case, the relevant information that does not meet the conditions will be stored in the form of a log.

[0089] The LLDP enable state control method provided in this application determines whether the network card meets the LLDP enable state modification conditions by comparing the network card related information pre-stored in the EEPROM with the current network card related information. After determining that the LLDP enable state modification conditions are met, the LLDP enable state is modified, thereby improving the reliability of the modification and enhancing the user experience.

[0090] It is understandable that different manufacturers' network cards have different corresponding calling interfaces. Therefore, based on the above embodiment, when calling the target interface to obtain modification request information, it is necessary to determine the target interface based on the network card manufacturer information in the network card information, and then obtain the modification request information from the temporary file through the target interface.

[0091] The LLDP enable state control method provided in this application embodiment, when calling the target interface to obtain modification request information, determines the target interface according to the network card manufacturer, and obtains the modification request information from the temporary file through the target interface. Then, according to the interface corresponding to the network card manufacturer, the modification request information in the temporary file is obtained accurately and quickly, thereby improving the efficiency and accuracy of LLDP enable state modification.

[0092] In a specific embodiment, the network interface card (NIC) includes multiple network ports. When modifying the LLDP enable state of a certain network port, it is necessary to determine the target network port based on the modification request information and modify the LLDP enable state of the target NIC. Therefore, in a preferred embodiment, determining the target network port based on the modification request information includes:

[0093] Iterate through the MAC addresses of each network interface of the network card in turn;

[0094] Each time a network interface MAC address is traversed, it is checked whether it is the same as the target network interface MAC address in the temporary file;

[0095] If they are the same, then the network interface with the same MAC address is determined as the target network interface.

[0096] In practice, each network interface of the network card is traversed sequentially to obtain the MAC address of each interface. For each interface MAC address obtained, it is compared with the target interface MAC address obtained from the temporary file. The interface with the same MAC address as the target interface is taken as the target interface, that is, the interface whose LLDP enable status needs to be modified.

[0097] Of course, if the obtained MAC address is different from the target network interface's MAC address, the next MAC address is obtained for comparison until a target network interface with the same MAC address is found. If the target network interface is not found after traversing all network interfaces, an alert signal is transmitted to the client.

[0098] The LLDP enable state control method provided in this application determines the target network port by comparing the MAC address of each network port of the network card with the target MAC address in the temporary file, and then accurately modifies the LLDP enable state of the target network port.

[0099] It is understandable that if it is determined from the network card information that the network card does not support LLDP enable state modification, the corresponding log information needs to be stored. However, in order to avoid repeatedly recording multiple identical log entries and thus consuming excessive resources, as a preferred embodiment, the technical solution provided in this application further includes:

[0100] Determine whether the number of log messages recording changes to the LLDP enable status of the network interface card exceeds a preset value;

[0101] If the value exceeds the preset value, log information with the earliest storage time will be deleted.

[0102] The LLDP enable status monitoring thread monitors the stored log information in real time and determines whether the number of log entries indicating that the network interface card (NIC) does not support LLDP enable status modifications exceeds a preset value. If it does, the thread deletes earlier-stored log entries based on their storage time to prevent the number of log entries from exceeding the preset value. For example, if the preset value is 3, then if there are 4 log entries indicating that the NIC does not support LLDP enable status modifications, one of the earlier-stored log entries will be deleted.

[0103] The LLDP enable state control method provided in this application, when determining that the number of log messages recorded that the network interface card does not support LLDP enable state modification exceeds a preset value, clears the log messages with earlier storage times. Therefore, based on this log anti-overlap strategy, resources are saved and the reliability of LLDP enable state control is improved.

[0104] In practice, when the network interface card (NIC) receives a modification data packet sent by the LLDP enable status monitoring thread, it parses the data packet to determine the LLDP enable status modification instruction and sets the LLDP enable status of the target network interface according to the instruction. For example, if the LLDP enable status modification instruction is to enable LLDP, the NIC will enable LLDP on the target network interface after parsing the modification data packet.

[0105] The LLDP enable state control method provided in this application monitors user requests through an LLDP enable state monitoring thread and sends corresponding modification data packets to the network card based on LLDP enable state modification requests, thereby modifying the LLDP enable state of the network card. This enables out-of-band modification of the LLDP enable state of the network interface card without requiring the installation of an LLDP client on the operating system, increasing the diversity of LLDP function control, meeting different user needs, and ultimately improving the user experience.

[0106] In the above embodiments, the control method for the LLDP enabled state has been described in detail. This application also provides an embodiment corresponding to the control device for the LLDP enabled state. It should be noted that this application describes the embodiment of the device part from two perspectives: one is based on the functional module, and the other is based on the hardware structure.

[0107] Figure 2 A structural diagram of a control device for an LLDP enabled state provided in an embodiment of this application is shown below. Figure 2 As shown, the device includes:

[0108] Module 10 is called to obtain relevant information about the modification request by calling the target interface when it is determined that an LLDP enable state modification request has been received and the network card meets the LLDP enable state modification conditions.

[0109] Module 11 is used to determine the target network interface based on the information related to the modification request;

[0110] The sending module 12 is used to send the modified data packet to the network card after encapsulating the modified data packet, so that the network card sets the target network interface to the corresponding LLDP enabled state.

[0111] As a preferred embodiment, the control device for the LLDP enable state provided in this application further includes:

[0112] The first processing module is used to determine whether there is a temporary file for storing information related to the modification request; wherein, the information related to the modification request includes the LLDP enable status modification instruction and the target network interface MAC address. If it exists, it is determined that the LLDP enable status modification request has been received.

[0113] The first acquisition module is used to acquire pre-stored network card related information from the EEPROM; wherein, the network card related information includes at least the network card manufacturer, network card model, and whether LLDP enable status modification flag information is supported;

[0114] The second acquisition module is used to acquire current network card information after establishing communication with the network card;

[0115] The second processing module is used to determine whether the pre-stored network card information is consistent with the current network card information. If they are consistent, it determines whether the network card supports LLDP enable state modification. If it supports it, it determines that the network card meets the conditions for LLDP enable state modification. If it does not support it, it records the log information that the network card does not support LLDP enable state modification. If they are inconsistent, it records the log information that the current network card information is inconsistent with the pre-stored network card information.

[0116] The query module is used to determine the target interface based on the network interface card (NIC) manufacturer.

[0117] The third acquisition module is used to obtain information related to the modification request from the temporary file through the target interface.

[0118] The traversal module is used to sequentially traverse the MAC addresses of each network interface of the network card;

[0119] The third processing module is used to check whether the MAC address of each network interface is the same as the target network interface MAC address in the temporary file. If they are the same, the network interface with the same MAC address is determined to be the target network interface.

[0120] The fourth processing module is used to determine whether the number of log messages recording changes to the LLDP enable status of the network card exceeds a preset value. If it exceeds the preset value, the log messages with the earliest storage time are cleared.

[0121] The parsing module is used to parse the modified data packet after receiving it to determine the LLDP enable state modification instruction.

[0122] The configuration module is used to modify the LLDP enable status of the target network interface according to the LLDP enable status modification command.

[0123] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.

[0124] The LLDP enable state control device provided in this application embodiment is applied to an LLDP enable state monitoring thread created by the BMC. It includes: upon determining that an LLDP enable state modification request has been received and that the network card meets the LLDP enable state modification conditions, calling the target interface to obtain modification request information; then, determining the target network port based on the modification request information; and after encapsulating the modification data packet, sending the modification data packet to the network card so that the network card sets the target network port to the corresponding LLDP enable state. Therefore, the technical solution provided in this application, through the LLDP enable state monitoring thread created by the BMC, enables out-of-band modification of the LLDP enable state of the network port without requiring the installation of an LLDP client on the operating system. This allows for modification of the LLDP enable state in a bare-metal state, increasing the diversity of LLDP function control, meeting different user needs, and thus improving the user experience.

[0125] Figure 3 A structural diagram of a control device for an LLDP enabled state provided in another embodiment of this application is shown below. Figure 3 As shown, the control device for the LLDP enabled state includes: a memory 20 for storing computer programs;

[0126] The processor 21 is configured to implement the steps of the control method for the LLDP enable state as described in the above embodiments when executing a computer program.

[0127] The control device for the LLDP enabled state provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.

[0128] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0129] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of the LLDP enable state control method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the relevant data involved in the LLDP enable state control method.

[0130] In some embodiments, the control device for the LLDP enabled state may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0131] Those skilled in the art will understand that Figure 3 The structure shown does not constitute a limitation on the control device for the LLDP enable state and may include more or fewer components than shown.

[0132] The LLDP enable state control device provided in this application includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: LLDP enable state control method.

[0133] The LLDP enable state control device provided in this application embodiment, through the LLDP enable state monitoring thread created by BMC, enables the modification of the LLDP enable state of the network port in an out-of-band manner. It does not require the installation of an LLDP client under the operating system, and the modification of the LLDP enable state can be realized in the bare metal state, increasing the diversity of LLDP function control, meeting different user needs, and thus improving the user experience.

[0134] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.

[0135] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0136] The foregoing provides a detailed description of the control method, apparatus, and medium for the enabled state of an LLDP (Limited Line Utility Device) provided in this application. The various embodiments are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

[0137] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A control method for the enabled state of an LLDP, characterized in that, The LLDP enable status monitoring thread applied to BMC creation includes: Once it is determined that an LLDP enable state modification request has been received and that the network interface card meets the LLDP enable state modification conditions, the target interface is called to obtain relevant information about the modification request. The target network port is determined based on the information related to the modification request; After encapsulating and modifying the data packet, the modified data packet is sent to the network card so that the network card sets the target network port to the corresponding LLDP enabled state; Setting the target network port to the corresponding LLDP enable state includes modifying the LLDP enable state of the target network port in an out-of-band manner to achieve the modification of the LLDP enable state in the bare metal state. The determination that an LLDP enable state modification request has been received includes: Determine whether a temporary file exists for storing information related to the modification request; wherein, the information related to the modification request includes the LLDP enable status modification instruction and the target network interface MAC address; If it exists, then it is determined that the LLDP enable state modification request has been received; The conditions for determining whether the network interface card meets the LLDP enable state modification criteria include: Obtain pre-stored network card information from EEPROM; wherein, the network card information includes at least the network card manufacturer, network card model, and whether LLDP enable state modification flag information is supported; After establishing communication with the network card, obtain the current network card information; Determine whether the pre-stored network card information is consistent with the current network card information; If they match, determine whether the network card supports LLDP enable state modification. If it does, determine that the network card meets the LLDP enable state modification conditions. If it does not support it, record the log information that the network card does not support LLDP enable state modification. If they are inconsistent, log information indicating that the current network card information is inconsistent with the pre-stored network card information will be recorded. The process of calling the target interface to obtain information related to the modification request includes: The target interface is determined based on the network card manufacturer; The modification request information is obtained from the temporary file through the target interface.

2. The control method for the LLDP enable state according to claim 1, characterized in that, Determining the target network interface based on the modification request information includes: Iterate through the MAC addresses of each port of the network card in sequence; Each time a network interface MAC address is traversed, it is determined whether it is the same as the target network interface MAC address in the temporary file; If they are the same, then the network interface with the same MAC address is determined as the target network interface.

3. The control method for the LLDP enable state according to claim 2, characterized in that, Also includes: Determine whether the number of log messages recording changes to the LLDP enable status of the network card exceeds a preset value; If the preset value is exceeded, log information with earlier storage time will be cleared.

4. The control method for the LLDP enable state according to claim 1, characterized in that, The network interface card sets the target network port to the corresponding LLDP enabled state, including: Upon receiving the modified data packet, the modified data packet is parsed to determine the LLDP enable state modification instruction; The LLDP enable state of the target network interface is set according to the LLDP enable state modification instruction.

5. A control device for an LLDP enabled state, characterized in that, The LLDP enable status monitoring thread applied to BMC creation includes: The calling module is used to call the target interface to obtain information related to the modification request when it is determined that an LLDP enable state modification request has been received and the network card meets the LLDP enable state modification conditions. The determination module is used to determine the target network interface based on the information related to the modification request; The sending module is used to send the modified data packet to the network card after encapsulating the modified data packet, so that the network card sets the target network port to the corresponding LLDP enabled state; The specific process of setting the target network port to the corresponding LLDP enable state includes: modifying the LLDP enable state of the network port in an out-of-band manner, and implementing the modification of the LLDP enable state in the bare metal state. The control device for the LLDP enabled state also includes: The first processing module is used to determine whether there is a temporary file for storing information related to the modification request; wherein, the information related to the modification request includes the LLDP enable state modification instruction and the target network interface MAC address; if it exists, it is determined that the LLDP enable state modification request has been received. The first acquisition module is used to acquire pre-stored network card related information from the EEPROM; wherein, the network card related information includes at least the network card manufacturer, network card model, and whether LLDP enable state modification flag information is supported; The second acquisition module is used to acquire current network card information after establishing communication with the network card; The second processing module is used to determine whether the pre-stored network card information is consistent with the current network card information. If they are consistent, it determines whether the network card supports LLDP enable state modification. If it supports it, it determines that the network card meets the LLDP enable state modification conditions. If it does not support it, it records log information indicating that the network card does not support LLDP enable state modification. If they are inconsistent, it records log information indicating that the current network card information is inconsistent with the pre-stored network card information. The query module is used to determine the target interface based on the network card manufacturer; The third acquisition module is used to obtain information related to the modification request from the temporary file through the target interface.

6. A control device for an LLDP enabled state, characterized in that, Includes memory used to store computer programs; A processor, configured to implement the steps of the control method for the LLDP enable state as described in any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the LLDP enable state control method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • System, method and device for determining connected relation

    CN103281206A

  • Method, device and system for computer monitoring

    CN105912439A