Port switching method and device of network equipment, equipment and medium

By quickly notifying port failures by using interrupt modules and message queues in network equipment, the problem of slow port switching speed in the prior art is solved, and the rapid response and switching of application services are realized, reducing the impact of failures.

CN118972239APending Publication Date: 2024-11-15SHEN ZHOU SHU MA WANG LUO BEI JING YOU XIAN GONG SI +2
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411204128.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The switching speed of existing network equipment is slow when the port fails, which leads to a significant impact on the application service, mainly because the method of querying the port link status is long and the reporting is not timely.

Method used

The interrupt module is used to send an interrupt event to the first message queue when the port of the network device fails. The processing module reads the interrupt event from the first message queue and sends a fault event to the second message queue. If the faulty port is the port corresponding to the application service If the same is true, the main port will be switched from the main port to the backup port to avoid step-by-step reporting and improve the switching speed.

Benefits of technology

Notifying port failures through interrupts and message queues enables rapid awareness and switching of application services, reducing the impact of port failures on application services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118972239A_ABST
    Figure CN118972239A_ABST
Patent Text Reader

Abstract

The invention discloses a port switching method and device of network equipment, equipment and a medium, and relates to the technical field of computers, the method is applied to the network equipment, and the method comprises the following steps: when a port of the network equipment fails, sending an interrupt event to a first message queue; reading the interrupt event from the first message queue, and if the interrupt event represents that the port of the network equipment has a fault, sending a fault event to a second message queue; and reading the fault event from the second message queue, and if the fault event represents that the failed port is consistent with the port corresponding to the application service, switching from the main port to the standby port. According to the method, the influence of the port fault on the application service can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a port switching method, device, equipment and medium for a network device. Background Art

[0002] With the rapid development of networks and data centers, the reliability requirements for network devices are getting higher and higher. Network devices include multiple ports. When some of the ports fail, the network devices can switch application services to backup ports for data transmission and interaction. Network devices support more and more public protocols and various private protocols. When the port link status of network devices changes, application services are required to quickly sense and switch.

[0003] At present, the port link status of network devices can be queried by switching chips or hardware. The query process uses the method of polling each port, which is time-consuming. After the port link status is queried to change, for example, the port link status fails, the port fault is reported in a step-by-step manner, but the bottom layer will also report other messages, which will cause the port fault to be reported in a delayed manner.

[0004] It can be seen that the current port switching method has a slow switching speed, takes a long time, and will have a great impact on application services. Summary of the invention

[0005] The present application provides a port switching method, device, equipment and medium for a network device, which can reduce the impact of port failures on application services.

[0006] In order to achieve the above purpose, this application adopts the following technical solutions:

[0007] In a first aspect, the present application provides a port switching method for a network device, which is applied to a network device, and the method includes:

[0008] When a port of the network device fails, sending an interrupt event to the first message queue;

[0009] Reading the interrupt event from the first message queue, and sending a fault event to the second message queue if the interrupt event indicates that a port of the network device fails;

[0010] The fault event is read from the second message queue. If the fault event indicates that the port where the fault occurs is consistent with the port corresponding to the application service, the primary port is switched to the backup port.

[0011] In some possible implementations, sending the fault event to the second message queue includes:

[0012] Determine the target priority corresponding to the port fault according to the pre-configured mapping relationship between the fault type and priority;

[0013] Sending a fault event to the second message queue according to the target priority.

[0014] In some possible implementations, the method further includes:

[0015] When the port fault of the network device is eliminated, sending an elimination event to the first message queue;

[0016] reading the elimination event from the first message queue, and sending a fault recovery event to the second message queue if the elimination event indicates that the fault of the port of the network device has been eliminated;

[0017] The fault recovery event is read from the second message queue, and according to the fault recovery event, the backup port is switched back to the primary port.

[0018] In some possible implementations, switching back the backup port to the primary port according to the fault recovery event includes:

[0019] According to the fault recovery event, a query request is sent to the opposite network device, wherein the query request is used to query whether the opposite network device has eliminated the port fault;

[0020] Receiving a query response returned by the opposite network device in response to the query request, wherein the query response carries a query result;

