Port management method, system and device of network equipment and network equipment

By periodically monitoring the status of the expansion card in the switch and dynamically managing port configuration information, the problem of restarting the device in the existing technology is solved to support the new port function, and the effect of dynamically configuring the port function without restarting the device is achieved.

CN119766761APending Publication Date: 2025-04-04NEW H3C TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411916964.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The existing switch operating system needs to restart after replacing or adding an expansion card to support the new port function, resulting in cumbersome operation and inability to expand ports in some usage scenarios, which seriously restricts the use of switches.

Method used

By periodically monitoring the status of the expansion card in the slot, timely managing the port configuration information corresponding to the slot's interface, and dynamically configuring the port function to enable the port function of the expansion card without restarting the device.

Benefits of technology

It realizes the function of dynamically unplugging and plugging the expansion card during the operation of network equipment. The port function of the expansion card can take effect without restarting the device, which is convenient for use and is conducive to flexible networking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766761A_ABST
    Figure CN119766761A_ABST
Patent Text Reader

Abstract

The invention provides a port management method, system and device of network equipment and the network equipment, and relates to the technical field of communication. The method comprises the following steps: acquiring a first state of an expansion card in at least one slot in a current monitoring period, wherein the first state is an in-place state or a non-in-place state; for any slot position, detecting whether the first state and the second state of the expansion card in the slot position are the same or not; and if the first state is different from the second state, managing port configuration information corresponding to at least one interface of the slot according to the first state. By adopting the technical scheme, the expansion card can be dynamically plugged in and pulled out in the operation process of the network equipment, the port function of the expansion card can take effect without restarting the network equipment, the use is convenient, and flexible networking is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure belongs to the field of communication technology, and in particular relates to a port management method, system, device and network device for network equipment. Background Art

[0002] As a widely used network device, some switches are provided with slots, allowing users to expand the functions and ports of the switch by inserting expansion cards (also called network interface cards) into the slots.

[0003] A mainstream switch operating system only supports the ports of the expansion card installed when the switch is started. If the expansion card is replaced or added, the switch needs to be restarted to enable the operating system to support the port function of replacing or adding the expansion card. This not only makes the operation of expanding the port cumbersome and inconvenient to use, but also makes it impossible to expand the port in some usage scenarios, which seriously limits the usage scenarios of the switch. Summary of the invention

[0004] The present disclosure provides a port management method, system, device and network device for a network device, which can solve the problem that the device needs to be restarted to make the function of the extended port effective.

[0005] A first aspect of the present disclosure provides a port management method for a network device, wherein the network device includes at least one slot, and any slot is connected to an expansion card through at least one interface. The method includes:

[0006] Acquire a first state of an expansion card in at least one slot in a current monitoring period, wherein the first state is an in-position state or an out-of-position state;

[0007] For any slot, detecting whether a first state and a second state of an expansion card in the slot are the same, wherein the second state is a state of the expansion card in the slot in a previous monitoring cycle of the current monitoring cycle;

[0008] If the first state is different from the second state, the port configuration information corresponding to the at least one interface of the slot is managed according to the first state, and the port configuration information is related to the expansion card.

[0009] In the embodiment of the present disclosure, the modifying the port configuration information corresponding to at least one interface of the slot includes:

[0010] If the first state is in the in-place state, setting port configuration information for the at least one interface according to the port function of the in-place expansion card, so as to configure the function of calling the port of the expansion card through the at least one interface;

[0011] If the first state is an out-of-place state, clear the port configuration information corresponding to the at least one interface to make the at least one interface in an uncallable state, wherein the port configuration information is obtained based on the port function configuration of the in-place expansion card in the previous monitoring cycle of the current monitoring cycle.

[0012] In an embodiment of the present disclosure, the step of setting port configuration information for the at least one interface according to the port function of the expansion card in place includes:

[0013] Determining port attribute information of the expansion card according to the type information of the expansion card;

[0014] Setting port configuration information for a corresponding interface according to port attribute information of any port;

[0015] The port configuration information is synchronized to the processor of the network device and the expansion card, so that the processor has the function of calling the port through the interface.

[0016] In the embodiment of the present disclosure, the clearing of the port configuration information corresponding to the at least one interface includes:

[0017] Determine the port number of the expansion card port corresponding to the at least one interface;

[0018] The port configuration information corresponding to each port number in the processor of the network device is cleared.

[0019] In an embodiment of the present disclosure, obtaining the first state of the expansion card in the at least one slot in the current monitoring period includes:

