Router interface state updating method and device, electronic equipment and storage medium

By receiving line card messages to obtain online status and updating router interface status, the problem of interface status update during line card hot-swapping is solved, improving the interface availability and reliability of router devices.

CN116232883BActive Publication Date: 2025-12-12CHINA TELECOM CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111460244.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-02
Publication Date
2025-12-12
Estimated Expiration
2041-12-02

AI Technical Summary

Technical Problem

In existing technologies, router devices cannot automatically update the routing interface status when the online card is hot-swapped, resulting in low interface availability and reliability.

Method used

A method for updating router interface status is provided, which obtains the online status of line cards and logical cards by receiving line card messages, and updates the router's interface status according to the status, including resetting, initializing or maintaining the interface status, to ensure line card type consistency.

Benefits of technology

It enables automatic updates of routing interface status when online cards are hot-swapped, improving the interface availability and reliability of router devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116232883B_ABST
    Figure CN116232883B_ABST
Patent Text Reader

Abstract

The present disclosure provides a router interface state updating method and device, electronic equipment and storage medium, and relates to the technical field of network security. The method comprises the following steps: receiving a target line card message of a router, wherein the target line card message is used to inform the router of connection or disconnection of a target line card, and the target line card comprises one or more line cards on the router; obtaining online states of the target line card and a target logical card on the router according to the target line card message, wherein the target logical card is a logical card corresponding to the target line card; and updating an interface state of the router according to the online states of the target line card and the target logical card on the router. The present disclosure can support hot plugging of the line card on the router and automatically manage and update the interface state of the router.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of network security, and particularly relates to a router interface state updating method and device, electronic equipment and storage medium. BACKGROUND

[0002] In a router device, there are usually multiple line cards, each of which has different interface quantity and interface specifications to cope with different service needs; different service volumes are required at different service volume periods; the router device can conveniently expand or shrink by increasing or reducing line cards according to service changes; when a line card fails, the line card can be quickly replaced through hot swapping to improve reliability.

[0003] At present, in the related art, the router device cannot automatically update the routing interface state when the line card is hot swapped, and the line card interface availability and reliability of the router device are not high.

[0004] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present disclosure, and therefore can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY

[0005] The present disclosure provides a router interface state updating method, device, electronic equipment and storage medium, which at least partially overcomes the problem that it is difficult to automatically update the routing interface state to adapt to line card hot swapping in the related art.

[0006] Other characteristics and advantages of the present disclosure will become apparent from the following detailed description, or will be learned by practice of the present disclosure.

[0007] According to one aspect of the present disclosure, a router interface state updating method is provided, comprising:

[0008] receiving a target line card message of a router, wherein the target line card message is used to notify the router of connecting or disconnecting a target line card, and the target line card comprises one or more line cards on the router;

[0009] According to the target line card message, obtaining the online state of the target line card and a target logical card on the router, wherein the target logical card is a logical card corresponding to the target line card;

[0010] updating the interface state of the router according to the online state of the target line card and the target logical card on the router.

[0011] In one embodiment of the present disclosure, the updating the interface state of the router according to the online state of the target line card and the target logical card on the router comprises:

[0012] In the case that the target line card is online on the router and the target logical card exists, judging whether the line card type of the target line card is consistent with the logical card type of the target logical card, and updating the interface state of the router according to the judging result.

[0013] In one embodiment of the present disclosure, the judging whether the line card type of the target line card is consistent with the logical card type of the target logical card, and updating the interface state of the router according to the judging result comprises:

[0014] If the target line card type and the logical card type of the router are consistent, resetting the interface state of the target line card on the router;

[0015] If the line card type of the target line card is not consistent with the logical card type of the target logical card, updating the logical card type of the target logical card to the line card type of the target line card.

[0016] In one embodiment of the present disclosure, the updating the logical card type of the target logical card to the line card type of the target line card comprises:

[0017] Obtaining the line card type of the target line card;

[0018] Deleting the command configuration on the target logical card;

