Switch event notification method, device, equipment and medium
By adopting preset priority message queues and independent push thread mechanisms in the switch, the delayed push and missed reporting problems when the switch handles multiple event messages is solved, efficient parallel processing and resource optimization are achieved, and network management is improved. The reliability of network management is improved Sex and user experience.
Patent Information
- Application Number
- CN202411431487.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2024-12-10
AI Technical Summary
When a switch processes multiple event messages, due to processing capabilities, it may lead to delayed pushing or missed reporting of highly sensitive events, affecting the efficiency and security of network management and operation and maintenance.
The message queue with preset priority and independent push thread mechanism is adopted to classify switch events in parallel according to priority level, and ensure the timely processing and push of high-priority events through polling and CPU resource optimization.
It improves event processing efficiency, reduces the risk of underreporting highly sensitive incidents, optimizes resource utilization, improves network management reliability and administrator work efficiency, and enhances the scalability and user experience of the system.
Smart Images

Figure CN119109882A_ABST
Abstract
Description
Technical Field
[0001] The present specification relates to the field of computer technology, and in particular to a switch event notification method, device, equipment and medium. Background Art
[0002] With the continuous development of network technology, switches play a vital role in modern communication networks. The main function of a switch is to forward data packets in the network to achieve communication between different devices.
[0003] However, as the features of switches continue to increase, various functional modules may generate event messages. These event messages may include but are not limited to link status changes, port failures, traffic anomalies, etc. The number of event types and the total number of messages are gradually increasing, which brings challenges to the management and operation of switches.
[0004] In actual applications, there is a possibility of multiple notification messages being sent simultaneously. This means that multiple events may occur at the same time, resulting in a large number of event messages that need to be processed simultaneously. Due to processing capacity limitations, the switch may not be able to process all event messages in a timely manner, resulting in the risk of delayed push or even missed reports of highly sensitive events. Delayed push or missed reports of highly sensitive events may cause potential problems for the management and operation of the switch. For example, administrators may not be able to learn about important network failures or security events in a timely manner, and therefore cannot take timely measures to repair or prevent them. This may lead to degraded network performance, service interruptions, and even security vulnerabilities. Summary of the invention
[0005] One or more embodiments of the present specification provide a switch event notification method, device, equipment and medium, which are used to solve the technical problems raised by the background technology.
[0006] One or more embodiments of this specification adopt the following technical solutions:
[0007] One or more embodiments of this specification provide a switch event notification method, the method comprising:
[0008] According to the preset priorities of various types of switch event notifications, each module is set to send the message queue corresponding to the various types of switch event notifications, so that the switch event notifications of the preset priority are sent to the message queues that meet the priority;
[0009] An independent push thread is allocated to the switch event notification of each message queue, so that the switch event notification in the corresponding message queue is monitored by the push thread, and the monitored switch event notification is packaged and pushed.
[0010] It should be noted that the embodiments of this specification have the following beneficial effects regarding the above content:
[0011] Improve event processing efficiency: By setting up independent message queues and push threads for switch event notifications of different priorities, parallel processing of event messages can be achieved, thereby improving event processing efficiency.
[0012] Reduce the risk of missed reports of highly sensitive events: High-priority event notifications can be processed and pushed in a timely manner, reducing the possibility of delayed push or missed reports, helping administrators take timely measures to respond to important network failures or security incidents.
[0013] Optimize resource utilization: Allocate resources according to event priority, avoid low-priority events taking up too many resources, and improve the overall performance of the system.
[0014] Improve the reliability of network management: Timely push event notifications can help administrators quickly discover and resolve network problems, reducing the risk of network performance degradation, service interruptions, and security vulnerabilities.
[0015] Enhance system scalability: This method can adapt to the increasing number of switch features and the diversification of event types, and meet the needs of future network management by flexibly configuring message queues and push threads.
[0016] Improve administrators' work efficiency: Administrators can obtain key event information in a timely manner, reducing the time for troubleshooting potential problems and improving work efficiency.
[0017] Furthermore, when multiple switch event notifications are pushed simultaneously, monitoring the switch event notifications in the corresponding message queues through the push thread includes:
[0018] The push thread polls and monitors the switch event notifications in the corresponding message queue based on the priority of the corresponding message queue.
[0019] It should be noted that the embodiments of this specification have the following beneficial effects regarding the above content:
[0020] Improve event processing efficiency: By polling and monitoring the message queue, ensure that high-priority event notifications can be processed in a timely manner, reduce waiting time, and improve event processing efficiency.
[0021] Ensure orderly processing of events: Polling and monitoring the message queue according to priority can ensure that high-priority event notifications are processed first, avoiding low-priority events blocking the processing of high-priority events, and ensuring the orderly processing of events.
[0022] Reduce the risk of missed reports of highly sensitive events: High-priority event notifications can be monitored and processed in a timely manner, reducing the possibility of delayed push or missed reports, helping administrators take timely measures to respond to important network failures or security incidents.
[0023] Optimize resource utilization: Perform polling and monitoring based on event priority to avoid low-priority events from occupying too many resources and improve the overall performance of the system.
[0024] Improve the reliability of network management: Timely processing of high-priority event notifications helps administrators quickly discover and resolve network problems, reducing the risk of network performance degradation, service interruptions, and security vulnerabilities.
[0025] Furthermore, the method further comprises:
[0026] Based on the priority of the message queue corresponding to the push thread, the notification message capacity that can be processed by the push thread in a single task is set.
[0027] It should be noted that the embodiments of this specification have the following beneficial effects regarding the above content:
[0028] Improve resource utilization efficiency: By setting the notification message capacity that the push thread can process in a single task according to the priority of the message queue, system resources can be allocated more reasonably to prevent low-priority messages from occupying too many resources.
[0029] Ensure timely processing of high-priority events: Allocate a larger notification message capacity to the high-priority message queue to ensure that highly sensitive events can be processed and pushed in a timely manner, reducing the risk of delayed push or missed reports.
[0030] Improve the overall performance of the system: Reasonable setting of notification message capacity can avoid system performance degradation caused by processing a large number of low-priority messages, thereby improving the stability and reliability of the system.
[0031] Furthermore, the method further comprises:
[0032] Set CPU parameters and message push real-time performance based on the priority of the message queue.
[0033] It should be noted that the embodiments of this specification have the following beneficial effects regarding the above content:
[0034] Improve system performance: Setting CPU parameters according to the priority of the message queue can ensure that high-priority messages get more CPU resources, thereby improving the overall performance of the system.
[0035] Ensure the real-time nature of message push: By properly setting CPU parameters, high-priority messages can be pushed more promptly, reducing delays and improving the real-time nature of message push.
[0036] Optimize resource allocation: Allocating CPU resources based on priority can prevent low-priority messages from occupying too many resources, thereby optimizing system resource allocation.
[0037] Improve user experience: For application scenarios with high real-time requirements, such as financial transactions and real-time monitoring, ensuring the real-time nature of message push can improve user experience.
[0038] Furthermore, the switch event notification is a NETCONF event notification.
[0039] Standardized event notification: NETCONF is a standardized network configuration protocol. Using NETCONF event notification can ensure that the format and content of event notifications are consistent and standardized.
[0040] Rich event information: NETCONF event notifications usually contain detailed event information, such as event type, event source, event time, etc., which helps administrators to have a more comprehensive understanding of the events occurring on the switch.
[0041] Compatibility with existing network management systems: Many network management systems support the NETCONF protocol, so using NETCONF event notifications can make it easier to integrate with existing network management systems, reducing the difficulty and cost of system integration.
[0042] Remote management and monitoring: The NETCONF protocol supports remote management and monitoring. By using NETCONF event notification, administrators can obtain event information on the switch in real time at a remote location, improving management flexibility and efficiency.
[0043] One or more embodiments of this specification provide a switch event notification device, including:
[0044] The message queue setting unit sets the message queues corresponding to the various switch event notifications sent by each module according to the preset priorities of the various switch event notifications, so as to send the switch event notifications of the preset priority to the message queues that meet the priority;
[0045] The event notification unit allocates an independent push thread to the switch event notification of each message queue, so that the switch event notification in the corresponding message queue is monitored by the push thread, and the monitored switch event notification is packaged and pushed.
[0046] Furthermore, when multiple switch event notifications are pushed simultaneously, monitoring the switch event notifications in the corresponding message queues through the push thread includes:
[0047] The push thread polls and monitors the switch event notifications in the corresponding message queue based on the priority of the corresponding message queue.
[0048] Furthermore, the device also includes:
[0049] The notification message capacity setting unit sets the notification message capacity that can be processed by the push thread in a single task based on the priority of the message queue corresponding to the push thread.
[0050] One or more embodiments of this specification provide a switch event notification device, including:
[0051] at least one processor; and,
[0052] a memory communicatively connected to the at least one processor; wherein,
[0053] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0054] According to the preset priorities of various types of switch event notifications, each module is set to send the message queue corresponding to the various types of switch event notifications, so that the switch event notifications of the preset priority are sent to the message queues that meet the priority;
[0055] An independent push thread is allocated to the switch event notification of each message queue, so that the switch event notification in the corresponding message queue is monitored by the push thread, and the monitored switch event notification is packaged and pushed.
[0056] One or more embodiments of this specification provide a non-volatile computer storage medium storing computer executable instructions, which can achieve the following when executed by a computer:
[0057] According to the preset priorities of various types of switch event notifications, each module is set to send the message queue corresponding to the various types of switch event notifications, so that the switch event notifications of the preset priority are sent to the message queues that meet the priority;
[0058] An independent push thread is allocated to the switch event notification of each message queue, so that the switch event notification in the corresponding message queue is monitored by the push thread, and the monitored switch event notification is packaged and pushed.
[0059] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects:
[0060] Improve event processing efficiency: By setting up independent message queues and push threads for switch event notifications of different priorities, parallel processing of event messages can be achieved, thereby improving event processing efficiency.
[0061] Reduce the risk of missed reports of highly sensitive events: High-priority event notifications can be processed and pushed in a timely manner, reducing the possibility of delayed push or missed reports, helping administrators take timely measures to respond to important network failures or security incidents.
[0062] Optimize resource utilization: Allocate resources according to event priority, avoid low-priority events taking up too many resources, and improve the overall performance of the system.
[0063] Improve the reliability of network management: Timely push event notifications can help administrators quickly discover and resolve network problems, reducing the risk of network performance degradation, service interruptions, and security vulnerabilities.
[0064] Enhance system scalability: This method can adapt to the increasing number of switch features and the diversification of event types, and meet the needs of future network management by flexibly configuring message queues and push threads.
[0065] Improve administrators' work efficiency: Administrators can obtain key event information in a timely manner, reducing the time for troubleshooting potential problems and improving work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:
[0067] Figure 1 A flow chart of a switch event notification method provided for one or more embodiments of this specification;
[0068] Figure 2 A schematic diagram of concurrent event messages of a switch multi-function module provided for one or more embodiments of this specification;
[0069] Figure 3 A schematic diagram of thread weight ratios provided for one or more embodiments of this specification;
[0070] Figure 4 A schematic diagram of the structure of a switch event notification device provided in one or more embodiments of this specification;
[0071] Figure 5A schematic diagram of the structure of a switch event notification device provided in one or more embodiments of this specification. DETAILED DESCRIPTION
[0072] The embodiments of this specification provide a switch event notification method, device, equipment and medium.
[0073] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0074] Figure 1 A schematic diagram of a process flow of a switch event notification method provided in one or more embodiments of this specification, the process can be executed by a switch event notification system. Certain input parameters or intermediate results in the process allow manual intervention and adjustment to help improve accuracy.
[0075] The method steps of the embodiment of this specification are as follows:
[0076] S102, according to the preset priorities of various types of switch event notifications, setting the message queues corresponding to the various types of switch event notifications sent by each module, so as to send the switch event notifications of the preset priority to the message queues that meet the priority.
[0077] In the examples of this specification, the above content can be implemented by the following specific implementation scheme:
[0078] Determine the priority classification of switch event notifications: It is necessary to determine the priority of different types of switch event notifications. This can be based on the importance, urgency or other relevant factors of the event.
[0079] Design a message queue system: Establish a message queue system to store and transmit switch event notifications. You can use existing message queue technologies such as RabbitMQ, Kafka, etc.
[0080] Create a message queue for each priority level: Create a corresponding message queue for each priority level based on the pre-set priority classification. For example, you can create high priority, medium priority, and low priority message queues.
[0081] Module sends event notification: When each module detects a switch event notification, it sends it to the corresponding message queue according to the priority of the event. The module needs to know how to map the event notification to the correct message queue.
[0082] Message queue processing: The message queue system is responsible for receiving and storing event notifications and processing them according to priority. High-priority message queues will be processed first to ensure that important events receive timely attention.
[0083] Receiving and processing event notifications: The receiving end can obtain event notifications from the message queue and perform further processing as needed, such as recording, analyzing, or taking corresponding actions.
[0084] S104, assigning an independent push thread to the switch event notification of each message queue, so that the push thread monitors the switch event notification in the corresponding message queue, and encapsulates and pushes the monitored switch event notification.
[0085] In the examples of this specification, the above content can be implemented by the following specific implementation scheme:
[0086] Message queue allocation: Assign a separate push thread to each message queue. This can be achieved by using a thread pool or creating a separate thread.
[0087] Push thread monitoring: The push thread is responsible for monitoring its corresponding message queue. Use the message queue monitoring mechanism or polling method to detect new switch event notifications.
[0088] Event notification encapsulation: When the push thread listens to the switch event notification, it encapsulates it. Encapsulation can include adding necessary metadata, format conversion and other operations to facilitate subsequent push and processing.
[0089] Push operation: The push thread pushes the encapsulated switch event notification to the target system or recipient. The push method can be selected according to specific needs, such as network communication, message middleware, etc.
[0090] Thread management: manage push threads, including thread creation, start, stop, etc. The number of threads can be dynamically adjusted according to the load of the message queue.
[0091] Error handling: handle errors that may occur during monitoring, packaging, and pushing. Record error logs and take appropriate error recovery measures.
[0092] Furthermore, when multiple switch event notifications are pushed simultaneously, when the push thread monitors the switch event notifications in the corresponding message queue, the push thread can poll and monitor the switch event notifications in the corresponding message queue based on the priority of the corresponding message queue.
[0093] In the examples of this specification, the above content can be implemented by the following specific implementation scheme:
[0094] Prioritize message queues: Assign a priority level to each message queue. Priority can be determined based on the importance, urgency, or other relevant factors of the event.
[0095] Polling and monitoring message queues: The push thread polls and monitors each message queue in turn according to the priority order of the message queues.
[0096] Processing switch event notifications: When the push thread monitors a switch event notification in a message queue, it performs corresponding processing, which may include packaging, pushing, or other operations related to event notifications.
[0097] Continue polling: After processing the event notification in the current message queue, the push thread continues to poll the next message queue in order of priority and repeats the above processing of switch event notifications.
[0098] Simultaneous push processing: If there are multiple message queues with event notifications at the same time during the polling process, the push thread can process the event notifications in each message queue in turn according to the priority.
[0099] It should be noted that the embodiments of this specification have the following beneficial effects regarding the above content:
[0100] Improve event processing efficiency: By polling and monitoring the message queue, ensure that high-priority event notifications can be processed in a timely manner, reduce waiting time, and improve event processing efficiency.
[0101] Ensure orderly processing of events: Polling and monitoring the message queue according to priority can ensure that high-priority event notifications are processed first, avoiding low-priority events blocking the processing of high-priority events, and ensuring the orderly processing of events.
[0102] Reduce the risk of missed reports of highly sensitive events: High-priority event notifications can be monitored and processed in a timely manner, reducing the possibility of delayed push or missed reports, helping administrators take timely measures to respond to important network failures or security incidents.
[0103] Optimize resource utilization: Perform polling and monitoring based on event priority to avoid low-priority events from occupying too many resources and improve the overall performance of the system.
[0104] Improve the reliability of network management: Timely processing of high-priority event notifications helps administrators quickly discover and resolve network problems, reducing the risk of network performance degradation, service interruptions, and security vulnerabilities.
[0105] Furthermore, the embodiment of the present specification may also set the notification message capacity that can be processed by the push thread in a single task based on the priority of the message queue corresponding to the push thread.
[0106] In the examples of this specification, the above content can be implemented by the following specific implementation scheme:
[0107] Define notification message capacity: Set an upper limit for the notification message capacity for each push thread. This capacity can be expressed as the number of notification messages or the amount of data that can be processed.
[0108] Priority and capacity mapping: Establish a mapping relationship between priority and notification message capacity. Different capacities can be allocated according to the priority. For example, a high-priority message queue can be allocated a larger notification message capacity, while a low-priority message queue can be allocated a smaller capacity.
[0109] Dynamic capacity adjustment: Based on actual conditions, you can also consider dynamically adjusting the notification message capacity. For example, if a high-priority message queue is backlogged with a large number of notification messages, you can temporarily increase its capacity to speed up processing.
[0110] It should be noted that the embodiments of this specification have the following beneficial effects regarding the above content:
[0111] Improve resource utilization efficiency: By setting the notification message capacity that the push thread can process in a single task according to the priority of the message queue, system resources can be allocated more reasonably to prevent low-priority messages from occupying too many resources.
[0112] Ensure timely processing of high-priority events: Allocate a larger notification message capacity to the high-priority message queue to ensure that highly sensitive events can be processed and pushed in a timely manner, reducing the risk of delayed push or missed reports.
[0113] Improve the overall performance of the system: Reasonable setting of notification message capacity can avoid system performance degradation caused by processing a large number of low-priority messages, thereby improving the stability and reliability of the system.
[0114] Furthermore, the embodiments of this specification can also set CPU parameters and message push real-time performance based on the priority of the message queue.
[0115] In the examples of this specification, the above content can be implemented by the following specific implementation scheme:
[0116] Set CPU parameters: According to the priority of the message queue, set different CPU parameters for message queues of different priorities. This can be achieved by using the scheduling strategy or tools provided by the operating system.
[0117] Message push real-time performance: adjust the real-time performance of message push according to the priority of the message queue and the set CPU parameters. High-priority message queues can obtain more CPU resources, thereby improving the real-time performance of message push; low-priority message queues obtain less CPU resources and have relatively low real-time performance.
[0118] It should be noted that the embodiments of this specification have the following beneficial effects regarding the above content:
[0119] Improve system performance: Setting CPU parameters according to the priority of the message queue can ensure that high-priority messages get more CPU resources, thereby improving the overall performance of the system.
[0120] Ensure the real-time nature of message push: By properly setting CPU parameters, high-priority messages can be pushed more promptly, reducing delays and improving the real-time nature of message push.
[0121] Optimize resource allocation: Allocating CPU resources based on priority can prevent low-priority messages from occupying too many resources, thereby optimizing system resource allocation.
[0122] Improve user experience: For application scenarios with high real-time requirements, such as financial transactions and real-time monitoring, ensuring the real-time nature of message push can improve user experience.
[0123] Furthermore, the switch event notification is a NETCONF event notification.
[0124] Standardized event notification: NETCONF is a standardized network configuration protocol. Using NETCONF event notification can ensure that the format and content of event notifications are consistent and standardized.
[0125] Rich event information: NETCONF event notifications usually contain detailed event information, such as event type, event source, event time, etc., which helps administrators to have a more comprehensive understanding of the events occurring on the switch.
[0126] Compatibility with existing network management systems: Many network management systems support the NETCONF protocol, so using NETCONF event notifications can make it easier to integrate with existing network management systems, reducing the difficulty and cost of system integration.
[0127] Remote management and monitoring: The NETCONF protocol supports remote management and monitoring. By using NETCONF event notification, administrators can obtain event information on the switch in real time at a remote location, improving management flexibility and efficiency.
[0128] It should be noted that the present invention can propose a multi-message queue implementation method for the switch NETCONF event notification mechanism.
[0129] The NETCONF protocol defines an event notification mechanism (Notification) for the NETCONF server to proactively notify the client of a specific event. The client first sends a <Create Subscription> message to the server, and then the server proactively pushes relevant event messages to the client.
[0130] As switch features increase, various functional modules may generate event messages. The types of events and the total number of messages are gradually increasing. There is a possibility of multiple notification messages being sent simultaneously, which may cause the risk of delayed push or even missed reporting of highly sensitive events, causing potential problems for the management and operation of the switch.
[0131] The present invention introduces a multi-message queue framework to manage switch NETCONF notification events as a whole, thereby improving the flexibility and reliability of message push in high-concurrency scenarios of notification events and reducing the risk of delayed push or even missed reporting of highly sensitive events.
[0132] When existing switches implement NETCONF event notification, they generally adopt an immediate sending strategy, that is, when an event occurs, the switch immediately encapsulates and pushes the message, provided that the client has subscribed. The order in which the message is encapsulated and pushed basically depends on the order in which the events themselves occur, without any priority classification or control.
[0133] Disadvantages of existing solutions:
[0134] The switch NETCONF event notification messages lack flexibility and reliability. When certain functional modules of the switch generate a large number of continuous non-important event notifications, it may cause the push of more important event notification messages to be blocked. There is even a risk of missed reports when system resources are limited.
[0135] Purpose of the present invention:
[0136] Considering the overall planning of switch NETCONF event objects, a multi-message queue framework is introduced to comprehensively manage and maintain the generation and push process of event messages, provide message priority classification and control, and improve reliability and flexibility.
[0137] This method is based on the concurrent event message scenario of the switch multi-function module. By introducing a multi-message queue mechanism, the generation and push actions of notification events are decoupled, such as Figure 2 A schematic diagram of concurrent event messages of a switch multi-function module is shown.
[0138] 1. Notification event message queue
[0139] Design three message queues to store notification events according to priority. Each functional module of the switch is a producer of notification events. According to actual needs, notification events are classified by priority so that they are inserted into the corresponding message queues after they are generated. The smaller the number, the higher the message priority. Therefore, the message priority relationship is: message queue 1 > message queue 2 > message queue 3.
[0140] As shown in Table 1, the operation and maintenance message queue, notification events caused by system resource fluctuations (such as events triggered by abnormal CPU / memory utilization) are generally classified as high-priority events. The corresponding perception module needs to store such notification events in the message queue 1 of the high-priority queue.
[0141] Table 1 Operation and maintenance message queue
[0142]
[0143] Notification event push task
[0144] This method assigns an independent push thread to each message queue, which is used to poll and listen to the messages in the corresponding message queue and execute the final package push action. The following mechanism is designed to ensure the priority difference processing:
[0145] All push threads are scheduled in one process, but different threads have different scheduling priorities. The smaller the number, the higher the scheduling priority. Therefore, the scheduling priority relationship is: push thread 1> push thread 2> push thread 3. The higher the priority, the more CPU time slices a thread gets, and the better the real-time performance of message push in the corresponding message queue.
[0146] Different push threads can process different notification message capacities in a single task. The higher the priority, the larger the processing capacity of a single task. The weight ratio is 8:4:2. For example, push thread 1 can obtain up to 8 notification events from message queue 1 in a single task (if there are less than 8, all of them will be taken out), and then all of them will be packaged and pushed. Similarly, push thread 2 can process up to 4 at a time, and push thread 3 can process up to 2 at a time. Figure 3 Schematic diagram of thread weight ratio shown.
[0147] Compared with other technologies, the present invention has the following advantages:
[0148] 1. For high-concurrency scenarios of switch NETCONF event notifications, this method provides an implementation method that is both reliable and flexible. Reliability lies in maximizing the real-time push of highly sensitive / high-priority events; flexibility lies in fine-tuning the proportion of single-task processing capacity of each thread to achieve personalized effects.
[0149] 2. This method is highly robust and uses message queues to asynchronously maintain notification events of each module in the system, without causing performance risks to the original logical processes of each module.
[0150] 3. This method has strong versatility and maintainability, and adding new modules and notification events will not introduce additional workload.
[0151] Figure 4 A schematic diagram of the structure of a switch event notification device provided for one or more embodiments of this specification includes: a message queue setting unit 402 and an event notification unit 404 .
[0152] The message queue setting unit 402 sets the message queues corresponding to the various switch event notifications sent by each module according to the preset priorities of the various switch event notifications, so as to send the switch event notifications of the preset priority to the message queues that meet the priority;
[0153] The event notification unit 404 allocates an independent push thread to the switch event notification of each message queue, so that the push thread monitors the switch event notification in the corresponding message queue and packages and pushes the monitored switch event notification.
[0154] Furthermore, when multiple switch event notifications are pushed simultaneously, monitoring the switch event notifications in the corresponding message queues through the push thread includes:
[0155] The push thread polls and monitors the switch event notifications in the corresponding message queue based on the priority of the corresponding message queue.
[0156] Furthermore, the device also includes:
[0157] The notification message capacity setting unit sets the notification message capacity that can be processed by the push thread in a single task based on the priority of the message queue corresponding to the push thread.
[0158] Figure 5 A schematic diagram of a switch event notification device provided for one or more embodiments of this specification includes:
[0159] at least one processor; and,
[0160] a memory communicatively connected to the at least one processor; wherein,
[0161] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0162] According to the preset priorities of various types of switch event notifications, each module is set to send the message queue corresponding to the various types of switch event notifications, so that the switch event notifications of the preset priority are sent to the message queues that meet the priority;
[0163] An independent push thread is allocated to the switch event notification of each message queue, so that the switch event notification in the corresponding message queue is monitored by the push thread, and the monitored switch event notification is packaged and pushed.
[0164] One or more embodiments of this specification provide a non-volatile computer storage medium storing computer executable instructions, which can achieve the following when executed by a computer:
[0165] According to the preset priorities of various types of switch event notifications, each module is set to send the message queue corresponding to the various types of switch event notifications, so that the switch event notifications of the preset priority are sent to the message queues that meet the priority;
[0166] An independent push thread is allocated to the switch event notification of each message queue, so that the switch event notification in the corresponding message queue is monitored by the push thread, and the monitored switch event notification is packaged and pushed.
[0167] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A switch event notification method, It is characterized in that include: According to the preset priorities of various types of switch event notifications, each module is set to send the message queue corresponding to the various types of switch event notifications, so that the switch event notifications of the preset priority are sent to the message queues that meet the priority; An independent push thread is allocated to the switch event notification of each message queue, so that the switch event notification in the corresponding message queue is monitored by the push thread, and the monitored switch event notification is packaged and pushed.
2. The method according to claim 1, It is characterized in that When multiple switch event notifications are pushed simultaneously, monitoring the switch event notifications in the corresponding message queues through the push thread includes: The push thread polls and monitors the switch event notifications in the corresponding message queue based on the priority of the corresponding message queue.
3. The method according to claim 2, It is characterized in that The method further comprises: Based on the priority of the message queue corresponding to the push thread, the notification message capacity that can be processed by the push thread in a single task is set.
4. The method according to claim 1, It is characterized in that The method further comprises: Set CPU parameters and message push real-time performance based on the priority of the message queue.
5. The method according to claim 1, It is characterized in that The switch event notification is a NETCONF event notification.
6. A switch event notification device, It is characterized in that include: The message queue setting unit sets the message queues corresponding to the various switch event notifications sent by each module according to the preset priorities of the various switch event notifications, so as to send the switch event notifications of the preset priority to the message queues that meet the priority; The event notification unit allocates an independent push thread to the switch event notification of each message queue, so that the switch event notification in the corresponding message queue is monitored by the push thread, and the monitored switch event notification is packaged and pushed.
7. The device according to claim 6, It is characterized in that When multiple switch event notifications are pushed simultaneously, monitoring the switch event notifications in the corresponding message queues through the push thread includes: The push thread polls and monitors the switch event notifications in the corresponding message queue based on the priority of the corresponding message queue.
8. The device according to claim 7, It is characterized in that The device also includes: The notification message capacity setting unit sets the notification message capacity that can be processed by the push thread in a single task based on the priority of the message queue corresponding to the push thread.
9. A switch event notification device, It is characterized in that include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: According to the preset priorities of various types of switch event notifications, each module is set to send the message queue corresponding to the various types of switch event notifications, so that the switch event notifications of the preset priority are sent to the message queues that meet the priority; An independent push thread is allocated to the switch event notification of each message queue, so that the switch event notification in the corresponding message queue is monitored by the push thread, and the monitored switch event notification is packaged and pushed.
10. A non-volatile computer storage medium, It is characterized in that Computer executable instructions are stored, and when the computer executable instructions are executed by a computer, the following can be achieved: According to the preset priorities of various types of switch event notifications, each module is set to send the message queue corresponding to the various types of switch event notifications, so that the switch event notifications of the preset priority are sent to the message queues that meet the priority; An independent push thread is allocated to the switch event notification of each message queue, so that the switch event notification in the corresponding message queue is monitored by the push thread, and the monitored switch event notification is packaged and pushed.
Citation Information
Patent Citations
Service flow processing method and system
CN107657531A
Network switch security monitoring method and device based on artificial intelligence, and medium
CN114710288A
Method for bidirectional communication between web server and unmanned aerial vehicle detection and countering equipment
CN115766689A
Method for monitoring exchanger in machine group
CN1674535A
Dynamic Balancing Priority Queue Assignments for Quality-of-Service Network Flows
US20120155264A1