[0020] For any slot, monitoring whether at least one interface of the slot transmits an electrical signal;

[0021] If any one of the at least one interface of the slot transmits an electrical signal, determining that the first state of the expansion card in the slot is an in-position state;

[0022] If at least one interface of the slot does not transmit an electrical signal, it is determined that the first state of the expansion card in the slot is an absent state.

[0023] In an embodiment of the present disclosure, determining the port attribute information of the expansion card through the at least one interface includes:

[0024] Calling a pre-deployed slot monitoring process to read the type information of the expansion card, and transmitting the type information to a pre-deployed slot control process;

[0025] The slot control process is called to determine the port attribute information according to the type information of the expansion card, and the port configuration information of the corresponding interface is set according to the port attribute information, the port configuration information is synchronized to the processor of the network device, and the type information and the port configuration information are written into a database.

[0026] In an embodiment of the present disclosure, synchronizing the port configuration information to the processor of the network device and the expansion card includes:

[0027] The slot monitoring process is called to read the port configuration information from the database, and the port configuration information is synchronized to the expansion card.

[0028] An embodiment of a second aspect of the present disclosure provides a port management system for a network device, wherein the network device comprises at least one slot, any slot being connected to an expansion card via at least one interface, and the port management system for the network device comprises a pre-deployed slot monitoring process and a pre-deployed slot control process,

[0029] The pre-deployed slot monitoring process is called to obtain a first state of an expansion card in at least one slot in a current monitoring cycle, wherein the first state is an in-place state or an out-of-place state; and for any slot, detect whether the first state and a second state of the expansion card in the slot are the same, wherein the second state is a state of the expansion card in the slot in a previous monitoring cycle of the current monitoring cycle;

[0030] The pre-deployed slot control process is called to manage port configuration information corresponding to at least one interface of the slot according to the first state if the first state is different from the second state, and the port configuration information is related to the expansion card.

[0031] An embodiment of a third aspect of the present disclosure provides a port management device for a network device, wherein the device is deployed in the network device, wherein the network device includes at least one slot, and any slot is connected to an expansion card through at least one interface, and the device includes:

[0032] An acquisition module, used for acquiring a first state of an expansion card in at least one slot in a current monitoring period, wherein the first state is an in-position state or an out-of-position state;

[0033] A detection module, used for detecting, for any slot, whether a first state and a second state of an expansion card in the slot are the same, wherein the second state is a state of the expansion card in the slot in a previous monitoring cycle of the current monitoring cycle;

[0034] A modification module is used to manage port configuration information corresponding to at least one interface of the slot according to the first state if the first state is different from the second state, wherein the port configuration information is related to the expansion card.

[0035] An embodiment of the fourth aspect of the present disclosure provides a network device, including at least one slot, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in the first aspect above.

[0036] An embodiment of the fifth aspect of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement the method described in the first aspect above.

[0037] The technical solution provided by the embodiments of the present disclosure has at least the following technical effects or advantages:

[0038] For a network device including at least one slot, the embodiment of the present disclosure monitors the status of the expansion card in each slot according to a monitoring cycle, and the status of the expansion card in each slot is in the in-place state or out-of-place state, so that the dynamic change of the status of the expansion card in each slot can be obtained in time. Furthermore, for the current monitoring cycle, if the status of the expansion card in a slot changes compared with the status in the previous monitoring cycle, the embodiment of the present disclosure manages the port configuration information corresponding to at least one interface of the slot according to the changed status of the expansion card. It can be seen that the technical solution of the embodiment of the present disclosure is adopted, by dynamically monitoring the status of the expansion card in the slot, and timely managing the port configuration information corresponding to the interface of the slot, so as to support the dynamic plugging and unplugging of the expansion card during the operation of the network device, and the port function of the expansion card can be made effective without restarting the network device, which is not only convenient to use, but also conducive to flexible networking.

[0039] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will become apparent from the following description or be learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] By reading the detailed description of the preferred embodiment below, various other advantages and benefits will become clear to those of ordinary skill in the art. The accompanying drawings are only used for the purpose of illustrating the preferred embodiment and are not considered to be limitations of the present disclosure. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings.

[0041] In the attached picture:

[0042] Figure 1 A schematic diagram showing a method flow of a port management method for a network device provided by an embodiment of the present disclosure is shown;