[0019] Updating the logical card type of the target logical card to the line card type of the target line card.

[0020] In one embodiment of the present disclosure, the updating the interface state of the router according to the online state of the target line card and the target logical card on the router comprises:

[0021] In the case that the target line card is online on the router and the logical card of the router does not exist, initializing the interface state information of the target line card on the router.

[0022] In one embodiment of the present disclosure, the updating the interface state of the router according to the online state of the target line card and the target logical card on the router comprises:

[0023] In the case that the target line card is not online on the router and the logical card of the router exists, updating the interface state of the target line card on the router to a closed state.

[0024] In one embodiment of the present disclosure, the updating the interface state of the router according to the online state of the target line card and the target logical card on the router comprises:

[0025] In the case that the target line card is not online on the router and the logical card of the router does not exist, keeping the interface state of the router unchanged.

[0026] According to another aspect of the present disclosure, there is also provided a router interface state updating apparatus, comprising:

[0027] a message receiving module configured to receive a target line card message of a router, wherein the target line card message is used to notify connection or disconnection of one or more line cards on the router;

[0028] a state obtaining module configured to obtain an online state of a target line card and an online state of a target logical card on the router according to the target line card message;

[0029] an interface updating module configured to update an interface state of the router according to the online states of the target line card and the target logical card on the router.

[0030] According to another aspect of the present disclosure, there is also provided an electronic device, comprising:

[0031] a processor; and

[0032] a memory configured to store executable instructions of the processor;

[0033] wherein the processor is configured to execute the above-mentioned any one of the router interface state updating methods via execution of the executable instructions.

[0034] According to another aspect of the present disclosure, there is also provided a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the above-mentioned any one of the router interface state updating methods.

[0035] The router interface state updating method, apparatus, electronic device and storage medium provided by the embodiments of the present disclosure can support hot plug of line cards on a router and automatically manage and update the interface state of the router by receiving a target line card message of the router, wherein the target line card message is used to notify connection or disconnection of a target line card on the router, and the target line card comprises one or more line cards on the router; obtaining online states of the target line card and a target logical card on the router according to the target line card message, wherein the target logical card is a logical card corresponding to the target line card; and updating an interface state of the router according to the online states of the target line card and the target logical card on the router.

[0036] It should be understood that the general description above and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0037] The accompanying drawings, which are incorporated herein and form a part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, further serve to explain the principles of the disclosure. It is to be clearly understood that the drawings are merely representative of some embodiments of the disclosure and that additional drawings can be derived from these drawings by one of ordinary skill in the art without paying creative effort.

[0038] Figure 1 A flow chart of a method for updating a router interface state is shown in the embodiments of the present disclosure;

[0039] Figure 2 A flow chart of a method for updating a logical card type of a target logical card to a line card type of a target line card is shown in the embodiments of the present disclosure;

[0040] Figure 3 A schematic diagram of a device for updating a router interface state is shown in the embodiments of the present disclosure;

[0041] Figure 4 A flow chart of another method for updating a router interface state is shown in the embodiments of the present disclosure;

[0042] Figure 5 A schematic diagram of a system for updating a router interface state is shown in the embodiments of the present disclosure;

[0043] Figure 6 A schematic diagram of a state transition of an interface state machine is shown in the embodiments of the present disclosure;

[0044] Figure 7 A structural block diagram of an electronic device is shown in the embodiments of the present disclosure. DETAILED DESCRIPTION

[0045] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations can be implemented in any

[0046] In addition, the drawings are to be regarded as being schematic only and therefore are not intended to provide an accurate reflection of the facts. The same reference numbers in different drawings denote the same or similar elements, and thus repeated description on them will be omitted. Some of the block diagrams shown in the drawings are functional entities, which do not necessarily have to correspond to physically or logically independent entities. These functional entities can be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0047] The present example embodiment will be described in detail below in conjunction with the accompanying drawings and examples.

[0048] A router interface state updating method is provided in the present example embodiment, which can be executed by any electronic device with computing processing capability.

