CN114827168A - Alarm aggregation reporting method and device, computer equipment and storage medium - Google Patents

Alarm aggregation reporting method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114827168A
CN114827168A CN202210492860.6A CN202210492860A CN114827168A CN 114827168 A CN114827168 A CN 114827168A CN 202210492860 A CN202210492860 A CN 202210492860A CN 114827168 A CN114827168 A CN 114827168A
Authority
CN
China
Prior art keywords
alarm
time
preset
aggregation
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210492860.6A
Other languages
Chinese (zh)
Inventor
文刚
吴剑
郭亿清
方平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinteng Technology Information Shenzhen Co ltd
Original Assignee
Jinteng Technology Information Shenzhen Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinteng Technology Information Shenzhen Co ltd filed Critical Jinteng Technology Information Shenzhen Co ltd
Priority to CN202210492860.6A priority Critical patent/CN114827168A/en
Publication of CN114827168A publication Critical patent/CN114827168A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1051Group master selection mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0604Management of faults, events, alarms or notifications using filtering, e.g. reduction of information by using priority, element types, position or time
    • H04L41/0622Management of faults, events, alarms or notifications using filtering, e.g. reduction of information by using priority, element types, position or time based on time

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the invention discloses an alarm aggregation reporting method, an alarm aggregation reporting device, computer equipment and a storage medium. The application relates to the technical field of alarming, which comprises: regularly inquiring whether a preset database has a main node or not; if the main node does not exist in the preset database, selecting one slave node from the plurality of slave nodes through an optimistic lock mechanism of the preset database as the main node, and setting the effective lease time of the main node as preset lease time; regularly inquiring whether the host node meets a renewal condition; if the main node meets the lease renewal condition, acquiring the current time, and resetting the effective lease time according to the current time and the preset lease time; if the main node receives the alarm information within the effective lease time, the alarm information is aggregated within the preset alarm aggregation time according to the alarm strategy to obtain aggregated information, and the aggregated information is reported to related personnel. The embodiment of the application can reduce the alarm frequency and improve the overall effectiveness of the alarm.

Description