[0043] Figure 2 A schematic diagram showing the structure of a port management system for a network device provided by an embodiment of the present disclosure is shown;

[0044] Figure 3 A schematic diagram showing data flow of a port management method for a network device provided by an embodiment of the present disclosure is shown;

[0045] Figure 4 A schematic diagram showing the composition of a port management device for a network device provided by an embodiment of the present disclosure is shown;

[0046] Figure 5 A schematic diagram of the structure of a network device provided by an embodiment of the present disclosure is shown;

[0047] Figure 6 A schematic diagram of a storage medium provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0048] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0049] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in the present disclosure should have the common meanings understood by those skilled in the art to which the present disclosure belongs.

[0050] The following introduces the implementation scenarios and related technologies involved in the embodiments of the present disclosure.

[0051] The technical solution disclosed in the present invention relates to a network device that supports plug-in card functions, such as a white box switch. This type of network device is provided with at least one physical slot, that is, a physical slot, each of which allows a user to insert an expansion card (also called a network interface card or plug-in card) to expand the functions of the network device. The expansion card can provide functional ports or connection ports outside the network device, such as ports that support specific communication protocols, ports that use duplex transmission, etc., thereby enhancing the transmission capacity of the network device and expanding the application scenarios of the network device.

[0052] Among them, any slot of the network device can provide at least one interface, which itself does not have the function of a port, but only provides a connection port such as a pin or a reed. The expansion card can be a hardware module that integrates dedicated hardware resources (such as a Field-Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), etc.) and software functions (such as a driver, management software, etc.). The expansion card is also provided with a physical port. After the expansion card is inserted into the slot of the network device, the physical port of the expansion card can be contacted and connected with the interface of the slot, so that the network device calls the function of the expansion card port through the interface of the slot, and then calls the function supported by the expansion card, thereby expanding the function and port of the network device.

[0053] In the actual implementation scenario, after the expansion card is inserted into the slot (i.e., the expansion card is in place in the slot), the operating system (OS) installed in the network device should configure the interface of the network device so that the operating system can identify the port connected to the interface and deploy the functional mode of configuring the port so that the connected port can be called through the interface to implement the function of the port.

[0054] Taking white box switches as an example, the operating system equipped with white box switches is usually the Software for Open Networking in the Cloud (SONiC) system, and the conventional SONiC system only supports the functions of the ports included when the switch is started. For switches with slots, even if the expansion card in the slot is replaced or an expansion card is added, the SONiC system cannot support the changed port function. The SONiC system must be restarted before the changed port function can take effect. This not only makes the operation of expanding the port cumbersome and inconvenient to use, but also makes it impossible to expand the port in some usage scenarios (such as scenarios where the network has already been established), which seriously limits the usage scenarios of network equipment.

[0055] In view of this, the technical solution proposed in the embodiment of the present disclosure, by deploying a method of periodically monitoring the status of the expansion cards in each slot, timely obtains the dynamic changes in the status of the expansion cards in each slot, and then supports timely management of the port configuration information corresponding to the interface of the slot according to the changed status of the expansion card, so as to modify the function of calling the expansion card port through the interface of the slot, thereby supporting dynamic insertion and removal of the expansion card during the operation of the network device, and the port function of the expansion card can be made effective without restarting the network device. It is not only easy to use, but also conducive to flexible networking.

[0056] The following describes a port management method, system, device and network device for a network device according to an embodiment of the present disclosure. The technical solution of the present disclosure is described in detail with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present disclosure will be described below in conjunction with the accompanying drawings.

[0057] See also Figure 1 , Figure 1 A port management method for a network device provided by an embodiment of the present disclosure is shown, and the method is applied to a network device including at least one slot, and any slot is connected to an expansion card via at least one interface. The method includes:

[0058] In step S11, a first state of an expansion card in at least one slot in a current monitoring period is obtained.

[0059] The first state is an in-place state or an out-of-place state. Exemplarily, the in-place state means that an expansion card is inserted into the slot, and the out-of-place state means that an expansion card is not inserted into the slot.

[0060] In some embodiments, a slot monitoring process may be pre-deployed in the operating system of the network device, and a monitoring cycle may be set. After the network device completes startup, the operating system may call the slot monitoring process to monitor the status of the expansion cards in all slots of the network device, and the operating system may configure the interface according to the status of the expansion cards in each slot. Afterwards, the operating system may call the slot monitoring process to monitor the status of the expansion cards in all slots of the network device in a polling manner according to the monitoring cycle to monitor whether the status of the expansion cards in each slot changes. The status of the expansion card in at least one slot in the current monitoring cycle is used as the first status of the expansion card in the corresponding slot.