[0049] Figure 1 A flow chart of a router interface state updating method is shown in the present example embodiment, as shown in the flow chart, the router interface state updating method provided in the present example embodiment comprises the following steps: Figure 1

[0050] In step S102, a target line card message of a router is received, wherein the target line card message is used to inform connection or disconnection of a target line card on the router, and the target line card comprises one or more line cards on the router;

[0051] In step S104, according to the target line card message, online states of the target line card and a target logical card on the router are acquired, wherein the target logical card is a logical card corresponding to the target line card;

[0052] In step S106, according to the online states of the target line card and the target logical card on the router, an interface state of the router is updated.

[0053] ​It should be noted that the line card is a physical port between an access line and an access device of a switch, a router or other network device; the logical card is a logical port defined by software, which plays a great role in configuration and debugging of the router; when one or more line cards on the router are inserted or pulled out of the card slot on the router, the one or more line cards are target line cards, and the logical card corresponding to the target line card is a target logical card; the router line card configuration information and interface state information are read, the configuration and interface state of the line card on the router are initialized according to the line card configuration information and interface state information, the line card type and command configuration are recorded in the memory and the hard disk; the command configuration includes operation commands of the line card and the interface of the router; the operation commands include a line card driver reset command, a logical card deletion command and the like; the target line card message of the router is received, the target line card message is used to notify connection or disconnection of the target line card on the router, and the target line card includes one or more line cards on the router; according to the target line card message, the online state of the target line card and the target logical card on the router is obtained, wherein the target logical card is the logical card corresponding to the target line card; if the target line card of the router is not online and the slot position has no corresponding target logical card, the interface state of the router is kept unchanged; if the target line card of the router is not online and the slot position has the corresponding target logical card, the interface state of the target line card on the router is updated to a closed state, and the command configuration is cancelled; if the target line card of the router is online and the slot position has no corresponding target logical card, the interface state information of the target line card is initialized, and the type of the target logical card is updated to the type of the target line card; if the target line card of the router is online and the slot position has the corresponding target logical card, and the types of the target line card and the target logical card are the same, the interface state of the target line card of the router is reset, and the command configuration is restored; if the target line card of the router is online and the slot position has the corresponding target logical card, and the types of the target line card and the target logical card are different, the command configuration is deleted, and the type of the target logical card is updated to the type of the target line card; through the above embodiment, the router interface state can be automatically updated when the line card is hot plugged.

[0054] In one embodiment of the present disclosure, the step S106 described above can be implemented by the following steps:

[0055] In the case that the target line card on the router is online and the target logical card exists, it is judged whether the line card type of the target line card is consistent with the logical card type of the target logical card, and the interface state of the router is updated according to the judgment result.

[0056] It should be noted that, obtaining the online state of the target line card on the router, obtaining the logical card corresponding to the slot of the target line card, that is, the target logical card corresponding to the target line card is online, obtaining the type of the target line card and the target logical card, judging whether the type of the target line card and the target logical card is consistent, if the type of the target line card and the type of the logical card of the router are consistent, resetting the interface state of the target line card on the router; resetting the interface state of the target line card on the router includes resetting the configuration and interface state of the target line card on the router according to the line card configuration information and the interface state information; resetting the configuration and interface state of the target line card on the router, specifically, obtaining the type of the target line card and the last command configuration recorded by the memory and the hard disk, and resetting according to the last command configuration; if the type of the target line card is inconsistent with the type of the target logical card, updating the type of the target logical card to the type of the target line card; updating the type of the target logical card to the type of the target line card includes obtaining the type of the target line card; updating the type of the target logical card to the type of the target line card.

[0057] In one embodiment of the present disclosure, the above judging whether the type of the target line card is consistent with the type of the target logical card, and updating the interface state of the router according to the judging result can be realized by the following steps:

[0058] If the type of the target line card and the type of the logical card of the router are consistent, resetting the interface state of the target line card on the router;

[0059] If the type of the target line card is inconsistent with the type of the target logical card, updating the type of the target logical card to the type of the target line card.