Alarm aggregation reporting method and device, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of alarm, in particular to an alarm aggregation reporting method, an alarm aggregation reporting device, computer equipment and a storage medium.
Background
With the development of the internet technology, the micro service architecture gradually becomes the mainstream of the internet architecture, and correspondingly, the alarm service architecture adapted to the micro service architecture also continuously evolves, the alarm service in the prior art has the main problem of alarm flooding, which means that massive alarms are generated in a short time, and on one hand, the alarm flooding can cause that serious alarms can be submerged by common alarms, so that operation and maintenance personnel cannot find faults; on the other hand, the cost for sending massive alarm information is increased, so that the overall effectiveness of the alarm is reduced.
Disclosure of Invention
The embodiment of the invention provides an alarm aggregation reporting method, an alarm aggregation reporting device, computer equipment and a storage medium, and aims to solve the problem of low overall effectiveness of the existing alarm.
In a first aspect, an embodiment of the present invention provides an alarm aggregation reporting method, which includes:
regularly inquiring whether a preset database has a main node or not;
if the master node does not exist in the preset database, selecting one slave node from a plurality of slave nodes as the master node through an optimistic lock mechanism of the preset database, and setting the effective lease time of the master node as preset lease time;
if the main node exists in the preset database, regularly inquiring whether the main node meets a renewal condition;
if the main node meets the lease renewal condition, acquiring the current time, and resetting the effective lease time according to the current time and the preset lease time;
and if the main node receives the alarm information within the effective lease time, aggregating the alarm information within preset alarm aggregation time according to an alarm strategy to obtain aggregated information, and reporting the aggregated information to related personnel.
In a second aspect, an embodiment of the present invention further provides an alarm aggregation reporting apparatus, including:
the first query unit is used for regularly querying whether a main node exists in a preset database;
a selecting unit, configured to select one slave node from multiple slave nodes as the master node through an optimistic lock mechanism of the preset database if the master node does not exist in the preset database, and set an effective lease time of the master node as a preset lease time;
the second query unit is used for regularly querying whether the main node meets a lease renewal condition or not if the main node exists in the preset database;
the setting unit is used for acquiring the current time if the main node meets the lease renewal condition and resetting the effective lease time according to the current time and the preset lease time;
and the aggregation reporting unit is used for aggregating the alarm information according to an alarm strategy within preset alarm aggregation time to obtain aggregated information if the main node receives the alarm information within the effective lease time, and reporting the aggregated information to related personnel.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the above method when executing the computer program.
In a fourth aspect, the present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program can implement the above method when being executed by a processor.
The embodiment of the invention provides an alarm aggregation reporting method, an alarm aggregation reporting device, computer equipment and a storage medium. Wherein the method comprises the following steps: regularly inquiring whether a preset database has a main node or not; if the master node does not exist in the preset database, selecting one slave node from a plurality of slave nodes as the master node through an optimistic lock mechanism of the preset database, and setting the effective lease time of the master node as preset lease time; if the main node exists in the preset database, regularly inquiring whether the main node meets a renewal condition; if the main node meets the lease renewal condition, acquiring the current time, and resetting the effective lease time according to the current time and the preset lease time; and if the main node receives the alarm information within the effective lease time, aggregating the alarm information within preset alarm aggregation time according to an alarm strategy to obtain aggregated information, and reporting the aggregated information to related personnel. According to the technical scheme of the embodiment of the invention, a slave node is selected from a plurality of nodes as a master node, and effective lease time is set for the master node; and then the received alarm information is aggregated by an alarm strategy within the effective lease time of the main node, so that the alarm times can be reduced, and the overall effectiveness of the alarm is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of an alarm aggregation reporting method according to an embodiment of the present invention;
fig. 2 is a schematic block diagram of an alarm aggregation reporting apparatus according to an embodiment of the present invention; and
fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Referring to fig. 1, fig. 1 is a flow chart illustrating an alarm aggregation reporting method according to an embodiment of the present invention. The alarm aggregation reporting method of the embodiment of the invention can be applied to terminals, such as intelligent terminal equipment like smart phones, portable computers, desktop computers, notebook computers and the like, and is realized by software installed on the server, so that the alarm times are reduced, and the overall effectiveness of the alarm is improved. The alarm aggregation reporting method is explained in detail below. As shown in fig. 1, the method includes the following steps S100-S140.
S100, regularly inquiring whether a main node exists in a preset database.
In the embodiment of the present invention, before aggregating the alarm information to obtain aggregated information and reporting the aggregated information, it is necessary to periodically query whether a master node exists in a preset database, where the preset database is a TDSQL database. It should be noted that, in the embodiment of the present invention, it is queried whether a master node exists in the TDSQL database, that is, whether the number of the master nodes is 0 or whether the lease of the master node expires.
And S110, if the master node does not exist in the preset database, selecting one slave node from the plurality of slave nodes as the master node through an optimistic lock mechanism of the preset database, and setting the effective lease time of the master node as preset lease time.
In the embodiment of the present invention, if the master node does not exist in the preset database, which indicates that the number of the master nodes is 0 or the lease of the master node has expired, a slave node is selected from the plurality of slave nodes as the master node through an optimistic lock mechanism of the TDSQL database. Specifically, if the master node does not exist in the TDSQL database, each slave node sends the IP address and the port information to the TDSQL database to register in the TDSQL database, and the TDSQL database allows only one slave node to register successfully through an optimistic lock mechanism and notifies whether the slave node has registered successfully through a return value. Understandably, in practical application, if the return value received by the slave node is Master, which indicates that the slave node is successfully registered, the slave node is taken as the Master node; and if the return value received by the Slave node is Slave, indicating that the Slave node is registered and identified, continuing to serve as the Slave node. After one slave node is selected from the plurality of slave nodes to serve as the master node, the valid lease time of the master node is required to be set as a preset lease time, wherein the preset lease time is 60 s.
It should be noted that, in the embodiment of the present invention, after the valid lease time is set for the master node, the plurality of slave nodes also periodically query whether the lease time of the master node exceeds the preset lease time; and if the lease of the main node exceeds the preset lease time and indicates that the main node does not exist in the preset database, returning to the step of executing the step of regularly inquiring whether the main node exists in the preset database or not so as to reselect a new main node.
And S120, if the main node exists in the preset database, regularly inquiring whether the main node meets a renewal condition.
In the embodiment of the present invention, if the main nodes exist in the preset database, it is indicated that the number of the main nodes is not 0 and the lease of the main nodes is not expired, then regularly querying whether the main nodes meet a lease renewal condition, where the lease renewal condition is that an effective lease time of the main nodes is less than a preset lease renewal time threshold. It should be noted that, in the embodiment of the present invention, the value of the preset lease renewal time threshold is related to the timed query lease renewal time, for example, if the timed query lease renewal time is 10s, the preset lease renewal time needs to be set to be greater than 10s, that is, it needs to be ensured that the lease of the host node is renewed before the lease of the host node expires.
S130, if the main node meets the lease renewal condition, acquiring the current time, and resetting the effective lease time according to the current time and the preset lease time.
In the embodiment of the present invention, if the master node meets the lease renewal condition, the current time is obtained, and the valid lease time of the master node is obtained by adding the preset lease time to the current time. Specifically, for example, if the current time is 12 minutes at 12 hours at 1 st at 4 months and 1 st at 2022 years, and the preset rental time is 60s, that is, 1 minute, the preset rental time is 13 minutes at 12 hours at 1 st at 4 months and 1 st at 2022 years.
And S140, if the main node receives the alarm information within the effective lease time, aggregating the alarm information within preset alarm aggregation time according to an alarm strategy to obtain aggregated information, and reporting the aggregated information to related personnel.
In the embodiment of the present invention, if the master node receives the alarm information within the effective lease time, the master node identifies the alarm policy according to a preset policy identifier, and understandably, the master node may receive the alarm information sent by the slave node or may directly receive the alarm information sent by the service; if the alarm strategy is a first alarm strategy, aggregating the alarm information according to the first alarm strategy within preset alarm aggregation time to obtain aggregated information, wherein the preset alarm aggregation time is 60s, and the first alarm strategy is a default alarm strategy; if the alarm strategy is a second alarm strategy, aggregating the alarm information according to the second alarm strategy within preset alarm aggregation time to obtain the aggregated information, wherein the second alarm strategy is a threshold alarm strategy, and the second alarm strategy is suitable for alarm scenes with low alarm emergency degree and needing to continuously pay attention to the alarm information within a period of time; and if the alarm strategy is a third alarm strategy, aggregating the alarm information according to the third alarm strategy within preset alarm aggregation time to obtain the aggregated information, wherein the third alarm strategy is a multiple alarm strategy which is suitable for application scenes with moderate alarm emergency degree. It should be noted that, in the embodiment of the present invention, the aggregation information reports information such as the number of times of alarm, the last alarm time, and the reason of alarm.
Further, the first alarm policy specifically is to determine whether the alarm information is received for the first time; if the alarm information is received for the first time, the time when the alarm information is received is taken as the time for starting alarm, for example, 30 minutes at 12 days 1, 4 months, 1 and 2022 years, and the alarm frequency is set to 1; if the alarm information is not received for the first time and is within the preset alarm aggregation time, updating the alarm times, and comparing the alarm times with a first alarm time threshold value, wherein the first alarm time threshold value N1 is 5; if the alarm frequency is not greater than the first alarm frequency threshold value, reporting the received alarm information to the related personnel; on the contrary, if the alarm times are greater than the first alarm time threshold, the received alarm information is stored, that is, the alarm information corresponding to the alarm times greater than the first alarm time threshold is stored in a time period from 30 minutes at 12 days 1/4/2022 to 31 minutes at 12 days 1/4/2022; after the preset alarm aggregation time 60s is reached, the time after the preset alarm aggregation time from the alarm starting time is taken as the alarm ending time, for example, 12 hours and 31 minutes at 4 months and 1 day at 2022 years, and calculates a difference between the alarm ending time and the last alarm information time within the preset alarm aggregation time to obtain a time difference, if the time difference is assumed to be 10s, the preset time threshold is 20s, when said time difference 10s is less than a preset time threshold 20s, indicating that the alarm is still continuing, reassigning the preset alarm aggregation time to 120s, and storing the received alarm information starting from the alarm ending time and within the preset alarm aggregation time period, the alarm information received in the time period from 31 points at 12 times at 4 months and 1 day 2022 to 32 points at 12 times at 4 months and 1 day 2022 is stored; taking the alarm ending time as the alarm starting time, and returning to execute the preset alarm aggregation time, and taking the time after the preset alarm aggregation time is elapsed from the alarm starting time as the alarm ending time; and circularly executing until the time difference is not less than the preset time threshold, for example, the time difference is 25s greater than the preset time threshold 20s, aggregating all the alarm information which is not reported to obtain aggregated information, and reporting the aggregated information to related personnel. Understandably, the second alarm policy needs to report N1 plus 1 alarm.
Further, the second alarm strategy specifically includes counting the number of times of receiving the alarm information within a preset alarm aggregation time to obtain a total alarm number of times; and if the total alarm frequency is greater than a second alarm frequency threshold value, aggregating the alarm information to obtain the aggregated information, wherein the second alarm frequency threshold value is 5, and reporting the aggregated information to related personnel. Understandably, the second alarm strategy only needs to report one alarm.
Further, the third alarm strategy is specifically to count the alarm times from the time of receiving the alarm information for the first time within a preset alarm aggregation time; if the alarm frequency is a multiple of a third alarm frequency threshold, where the third alarm frequency threshold is 10, specifically, when the alarm frequency is 10, since 10 is a multiple of the third alarm frequency threshold 10, aggregating the alarm information between 1 st time and 10 th time, and reporting the aggregated information to related personnel, and so on, and when the alarm frequency is 20, reporting the alarm information between 11 th time and 20 th time, and reporting the aggregated information to related personnel. Understandably, if it is assumed that the alarm times are 22 times in total within the preset alarm aggregation time, the alarm information of 21 st and 22 nd times will not be uploaded, and the third alarm policy only needs to report 2 times of alarms, that is, uploads times of alarms of a multiple of the third alert threshold.
Fig. 2 is a schematic block diagram of an alarm aggregation reporting apparatus 200 according to an embodiment of the present invention. As shown in fig. 2, the present invention further provides an alarm aggregation reporting apparatus 200 corresponding to the above alarm aggregation reporting method. The alarm aggregation reporting apparatus 200 includes a unit for executing the alarm aggregation reporting method, and the apparatus may be configured in a server. Specifically, referring to fig. 2, the alarm aggregation reporting apparatus 200 includes a first querying unit 201, a selecting unit 202, a second querying unit 203, a setting unit 204, and an aggregation reporting unit 205.
The first query unit 201 is configured to query whether a master node exists in a preset database at regular time; the selecting unit 202 is configured to select one slave node from the multiple slave nodes as the master node through an optimistic lock mechanism of the preset database if the master node does not exist in the preset database, and set an effective lease time of the master node as a preset lease time; the second query unit 203 is configured to query whether the master node meets a lease renewal condition at regular time if the master node exists in the preset database; the setting unit 204 is configured to obtain a current time if the master node meets the lease renewal condition, and reset the effective lease time according to the current time and the preset lease time; the aggregation reporting unit 205 is configured to, if the master node receives the alarm information within the valid lease time, aggregate the alarm information within a preset alarm aggregation time according to an alarm policy to obtain aggregated information, and report the aggregated information to related personnel.
In some embodiments, for example, in this embodiment, the aggregation reporting unit 205 includes an identification unit 2051, a first aggregation unit 2052, a second aggregation unit 2053, and a third aggregation unit 2054.
The identification unit 2051 is configured to identify an alarm policy according to a preset policy identifier; the first aggregating unit 2052 is configured to aggregate the alarm information according to the first alarm policy within a preset alarm aggregation time to obtain aggregated information if the alarm policy is a first alarm policy; the second aggregating unit 2053 is configured to aggregate the alarm information according to the second alarm policy within a preset alarm aggregation time if the alarm policy is the second alarm policy, so as to obtain the aggregated information; the third aggregation unit 2054 is configured to, if the alarm policy is a third alarm policy, aggregate the alarm information according to the third alarm policy within preset alarm aggregation time to obtain the aggregated information.
In some embodiments, for example, in this embodiment, the first aggregating unit 2052 includes a determining unit 20521, a setting sub-unit 20522, an updating unit 20523, a reporting unit 20524, a first saving unit 20525, a first calculating unit 20526, a second saving unit 20527, a return executing unit 20528, and a first aggregating sub-unit 20529.
The judging unit 20521 is configured to judge whether the alarm information is received for the first time; the setting subunit 20522 is configured to, if the alarm information is received for the first time, take the time when the alarm information is received as the time for starting alarm, and set the alarm frequency to 1; the updating unit 20523 is configured to update the alarm times if the alarm information is not received for the first time and is within a preset alarm aggregation time, and compare the alarm times with a first alarm time threshold; the reporting unit 20524 is configured to report the received alarm information to the relevant person if the alarm frequency is not greater than the first alarm frequency threshold; the first saving unit 20525 is configured to save the received alarm information if the alarm frequency is greater than the first alarm frequency threshold; the calculating unit 20526 is configured to, after the preset alarm aggregation time is reached, take a time after the preset alarm aggregation time elapses from the alarm start time as an alarm end time, and calculate a difference between the alarm end time and the last alarm information time within the preset alarm aggregation time to obtain a time difference; the second saving unit 20527 is configured to reassign the preset alarm aggregation time if the time difference is smaller than a preset time threshold, and save the received alarm information starting from the alarm end time and within the preset alarm aggregation time period; the return execution unit 20528 is configured to use the alarm ending time as the starting alarm time, and return to a step of using the time after the preset alarm aggregation time elapses from the starting alarm time as the alarm ending time after the preset alarm aggregation time is executed; the first aggregating subunit 20529 is configured to aggregate all the alarm information that is not reported to obtain aggregated information, if the time difference is not smaller than the preset time threshold.
In some embodiments, such as the present embodiment, the second aggregation unit 2053 includes a second calculation unit 20531 and a second aggregation sub-unit 20532.
The second computing unit 20531 is configured to count the number of times of receiving the alarm information within a preset alarm aggregation time to obtain a total number of alarms; the second aggregation sub-unit 20532 is configured to aggregate the alarm information to obtain the aggregated information if the total number of alarms is greater than a second alarm number threshold.
In some embodiments, such as the present embodiment, the third aggregation unit 2054 includes a third computation unit 20541 and a third aggregation sub-unit 20542.
The third computing unit 20541 is configured to count the number of alarms from the time when the alarm information is received for the first time within a preset alarm aggregation time; the third aggregating subunit 20542 is configured to aggregate the alarm information to obtain the aggregated information if the alarm frequency is a multiple of a third alarm frequency threshold.
In some embodiments, for example, in this embodiment, the alarm aggregation reporting device 200 further includes a third query unit 206 and a return unit 207.
The third querying unit 206 is configured to query whether the lease of the master node exceeds the preset lease time at regular time; the returning unit 207 is configured to return to execute the step of periodically querying whether the master node exists in the preset database if the lease of the master node exceeds the preset lease time.
The specific implementation manner of the alarm aggregation reporting device 200 of the embodiment of the present invention corresponds to the alarm aggregation reporting method described above, and is not described herein again.
The alarm aggregation reporting apparatus may be implemented in the form of a computer program, where the computer program may be run on a computer device shown in fig. 3.
Referring to fig. 3, fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 300 is a server, and specifically, the server may be an independent server, or may also be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), and a big data and artificial intelligence platform.
Referring to fig. 3, the computer device 300 includes a processor 302, a memory, which may include a storage medium 303 and an internal memory 304, and a network interface 305 connected by a system bus 301.
The storage medium 303 may store an operating system 3031 and computer programs 3032. The computer program 3032, when executed, causes the processor 302 to perform an alarm aggregation reporting method.
The processor 302 is used to provide computing and control capabilities to support the operation of the overall computer device 300.
The internal memory 304 provides an environment for the running of the computer program 3032 in the storage medium 303, and when the computer program 3032 is executed by the processor 302, the processor 302 may execute a method for reporting an alarm aggregation.
The network interface 305 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 3 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation of the computer apparatus 300 to which the present application is applied, and that a particular computer apparatus 300 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 302 is configured to run a computer program 3032 stored in the memory to implement the following steps: regularly inquiring whether a preset database has a main node or not; if the master node does not exist in the preset database, selecting one slave node from a plurality of slave nodes as the master node through an optimistic lock mechanism of the preset database, and setting the effective lease time of the master node as preset lease time; if the main node exists in the preset database, regularly inquiring whether the main node meets a renewal condition; if the main node meets the lease renewal condition, acquiring the current time, and resetting the effective lease time according to the current time and the preset lease time; and if the main node receives the alarm information within the effective lease time, aggregating the alarm information within preset alarm aggregation time according to an alarm strategy to obtain aggregated information, and reporting the aggregated information to related personnel.
In some embodiments, for example, in this embodiment, when implementing the step of aggregating the alarm information according to the alarm policy within the preset alarm aggregation time to obtain the aggregated information, the processor 302 specifically implements the following steps: identifying an alarm strategy according to a preset strategy identifier; if the alarm strategy is a first alarm strategy, aggregating the alarm information according to the first alarm strategy within preset alarm aggregation time to obtain aggregated information; if the alarm strategy is a second alarm strategy, aggregating the alarm information according to the second alarm strategy within preset alarm aggregation time to obtain the aggregated information; and if the alarm strategy is a third alarm strategy, aggregating the alarm information according to the third alarm strategy within preset alarm aggregation time to obtain the aggregated information.
In some embodiments, for example, in this embodiment, when the processor 302 implements the step of aggregating the alarm information according to the first alarm policy within the preset alarm aggregation time to obtain the aggregated information, the following steps are specifically implemented: judging whether the alarm information is received for the first time; if the alarm information is received for the first time, the time of receiving the alarm information is used as the time of starting alarm, and the alarm frequency is set to be 1; if the alarm information is not received for the first time and is within the preset alarm aggregation time, updating the alarm times, and comparing the alarm times with a first alarm time threshold value; if the alarm frequency is not greater than the first alarm frequency threshold value, reporting the received alarm information to the related personnel; if the alarm times are larger than the first alarm time threshold value, storing the received alarm information; after the preset alarm aggregation time is reached, taking the time after the preset alarm aggregation time from the alarm starting time as alarm ending time, and calculating the difference between the alarm ending time and the last alarm information time in the preset alarm aggregation time to obtain a time difference; if the time difference is smaller than a preset time threshold, re-assigning the preset alarm aggregation time, and storing the received alarm information starting from the alarm ending time and within the preset alarm aggregation time period; taking the alarm ending time as the alarm starting time, and returning to the step of taking the time after the preset alarm aggregation time is up, and taking the time after the preset alarm aggregation time from the alarm starting time as the alarm ending time; and if the time difference is not smaller than the preset time threshold, aggregating all the alarm information which is not reported to obtain aggregated information.
In some embodiments, for example, in this embodiment, when the processor 302 implements the step of aggregating the alarm information according to the second alarm policy within the preset alarm aggregation time to obtain the aggregated information, the following steps are specifically implemented: counting the times of the received alarm information within preset alarm aggregation time to obtain total alarm times; and if the total alarm times are larger than a second alarm time threshold, aggregating the alarm information to obtain the aggregated information.
In some embodiments, for example, in this embodiment, when the processor 302 implements the step of aggregating the alarm information according to the third alarm policy within the preset alarm aggregation time to obtain the aggregated information, the following steps are specifically implemented: counting the alarm times from the time of receiving the alarm information for the first time within the preset alarm aggregation time; and if the alarm times are multiples of a third alarm time threshold, aggregating the alarm information to obtain the aggregated information.
In some embodiments, for example, in this embodiment, after implementing the step of selecting one slave node from the plurality of slave nodes as the master node through an optimistic lock mechanism of the preset database if the master node does not exist in the preset database, and setting the valid lease time of the master node as the preset lease time, the processor 302 further specifically implements the following steps: regularly inquiring whether the lease time of the main node exceeds the preset lease time; and if the lease of the main node exceeds the preset lease time, returning to the step of executing the step of regularly inquiring whether the main node exists in the preset database.
It should be understood that, in the embodiment of the present Application, the Processor 302 may be a Central Processing Unit (CPU), and the Processor 302 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiment of the alarm aggregation reporting method.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, which can store various computer readable storage media.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, while the invention has been described with respect to the above-described embodiments, it will be understood that the invention is not limited thereto but may be embodied with various modifications and changes.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. An alarm aggregation reporting method is characterized by comprising the following steps:
regularly inquiring whether a preset database has a main node or not;
if the master node does not exist in the preset database, selecting one slave node from a plurality of slave nodes as the master node through an optimistic lock mechanism of the preset database, and setting the effective lease time of the master node as preset lease time;
if the main node exists in the preset database, regularly inquiring whether the main node meets a renewal condition;
if the main node meets the lease renewal condition, acquiring the current time, and resetting the effective lease time according to the current time and the preset lease time;
and if the main node receives the alarm information within the effective lease time, aggregating the alarm information within preset alarm aggregation time according to an alarm strategy to obtain aggregated information, and reporting the aggregated information to related personnel.
2. The alarm aggregation reporting method of claim 1, wherein aggregating the alarm information according to an alarm policy within a preset alarm aggregation time to obtain aggregated information comprises:
identifying an alarm strategy according to a preset strategy identifier;
if the alarm strategy is a first alarm strategy, aggregating the alarm information according to the first alarm strategy within preset alarm aggregation time to obtain aggregated information;
if the alarm strategy is a second alarm strategy, aggregating the alarm information according to the second alarm strategy within preset alarm aggregation time to obtain the aggregated information;
and if the alarm strategy is a third alarm strategy, aggregating the alarm information according to the third alarm strategy within preset alarm aggregation time to obtain the aggregated information.
3. The alarm aggregation reporting method according to claim 2, wherein aggregating the alarm information according to the first alarm policy within a preset alarm aggregation time to obtain aggregated information comprises:
judging whether the alarm information is received for the first time;
if the alarm information is received for the first time, the time of receiving the alarm information is used as the time of starting alarm, and the alarm frequency is set to be 1;
if the alarm information is not received for the first time and is within the preset alarm aggregation time, updating the alarm times, and comparing the alarm times with a first alarm time threshold value;
if the alarm frequency is not greater than the first alarm frequency threshold value, reporting the received alarm information to the related personnel;
if the alarm times are larger than the first alarm time threshold, storing the received alarm information;
after the preset alarm aggregation time is reached, taking the time after the preset alarm aggregation time from the alarm starting time as alarm ending time, and calculating the difference between the alarm ending time and the last alarm information time in the preset alarm aggregation time to obtain a time difference;
and aggregating all the alarm information which is not reported according to the time difference, the alarm ending time, the preset alarm aggregation time and a preset time threshold to obtain aggregated information.
4. The alarm aggregation reporting method of claim 3, wherein the aggregating all the alarm information that is not reported according to the time difference, the alarm ending time, the preset alarm aggregation time, and a preset time threshold to obtain aggregated information comprises:
if the time difference value is smaller than a preset time threshold value, carrying out reassignment on the preset alarm aggregation time, and storing the received alarm information which starts from the alarm ending time and is in the preset alarm aggregation time period;
taking the alarm ending time as the alarm starting time, and returning to execute the preset alarm aggregation time, and taking the time after the preset alarm aggregation time is elapsed from the alarm starting time as the alarm ending time;
and if the time difference is not smaller than the preset time threshold, aggregating all the alarm information which is not reported to obtain aggregated information.
5. The alarm aggregation reporting method according to claim 2, wherein aggregating the alarm information according to the second alarm policy within a preset alarm aggregation time to obtain the aggregated information comprises:
counting the times of the received alarm information within preset alarm aggregation time to obtain total alarm times;
and if the total alarm times is greater than a second alarm time threshold value, aggregating the alarm information to obtain the aggregated information.
6. The alarm aggregation reporting method according to claim 2, wherein aggregating the alarm information according to the third alarm policy within a preset alarm aggregation time to obtain the aggregated information comprises:
counting the alarm times from the time of receiving the alarm information for the first time within the preset alarm aggregation time;
and if the alarm times are multiples of a third alarm time threshold, aggregating the alarm information to obtain the aggregated information.
7. The alarm aggregation reporting method according to claim 1, wherein, after the step of selecting one slave node from the plurality of slave nodes as the master node through an optimistic lock mechanism of the preset database and setting the valid lease time of the master node as the preset lease time if the master node does not exist in the preset database, the method further comprises:
regularly inquiring whether the lease time of the main node exceeds the preset lease time;
and if the lease of the main node exceeds the preset lease time, returning to the step of executing the step of regularly inquiring whether the main node exists in the preset database.
8. An alarm aggregation reporting device, comprising:
the first query unit is used for regularly querying whether a main node exists in a preset database;
a selecting unit, configured to select one slave node from multiple slave nodes as the master node through an optimistic lock mechanism of the preset database if the master node does not exist in the preset database, and set an effective lease time of the master node as a preset lease time;
the second query unit is used for regularly querying whether the main node meets a lease renewal condition or not if the main node exists in the preset database;
the setting unit is used for acquiring the current time if the main node meets the lease renewal condition and resetting the effective lease time according to the current time and the preset lease time;
and the aggregation reporting unit is used for aggregating the alarm information according to an alarm strategy within preset alarm aggregation time to obtain aggregated information if the main node receives the alarm information within the effective lease time, and reporting the aggregated information to related personnel.
9. A computer device, characterized in that the computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the alarm aggregation reporting method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program, which when executed by a processor, implements the alarm aggregation reporting method according to any one of claims 1 to 7.
CN202210492860.6A 2022-05-07 2022-05-07 Alarm aggregation reporting method and device, computer equipment and storage medium Pending CN114827168A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210492860.6A CN114827168A (en) 2022-05-07 2022-05-07 Alarm aggregation reporting method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210492860.6A CN114827168A (en) 2022-05-07 2022-05-07 Alarm aggregation reporting method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114827168A true CN114827168A (en) 2022-07-29