[0061] The duration of the monitoring cycle can be flexibly set according to the requirements, and the embodiments of the present disclosure are not limited thereto. In an optional example, the duration of the monitoring cycle is, for example, 100 milliseconds (ms).

[0062] It should be noted that at least one interface of the slot is connected to the pins of the expansion card through pins. Exemplarily, a series of pins of at least one interface include pins for detecting whether the expansion card is in place. When the expansion card is inserted, these pins will detect changes in electrical signals, such as changes in resistance or voltage, to determine whether the card is in place. Based on this, exemplarily, the acquisition of the first state of the expansion card in at least one slot in the current monitoring cycle can be implemented as follows: for any slot, monitoring whether at least one interface of the slot transmits an electrical signal; if any of the at least one interface of the slot transmits an electrical signal, determining that the first state of the expansion card in the slot is in place; if at least one interface of the slot does not transmit an electrical signal, determining that the first state of the expansion card in the slot is not in place.

[0063] It should be understood that the above-mentioned method of detecting the expansion card status by changing the electrical signal is only an illustrative implementation method and does not limit the technical solution of the embodiment of the present disclosure. In the actual implementation scenario, the specific detection method of the expansion card status may depend on the hardware design and software system of the network device, and other methods such as interrupt signals, baseboard management controllers, etc. may be used for detection. It will not be elaborated here.

[0064] In step S12, for any slot, it is detected whether the first state and the second state of the expansion card in the slot are the same.

[0065] The second state is the state of the expansion card in the slot in the previous monitoring cycle of the current monitoring cycle.

[0066] It should be understood that if the current monitoring cycle is the first monitoring cycle after the network device is started, the expansion card in the slot does not exist in the second state, and it can be considered that the first state is the same as the second state.

[0067] By adopting this implementation method, the status of the expansion card in each slot is monitored according to the monitoring cycle, and the status of the expansion card in each slot is whether it is in place or not in place, so that the dynamic change of the status of the expansion card in each slot can be obtained in time, providing information basis for dynamically configuring the interface in the slot.

[0068] In step S13, if the first state is different from the second state, the port configuration information corresponding to the at least one interface of the slot is managed according to the first state.

[0069] The port configuration information is related to the expansion card.

[0070] The first state is different from the second state, indicating that the state of the expansion card in the slot has changed. If the second state is in place, it indicates that the first state is not in place; if the second state is not in place, it indicates that the first state is in place. In order to ensure that the callable port of the network device matches the state of the expansion card in the slot, when the first state is different from the second state, the port configuration information corresponding to at least one interface of the slot should be modified accordingly to manage the callable port in the network device.

[0071] Specifically, if the first state is in the in-place state, the network device can set port configuration information for the at least one interface according to the port function of the in-place expansion card to configure the function of calling the port of the expansion card through the at least one interface. If the first state is the out-of-place state, the port configuration information corresponding to the at least one interface is cleared to make the at least one interface in an uncallable state, and the port configuration information is obtained based on the port function configuration of the in-place expansion card in the previous monitoring cycle of the current monitoring cycle.

[0072] Combined with the above description of the interface, it can be known that the interface of the slot itself does not have the function of the port. When the expansion card of the slot is in place, the interface can be configured based on the information of the port connected to the interface, so that the function of the port can be called through the interface. Exemplarily, setting the port configuration information for the at least one interface according to the port function of the expansion card in place can include determining the port attribute information of the expansion card according to the type information of the expansion card. The port attribute information can include at least one item of information such as the port rate, working module, forward error correction code (Forward Error Correction, FEC), pre-emphasis parameter, etc. of the port. Then, according to the port attribute information of any port, the port configuration information is set for the corresponding interface. Then, the port configuration information is synchronized to the processor of the network device and the expansion card, so that the processor has the function of calling the port through the interface.

[0073] In some embodiments, if an expansion card in a slot is in place, the network device may call a slot monitoring process to read expansion card type information, where the expansion card type information may include the number of ports included in the expansion card, and determine port attribute information based on the type information to set port configuration information for a corresponding interface based on the port attribute information of any port.

[0074] The processor of the network device can be responsible for functions such as forwarding, filtering and management of data packets. During the process of forwarding data packets, the processor can determine the correct port according to the destination address of the data packet and the port configuration information, and then send the data packet to the corresponding port to call the port to forward the data packet. Taking the network device as a switch as an example, the processor of the network device can be a switch chip.