[0060] It should be noted that, if the type of the target line card and the type of the logical card of the router are consistent, resetting the interface state of the target line card on the router; resetting the interface state of the target line card on the router includes resetting the configuration and interface state of the target line card on the router according to the line card configuration information and the interface state information, specifically, obtaining the type of the target line card and the last command configuration recorded by the memory and the hard disk, and resetting according to the last command configuration; if the type of the target line card is inconsistent with the type of the target logical card, updating the type of the target logical card to the type of the target line card; updating the type of the target logical card to the type of the target line card includes obtaining the type of the target line card; updating the type of the target logical card to the type of the target line card.

[0061] Figure 2 A flow chart of a method for updating the type of a target logical card to the type of a target line card is shown in an embodiment of the present disclosure; as shown in Figure 2 The method for updating the type of a target logical card to the type of a target line card provided by the embodiment of the present disclosure includes:

[0062] Step S202, obtaining the line card type of the target line card;

[0063] Step S204, deleting the command configuration on the target logical card;

[0064] Step S206, updating the logical card type of the target logical card to the line card type of the target line card.

[0065] It should be noted that if the line card type of the target line card is inconsistent with the logical card type of the target logical card, the line card type of the target line card is obtained; the target logical card corresponding to the target line card is obtained, the command configuration on the target logical card is deleted, and the logical card type of the target logical card is updated to the line card type of the target line card.

[0066] In an embodiment of the present disclosure, the above step S106 can be implemented by the following steps:

[0067] In the case that the target line card is online on the router and the logical card of the router does not exist, the interface state information of the target line card on the router is initialized.

[0068] It should be noted that according to the target line card message, it is obtained that the target line card of the router is online and the slot does not have a corresponding target logical card, the target line card interface state information is initialized, the type of the target line card is obtained, and the type of the target logical card is updated to the type of the target line card.

[0069] In an embodiment of the present disclosure, the above step S106 can be implemented by the following steps:

[0070] In the case that the target line card is offline on the router and the logical card of the router exists, the interface state of the target line card on the router is updated to a closed state.

[0071] It should be noted that according to the target line card message, it is obtained that the target line card of the router is offline and the slot has a corresponding target logical card, the interface state of the target line card on the router is updated to a closed state, and the command configuration is revoked.

[0072] In an embodiment of the present disclosure, the above step S106 can be implemented by the following steps:

[0073] In the case that the target line card is offline on the router and the logical card of the router does not exist, the interface state of the router is kept unchanged.

[0074] Based on the same inventive concept, the present disclosure also provides a router interface state updating device in the embodiments, as follows. Since the principle of the device for solving the problem is similar to that of the traffic hijacking point detection method, the implementation of the device can be referred to the implementation of the traffic hijacking point detection device, and the repeated parts will not be described herein.

[0075] Figure 3 Figure 1 shows a schematic diagram of a router interface state updating device according to an embodiment of the present disclosure, and Figure 2 shows a schematic diagram of a router interface state updating device according to another embodiment of the present disclosure. Figure 3 As shown in Figure 1, the router interface state updating device 3 comprises:

[0076] a message receiving module 301 configured to receive a target line card message of a router, wherein the target line card message is used to notify the router of connection or disconnection of one or more line cards;

[0077] a state obtaining module 302 configured to obtain an online state of the target line card and an online state of a target logical card on the router according to the target line card message;

[0078] an interface updating module 303 configured to update an interface state of the router according to the online states of the target line card and the target logical card on the router; the interface updating module 303 is configured to keep the interface state of the router unchanged if the target line card of the router is offline and the slot does not have a corresponding target logical card; update the interface state of the target line card on the router to a closed state and cancel the command configuration if the target line card of the router is offline and the slot has a corresponding target logical card; initialize the interface state information of the target line card, and update the type of the target logical card to the type of the target line card if the target line card of the router is online and the slot does not have a corresponding target logical card; reset the interface state of the target line card of the router, and restore the command configuration if the target line card of the router is online and the slot has a corresponding target logical card, and the types of the target line card and the target logical card are the same; delete the command configuration, and update the type of the target logical card to the type of the target line card if the target line card of the router is online and the slot has a corresponding target logical card, and the types of the target line card and the target logical card are different.

