Alarm flow control method based on consistent hash of alarm priority and related equipment
By adopting the alarm flow control method based on the consistent hash of alarm priority in the automated control system of large thermal power units, the data congestion and system crash caused by the surge in alarm information under sudden abnormal operating conditions is solved, and efficient Alarm information processing and system stability are improved.
Patent Information
- Application Number
- CN202411543382.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-18
AI Technical Summary
In the automated control system of large thermal power units, the generation speed of alarm information may surge in the event of sudden abnormal working conditions, exceeding the real-time processing capability of the host computer, resulting in data congestion, slow system response or even crash.
Using the alarm flow control method based on the consistent hashing of alarm priority, by starting the alarm software, setting the appropriate cache size, processing alarm information in time according to the queue priority order, and prioritizing high priority when entering the avalanche state Alarm, perform consistent hash calculation to allocate alarm information, and synchronize alarm information after normal recovery.
It effectively avoids data congestion and system crashes, ensures timely response and processing of high-priority alarms, and improves the stability and reliability of the system in extreme cases.
Smart Images

Figure CN119479224A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of alarm flow control, and specifically relates to an alarm flow control method and related equipment based on consistent hashing of alarm priorities. Background Art
[0002] In the automation control system of large thermal power units, the host computer plays a vital role as the core of central monitoring and data processing. It continuously receives and processes various monitoring data and alarm information from the lower computers (such as PLC, DCS and other control systems) and other related equipment. Under normal operation of the unit, due to the complexity of the system and the precision requirements of monitoring, it is normal to generate hundreds to thousands of alarm messages per second. These alarm messages cover various types such as temperature anomalies, pressure fluctuations, equipment failure warnings, etc., which are crucial to ensure the safe and stable operation of the unit.
[0003] However, when encountering power outages, network interruptions or other sudden abnormal conditions, the system may face an unprecedented data flood, and the alarm information generation rate may instantly surge to tens of thousands per second, far exceeding the real-time processing capabilities of the host computer. In this case, if an effective processing strategy is not adopted, it may lead to data congestion, slow system response or even crash, which in turn affects the timely response and processing of the unit's emergency. Summary of the invention
[0004] The present invention provides an alarm flow control method and related equipment based on consistent hashing of alarm priorities, which solves the problem of data congestion, slow system response and even crash caused by the surge in alarm data.
[0005] To achieve the above object, the present invention provides the following technical solutions: The alarm flow control method based on consistent hashing of alarm priorities includes: Start the alarm software, set the cache size of the alarm receiving area according to the memory size, and also set the cache size of the network card; When the system is operating normally, the alarm information is processed in different time periods according to the priority order of the queue. Alarms with high priority are stored in the real-time database first and displayed on the screen. Set the avalanche value and calculate the number of alarms received per second. When the preset avalanche value is exceeded for 2 consecutive seconds, the avalanche state is entered by default. The number of alarms received per second is continuously calculated. When it is lower than the preset avalanche value for 2 consecutive seconds, the avalanche state is exited by default. After exiting the avalanche state, each node synchronizes the alarm information stored locally during the avalanche state to other nodes.
[0006] Preferably, the network card cache size is set as follows: The receiving buffer area is set to 5 queues, and alarms of different levels are placed in queues according to the priority of the alarms. The cache of the queue with high priority is smaller than the cache of the queue with low priority, and the number of alarms stored in the queue with high priority is smaller than that in the queue with low priority.
[0007] Preferably, data consistency is ensured between queues through locks or keywords.
[0008] Preferably, when the system is operating normally, the alarm information is processed in time-sharing according to the priority order of the queues, and each queue is polled in priority order through a timer or event trigger mechanism, and the polling frequency of a high priority queue is higher than that of a low priority queue.
[0009] Preferably, when entering the avalanche state, processing is performed in the order of queue priority.
[0010] Preferably, processing in order of queue priority includes: a) The queue with the highest priority performs consistent hash calculation on the ID corresponding to kks in the alarm. If the calculated key value is consistent with the node number of the current node, the alarm information is saved to the current node, otherwise the alarm information is discarded; b) When the high-priority queue is processed, it is processed in order. If the number of stored high-priority alarms does not exceed the avalanche value processed by the node, then repeat the steps in a, calculate the hash value of kks in the alarm, and store them by node; c) If the number of stored high-priority alarms exceeds the avalanche value processed by the node, the subsequent queues are not processed, and the alarm information in the queue is discarded or saved according to the preset strategy.
[0011] Preferably, each node synchronizes the alarm information stored locally during the avalanche state to other nodes using a distributed protocol, adds data integrity verification during the synchronization process to ensure that the transmitted data is accurate, considers the importance and timeliness of the data, and prioritizes synchronization of high-priority and important alarm information.
[0012] The alarm flow control system based on consistent hashing of alarm priorities includes: Setting module: used to start the alarm software, set the cache size of the alarm receiving area according to the memory size, and set the cache size of the network card; Display module: used to process alarm information in different time periods according to the priority order of the queue when the system is operating normally. Alarms with high priority are stored in the real-time database first and displayed on the screen. Processing module: used to set the avalanche value and calculate the number of alarms received per second. When the preset avalanche value is exceeded for 2 consecutive seconds, the avalanche state is entered by default. Recovery module: used to continuously calculate the number of alarms received per second. When it is lower than the preset avalanche value for 2 consecutive seconds, the avalanche state is exited by default. Data synchronization module: After exiting the avalanche state, each node synchronizes the alarm information stored locally during the avalanche state to other nodes.
[0013] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of an alarm flow control method based on consistent hashing of alarm priorities are implemented.
[0014] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of an alarm flow control method based on consistent hashing of alarm priorities.
[0015] Compared with the prior art, the present invention has the following beneficial effects: the present invention provides an alarm flow control method based on consistent hashing of alarm priority. First, the cache size is configured according to the actual physical memory size to ensure that the alarm software processes the alarm information as efficiently as possible without exhausting system resources. Then, priority is arranged. Priority processing of high-priority alarms can ensure that key security issues are responded to in a timely manner and reduce potential risks. The setting of avalanche values provides an early warning mechanism for the system, which can react in advance before the number of alarms surges, and automatically adjust the system status according to the real-time changes in the number of alarms to ensure that the processing capacity can be quickly restored after the system returns to normal. Finally, it ensures that all nodes can obtain complete alarm information and maintain data consistency. Through a series of optimization measures, the stability and reliability of the system in extreme situations are improved, high-priority alarms are processed first, and key security issues are ensured to be responded to and handled in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 The flowchart of the alarm flow control method based on consistent hashing of alarm priority of the present invention; Figure 2 This is a flow chart of an alarm flow control method based on consistent hashing of alarm priorities according to an embodiment of the present invention; Figure 3 The block diagram of the alarm flow control system based on consistent hashing of alarm priorities of the present invention; DETAILED DESCRIPTION In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0017] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0018] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0019] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.
[0020] like Figure 1 As shown, the present invention provides an alarm flow control method based on consistent hashing of alarm priorities, comprising: S101 starts the alarm software, sets the cache size of the alarm receiving area according to the memory size, and also sets the cache size of the network card; Optimize resource utilization: Configuring the cache size based on the actual physical memory size ensures that the alarm software processes alarm information as efficiently as possible without exhausting system resources.
[0021] Reduce data loss: Properly increasing the network card cache size can reduce data packet loss caused by network congestion and ensure the integrity of alarm information.
[0022] Improve response speed: The cache mechanism can reduce the time of directly processing network data and improve the speed of software response to alarms.
[0023] When the system is operating normally, S102 processes alarm information in different time periods according to the priority order of the queues. Alarms with high priority are stored in the real-time database first and displayed on the screen. Prioritized handling of high-priority alarms ensures that critical safety issues receive timely responses and reduces potential risks.
[0024] Improve user experience: High-priority alarms are displayed first on the monitoring screen, allowing operators to quickly focus on important information.
[0025] Reasonable allocation of resources: The time-sharing processing mechanism helps to balance the system load and avoid excessive concentration of resources on a single task.
[0026] S103 sets the avalanche value and calculates the number of alarms received per second. When the number exceeds the preset avalanche value for 2 consecutive seconds, the avalanche state is entered by default. Early warning mechanism: The setting of avalanche value provides an early warning mechanism for the system, which can respond in advance before the number of alarms surges.
[0027] Avoid overload: By entering the avalanche state in time, the alarm processing rate can be limited to prevent the system from crashing due to overload.
[0028] Data protection: In an avalanche state, the system can prioritize saving critical alarm information to reduce data loss.
[0029] S104 continuously calculates the number of alarms received per second. When the number is lower than the preset avalanche value for 2 consecutive seconds, the avalanche state is exited by default. Flexible recovery: Automatically adjust system status based on real-time changes in the number of alarms to ensure that processing capabilities can be quickly restored after the system returns to normal.
[0030] Effective use of resources: Avoid maintaining an avalanche state when the number of alarms has decreased, thereby wasting system resources.
[0031] After S105 exits the avalanche state, each node synchronizes the alarm information stored locally during the avalanche state to other nodes.
[0032] Data consistency: Ensure that all nodes can obtain complete alarm information and maintain data consistency.
[0033] Enhanced reliability: Through data synchronization between nodes, the system's fault tolerance and reliability are enhanced.
[0034] Easy to analyze: Complete alarm records facilitate subsequent problem analysis and system optimization.
[0035] Specific as Figure 2 As shown in the figure, in the thermal power unit under the distributed architecture, each host computer will run a real-time database to save real-time data (point data, alarm data) and to display the operating status of the unit in real time on the screen. The alarm data is generated by the host computer and the slave computer and sent to the alarm collection program of the host computer. The alarm collection program is stored in the local real-time database. Under abnormal conditions, when a large amount of alarm information is received instantly and exceeds the storage performance of the real-time database, it is necessary to process the received alarm information based on priority. The specific steps are as follows: 1 When the alarm software is started, the cache size of the alarm receiving area is set according to the memory size, and the cache size of the network card is set at the same time. The receiving cache area is set to 5 queues, and different levels of alarms are placed in the queues according to the alarm priority. The queue with high priority has a small cache and can store fewer alarms. The queue with low priority has a large cache and can store more alarms.
[0036] Optimize resource allocation: By setting different sizes of cache queues for alarms of different priorities, you can ensure that high-priority alarms get more processing resources and reduce processing delays caused by insufficient cache.
[0037] Improve processing efficiency: High-priority alarms can enter the processing flow more quickly, improving the response speed of emergency alarms.
[0038] Reduce data loss: Providing a relatively large buffer space for low-priority alarms helps reduce the risk of data loss when the system is busy.
[0039] Data consistency is ensured between queues through locks or keywords; In a multi-threaded or multi-process environment, synchronization mechanisms such as locks or keywords can effectively prevent data contention and inconsistency issues, ensuring data accuracy and reliability. Ensuring data consistency is the basis for stable system operation and helps reduce system crashes or anomalies caused by data errors.
[0040] 2 When the system is operating normally, the alarm information is processed in time-sharing according to the priority order of the queues. Alarms with high priority are stored in the real-time database first and displayed on the screen. Through the timer or event trigger mechanism, each queue is polled in order of priority. The polling frequency of the high-priority queue is higher than that of the low-priority queue.
[0041] By polling each queue in order of priority through a timer or event trigger mechanism, the system load can be balanced to prevent a single task from occupying too many resources. The polling frequency of high-priority queues is higher than that of low-priority queues to ensure that emergency alarms are handled in a timely manner. The time-sharing processing mechanism can flexibly adjust the processing strategy according to the actual situation of the system, thereby improving the adaptability and scalability of the system.
[0042] 3. Calculate the number of alarms received per second. When the number exceeds the preset avalanche value for 2 consecutive seconds, the avalanche state is entered by default.
[0043] In an avalanche state, prioritizing high-priority alarms can ensure that critical safety issues are responded to and handled in a timely manner. By limiting the processing of low-priority alarms, the system burden can be reduced and the system can be prevented from crashing due to overload.
[0044] 3 When entering the avalanche state, the alarm software of each host computer node processes it according to the order of queue priority.
[0045] a) The queue with the highest priority performs consistent hash calculation on the ID corresponding to kks in the alarm. If the calculated key value is consistent with the node number of the current node, the alarm information is saved to the current node, otherwise the alarm information is discarded. (The simplest way is to number the host computer nodes from 1 to n in sequence, perform modulo n calculation on the id corresponding to kks, and take the remainder of id%n. The alarm is stored in the corresponding node based on the calculated number.) b) When the high-priority queue is processed, it is processed in order. If the number of stored high-priority alarms does not exceed the avalanche value processed by the node, then repeat the steps in a, calculate the hash value of kks in the alarm, and store it by node.
[0046] c) If the number of stored high-priority alarms exceeds the avalanche value that the node can process, the subsequent queues will not be processed. The alarm information in the queue will be discarded or saved according to the preset strategy.
[0047] Alarm information is assigned to specific nodes through consistent hashing calculations, which enables precise control of alarm processing. Alarm information is reasonably distributed according to node processing capabilities and alarm priorities, which helps to achieve load balancing and ensures that only alarm information that meets specific conditions is saved to the node, thereby improving the validity and accuracy of the data.
[0048] 4 When the number of alarms received per second is lower than the preset avalanche value for 2 consecutive seconds, the avalanche state is exited by default.
[0049] 5 After exiting the avalanche state, each node synchronizes the alarm information saved locally during the avalanche state to other nodes, so that the alarm information during the avalanche period can be retained to the maximum extent without affecting the normal operation of the system.
[0050] Adding data integrity verification during the synchronization process can ensure that the transmitted data is accurate and avoid system problems caused by data errors. Synchronizing alarm information to other nodes through a distributed synchronization protocol improves the system's availability and fault tolerance. Prioritizing the synchronization of high-priority and important alarm information can ensure that critical information is processed and responded to in a timely manner.
[0051] like Figure 3 As shown, the present invention also provides an alarm flow control system based on consistent hashing of alarm priorities, comprising: Setting module: used to start the alarm software, set the cache size of the alarm receiving area according to the memory size, and set the cache size of the network card; Display module: used to process alarm information in different time periods according to the priority order of the queue when the system is operating normally. Alarms with high priority are stored in the real-time database first and displayed on the screen. Processing module: used to set the avalanche value and calculate the number of alarms received per second. When the preset avalanche value is exceeded for 2 consecutive seconds, the avalanche state is entered by default. Recovery module: used to continuously calculate the number of alarms received per second. When it is lower than the preset avalanche value for 2 consecutive seconds, the avalanche state is exited by default. Data synchronization module: After exiting the avalanche state, each node synchronizes the alarm information stored locally during the avalanche state to other nodes.
[0052] The specific settings of the network card cache size are: The receiving buffer area is set to 5 queues, and alarms of different levels are placed in queues according to the priority of the alarms. The cache of the queue with high priority is smaller than the cache of the queue with low priority, and the number of alarms stored in the queue with high priority is smaller than that in the queue with low priority.
[0053] Data consistency is ensured between queues through locks or keywords.
[0054] When the system is operating normally, the alarm information is processed in time-sharing according to the priority order of the queues. Through the timer or event trigger mechanism, each queue is polled in priority order. The polling frequency of the high-priority queue is higher than that of the low-priority queue.
[0055] When entering the avalanche state, processing is performed in the order of queue priority.
[0056] Processing in order of queue priority includes: a) The queue with the highest priority performs consistent hash calculation on the ID corresponding to kks in the alarm. If the calculated key value is consistent with the node number of the current node, the alarm information is saved to the current node, otherwise the alarm information is discarded; b) When the high-priority queue is processed, it is processed in order. If the number of stored high-priority alarms does not exceed the avalanche value processed by the node, then repeat the steps in a, calculate the hash value of kks in the alarm, and store them by node; c) If the number of stored high-priority alarms exceeds the avalanche value processed by the node, the subsequent queues are not processed, and the alarm information in the queue is discarded or saved according to the preset strategy.
[0057] Each node synchronizes the alarm information stored locally during the avalanche state to other nodes using the distributed Tongxi protocol. Data integrity verification is added during the synchronization process to ensure that the transmitted data is accurate. Considering the importance and timeliness of the data, high-priority and important alarm information is synchronized first.
[0058] A terminal device is provided in one embodiment of the present invention. The terminal device of this embodiment includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0059] The computer program may be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to accomplish the present invention.
[0060] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0061] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0062] The memory may be used to store the computer programs and / or modules, and the processor implements various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory.
[0063] If the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0064] Although the embodiments of the present invention are described above in conjunction with the accompanying drawings, the present invention is not limited to the above-mentioned specific embodiments and application fields, and the above-mentioned specific embodiments are only illustrative and instructive, rather than restrictive. Under the guidance of the specification, a person skilled in the art can also make many forms without departing from the scope of protection of the claims of the present invention, all of which belong to the scope of protection of the present invention.
Claims
1. An alarm flow control method based on consistent hashing of alarm priorities, characterized in that: include: Start the alarm software, set the cache size of the alarm receiving area according to the memory size, and also set the cache size of the network card; When the system is operating normally, the alarm information is processed in different time periods according to the priority order of the queue. Alarms with high priority are stored in the real-time database first and displayed on the screen. Set the avalanche value and calculate the number of alarms received per second. When the preset avalanche value is exceeded for 2 consecutive seconds, the avalanche state is entered by default. The number of alarms received per second is continuously calculated. When it is lower than the preset avalanche value for 2 consecutive seconds, the avalanche state is exited by default. After exiting the avalanche state, each node synchronizes the alarm information stored locally during the avalanche state to other nodes.
2. The alarm flow control method based on consistent hashing of alarm priorities according to claim 1 is characterized in that: The specific settings of the network card cache size are: The receiving buffer area is set to 5 queues, and alarms of different levels are placed in queues according to the priority of the alarms. The cache of the queue with high priority is smaller than the cache of the queue with low priority, and the number of alarms stored in the queue with high priority is smaller than that in the queue with low priority.
3. The alarm flow control method based on consistent hashing of alarm priorities according to claim 1 is characterized in that: Data consistency is ensured between queues through locks or keywords.
4. The alarm flow control method based on consistent hashing of alarm priorities according to claim 1 is characterized in that: When the system is operating normally, the alarm information is processed in time-sharing according to the priority order of the queues. Through the timer or event trigger mechanism, each queue is polled in priority order. The polling frequency of the high-priority queue is higher than that of the low-priority queue.
5. The alarm flow control method based on consistent hashing of alarm priorities according to claim 1 is characterized in that: When entering the avalanche state, processing is performed in the order of queue priority.
6. The alarm flow control method based on consistent hashing of alarm priorities according to claim 5 is characterized in that: Processing in order of queue priority includes: a) The queue with the highest priority performs consistent hash calculation on the ID corresponding to kks in the alarm. If the calculated key value is consistent with the node number of the current node, the alarm information is saved to the current node, otherwise the alarm information is discarded; b) When the high-priority queue is processed, it is processed in order. If the number of stored high-priority alarms does not exceed the avalanche value processed by the node, then repeat the steps in a, calculate the hash value of kks in the alarm, and store them by node; c) If the number of stored high-priority alarms exceeds the avalanche value processed by the node, the subsequent queues are not processed, and the alarm information in the queue is discarded or saved according to the preset strategy.
7. The alarm flow control method based on consistent hashing of alarm priorities according to claim 1 is characterized in that: Each node synchronizes the alarm information stored locally during the avalanche state to other nodes using the distributed Tongxi protocol. Data integrity verification is added during the synchronization process to ensure that the transmitted data is accurate. Considering the importance and timeliness of the data, high-priority and important alarm information is synchronized first.
8. The alarm flow control system based on consistent hashing of alarm priorities is characterized by: include: Setting module: used to start the alarm software, set the cache size of the alarm receiving area according to the memory size, and set the cache size of the network card; Display module: used to process alarm information in different time periods according to the priority order of the queue when the system is operating normally. Alarms with high priority are stored in the real-time database first and displayed on the screen. Processing module: used to set the avalanche value and calculate the number of alarms received per second. When the preset avalanche value is exceeded for 2 consecutive seconds, the avalanche state is entered by default. Recovery module: used to continuously calculate the number of alarms received per second. When it is lower than the preset avalanche value for 2 consecutive seconds, the avalanche state is exited by default. Data synchronization module: After exiting the avalanche state, each node synchronizes the alarm information stored locally during the avalanche state to other nodes.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the alarm flow control method based on consistent hashing of alarm priorities as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the alarm flow control method based on consistent hashing of alarm priorities as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Power dispatching alarm real-time processing method and processing system
CN122313654A
A power dispatching alarm real-time processing method and processing system
CN122313654B