[0021] If the query result indicates that the port failure of the opposite network device has been eliminated, the backup port is switched back to the primary port.

[0022] In some possible implementations, the method further includes:

[0023] If the query result indicates that the port fault of the opposite network device has not been eliminated, the query request is sent to the opposite network device again after a preset delay.

[0024] In some possible implementations, the service type of the application service includes: a Link Aggregation Control Protocol LACP task, a Multiple Spanning Tree Protocol MSTP task, or a Multi-Chassis Link Aggregation MCLAG task.

[0025] In some possible implementations, the method further includes: if the fault event indicates that the port where the fault occurs is inconsistent with the port corresponding to the application service, prompting that the port has a fault.

[0026] In a second aspect, the present application provides a port switching device for a network device, the device comprising:

[0027] An interrupt module, configured to send an interrupt event to the first message queue when a port of the network device fails;

[0028] a processing module, configured to read the interrupt event from the first message queue, and send a fault event to a second message queue if the interrupt event indicates that a port of the network device fails;

[0029] The switching module is used to read the fault event from the second message queue, and if the fault event indicates that the port where the fault occurs is consistent with the port corresponding to the application service, switch from the primary port to the backup port.

[0030] In a third aspect, the present application provides a computing device, including a memory and a processor;

[0031] One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as described in any one of the first aspects.

[0032] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method as described in any one of the first aspects.

[0033] It can be seen from the above technical solution that the present application has at least the following beneficial effects:

[0034] The present application provides a port switching method for a network device, which can be applied to a network device, and the network device can include an interrupt module, a processing module, and a switching module. In the method, when a port of the network device fails, the interrupt module sends an interrupt event to a first message queue, and the processing module can read the interrupt event from the first message queue. If the interrupt event indicates that the port of the network device fails, a fault event is sent to a second message queue, and the switching module can read the fault event from the second message queue. If the fault event indicates that the port that fails is consistent with the port corresponding to the application service, the primary port is switched to the backup port. Compared with the traditional solution, the technical solution of the present application adopts the interrupt and message queue method to notify the port fault, without the need to adopt the step-by-step reporting method, so that the application service can quickly know that the port has a fault and switch.

[0035] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it is understood that the description of features or beneficial effects means that specific technical features, technical solutions or beneficial effects are included in at least one embodiment. Therefore, the description of technical features, technical solutions or beneficial effects in this specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in the present embodiment can also be combined in any appropriate manner. Those skilled in the art will understand that the embodiment can be realized without one or more specific technical features, technical solutions or beneficial effects of a specific embodiment. In other embodiments, additional technical features and beneficial effects can also be identified in a specific embodiment that does not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A flow chart of a port switching method for a network device provided in an embodiment of the present application;

[0037] Figure 2 A schematic diagram of an application scenario provided in an embodiment of the present application;

[0038] Figure 3 A flowchart of a port failure recovery method for a network device provided in an embodiment of the present application;

[0039] Figure 4 A schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] The terms "first", "second", "third", etc. in the specification of this application and the accompanying drawings are used to distinguish different objects rather than to limit a specific order.

[0041] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0042] In order to make the description of the following embodiments clear and concise, a brief introduction to the related technology is first given:

[0043] SDK (Software Development Kit) is a set of development tools and interfaces for switch chips. SDK allows developers to configure, manage and optimize switch chips through high-level programming interfaces without directly operating hardware registers. After completing the relevant configuration, the port link status of network devices (such as switches) can be queried through the switch chip.

[0044] Although the above method can query the port link status of the network device, there is still a problem that the port link status is not reported in time, which will lead to slow port switching and affect application services.

[0045] In view of this, an embodiment of the present application provides a port switching method for a network device, which is applied to a network device, and the method includes: when a port of the network device fails, the interrupt module sends an interrupt event to a first message queue, and then the processing module can read the interrupt event from the first message queue. If the interrupt event indicates that the port of the network device fails, a fault event is sent to a second message queue, and finally the switching module can read the fault event from the second message queue. If the fault event indicates that the port where the fault occurs is consistent with the port corresponding to the application service, the primary port is switched to the backup port, thereby ensuring the normal operation of the application service. In this method, even if there are multiple application services linked, since there is no need to report the port fault step by step, the port switching speed can be guaranteed, thereby reducing the impact of the port fault on the application service.