[0075] If the state of the expansion card in the slot changes from the in-place state to the out-of-place state, then the port function corresponding to the interface in the slot can no longer be called. To prevent the processor from continuing to call the port function of the expansion card in the slot, the port number of the expansion card port corresponding to the at least one interface can be determined, and then the port configuration information corresponding to each port number in the processor of the network device can be cleared.

[0076] It should be noted that a slot control process may be pre-deployed in the operating system of the network device, and the slot control process may set the port configuration information corresponding to at least one interface or clear the port configuration information corresponding to at least one interface according to the detection result of the slot monitoring process. The interaction between the slot monitoring process and the slot control process is described in the following embodiments of the present disclosure, which will not be described in detail here.

[0077] By adopting this implementation, for the current monitoring cycle, if the state of an expansion card in a slot changes compared to the state in the previous monitoring cycle, the embodiment of the present disclosure manages the port configuration information corresponding to at least one interface of the slot according to the changed state of the expansion card, so as to manage the function of the slot interface calling the port. It can be seen that by adopting the technical solution of the embodiment of the present disclosure, by dynamically monitoring the state of the expansion card in the slot, the function of the slot interface calling the port is managed in time, thereby supporting the dynamic plugging and unplugging of the expansion card during the operation of the network device, and the port function of the expansion card can be made effective without restarting the network device, which is not only convenient to use, but also conducive to flexible networking.

[0078] The above embodiment is an explanation of the port management method of the network device disclosed in the present invention from the perspective of the overall operating system of the network device. The following is an explanation of the embodiment of the port management method of the network device disclosed in the present invention from the perspective of the interaction between the slot monitoring process and the slot control process in the operating system in combination with an example.

[0079] Figure 2 The structure diagram of the port management system of the network device provided by an embodiment of the present disclosure is shown. Figure 2 The system shown is, for example, a SONiC system, which may include, according to a top-down software architecture, a user layer, a kernel layer, and a hardware layer.

[0080] The user layer can be configured to include various network applications and management tools to implement specific network functions and management tasks, such as network monitoring, configuration management, security policies, etc. The user layer can also be configured to provide standardized services and application program interfaces (APIs), which can be called by the application layer to implement signaling interaction between the application layer and the kernel layer.

[0081] The kernel layer can be configured to handle control plane tasks and data plane tasks, as well as control and configure drivers for hardware devices, such as network card drivers, ASIC drivers, etc. These drivers enable the operating system to communicate with hardware devices. Control plane tasks can include, for example, routing protocols, VLAN management, access control list (ACL) processing, etc., to make correct forwarding decisions based on network policies. Data plane tasks can include, for example, monitoring of expansion card status in slots, setting and clearing of port configuration information, forwarding of data packets, etc. Specifically, a slot monitoring (slot task) process can be deployed in the kernel layer.

[0082] In order to maintain high cohesion between components and reduce coupling, the SONiC system can modularly deploy various functions in independent containers through Docker containers. Different containers can have different functions. For example, the SONiC system can include DHCP relay (Dynamic Host Configuration Protocol Relay, DHCP-Relay) container, performance monitoring (Performance Monitor, Pmon) container, link layer discovery protocol (Link Layer Discovery Protocol, LLDP) container, border gateway protocol (Border Gateway Protocol, BGP) switch state service (SwitchState Service, Swss) container, synchronizer (Synchronous, Syncd) container, etc. The SONiC system also deploys a database, which is used to store the configuration and status information of network devices for use by various containers and systems.

[0083] The Syncd container is configured to synchronize the configuration information in the database to the hardware ASIC (e.g., switch chip) and other components to ensure that the operating status of the hardware is consistent with the configuration in the database. Based on this, in order to achieve the purpose of dynamically configuring ports in the embodiment of the present disclosure, a port control (slot control) process can be deployed in the Syncd container.

[0084] The hardware layer is configured to deploy the physical components of the network device, which may include ASIC, memory, processor (such as a switching chip), at least one slot, etc., to provide the hardware resources required to perform network functions.

[0085] It should be understood that Figure 2 This is only a schematic description and does not limit the SONiC system architecture of the embodiment of the present disclosure. In some other embodiments, the architecture layer of the SONiC system can be divided into more layers or fewer layers according to the functions of each part of the SONiC system. The embodiment of the present disclosure does not limit this.