[0079] Figure 4 Figure 3 shows a flowchart of a router interface state updating method according to another embodiment of the present disclosure, and Figure 4 shows a flowchart of a router interface state updating method according to another embodiment of the present disclosure. Figure 4 As shown in Figure 3, the router interface state updating method according to an embodiment of the present disclosure comprises the following steps:

[0080] Step S402: reading configuration information and interface state information of a line card, initializing configuration and interface state of the line card on a router according to the configuration information and the interface state information of the line card, and recording line card types and command configurations in a memory and a hard disk; wherein the command configurations comprise operation commands of the line card and the interface of the router; the operation commands comprise a reset line card driver command, a delete logical card command, etc.

[0081] Step S404: waiting for receiving a target line card message; wherein the target line card message is used to notify the router of connection or disconnection of a target line card, and the target line card comprises one or more line cards on the router; and a target logical card is a logical card corresponding to the target line card.

[0082] Step S406, according to the target line card message, obtaining that the target line card of the router is offline and the slot has no corresponding target logical card, keeping the interface state of the router unchanged;

[0083] Step S408, according to the target line card message, obtaining that the target line card of the router is offline and the slot has corresponding target logical card, updating the interface state of the target line card on the router to the closed state, and canceling the command configuration;

[0084] Step S410, according to the target line card message, obtaining that the target line card of the router is online and the slot has no corresponding target logical card, initializing the interface state information of the target line card, and updating the type of the target logical card to the type of the target line card;

[0085] Step S412, according to the target line card message, obtaining that the target line card of the router is online and the slot has corresponding target logical card, and the types of the target line card and the target logical card are same, resetting the interface state of the target line card of the router, and restoring the command configuration;

[0086] Step S414, according to the target line card message, obtaining that the target line card of the router is online and the slot has corresponding target logical card, and the types of the target line card and the target logical card are different, deleting the command configuration, and updating the type of the target logical card to the type of the target line card.

[0087] Figure 5 A schematic diagram of a router interface state updating system in an embodiment of the present disclosure is shown. Figure 5 As shown in the figure, the router interface state updating system 5 provided by the embodiment of the present disclosure comprises:

[0088] A command configuration module 501 receives and issues operation commands of the line card and the interface of the router, and the operation commands include a line card driver resetting command, a logical card deleting command, etc.

[0089] A hardware reporting message module 502 obtains hardware physical state change messages, such as line card hot plug messages, sends the messages to the line card management module through a message service module, and records to a memory database;

[0090] A message processing service module 503 is used for centralized processing of the messages obtained by the hardware reporting message module;

[0091] A memory database 504 is used for saving the command configuration, and is queried and confirmed by other modules;

[0092] A line card management module 505 is used for managing the core logic module of the router interface state updating system, receiving and processing the messages reported by the hardware reporting message module, and creating or deleting the interfaces corresponding to the router according to the command configuration data in the command configuration module;

[0093] The interface management module 506 is configured to receive the router interface state data sent by the line card management module, and process updating the router interface state.

[0094] Figure 6 An interface state machine state transition schematic diagram in the embodiment of the present disclosure is shown. Figure 6 As shown in the figure, the interface state machine provided by the embodiment of the present disclosure includes: a management state, a physical state and a protocol state; the management state is the management state of the interface by the management layer; the physical state is the data connection state of the interface physical link; the protocol state is the protocol configuration state of the interface; the interface state machine state is Up / Down / Down 601, which can be expressed as: the management state is the start state, the physical state is the closed state, and the protocol state is the closed state; the interface state machine state is Up / Up / Down 603, which can be expressed as: the management state is the start state, the physical state is the start state, and the protocol state is the closed state; the interface state machine state is Up / Up / Up 604, which can be expressed as: the management state is the start state, the physical state is the start state, and the protocol state is the start state; the interface state machine state is Down / Down / Down 602, which can be expressed as: the management state is the closed state, the physical state is the closed state, and the protocol state is the closed state.