[0046] In order to make the technical solution of the present application clearer and easier to understand, the technical solution of the present application is introduced below in conjunction with the accompanying drawings. Figure 1 As shown, the figure is a flow chart of a port switching method for a network device provided in an embodiment of the present application. The method can be applied to a network device, and the method includes:

[0047] S101. When a port of a network device fails, an interrupt event is sent to a first message queue.

[0048] In some examples, the network device may include an interrupt module, a processing module, and a switching module. The port of the network device refers to a physical port of the network device. When a physical port of the network device fails, the interrupt module can know that the physical port fails (port down) and then send an interrupt event to the first message queue.

[0049] Exemplarily, the network device may be a switch. When a port of the switch fails, an interrupt module is triggered to respond to the event and take corresponding measures, such as sending an interrupt event to one or more message queues, so that other components of the switch (such as a processing module, a management process module, a logging module, a fault recovery module, etc.) are notified of the port failure.

[0050] In some embodiments, it is possible to determine whether a switch port is faulty by determining whether a link is disconnected, whether a signal is lost, whether a CRC check is successful, etc. For example, a link disconnection, signal loss, or CRC check failure can be considered to be a port fault. When a port fault is detected, the relevant hardware or firmware will trigger an interrupt signal (used to inform the interrupt module that an emergency event needs to be processed). This interrupt signal will be recognized and received by the interrupt module, and then the interrupt module will execute a preset interrupt service routine based on the interrupt signal (used to determine the response method based on the type of interrupt). The interrupt module sends an interrupt event to the first message queue, and the interrupt event will carry relevant information, such as the port number where the fault occurred, the fault type, and a timestamp. The first message queue is a queue of the first priority.

[0051] By transmitting interrupt events through the first message queue, the producer and consumer of the interrupt event can be decoupled, so that the terminal module can focus on the detection and reporting of port faults of the event without worrying about who handles the interrupt event. It can be seen that this can further improve the detection efficiency of port faults and thus improve the subsequent port switching efficiency.

[0052] S102: Read an interruption event from the first message queue, and if the interruption event indicates that a port of the network device fails, send a failure event to the second message queue.

[0053] After the interrupt module sends the interrupt event to the first message queue, the processing module may read the interrupt event from the first message queue, and send a fault event to the second message queue if it is determined that the interrupt event indicates that a port of the network device has a fault.

[0054] In some embodiments, the processing module may periodically read the interruption event from the first message queue, or may read the interruption event from the first message queue after a new message (such as the above-mentioned interruption event) is added to the first message queue.

[0055] After the processing module reads the interrupt event from the first message queue, it can parse the interrupt event to obtain relevant information of the interrupt event, and then know whether the interrupt event indicates that a port of the network device has a fault. For example, the relevant information of the interrupt event may include a fault type, and the fault type is a port fault, and then according to the fault type, it is determined that the interrupt event indicates that a port of the network device has a fault.

[0056] In some embodiments, the service type of the application service includes: Link Aggregation Control Protocol LACP task, Multiple Spanning Tree Protocol MSTP task or Multi-Chassis Link Aggregation MCLAG task. Each type of application service can register a hook function on the processing module, so that the processing module can send messages or instructions to the application service.

[0057] In some embodiments, after determining that the fault type is a port fault, the processing module can also determine the target priority corresponding to the port fault based on the pre-configured mapping relationship between the fault type and the priority, and then send the fault event to the second message queue according to the target priority. Among them, the fault event can carry relevant information, such as fault description, fault cause, fault handling measures, etc. Exemplarily, the target priority corresponding to the port fault is the first priority, and the first priority refers to the priority of the task that is processed with the highest priority. In this way, it can be further ensured that the port fault is notified to the corresponding application business in the first time, so as to facilitate subsequent port switching.

[0058] S103: Read a fault event from the second message queue. If the fault event indicates that the port where the fault occurs is consistent with the port corresponding to the application service, switch from the primary port to the backup port.