[0086] See also Figure 3 , Figure 3 A data flow diagram of a port management method for a network device is shown, wherein: Figure 3 The port management method of the network device of the embodiment of the present disclosure is described from the perspective of the slot task process and the slot control process executing operations. The slot task process and the slot control process can be as follows Figure 2 The exemplary embodiments are described.

[0087] Figure 3 The illustrated method for managing the ports of a network device includes the following steps:

[0088] Step S31, in response to a signal from the network device to start up, the slot task process monitors the status of expansion cards in all slots included in the network device.

[0089] Exemplarily, the slot task process monitors the status of the expansion card in each slot through the voltage signal of each slot.

[0090] Step S32: For the expansion cards in the in-place state, the slot task process reads the type information of the corresponding expansion cards, and transmits the type information of each expansion card to the slot control process.

[0091] The type information of any expansion card includes port attribute information of the ports included in the expansion card.

[0092] Step S33, for any expansion card, the slot control process sets the port configuration information of the corresponding interface according to the port attribute information of any port of the expansion card, synchronizes the port configuration information to the syncd process responsible for the operation of the switching chip, and writes the type information and port configuration information of the expansion card into the database.

[0093] Step S34, the slot task process reads the corresponding port configuration information from the database, and synchronizes the port configuration information with the expansion card.

[0094] In this way, it is ensured that the port configuration information on the switch chip is consistent with the port configuration information on the expansion card, so that the switch chip can call the port execution function of the expansion card.

[0095] Step S35, the slot task process monitors the status of the expansion cards in all the slots included in the network device according to a preset polling period.

[0096] Exemplarily, the preset polling period is the aforementioned monitoring period.

[0097] Step S36, for any slot, determine whether the state of the expansion card in the current polling cycle is the same as the state of the expansion card in the previous cycle; if they are the same, no processing is performed; if they are different, execute step S37.

[0098] Step S37, determining whether the expansion card is in place or out of place in the current polling cycle. If it is in place, executing step S32; if it is out of place, executing step S38.

[0099] Step S38, the slot task process transmits information that the expansion card in the corresponding slot is not in place to the slot control process.

[0100] Step S39, the slot control process modifies the state of the expansion card in the database to not in place, deletes the port configuration information corresponding to the expansion card, and clears the corresponding port configuration information in the switch chip.

[0101] Step S310 , after the slot task process reads from the database that the status of the expansion card is modified to not in place, the port configuration information corresponding to the interface in the slot is cleared, and step 35 is continued.

[0102] In summary, for a network device including at least one slot, the embodiment of the present disclosure monitors the state of the expansion card in each slot according to a monitoring cycle, and the state of the expansion card in each slot is in the in-place state or out-of-place state, so that the dynamic change of the state of the expansion card in each slot can be obtained in time. Furthermore, for the current monitoring cycle, if the state of the expansion card in a slot changes compared to the state in the previous monitoring cycle, the embodiment of the present disclosure manages the port configuration information corresponding to at least one interface of the slot according to the changed state of the expansion card, so as to manage the ports that can be called by the network device. It can be seen that the technical solution of the embodiment of the present disclosure is adopted, and the ports that can be called by the network device are managed in time by dynamically monitoring the state of the expansion card in the slot, thereby supporting the dynamic plugging and unplugging of the expansion card during the operation of the network device, and the port function of the expansion card can be made effective without restarting the network device, which is not only convenient to use, but also conducive to flexible networking.

[0103] Corresponding to the port management method of the network device shown in the above embodiment, the embodiment of the present disclosure also provides a port management device of the network device. Figure 4 As shown, a port management device for a network device is provided, which can be deployed in the above network device to perform the above Figure 1 and Figure 3 The operations performed by the network devices in Figure 4 As shown, the port management device of the network device includes:

[0104] An acquisition module 401 is used to acquire a first state of an expansion card in at least one slot in a current monitoring period, wherein the first state is an in-position state or an out-of-position state;

[0105] A detection module 402 is used to detect, for any slot, whether a first state and a second state of an expansion card in the slot are the same, where the second state is a state of the expansion card in the slot in a previous monitoring period of the current monitoring period;

[0106] The modification module 403 is used to manage the port configuration information corresponding to at least one interface of the slot according to the first state if the first state is different from the second state, wherein the port configuration information is related to the expansion card.