[0095] If the state of the interface state machine is Up / Down / Down 601, the user executes a closing instruction or pulls out the line card, and the state of the interface state machine is converted from Up / Down / Down 601 to Down / Down / Down 602.

[0096] If the state of the interface state machine is Down / Down / Down 602, the user executes an opening instruction or inserts the line card, and the state of the interface state machine is converted from Down / Down / Down 602 to Up / Down / Down 601.

[0097] If the state of the interface state machine is Up / Down / Down 601, the data connection of the interface physical link of the interface state machine, and the state of the interface state machine is converted from Up / Down / Down 601 to Up / Up / Down 603.

[0098] If the state of the interface state machine is Up / Up / Down 603, the data disconnection of the interface physical link of the interface state machine, and the state of the interface state machine is converted from Up / Up / Down 603 to Up / Down / Down 601.

[0099] If the state of the interface state machine is Up / Up / Up 604, the interface state machine clears the interface protocol configuration, and the state of the interface state machine is converted from Up / Up / Up 604 to Up / Up / Down 603.

[0100] If the state of the interface state machine is Up / Up / Down 603, the interface state machine retains the interface protocol configuration, and the state of the interface state machine is converted from Up / Up / Down 603 to Up / Up / Up 604;

[0101] If the state of the interface state machine is Down / Down / Down 602, the user executes an opening instruction and inserts a line card, the state of the interface state machine is converted from Down / Down / Down 602 to Up / Up / Up 604;

[0102] If the state of the interface state machine is Up / Up / Up 604, the user executes a closing instruction or removes a line card, the state of the interface state machine is converted from Up / Up / Up 604 to Down / Down / Down 602;

[0103] If the state of the interface state machine is Up / Up / Up 604, the data of the interface physical link of the interface state machine is disconnected, the state of the interface state machine is converted from Up / Up / Up 604 to Up / Down / Down 601;

[0104] If the state of the interface state machine is Up / Up / Down 603, the user executes a closing instruction or removes a line card, the state of the interface state machine is converted from Up / Up / Down 603 to Down / Down / Down 602.

[0105] Through the above embodiment, the switching of various states can be realized through the interface state machine, and the management state, the physical state and the protocol state of the router interface can be inquired.

[0106] Those skilled in the art can understand that each aspect of the present disclosure can be implemented as a system, a method or a program product. Therefore, each aspect of the present disclosure can be specifically implemented as a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which can be collectively referred to as "circuitry", "module" or "system" here.

[0107] The electronic device 700 according to this embodiment of the present disclosure will be described below with reference to Figure 7 The electronic device 700 is only an example and should not limit the functions and use range of the embodiments of the present disclosure. Figure 7 The electronic device 700 is only an example and should not limit the functions and use range of the embodiments of the present disclosure.

[0108] As Figure 7As shown, the electronic device 700 is in the form of a general computing device. The components of the electronic device 700 can include, but are not limited to, the at least one processing unit 710 described above, the at least one storage unit 720 described above, and a bus 730 that connects the various system components, including the storage unit 720 and the processing unit 710.

[0109] The storage unit stores program code that can be executed by the processing unit 710 to cause the processing unit 710 to perform the steps described above in the "Exemplary Methods" section of this specification in accordance with various exemplary embodiments of the present disclosure. For example, the processing unit 710 can perform the steps of the above-described method embodiments of receiving a target line card message of a router, wherein the target line card message is used to inform the router of a connection or disconnection of a target line card, and the target line card includes one or more line cards on the router; obtaining, according to the target line card message, an online state of the target line card and a target logical card on the router, wherein the target logical card is a logical card corresponding to the target line card; and updating an interface state of the router according to the online state of the target line card and the target logical card on the router.