[0059] After the processing module writes the fault event to the second message queue, the switching module can read the fault event from the second message queue. If the fault event indicates that the port where the fault occurs is consistent with the port corresponding to the application service, port switching is performed from the primary port to the backup port.

[0060] After the switching module reads the fault event from the second message queue, it can parse the fault event to determine the fault description, fault cause and fault handling measures. Then the switching module can learn the port where the fault occurs from the fault cause, and then determine whether the port where the fault occurs is consistent with the port corresponding to the application service. If they are consistent, the switching module can switch from the main port to the backup port to ensure the normal operation of the application service. If the port where the fault occurs is inconsistent with the port corresponding to the application service, the switching module can prompt that the port has a fault. Further, the network device can send a notification to the user device to inform the fault description, fault cause and corresponding fault handling measures of the fault, so that the user can know the fault in time and handle the fault according to the fault handling measures.

[0061] like Figure 2 As shown, the figure is a schematic diagram of an application scenario provided by an embodiment of the present application. In this application scenario, when the physical port of the network device fails, an interrupt signal will be triggered to the interrupt module 201, and the interrupt module 201 will send an interrupt event to the first message queue based on the interrupt signal. Then the processing module 202 can read the interrupt event from the first message queue, and send the fault event to the second message queue when it is determined that the interrupt event is a port failure. Finally, the switching module 203 can read the fault event from the second message queue, and determine whether the failed port is consistent with the port corresponding to the application service based on the fault event. If consistent, the main port is switched to the backup port. Exemplarily, the switching module 203 can determine that the failed port is consistent with the port corresponding to the LACP task, then switch the LACP task from the main port to the backup port, and if the failed port is inconsistent with the MSTP task and the MLAG task, a fault prompt is given.

[0062] The present application also provides a method for recovering a port failure of a network device. Figure 3 As shown, this figure is a flow chart of a port fault recovery method of a network device provided by an embodiment of the present application. The method includes:

[0063] S301. When a port fault of a network device is eliminated, a elimination event is sent to a first message queue.

[0064] In some examples, when a port fault of a network device is eliminated, the interrupt module can send an elimination event to the first message queue, wherein the port fault of the network device is eliminated means that the port of the network device is in a recoverable state at any time (the port can be up), but recovery processing is not currently being performed.

[0065] Exemplarily, at a port where a network device fails, after the failure is eliminated, the relevant hardware or firmware will trigger an interrupt signal (the interrupt signal is used to inform the interrupt module that an emergency event needs to be processed). After the interrupt signal is received by the interrupt module, the interrupt module will respond to the event and take corresponding measures. In an embodiment of the present application, the interrupt module sends an elimination event to the first message queue, thereby informing the subsequent modules that the port where the current failure occurs is in a recoverable state. Among them, the elimination event can carry relevant information, such as the faulty port number, whether it is in a recoverable state, timestamp and other information.

[0066] S302: Read a elimination event from the first message queue, and if the elimination event indicates that the fault of the port of the network device has been eliminated, send a fault recovery event to the second message queue.

[0067] After the interrupt module sends an elimination event to the first message queue, the processing module can read the elimination event from the first message queue, and when the elimination event indicates that the fault of the port of the network device has been eliminated, send a fault recovery event to the second message queue. The fault recovery event can carry relevant information, such as whether the current fault is in a recoverable state, the recoverable port number, recovery measures, etc.

[0068] In some embodiments, the processing module may periodically read the elimination event from the first message queue, or may read the elimination event from the first message queue after a new message (such as the above elimination event) is added to the first message queue.

[0069] After reading the elimination event from the first message queue, the processing module may parse the elimination event to obtain relevant information of the elimination event, and then learn whether the port of the network device where the failure occurs is in a recoverable state through the elimination event.

[0070] S303: Read a fault recovery event from the second message queue, and switch back from the standby port to the primary port according to the fault recovery event.

[0071] After the processing module sends the fault recovery event to the second message queue, the switching module reads the fault recovery event from the second message queue, and switches back from the standby port to the primary port according to the fault recovery event.