Family

ID=82511809

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210492860.6A Pending CN114827168A (en) 2022-05-07 2022-05-07 Alarm aggregation reporting method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114827168A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115190002A (en) * 2022-09-13 2022-10-14 北京六方云信息技术有限公司 Alarm processing method, device, terminal equipment and storage medium
CN115664938A (en) * 2022-12-26 2023-01-31 北京天维信通科技有限公司 Nonlinear statistical alarm method and device based on IRC platform and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101951621A (en) * 2010-09-16 2011-01-19 新邮通信设备有限公司 Alarm storm prevention and control method and device
US20140081925A1 (en) * 2012-09-19 2014-03-20 Tilmann Haeberle Managing Incident Reports
CN105871581A (en) * 2015-11-13 2016-08-17 乐视云计算有限公司 Method and device for processing of alarm information in cloud calculation
US9984140B1 (en) * 2015-02-05 2018-05-29 Amazon Technologies, Inc. Lease based leader election system
CN113297236A (en) * 2020-11-10 2021-08-24 阿里巴巴集团控股有限公司 Method, device and system for electing main node in distributed consistency system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101951621A (en) * 2010-09-16 2011-01-19 新邮通信设备有限公司 Alarm storm prevention and control method and device
US20140081925A1 (en) * 2012-09-19 2014-03-20 Tilmann Haeberle Managing Incident Reports
US9984140B1 (en) * 2015-02-05 2018-05-29 Amazon Technologies, Inc. Lease based leader election system
CN105871581A (en) * 2015-11-13 2016-08-17 乐视云计算有限公司 Method and device for processing of alarm information in cloud calculation
CN113297236A (en) * 2020-11-10 2021-08-24 阿里巴巴集团控股有限公司 Method, device and system for electing main node in distributed consistency system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115190002A (en) * 2022-09-13 2022-10-14 北京六方云信息技术有限公司 Alarm processing method, device, terminal equipment and storage medium
CN115190002B (en) * 2022-09-13 2022-11-22 北京六方云信息技术有限公司 Alarm processing method, device, terminal equipment and storage medium
CN115664938A (en) * 2022-12-26 2023-01-31 北京天维信通科技有限公司 Nonlinear statistical alarm method and device based on IRC platform and electronic equipment
CN115664938B (en) * 2022-12-26 2023-04-21 北京天维信通科技有限公司 Nonlinear statistical alarm method and device based on IRC platform and electronic equipment