[0110] The processing unit 710 can also perform the steps of the above-described method embodiments of reading configuration information and interface state information of a line card, initializing configuration and interface state of the line card on the router according to the configuration information and the interface state information of the line card, and recording line card types and command configurations in memory and a hard disk; wherein the command configurations include operation commands of the line cards and interfaces of the router; the operation commands include a line card driver reset command, a logical card deletion command, and the like; waiting to receive a target line card message; wherein the target line card message is used to inform the router of a connection or disconnection of a target line card, and the target line card includes one or more line cards on the router; the target logical card is a logical card corresponding to the target line card; obtaining, according to the target line card message, that the target line card is not online and that the slot does not have a corresponding target logical card, and keeping the interface state of the router unchanged; obtaining, according to the target line card message, that the target line card is not online and that the slot has a corresponding target logical card, updating the interface state of the target line card on the router to a closed state, and canceling the command configurations; obtaining, according to the target line card message, that the target line card is online and that the slot does not have a corresponding target logical card, initializing the interface state information of the target line card, and updating the type of the target logical card to the type of the target line card; obtaining, according to the target line card message, that the target line card is online and that the slot has a corresponding target logical card, and that the target line card and the target logical card are of the same type, resetting the interface state of the target line card of the router, and restoring the command configurations; obtaining, according to the target line card message, that the target line card is online and that the slot has a corresponding target logical card, and that the target line card and the target logical card are of different types, deleting the command configurations, and updating the type of the target logical card to the type of the target line card.

[0111] The storage unit 720 can include a readable medium in the form of volatile storage such as random access memory (RAM) 7201 and / or cache memory 7202, and also can include a non-volatile storage such as read only memory (ROM) 7203.

[0112] The storage unit 720 also can include a program / utility 7204 having a set of program modules 7205 such as an operating system, one or more application programs, other program modules, and program data, each of which can give the electronic device 700 its functionality, at least in part. The program modules 7205 can include, but are not limited to, a network environment implementation, either alone or in some combination.

[0113] The bus 730 can represent one or more of several types of bus structures, including a storage bus or bus controller, a peripheral bus, an accelerated graphics port, an electronic device 700, or a local bus using any of a variety of bus architectures.

[0114] The electronic device 700 also can communicate with one or more external devices 740 such as a keyboard or pointing device, a Bluetooth device, etc.; other devices such as are necessary to support a user's interactions with the electronic device 700; and / or one or more devices that enable

[0115] Those skilled in the art will readily recognize that the example embodiments described herein can be implemented in software and / or hardware, and that the example embodiments can be implemented using software and necessary hardware in combination. Thus, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, etc.) or a network, and includes a number of instructions to make a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) execute the methods according to the embodiments of the present disclosure.

[0116] In the example embodiments of the present disclosure, a computer readable storage medium is also provided, which can be a readable signal medium or a readable storage medium. A program product is stored thereon, which can implement the method of the present disclosure. In some possible implementations, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program codes for causing terminal equipment to perform the steps described in the above "example method" section according to various example embodiments of the present disclosure when the program product is run on the terminal equipment.

[0117] More specific examples of the computer readable storage medium in the present disclosure can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination of the foregoing.

[0118] In the present disclosure, the computer readable storage medium can include a data signal carried in the baseband or as a part of a carrier wave propagating through the program code, in which the readable program code is borne. Such a propagating data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal, or any appropriate combination of the foregoing. The readable signal medium can also be any readable medium other than the readable storage medium, which can send, propagate or transmit programs for use by or in connection with an instruction execution system, apparatus or device.

[0119] Optionally, the program code contained in the computer readable storage medium can be transmitted by any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any appropriate combination of the foregoing.

[0120] In specific implementation, the program code for performing the operations of the present disclosure can be written in any combination of one or more programming languages, including an object-oriented programming language such as Java, C++, etc., and a conventional procedural programming language such as "C" language or similar programming languages. The program code can be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case involving a remote computing device, the remote computing device can be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, through the Internet by connecting to an Internet service provider).