[0072] In some embodiments, the switching module can parse the fault recovery event to determine whether the current port fault can be recovered. If the current port fault can be recovered, a query request is sent to the opposite network device, and the query request is used to query whether the opposite network device has also eliminated the port fault and is in a recoverable state. After receiving the query request, the opposite network device can return a query response to the query request to the network device based on its own situation, and the query response carries the query result. After receiving the query response, the network device can parse the query result. If the query result shows that the opposite network device has eliminated the port fault and is in a recoverable state, the backup port is switched back to the main port. If the query result shows that the opposite network device has not eliminated the port fault, after a preset time, the query request is sent to the opposite network device again to query again whether the opposite network device has eliminated the port fault and is in a recoverable state.

[0073] In the embodiment of the present application, controlling the network devices at the local end and the opposite end to perform fault recovery at approximately the same time can reduce packet loss caused by data traffic being forwarded through links, and further ensure the normal operation of application services.

[0074] Based on the above description, the present application provides a port switching method for a network device, which can be applied to a network device, and the network device may include an interrupt module, a processing module and a switching module. In the method, when a port of the network device fails, the interrupt module sends an interrupt event to a first message queue, and the processing module can read the interrupt event from the first message queue. If the interrupt event indicates that the port of the network device fails, a fault event is sent to a second message queue, and the switching module can read the fault event from the second message queue. If the fault event indicates that the port where the fault occurs is consistent with the port corresponding to the application service, the primary port is switched to the backup port. Compared with the traditional solution, the technical solution of the present application adopts the method of interruption and message queue to notify the fault of the port, without the need to adopt the method of reporting step by step, so that the application service can quickly know that the port has a fault and switch.

[0075] Combination of the above Figures 1 to 3 The port switching method of the network device provided in the embodiment of the present application is introduced in detail. The device and equipment provided in the embodiment of the present application will be introduced in conjunction with the accompanying drawings.

[0076] Continue to see Figure 2 , an embodiment of the present application provides a port switching device for a network device, the device comprising:

[0077] An interrupt module 201, configured to send an interrupt event to a first message queue when a port of the network device fails;

[0078] The processing module 202 is configured to read the interrupt event from the first message queue, and send a fault event to a second message queue if the interrupt event indicates that a port of the network device fails;

[0079] The switching module 203 is configured to read the fault event from the second message queue, and if the fault event indicates that the port where the fault occurs is consistent with the port corresponding to the application service, switch from the primary port to the backup port.

[0080] Optionally, the processing module 202 is specifically configured to determine a target priority corresponding to the port fault according to a pre-configured mapping relationship between the fault type and the priority; and send the fault event to the second message queue according to the target priority.

[0081] Optionally, the interrupt module 201 is further configured to send a elimination event to the first message queue when the port fault of the network device is eliminated;

[0082] The processing module 202 is further configured to read the elimination event from the first message queue, and send a fault recovery event to the second message queue if the elimination event indicates that the fault of the port of the network device has been eliminated;

[0083] The switching module 203 is further configured to read the fault recovery event from the second message queue, and switch the backup port back to the primary port according to the fault recovery event.

[0084] Optionally, the switching module 203 is specifically used to send a query request to the opposite network device according to the fault recovery event, and the query request is used to query whether the opposite network device has eliminated the port fault; receive a query response returned by the opposite network device for the query request, and the query response carries a query result; if the query result indicates that the opposite network device has eliminated the port fault, the backup port is switched back to the main port.

[0085] Optionally, the switching module 203 is further configured to send the query request to the opposite network device again after a preset delay if the query result indicates that the opposite network device has not eliminated the port fault.

[0086] Optionally, the device includes a prompt module, which is used to prompt that the port has a fault if the fault event indicates that the port where the fault occurs is inconsistent with the port corresponding to the application service.

[0087] The port switching device of the network device according to the embodiment of the present application may correspond to the method described in the embodiment of the present application, and the above-mentioned other operations and / or functions of each module / unit of the port switching device of the network device are respectively to realize Figure 1 or Figure 3 For the sake of brevity, the corresponding processes of each method in the illustrated embodiment are not described in detail here.

[0088] The present application also provides a computing device. The computing device may be a network device, such as a switch. The computing device is specifically used to implement the following Figure 4 The functions of the port switching device of the network device in the illustrated embodiment.