[0107] Optionally, the modification module 403 is also used to set port configuration information for the at least one interface according to the port function of the expansion card in place if the first state is in place, so as to configure the function of calling the expansion card port through the at least one interface; the modification module 403 is also used to clear the port configuration information corresponding to the at least one interface if the first state is not in place, so as to make the at least one interface in an uncallable state, and the port configuration information is obtained based on the port function configuration of the expansion card in place in the previous monitoring period of the current monitoring period.

[0108] Optionally, the modification module 403 is also used to determine the port attribute information of the expansion card according to the type information of the expansion card; set the port configuration information for the corresponding interface according to the port attribute information of any port; and synchronize the port configuration information to the processor of the network device and the expansion card so that the processor has the function of calling the port through the interface.

[0109] Optionally, the modification module 403 is further used to determine the port number of the expansion card port corresponding to the at least one interface; and clear the port configuration information corresponding to each port number in the processor of the network device.

[0110] Optionally, the acquisition module 401 is also used to monitor, for any slot, whether at least one interface of the slot transmits an electrical signal; if any of the at least one interface of the slot transmits an electrical signal, determine that the first state of the expansion card in the slot is an in-place state; and if at least one interface of the slot does not transmit an electrical signal, determine that the first state of the expansion card in the slot is an out-of-place state.

[0111] Optionally, the port management device of the network device also includes a process calling module, which is used to call a pre-deployed slot monitoring process to read the type of the expansion card and transmit the type of the expansion card to a pre-deployed slot control process; the process calling module is also used to call the slot control process to determine the port attribute information according to the type of the expansion card, and set the port configuration information of the corresponding interface according to the port attribute information, synchronize the port configuration information to the processor of the network device, and write the type information and the port configuration information into a database.

[0112] Optionally, the process calling module is further used to call the slot monitoring process to read the port configuration information from the database, and synchronize the port configuration information to the expansion card.

[0113] The port management device of the network device provided in the above-mentioned embodiment of the present disclosure and the port management method of the network device provided in the embodiment of the present disclosure are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.

[0114] The present disclosure also provides a network device, which can be implemented as Figure 2 Schematic diagram of network equipment to perform the above Figure 1 and Figure 3 This is a diagram of how to manage the ports of network devices. Figure 5 , which shows a schematic diagram of a network device provided by some embodiments of the present disclosure. Figure 5 As shown, the network device 6 includes: a processor 600, a memory 601, a bus 602, a communication interface 603 and at least one slot 604, and the processor 600, the communication interface 603, the at least one slot 604 and the memory 601 are connected via the bus 602; the memory 601 stores a computer program that can be run on the processor 600, and the function of the processor 600 can execute the port management method of the network device provided in any of the aforementioned embodiments of the present disclosure when running the computer program.

[0115] The memory 601 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the virtual devices of the system is realized through at least one communication interface 603 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.

[0116] The bus 602 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The memory 601 is used to store a program, and the processor 600 executes the program after receiving an execution instruction. The port management method of the network device disclosed in any implementation of the aforementioned embodiment of the present disclosure may be applied to the processor 600, or implemented by the processor 600.

[0117] The processor 600 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 600 or the instruction in the form of software. The above processor 600 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor to be executed, or a combination of hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 601, and the processor 600 reads the content in the memory 601 and completes the steps of the above method in combination with its hardware.

[0118] The electronic device provided by the embodiment of the present disclosure and the port management method of the network device provided by the embodiment of the present disclosure are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by them.

[0119] The present disclosure also provides a computer-readable storage medium corresponding to the port management method of the network device provided in the above embodiment. Figure 6 The computer-readable storage medium shown is a CD 30 on which a computer program (ie, a program product) is stored. When the computer program is run by a processor, the port management method for a network device provided in any of the aforementioned embodiments will be executed.

[0120] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical or magnetic storage media, which are not listed here one by one.

[0121] The computer-readable storage medium provided by the above-mentioned embodiments of the present disclosure and the port management method of the network device provided by the embodiments of the present disclosure are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.

[0122] Although the optional embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present disclosure.

[0123] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present disclosure. It should be understood that the above description is only the specific implementation method of the present disclosure and is not intended to limit the protection scope of the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present disclosure should be included in the protection scope of the present invention.

Claims