[0121] It should be noted that, although several modules or units of the devices for action execution are mentioned in the above detailed description, the division into such modules or units is not mandatory. Indeed, according to an embodiment of the disclosure, the features and functionalities of two or more of the above-described modules or units can be embodied in one module or unit. Conversely, the features and functionalities of one of the above-described modules or units can be further divided into several modules or units.

[0122] Furthermore, although the various steps of the methods in the disclosure are described in a particular order in the drawings, this is not required or implied as to the order of the steps or that all of the steps shown must be performed to achieve the desired result. Additionally or alternatively, certain steps can be omitted, multiple steps can be combined into one step, one step can be broken into multiple steps, etc.

[0123] From the above description of the embodiments, those skilled in the art will readily perceive that the example embodiments described herein can be implemented by software and / or by software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, U disk, mobile hard disk, etc.) or network, and includes several instructions to make a computing device (which can be a personal computer, server, mobile terminal, or network device, etc.) execute the method according to the embodiments of the disclosure.

[0124] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features of the disclosure as disclosed herein. It is intended that the disclosure be considered as including any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such steps, compositions, components, and / or elements of the disclosure as come within the true scope of the disclosure. The specification and examples given are considered exemplary only, with the true scope and spirit of the disclosure being indicated by the appended claims.

Claims

1. A method for updating a state of a router interface, the method comprising: The method comprises the following steps: receiving a target line card message of a router, wherein the target line card message is used to inform the router of connecting or disconnecting a target line card, and the target line card comprises one or more line cards on the router; acquiring the online state of the target line card and the target logical card on the router according to the target line card message, wherein the target logical card is a logical card corresponding to the target line card; updating the interface state of the router according to the online state of the target line card and the target logical card on the router; judging whether the line card type of the target line card is consistent with the logical card type of the target logical card when the target line card is online and the target logical card exists on the router, and updating the interface state of the router according to the judging result; initializing the interface state information of the target line card on the router when the target line card is online and the logical card of the router does not exist; updating the interface state of the target line card on the router to a closed state when the target line card is offline and the logical card of the router exists.

2. The router interface state update method of claim 1, wherein, The judging whether the line card type of the target line card is consistent with the logical card type of the target logical card and updating the interface state of the router according to the judging result comprises: resetting the interface state of the target line card on the router if the target line card type and the logical card type of the router are consistent; updating the logical card type of the target logical card to the line card type of the target line card if the line card type of the target line card is inconsistent with the logical card type of the target logical card.

3. The method according to claim 2, wherein updating the logical card type of the target logical card to the line card type of the target line card comprises: acquiring the line card type of the target line card; deleting the command configuration on the target logical card; updating the logical card type of the target logical card to the line card type of the target line card. The updating the interface state of the router according to the online state of the target line card and the target logical card on the router comprises:

4. The router interface state update method of claim 1, wherein, keeping the interface state of the router unchanged when the target line card is offline and the logical card of the router does not exist. The method comprises the following steps:

5. A router interface state updating apparatus characterized by comprising: a message receiving module is configured to receive a target line card message of a router, wherein the target line card message is used to inform the router of connecting or disconnecting one or more line cards; a state acquiring module is configured to acquire the online state of a target line card and the online state of a logical card on the router according to the target line card message; an interface updating module is configured to update the interface state of the router according to the online state of the target line card and the target logical card on the router; judging whether the line card type of the target line card is consistent with the logical card type of the target logical card when the target line card is online and the target logical card exists on the router, and updating the interface state of the router according to the judging result; initializing the interface state information of the target line card on the router when the target line card is online and the logical card of the router does not exist; updating the interface state of the target line card on the router to a closed state when the target line card is offline and the logical card of the router exists. ​ 6. An electronic device, comprising: Comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the router interface state update method of any one of claims 1-4 via execution of the executable instructions.

7. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by a processor, implements the router interface state update method of any one of claims 1-4.

Citation Information

Patent Citations

  • Hot plug method and device based on single-chip switch, equipment and medium

    CN113556249A