[0089] like Figure 4 As shown, this figure is a schematic diagram of a computing device provided in an embodiment of the present application, and the computing device 400 includes a bus 401, a processor 402, a communication interface 403 and a memory 404. The processor 402, the memory 404 and the communication interface 403 communicate with each other through the bus 401.

[0090] The bus 401 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0091] The processor 402 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0092] The communication interface 403 is used for communicating with the outside.

[0093] The memory 404 may include a volatile memory, such as a random access memory (RAM). The memory 404 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0094] The memory 404 stores executable codes, and the processor 402 executes the executable codes to perform the port switching method of the network device described above.

[0095] Specifically, in implementing Figure 2 In the case of the embodiment shown, and Figure 2 When each module or unit of the port switching device of the network device described in the embodiment is implemented by software, the execution Figure 2 The software or program code required for the functions of each module / unit in the network device may be partially or completely stored in the memory 404. The processor 402 executes the program code corresponding to each unit stored in the memory 404 to execute the port switching method of the network device.

[0096] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by the computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the port switching method applied to the network device.

[0097] The embodiment of the present application further provides a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.

[0098] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0099] When the computer program product is executed by a computer, the computer executes any of the aforementioned methods for switching ports of a network device. The computer program product may be a software installation package, and when any of the aforementioned methods for switching ports of a network device is required, the computer program product may be downloaded and executed on a computer.

[0100] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.

[0101] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.

Claims

1. A port switching method for a network device, characterized in that: Applied to a network device, the method comprises: When a port of the network device fails, sending an interrupt event to the first message queue; Reading the interrupt event from the first message queue, and sending a fault event to the second message queue if the interrupt event indicates that a port of the network device fails; The fault event is read from the second message queue. If the fault event indicates that the port where the fault occurs is consistent with the port corresponding to the application service, the primary port is switched to the backup port.

2. The method according to claim 1, characterized in that The sending the fault event to the second message queue includes: Determine the target priority corresponding to the port fault according to the pre-configured mapping relationship between the fault type and priority; Sending a fault event to the second message queue according to the target priority.

3. The method according to claim 1, characterized in that The method further comprises: When the port fault of the network device is eliminated, sending an elimination event to the first message queue; reading the elimination event from the first message queue, and sending a fault recovery event to the second message queue if the elimination event indicates that the fault of the port of the network device has been eliminated; The fault recovery event is read from the second message queue, and according to the fault recovery event, the backup port is switched back to the primary port.

4. The method according to claim 3, characterized in that The step of switching back the backup port to the primary port according to the fault recovery event includes: According to the fault recovery event, a query request is sent to the opposite network device, wherein the query request is used to query whether the opposite network device has eliminated the port fault; Receiving a query response returned by the opposite network device in response to the query request, wherein the query response carries a query result; If the query result indicates that the port failure of the opposite network device has been eliminated, the backup port is switched back to the primary port.

5. The method according to claim 4, characterized in that The method further comprises: If the query result indicates that the port fault of the opposite network device has not been eliminated, the query request is sent to the opposite network device again after a preset delay.

6. The method according to claim 1, characterized in that The service type of the application service includes: a Link Aggregation Control Protocol LACP task, a Multiple Spanning Tree Protocol MSTP task or a Multi-Chassis Link Aggregation MCLAG task.

7. The method according to claim 1, characterized in that The method further includes: if the fault event indicates that the port where the fault occurs is inconsistent with the port corresponding to the application service, prompting that the port has a fault.

8. A port switching device for a network device, characterized in that: The device comprises: An interrupt module, configured to send an interrupt event to the first message queue when a port of the network device fails; a processing module, configured to read the interrupt event from the first message queue, and send a fault event to a second message queue if the interrupt event indicates that a port of the network device fails; The switching module is used to read the fault event from the second message queue, and if the fault event indicates that the port where the fault occurs is consistent with the port corresponding to the application service, switch from the primary port to the backup port.

9. A computing device, characterized in that including memory and processor; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Data stream transmission method, system, device and equipment

    CN121486273A

  • Data streaming method, system, apparatus and device

    CN121486273B