1. A port management method for a network device, characterized in that: The network device includes at least one slot, any slot is connected to an expansion card via at least one interface, and the method includes: Acquire a first state of an expansion card in at least one slot in a current monitoring period, wherein the first state is an in-position state or an out-of-position state; For any slot, detecting whether a first state and a second state of an expansion card in the slot are the same, wherein the second state is a state of the expansion card in the slot in a previous monitoring cycle of the current monitoring cycle; If the first state is different from the second state, the port configuration information corresponding to the at least one interface of the slot is managed according to the first state, and the port configuration information is related to the expansion card.

2. The method according to claim 1, characterized in that The managing the port configuration information corresponding to at least one interface of the slot according to the first state includes: If the first state is in the in-place state, setting port configuration information for the at least one interface according to the port function of the in-place expansion card, so as to configure the function of calling the port of the expansion card through the at least one interface; If the first state is an out-of-place state, clear the port configuration information corresponding to the at least one interface to make the at least one interface in an uncallable state, wherein the port configuration information is obtained based on the port function configuration of the in-place expansion card in the previous monitoring cycle of the current monitoring cycle.

3. The method according to claim 2, characterized in that The step of setting the port configuration information for the at least one interface according to the port function of the expansion card in place includes: Determining port attribute information of the expansion card according to the type information of the expansion card; Setting port configuration information for a corresponding interface according to port attribute information of any port; The port configuration information is synchronized to the processor of the network device and the expansion card, so that the processor has the function of calling the port through the interface.

4. The method according to claim 2, characterized in that: The clearing of the port configuration information corresponding to the at least one interface includes: Determine the port number of the expansion card port corresponding to the at least one interface; The port configuration information corresponding to each port number in the processor of the network device is cleared.

5. The method according to claim 1, characterized in that The obtaining of a first state of the expansion card in the at least one slot in the current monitoring period includes: For any slot, monitoring whether at least one interface of the slot transmits an electrical signal; If any one of the at least one interface of the slot transmits an electrical signal, determining that the first state of the expansion card in the slot is an in-position state; If at least one interface of the slot does not transmit an electrical signal, it is determined that the first state of the expansion card in the slot is an absent state.

6. The method according to claim 2, characterized in that If the first state is in the in-place state, setting port configuration information for the at least one interface according to the port function of the in-place expansion card includes: Calling a pre-deployed slot monitoring process to read the type information of the expansion card, and transmitting the type information to a pre-deployed slot control process; The slot control process is called to determine the port attribute information according to the type information of the expansion card, and the port configuration information of the corresponding interface is set according to the port attribute information, the port configuration information is synchronized to the processor of the network device, and the type information and the port configuration information are written into a database.

7. The method according to claim 6, characterized in that The step of synchronizing the port configuration information to the processor of the network device and the expansion card comprises: The slot monitoring process is called to read the port configuration information from the database, and the port configuration information is synchronized to the expansion card.

8. A port management system for a network device, characterized in that: The network device comprises at least one slot, any slot is connected to an expansion card via at least one interface, and the port management system of the network device comprises a pre-deployed slot monitoring process and a pre-deployed slot control process, The pre-deployed slot monitoring process is called to obtain a first state of an expansion card in at least one slot in a current monitoring period, wherein the first state is an in-position state or an out-of-position state; and for any slot, detecting whether a first state and a second state of an expansion card in the slot are the same, wherein the second state is a state of the expansion card in the slot in a previous monitoring cycle of the current monitoring cycle; The pre-deployed slot control process is called to manage port configuration information corresponding to at least one interface of the slot according to the first state if the first state is different from the second state, and the port configuration information is related to the expansion card.

9. A port management device for a network device, characterized in that: The device is deployed in a network device, the network device includes at least one slot, any slot is connected to an expansion card via at least one interface, and the device includes: An acquisition module, used for acquiring a first state of an expansion card in at least one slot in a current monitoring period, wherein the first state is an in-position state or an out-of-position state; A detection module, used for detecting, for any slot, whether a first state and a second state of an expansion card in the slot are the same, wherein the second state is a state of the expansion card in the slot in a previous monitoring cycle of the current monitoring cycle; A modification module is used to manage port configuration information corresponding to at least one interface of the slot according to the first state if the first state is different from the second state, wherein the port configuration information is related to the expansion card.

10. A network device, characterized in that: The method comprises at least one slot, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Topology generation method, expansion board card and server

    CN117687944A

  • Management method and system for OCP network card

    CN118113563A

  • Pluggable equipment management method and device based on SONiC operating system

    CN119045900A

  • Method and system for maintaining PCIE signal connection by using in-place signal, device, and medium

    WO2022105448A1