Similar Documents

Publication Publication Date Title
CN110213068B (en) Message middleware monitoring method and related equipment
CN111913818B (en) Method for determining dependency relationship between services and related device
CN114827168A (en) Alarm aggregation reporting method and device, computer equipment and storage medium
US8516499B2 (en) Assistance in performing action responsive to detected event
CN110362455B (en) Data processing method and data processing device
JP6160064B2 (en) Application determination program, failure detection apparatus, and application determination method
CN110858843A (en) Service request processing method and device and computer readable storage medium
KR20150111952A (en) Method and system for using a recursive event listener on a node in hierarchical data structure
CN108572898A (en) A kind of method, apparatus of control interface, equipment and storage medium
CN109495543B (en) Management method and device for monitors in ceph cluster
CN111343267A (en) Configuration management method and system
CN113535344A (en) Network data processing method and device, server and storage medium
CN111949421B (en) SDK calling method, device, electronic equipment and computer readable storage medium
CN110855484B (en) Method, system, electronic device and storage medium for automatically detecting traffic change
CN109510730A (en) Distributed system and its monitoring method, device, electronic equipment and storage medium
CN113835961B (en) Alarm information monitoring method, device, server and storage medium
WO2012102727A1 (en) Distributing information
CN110633165B (en) Fault processing method, device, system server and computer readable storage medium
CN113132431B (en) Service monitoring method, service monitoring device, electronic device, and medium
CN114328080A (en) Firmware state detection method and device and electronic equipment
CN109508356B (en) Data abnormality early warning method, device, computer equipment and storage medium
CN115333917A (en) CDN anomaly detection method and device
CN113377622B (en) Alarm method and device for abnormal transaction response and electronic equipment
CN110837431A (en) Service control method, service control device, computer equipment and computer-readable storage medium
CN114880713B (en) User behavior analysis method, device, equipment and medium based on data link

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination