A customizable alarm subscription forwarding method and device

By defining a general alarm subscription model, the problem of differentiation of alarm forwarding is solved, and the flexible configuration and diversified forwarding of alarm subscription rules are realized, which quickly responds to user needs and reduces maintenance workload.

CN115913885BActive Publication Date: 2024-11-12CHINA UNITECHS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211651314.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-21
Publication Date
2024-11-12
Estimated Expiration
2042-12-21

AI Technical Summary

Technical Problem

In network monitoring, there are differences in scope, method and format of forwarding of alarms, which leads to the need to maintain multiple forwarding programs separately, which increases the maintenance workload, especially when the interface changes, code changes, testing and online processes are required.

Method used

By defining a general and flexible alarm subscription model, including alarm subscription rules, forwarding templates and subscription parameters, a unified alarm subscription logic is built to realize alarm reception, rule matching and forwarding execution, and support different subscription types and forwarding methods.

Benefits of technology

It realizes flexible configuration of alarm subscription rules, diversified forwarding types and fast response to user needs, reduces maintenance workload and improves system flexibility and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115913885B_ABST
    Figure CN115913885B_ABST
Patent Text Reader

Abstract

The present invention discloses a customizable alarm subscription forwarding method and device, wherein the method comprises: constructing a unified alarm subscription model by defining alarm subscription rules, alarm forwarding templates and subscription parameters; configuring alarm subscription rules according to the alarm subscription model, and executing subscription operations through an alarm subscription module according to the alarm subscription rules, thereby realizing the entire processing logic from alarm reception to forwarding. The method and device define a universal and flexible alarm subscription model, and realize functions such as alarm reception, rule matching, alarm forwarding and forwarding execution around the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of alarm forwarding, and in particular to a customizable alarm subscription forwarding method and device. Background Art

[0002] In network monitoring, it is often necessary to forward the alarms received by the system to external systems or internal subsystems in various ways, but the scope, forwarding method and forwarding format of the alarms need to be forwarded are different. In the past, a forwarding program was implemented separately according to each need, and even if there were a few differences, they had to be maintained separately. In the long run, it may be necessary to maintain a dozen or even dozens of programs, which causes a huge maintenance workload, especially when the internal and external interfaces of these programs change, the programs need to go through the code change, testing, joint debugging and online processes. Summary of the invention

[0003] In order to quickly respond to different subscription requirements of users inside and outside the system for real-time alarm data, the present invention provides a customizable alarm subscription forwarding method and device, which defines a universal and flexible alarm subscription model and implements functions such as alarm reception, rule matching, alarm forwarding and forwarding execution around the model.

[0004] To achieve the above object, the present invention adopts the following technical solutions:

[0005] In one embodiment of the present invention, a customizable alarm subscription forwarding method is proposed, the method comprising:

[0006] Build a unified alarm subscription model by defining alarm subscription rules, alarm forwarding templates, and subscription parameters;

[0007] Configure the alarm subscription rules according to the alarm subscription model, and execute the subscription operation through the alarm subscription module according to the alarm subscription rules to realize the entire processing logic from alarm reception to forwarding.

[0008] Furthermore, the model of the alarm subscription rule is as follows:

[0009] The main table is alarm subscription rules. Each rule contains several rule filters to determine the scope of alarm subscription. Each rule filter contains multiple matching condition information.

[0010] Each rule contains several subscription parameters, which are used to determine the parameter information to be configured for different subscription types. The parameter information is stored in the form of a dictionary table.

[0011] Each rule includes an active alarm forwarding template, a clear alarm forwarding template, and an update alarm forwarding template, which are used to determine rule conversion template information when forwarding these three types of alarm messages, wherein each template includes several rule conversion template detailed information.

[0012] Furthermore, the alarm subscription module includes:

[0013] The alarm receiving submodule is used to receive the standardized real-time alarm stream from the message middleware;

[0014] The rule matching submodule is used to parse the alarm attribute information, assign the alarms that meet the subscription rules to the corresponding subscription rules, and discard the alarms that do not meet the subscription rules;

[0015] The alarm forwarding submodule is used to construct alarm content according to the subscription template for forwarding;

[0016] The forwarding execution submodule is used to perform different forwarding actions according to different subscription types.

[0017] Furthermore, the processing logic of the alarm forwarding submodule is as follows:

[0018] Receive alarms from the alarm distribution queue and make judgments based on the alarm type;

[0019] If the alarm type is an active alarm, the list of rules that the alarm satisfies is traversed according to the subscription rule matching result to determine whether the following conditions are met:

[0020] Initially, set the forwarding flag = 0;

[0021] If the rule filter to which the alarm belongs needs to be forwarded with delay, it will not be forwarded immediately, and the final forwarding time will be set to be the alarm occurrence time + delay time. If the final forwarding time is <= the current time, it will be forwarded immediately. The timer will be started, and the current time will be waited until the forwarding end time, and the alarm status is 1. The alarm will be distributed to the active alarm forwarding execution queue of each subscription rule, and the forwarding mark will be set to 1. If the alarm status is 0 within the delay time window, it will not be forwarded, and the alarm will be deleted from the cache.

[0022] If the rule filter to which the alarm belongs does not need delayed forwarding, the alarm is distributed to the active alarm forwarding execution queue of each subscription rule;

[0023] If the alarm type is an update alarm, query the cache according to the alarm unique identifier. If it does not exist, discard it. If it does exist, update the corresponding alarm attribute information in the cache. Distribute the alarm to the update forwarding execution queue of each subscription rule.

[0024] If the alarm type is to clear the alarm, the cache is queried according to the alarm unique identifier. If it does not exist, it is discarded; if it exists, and if the forwarding mark of the current alarm = 0, the alarm is deleted from the cache, and the alarm is cleared without forwarding; if the forwarding mark of the current alarm = 1, the alarm is distributed to the clear forwarding execution queue of each subscription rule, and the corresponding alarm in the cache is deleted.

[0025] In one embodiment of the present invention, a customizable alarm subscription forwarding device is also proposed, the device comprising:

[0026] The modeling submodule is used to build a unified alarm subscription model by defining alarm subscription rules, alarm forwarding templates, and subscription parameters;

[0027] The alarm processing module is used to configure the alarm subscription rules according to the alarm subscription model, and execute the subscription operation through the alarm subscription module according to the alarm subscription rules to realize the entire processing logic from alarm reception to forwarding.

[0028] Furthermore, the model of the alarm subscription rule is as follows:

[0029] The main table is alarm subscription rules. Each rule contains several rule filters to determine the scope of alarm subscription. Each rule filter contains multiple matching condition information.

[0030] Each rule contains several subscription parameters, which are used to determine the parameter information to be configured for different subscription types. The parameter information is stored in the form of a dictionary table.

[0031] Each rule includes an active alarm forwarding template, a clear alarm forwarding template, and an update alarm forwarding template, which are used to determine rule conversion template information when forwarding these three types of alarm messages, wherein each template includes several rule conversion template detailed information.

[0032] Furthermore, the alarm subscription module includes:

[0033] The alarm receiving submodule is used to receive the standardized real-time alarm stream from the message middleware;

[0034] The rule matching submodule is used to parse the alarm attribute information, assign the alarms that meet the subscription rules to the corresponding subscription rules, and discard the alarms that do not meet the subscription rules;

[0035] The alarm forwarding submodule is used to construct alarm content according to the subscription template for forwarding;

[0036] The forwarding execution submodule is used to perform different forwarding actions according to different subscription types.

[0037] Furthermore, the processing logic of the alarm forwarding submodule is as follows:

[0038] Receive alarms from the alarm distribution queue and make judgments based on the alarm type;

[0039] If the alarm type is an active alarm, the list of rules that the alarm satisfies is traversed according to the subscription rule matching result to determine whether the following conditions are met:

[0040] Initially, set the forwarding flag = 0;

[0041] If the rule filter to which the alarm belongs needs to be forwarded with delay, it will not be forwarded immediately, and the final forwarding time will be set to be the alarm occurrence time + delay time. If the final forwarding time is <= the current time, it will be forwarded immediately. The timer will be started, and the current time will be waited until the forwarding end time, and the alarm status is 1. The alarm will be distributed to the active alarm forwarding execution queue of each subscription rule, and the forwarding mark will be set to 1. If the alarm status is 0 within the delay time window, it will not be forwarded, and the alarm will be deleted from the cache.

[0042] If the rule filter to which the alarm belongs does not need delayed forwarding, the alarm is distributed to the active alarm forwarding execution queue of each subscription rule;

[0043] If the alarm type is an update alarm, query the cache according to the alarm unique identifier. If it does not exist, discard it. If it does exist, update the corresponding alarm attribute information in the cache. Distribute the alarm to the update forwarding execution queue of each subscription rule.

[0044] If the alarm type is to clear the alarm, the cache is queried according to the alarm unique identifier. If it does not exist, it is discarded; if it exists, and if the forwarding mark of the current alarm = 0, the alarm is deleted from the cache, and the alarm is cleared without forwarding; if the forwarding mark of the current alarm = 1, the alarm is distributed to the clear forwarding execution queue of each subscription rule, and the corresponding alarm in the cache is deleted.

[0045] In one embodiment of the present invention, a computer device is also proposed, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the aforementioned customizable alarm subscription forwarding when executing the computer program.

[0046] In one embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program for executing a customizable alarm subscription and forwarding.

[0047] Beneficial effects:

[0048] 1. Flexible configuration of alarm subscription rules: The present invention can flexibly set the alarm scope that needs to be subscribed according to different rule combinations.

[0049] 2. Diversity of alarm subscription types: The present invention supports forwarding subscribed alarms according to different subscription types, such as message middleware kafka / MQ, email, SMS, enterprise WeChat, ES and socket.

[0050] 3. Flexible definition of forwarding content: The present invention can flexibly define the alarm subscription template according to the requirements of the subscriber, and automatically construct the final required alarm content format for forwarding through various assignment conversion methods.

[0051] 4. Quickly respond to user needs: The present invention can quickly meet the personalized alarm subscription needs of different users and different scenarios through configuration. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 This is a diagram of the alarm subscription rule model of the present invention;

[0053] Figure 2 This is a diagram of an alarm subscription rule management page according to an embodiment of the present invention;

[0054] Figure 3 It is a schematic diagram of the structure of the alarm subscription module of the present invention;

[0055] Figure 4 It is the alarm distribution processing logic diagram of the present invention;

[0056] Figure 5 It is a schematic diagram of the structure of a customizable alarm subscription and forwarding device of the present invention;

[0057] Figure 6 It is a schematic diagram of the computer device structure of the present invention. DETAILED DESCRIPTION

[0058] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0059] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a device, apparatus, node, method or computer program product. Therefore, the present disclosure may be implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0060] The implementation mode of the present invention proposes a customizable alarm subscription forwarding method and device, which realizes the construction of a unified alarm subscription model by defining alarm subscription rules, subscription parameters and alarm forwarding templates. It aims to quickly meet the subscription needs of users inside and outside the system for real-time alarms by configuring alarm subscription rules.

[0061] The principle and spirit of the present invention are explained in detail below with reference to several representative embodiments of the present invention.

[0062] 1. The present invention proposes a customizable alarm subscription forwarding method. The key to this method is to build a unified alarm subscription model, which specifically includes the following contents:

[0063] Alarm subscription rule definition: includes rule code, rule name, rule description, rule status, active alarm forwarding template, clear alarm forwarding template, update alarm forwarding template and alarm filtering conditions.

[0064] Alarm forwarding template definition: includes template code, template name, template description, and template content customization.

[0065] Subscription parameter definition: Dynamically configure and build different parameters according to subscription type. For example, email subscription includes information such as email address, account number, and recipient.

[0066] Configure alarm subscription rules according to the alarm subscription model, and perform operations through the alarm subscription module according to the alarm subscription rules to implement the entire processing logic from alarm reception to forwarding.

[0067] 2. The alarm subscription model includes an alarm subscription rule model and an alarm subscription module. The alarm subscription module performs subscription operations according to the alarm subscription rules.

[0068] (1) The alarm subscription rule model includes: Figure 1 Models and their relationships:

[0069] The main table is alarm subscription rules. Each rule contains several rule filters to determine the scope of alarm subscription. Each rule filter contains multiple matching condition information.

[0070] Each rule contains several subscription parameters, which are used to determine the parameter information to be configured for different subscription types. The parameter information is stored in the form of a dictionary table.

[0071] Each rule includes an active alarm forwarding template, a clear alarm forwarding template, and an update alarm forwarding template, which are used to determine rule conversion template information when forwarding these three types of alarm messages, wherein each template includes several rule conversion template detailed information.

[0072] (2) The following is a detailed definition of each table in the alarm subscription rule model.

[0073] The main table of alarm subscription rules: cm_ala_subscribe_rule, defines the basic information and subject information of the rules, as shown in Table 1:

[0074] Table 1

[0075] Field Name Field encoding Field Description Rule Encoding rule_id Unique ID Rule Name rile_name Subscription Type rule_type kafka / CTG-MQ / email / wechat / ES / sms Rule Description rule_desc Rule Status rule_status 1- Enable 0- Disable Creation time create_time Modification time modify_time Active alarm template code active_templ_id Update alarm template code mod_templ_id Clear alarm template code clear_templ_id

[0076] Rule filter: cm_ala_subscribe_filter, defines the matching condition information contained in the rule, as shown in Table 2 below:

[0077] Table 2

[0078] Field Name Field encoding Field Description Rule Encoding rule_id Unique ID Filter condition name fillter_name Identifier of the filter list Filter Type filter_type 1-According to alarm type 2-Custom conditions Conditional Expressions filter_expr Alarm type identifier alarm_type Is it delayed is_delay 1-Yes 0-No Delay time delay_time Unit: Seconds

[0079] Rule filter matching condition information: cm_ala_subscribe_condition, defines the matching condition information contained in the rule, as shown in Table 3 below:

[0080] Table 3

[0081] Field Name Field encoding Field Description Rule Encoding rule_id Unique ID Filter condition name fillter_name Identifier of the filter list Attribute Encoding attribute_code Corresponding alarm attribute field (ES field name) Property Name attribute_name Chinese field name Matching method match_type Enumeration, see dictionary table definition Matching Expressions match_expr

[0082] Subscription parameter dictionary table: cm_ala_subscribe_dict, defines the parameter information that needs to be configured for different subscription types, as shown in Table 4 below:

[0083] Table 4

[0084]

[0085]

[0086] Rule subscription parameter table: cm_ala_subscribe_para, defines the subscription parameter value information of the rule, as shown in Table 5 below:

[0087] Table 5

[0088] Field Name Field encoding Field Description Rule Encoding rule_id Subscription parameter code para_code Subscription parameter value para_value

[0089] Rule conversion template: cm_ala_subscribe_template, defines the conversion template information of the content sent when the rule executes the action, as shown in Table 6 below:

[0090] Table 6

[0091]

[0092] Rule conversion template details: cm_ala_subscribe_template_detail, defines the detailed information of the rule conversion template, as shown in Table 7 below:

[0093] Table 7

[0094]

[0095]

[0096] (3) Alarm subscription rule management

[0097] Create an alert subscription rule, such as Figure 2 shown.

[0098] The rule information is divided into the following three parts (note that the required fields are marked with "*"):

[0099] (a) Basic information of the rules:

[0100] Rule code: text box, filled in manually, required.

[0101] Rule name: text box, filled in manually, required.

[0102] Subscription type: radio button, enumeration value is a dictionary value, required.

[0103] Rule description: text box, manual filling, optional.

[0104] Rule status: radio button, enumeration value is dictionary value, required, default is yes.

[0105] Active alarm template: Radio button. You can also click the "Add" button to add a template. Clicking it will call the "Subscription Template Add / Edit" page. After confirming the page, the newly added template will be brought in as the current selected value of the template.

[0106] Clear alarm template: Same as active alarm template.

[0107] (b) Subscription parameter information: The following contents are displayed in a list format:

[0108] Parameter Code: Not editable.

[0109] Parameter name: Not editable.

[0110] Required: Not editable.

[0111] Parameter value: Manual entry.

[0112] Operation: Details, click to view the complete parameter information in a multi-line text box, support editing and backfilling. Line breaks should be displayed correctly.

[0113] (c) Rule matching conditions: You can define multiple different filter conditions. Each filter can be defined by alarm type or custom condition. The default is by alarm type, which is required.

[0114] By alarm type: A multiple-select drop-down list box with input filters. Click "Add" to add a new alarm type.

[0115] Custom conditions: Click the "Add filter" button to add multiple filter condition combinations. The filter name is a text box, which must be filled in manually. Multiple condition combinations are in an or relationship, and the relationship within a condition combination is an and relationship. When selecting a custom condition, at least one filter must be included.

[0116] Delayed forwarding: Unchecked by default. If checked, the delay time window text box and unit will be displayed (the text box prompts "Delay time window" by default).

[0117] Filter condition list: Add a list including the following columns, each column can be edited. Each column is required.

[0118] Alarm attribute, attribute code: single-select drop-down list box, the two are linked, display Chinese description, required.

[0119] Judgment method: drop-down list box, enumeration value is dictionary value.

[0120] Matching expression: text box, enter manually.

[0121] The user can click "Delete" and the system will prompt "Are you sure to delete?" and delete it from the page after confirmation.

[0122] When the user clicks "Add", the system adds a row to the end of the list page.

[0123] Conditional expressions: Distinguish between the following two methods:

[0124] By alarm type: the format is "k_ALARMTYPEID == alarm type selected on the page".

[0125] Custom conditions: Automatically generated and filled in the text box based on the set condition information, set to read-only and non-editable.

[0126] Traverse the filter condition combinations and connect them by pressing “||”.

[0127] Traverse the filter condition list and concatenate them by "&&" lines.

[0128] The conditional line is concatenated in the following format: attribute code + judgment method + matching expression.

[0129] (d) Save button: After clicking, if the verification passes, the save operation is triggered.

[0130] (4) Alarm subscription module

[0131] like Figure 3 As shown, the alarm subscription module contains the following submodules:

[0132] Alarm receiving (SubscribeRecv) submodule: receives standardized real-time alarm streams from the message middleware (such as Kafka).

[0133] SubscribeRuleMatch submodule: parses alarm attribute information; assigns alarms that meet subscription rules to corresponding subscription rules, and discards alarms that do not meet subscription rules.

[0134] Alarm forwarding (SubscribeTransfer) submodule: constructs alarm content according to the subscription template for forwarding.

[0135] SubscribeExecutor submodule: Executes different forwarding actions according to different subscription types, including pushing Kafka, pushing MQ, sending emails, sending SMS, sending enterprise WeChat, entering ES and socket.

[0136] (a) Alarm reception processing logic (SubscribeRecv submodule)

[0137] Processing logic:

[0138] Connect to Kafka and receive data streams in real time according to the configured topic.

[0139] The message content is taken out as an alarm message and an internal unified object is generated.

[0140] If k_MSTYPE=add(new alarm): calculate the queue number queueNo=mod(abs(crc32(k_ClearFp)) / number of working queues), and send it to the corresponding rule matching queue according to queueNo, that is, take the alarm clearing fingerprint, convert it into an integer according to the crc32 algorithm and take the absolute value, and then take the modulus with the number of working queues.

[0141] If k_MSTYPE = delete (alarm clear): send to the alarm distribution queue.

[0142] If k_MSTYPE = modify (alarm update): send to the alarm distribution queue.

[0143] Note: k_MSTYPE is the message type field, and k_ClearFp is the clear fingerprint field of the alarm.

[0144] (b) Rule matching processing logic (SubscribeMatch submodule)

[0145] Processing logic:

[0146] Receive alerts from rule matching queues.

[0147] Traverse the global subscription rules and match the rule filter list (filterList) one by one. If no match is found, continue to the next rule.

[0148] If a match is found, the subscription rule ID that the alarm satisfies is recorded. The same alarm may satisfy multiple rules, and a rule list ruleList is eventually generated.

[0149] Send to the alarm distribution queue.

[0150] (c) Alarm distribution processing logic (SubscribeMatch submodule)

[0151] like Figure 4 As shown, the processing logic is:

[0152] Receive alarms from the alarm distribution queue. Judge by alarm type:

[0153] Active alarm (message type = 200):

[0154] According to the rule matching results, traverse the ruleList that the alarm meets to determine whether the following conditions are met:

[0155] Initially, the transfer flag transfer_flag=0 is set.

[0156] If the rule filter to which the alarm belongs needs delayed forwarding (isDelay=1), no immediate forwarding is performed, and the final forwarding time t_transfer_time=t_STARTTIME+delayTime(seconds) is set, where t_STARTTIME is the alarm occurrence time, delayTime is the delay time, and if t_transfer_time<=current time, forward immediately. Start the timer, wait for the current time = forwarding end time &&l_ALARMSTATUS=1 (l_ALARMSTATUS is the alarm status, 1 is active alarm, 0 is cleared alarm), distribute the alarm object to the active alarm forwarding execution queue of each subscription rule, and set the forwarding flag transfer_flag=1. If the alarm has been cleared within the delay time window (alarm status l_ALARMSTATUS=0), no forwarding is performed, and the alarm is deleted from the cache.

[0157] If the rule filter to which the alarm belongs does not need delayed forwarding (isDelay=0), the alarm object is distributed to the active alarm forwarding execution queue of each subscription rule.

[0158] Update alert (message type = 201):

[0159] The cache is queried based on the unique alarm identifier AlarmID. If the cache does not exist, it is discarded.

[0160] If it exists, the corresponding alarm attribute information in the cache is updated, and the alarm object is distributed to the update forwarding execution queue of each rule.

[0161] Clear alarm (message type = 202):

[0162] The cache is queried based on the unique alarm identifier AlarmID. If the cache does not exist, it is discarded.

[0163] If it exists, and if the current alarm has not been forwarded (forwarding flag transfer_flag = 0), the alarm will be deleted from the cache, and the message will be cleared without forwarding; if the alarm has been forwarded (forwarding flag transfer_flag = 1), the alarm object will be distributed to the clear forwarding execution queue of each subscription rule, and the corresponding alarm in the cache will be deleted.

[0164] (d) Forwarding execution processing logic (SubscribeTransfer submodule)

[0165] Processing logic:

[0166] Receive alerts from the rule matching queue, construct forwarding messages and execute forwarding actions according to subscription types.

[0167] Construct the forwarding message content according to the following template conversion logic.

[0168] The template conversion logic is assigned values ​​according to the following steps: (For English fields, please refer to the alarm subscription rules for their meanings. The mapType type is the Chinese character before the "(", for example, fixed is a fixed value).

[0169] Traverse the attribute assignment entries in the rule and generate a forwarding mapping table in the "key:value" format. The key corresponds to dstField, and the value is generated according to mapType. If valueType = string, value must be enclosed in double quotes; if valueType = number, it is necessary to determine whether it is a numeric value. If so, directly quote it, otherwise assign it to "-1". The following expr* represents the alarm attribute value. Execute different conversion logic according to mapType.

[0170] Fixed value (mapType=fixed): directly assigned to mapExpr.

[0171] Alarm attribute direct mapping (mapType=direct): directly assign the value of the alarm attribute represented by mapExpr. For example, if mapExpr=k_RESIP, the value assigned is the value corresponding to the current alarm k_RESIP.

[0172] Regular (mapType=reg): In this case, srcField is the alarm attribute, mapExpr is a regular expression, and the regular expression is applied to srcField to obtain the required content for assignment.

[0173] Join (mapType = join): In this case, mapExpr is a join expression, and the corresponding variable in the expression is replaced with the alarm attribute value and the resulting string content is assigned. For example: "${k_RESIP}::${k_RESNAME}:100". (k_RESIP represents the resource IP, and k_RESNAME represents the resource name).

[0174] Conditional judgment (mapType = case): In this case, mapExpr is a conditional expression in the format of "expr = 1: a; expr = 2: b; c", which means that if expr = 1, a is assigned, if expr = 2, b is assigned, and if not, c is assigned. Multiple conditions are separated by ";". a, b, c can be variables or constants.

[0175] Non-empty judgment (mapType = nvl): In this case, mapExpr is a conditional expression with the format of "expr, a, b", that is, "expression, set value if not empty, set value if empty". It means that if expr is not empty, a is assigned, and if it is empty, b is assigned. a and b can be variables or constants.

[0176] Serial number (mapType = serial): In this case, the assignment expression is the starting value and step length of the serial number, separated by commas. The format is "1,1", which means that the starting value is 1 and increases by 1 each time. The current value is obtained from redis and stored in redis after update. key = serial:$ruleId:$TemplId:$dstField, value = current value.

[0177] API call (mapType = api): Call the specified API, the input parameter is the specified alarm attribute or variable, and assign the return value of the called interface. Where mapExpr is the URL, and the get method is used for calling. For example: http: / / RESOURCE-JAVA-SERVICE / api / ala / getCircuitNo? resid = ${k_RESID}&resClass = ${var1}, "${}" is the variable reference, and RESOURCE-JAVA-SERVICE is the service name. The return parameter format is as follows, where code = 0000 is successful, code = 0001 is failed, and data is the return value. (k_RESID represents the resource identifier, k_RESNAME represents the resource name, resClass is the parameter name of the interface, and http: / / RESOURCE-JAVA-SERVICE / api / ala / getCircuitNo is the interface URL)

[0178]

[0179] (5) Subscription parameters

[0180] The subscription parameters for different subscription types are listed in Table 8 below and can be deleted as needed.

[0181] Table 8

[0182]

[0183]

[0184] It should be noted that, although the operations of the method of the present invention are described in a specific order in the above embodiments and the accompanying drawings, this does not require or imply that the operations must be performed in the specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0185] Based on the same inventive concept, the present invention also proposes a customizable alarm subscription forwarding device. The implementation of the device can refer to the implementation of the above method, and the repeated parts will not be repeated. The term "submodule" used below can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0186] Figure 5 Schematic diagram of the structure of the customizable alarm subscription and forwarding device of the present invention. Figure 5 As shown, the device comprises:

[0187] The modeling submodule 101 is used to build a unified alarm subscription model by defining alarm subscription rules, alarm forwarding templates and subscription parameters;

[0188] The alarm processing module 102 is used to configure the alarm subscription rules according to the alarm subscription model, and execute the subscription operation through the alarm subscription module according to the alarm subscription rules to realize the entire processing logic from alarm reception to forwarding.

[0189] The model of the alarm subscription rule is as follows:

[0190] The main table is alarm subscription rules. Each rule contains several rule filters to determine the scope of alarm subscription. Each rule filter contains multiple matching condition information.

[0191] Each rule contains several subscription parameters, which are used to determine the parameter information to be configured for different subscription types. The parameter information is stored in the form of a dictionary table.

[0192] Each rule includes an active alarm forwarding template, a clear alarm forwarding template, and an update alarm forwarding template, which are used to determine rule conversion template information when forwarding these three types of alarm messages, wherein each template includes several rule conversion template detailed information.

[0193] The alarm subscription module includes:

[0194] The alarm receiving submodule is used to receive the standardized real-time alarm stream from the message middleware;

[0195] The rule matching submodule is used to parse the alarm attribute information, assign the alarms that meet the subscription rules to the corresponding subscription rules, and discard the alarms that do not meet the subscription rules;

[0196] The alarm forwarding submodule is used to construct alarm content according to the subscription template for forwarding;

[0197] The alarm forwarding processing logic is as follows:

[0198] Receive alarms from the alarm distribution queue and make judgments based on the alarm type;

[0199] If the alarm type is an active alarm, the list of rules that the alarm satisfies is traversed according to the subscription rule matching result to determine whether the following conditions are met:

[0200] Initially, set the forwarding flag = 0;

[0201] If the rule filter to which the alarm belongs needs to be forwarded with delay, it will not be forwarded immediately, and the final forwarding time will be set to be the alarm occurrence time + delay time. If the final forwarding time is <= the current time, it will be forwarded immediately. The timer will be started, and the current time will be waited until the forwarding end time, and the alarm status is 1. The alarm will be distributed to the active alarm forwarding execution queue of each subscription rule, and the forwarding mark will be set to 1. If the alarm status is 0 within the delay time window, it will not be forwarded, and the alarm will be deleted from the cache.

[0202] If the rule filter to which the alarm belongs does not need delayed forwarding, the alarm is distributed to the active alarm forwarding execution queue of each subscription rule;

[0203] If the alarm type is an update alarm, query the cache according to the alarm unique identifier. If it does not exist, discard it. If it does exist, update the corresponding alarm attribute information in the cache. Distribute the alarm to the update forwarding execution queue of each subscription rule.

[0204] If the alarm type is to clear the alarm, the cache is queried according to the alarm unique identifier. If it does not exist, it is discarded; if it exists, and if the forwarding mark of the current alarm = 0, the alarm is deleted from the cache, and the alarm is cleared without forwarding; if the forwarding mark of the current alarm = 1, the alarm is distributed to the clear forwarding execution queue of each subscription rule, and the corresponding alarm in the cache is deleted.

[0205] The forwarding execution submodule is used to perform different forwarding actions according to different subscription types.

[0206] It should be noted that, although several submodules of the customizable alarm subscription forwarding device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more submodules described above can be concretized in one submodule. Conversely, the features and functions of one submodule described above can be further divided into multiple submodules to be concretized.

[0207] Based on the above invention concept, Figure 6 As shown, the present invention also proposes a computer device 200, including a memory 210, a processor 220, and a computer program 230 stored in the memory 210 and executable on the processor 220, and when the processor 220 executes the computer program 230, the aforementioned customizable alarm subscription forwarding method is implemented.

[0208] Based on the aforementioned inventive concept, the present invention further proposes a computer-readable storage medium, which stores a computer program for executing the aforementioned customizable alarm subscription forwarding.

[0209] The customizable alarm subscription forwarding method and device proposed in the present invention can meet the real-time subscription of alarm data by internal and external systems in different scenarios by defining an alarm subscription model. The ultimate goals include:

[0210] (1) Flexible configuration of alarm subscription rules: The alarm scope to be subscribed can be flexibly set according to different rule combinations.

[0211] (2) Diversity of alarm subscription types: Supports forwarding subscribed alarms according to different subscription types, such as message middleware Kafka / MQ, email, SMS, enterprise WeChat, ES, and socket.

[0212] (3) Flexible definition of forwarding content: The alarm subscription template can be flexibly defined according to the requirements of the subscriber. Through various assignment conversion methods, the final required alarm content format can be automatically constructed for forwarding.

[0213] (4) Quickly respond to user needs: The personalized alarm subscription needs of different users and different scenarios can be quickly met through configuration.

[0214] Although the spirit and principle of the present invention have been described with reference to several specific embodiments, it should be understood that the present invention is not limited to the disclosed specific embodiments, and the division of various aspects does not mean that the features in these aspects cannot be combined to benefit, and such division is only for the convenience of expression. The present invention is intended to cover various modifications and equivalent arrangements contained in the spirit and scope of the attached claims.

[0215] Regarding the limitation of the protection scope of the present invention, those skilled in the art should understand that, based on the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative work are still within the protection scope of the present invention.

Claims

1. A customizable alarm subscription forwarding method, characterized in that: The method includes: Build a unified alarm subscription model by defining alarm subscription rules, alarm forwarding templates, and subscription parameters; Configure alarm subscription rules according to the alarm subscription model. According to the alarm subscription rules, execute subscription operations through the alarm subscription module to implement the entire processing logic from alarm reception to forwarding. The processing logic of the alarm forwarding submodule in the alarm subscription module is as follows: Receive alarms from the alarm distribution queue and make judgments based on the alarm type; If the alarm type is an active alarm, the list of rules that the alarm satisfies is traversed according to the subscription rule matching result to determine whether the following conditions are met: Initially, set the forwarding flag = 0; If the rule filter to which the alarm belongs needs to be forwarded with delay, it will not be forwarded immediately, and the final forwarding time will be set to be the alarm occurrence time + delay time. If the final forwarding time is <= the current time, it will be forwarded immediately. The timer will be started, and the current time will be waited until the forwarding end time, and the alarm status is 1. The alarm will be distributed to the active alarm forwarding execution queue of each subscription rule, and the forwarding mark will be set to 1. If the alarm status is 0 within the delay time window, it will not be forwarded, and the alarm will be deleted from the cache. If the rule filter to which the alarm belongs does not need delayed forwarding, the alarm is distributed to the active alarm forwarding execution queue of each subscription rule; If the alarm type is an update alarm, query the cache according to the alarm unique identifier. If it does not exist, discard it. If it does exist, update the corresponding alarm attribute information in the cache. Distribute the alarm to the update forwarding execution queue of each subscription rule. If the alarm type is to clear the alarm, the cache is queried according to the alarm unique identifier. If it does not exist, it is discarded; if it exists, and if the forwarding mark of the current alarm = 0, the alarm is deleted from the cache, and the alarm is cleared without forwarding; if the forwarding mark of the current alarm = 1, the alarm is distributed to the clear forwarding execution queue of each subscription rule, and the corresponding alarm in the cache is deleted.

2. The customizable alarm subscription forwarding method according to claim 1, characterized in that: The model of the alarm subscription rule is as follows: The main table is alarm subscription rules. Each rule contains several rule filters to determine the scope of alarm subscription. Each rule filter contains multiple matching condition information. Each rule contains several subscription parameters, which are used to determine the parameter information to be configured for different subscription types. The parameter information is stored in the form of a dictionary table. Each rule includes an active alarm forwarding template, a clear alarm forwarding template, and an update alarm forwarding template, which are used to determine rule conversion template information when forwarding these three types of alarm messages, wherein each template includes several rule conversion template detailed information.

3. The customizable alarm subscription forwarding method according to claim 1, characterized in that: The alarm subscription module includes: The alarm receiving submodule is used to receive the standardized real-time alarm stream from the message middleware; The rule matching submodule is used to parse the alarm attribute information, assign the alarms that meet the subscription rules to the corresponding subscription rules, and discard the alarms that do not meet the subscription rules; The alarm forwarding submodule is used to construct alarm content according to the subscription template for forwarding; The forwarding execution submodule is used to perform different forwarding actions according to different subscription types.

4. A customizable alarm subscription and forwarding device, characterized in that: The device includes: The modeling submodule is used to build a unified alarm subscription model by defining alarm subscription rules, alarm forwarding templates, and subscription parameters; The alarm processing module is used to configure the alarm subscription rules according to the alarm subscription model, and execute the subscription operation through the alarm subscription module according to the alarm subscription rules to realize the entire processing logic from alarm reception to forwarding; The processing logic of the alarm forwarding submodule in the alarm subscription module is as follows: Receive alarms from the alarm distribution queue and make judgments based on the alarm type; If the alarm type is an active alarm, the list of rules that the alarm satisfies is traversed according to the subscription rule matching result to determine whether the following conditions are met: Initially, set the forwarding flag = 0; If the rule filter to which the alarm belongs needs to be forwarded with delay, it will not be forwarded immediately, and the final forwarding time will be set to be the alarm occurrence time + delay time. If the final forwarding time is <= the current time, it will be forwarded immediately. The timer will be started, and the current time will be waited until the forwarding end time, and the alarm status is 1. The alarm will be distributed to the active alarm forwarding execution queue of each subscription rule, and the forwarding mark will be set to 1. If the alarm status is 0 within the delay time window, it will not be forwarded, and the alarm will be deleted from the cache. If the rule filter to which the alarm belongs does not need delayed forwarding, the alarm is distributed to the active alarm forwarding execution queue of each subscription rule; If the alarm type is an update alarm, query the cache according to the alarm unique identifier. If it does not exist, discard it. If it does exist, update the corresponding alarm attribute information in the cache. Distribute the alarm to the update forwarding execution queue of each subscription rule. If the alarm type is to clear the alarm, the cache is queried according to the alarm unique identifier. If it does not exist, it is discarded; if it exists, and if the forwarding mark of the current alarm = 0, the alarm is deleted from the cache, and the alarm is cleared without forwarding; if the forwarding mark of the current alarm = 1, the alarm is distributed to the clear forwarding execution queue of each subscription rule, and the corresponding alarm in the cache is deleted.

5. The customizable alarm subscription and forwarding device according to claim 4, characterized in that: The model of the alarm subscription rule is as follows: The main table is alarm subscription rules. Each rule contains several rule filters to determine the scope of alarm subscription. Each rule filter contains multiple matching condition information. Each rule contains several subscription parameters, which are used to determine the parameter information to be configured for different subscription types. The parameter information is stored in the form of a dictionary table. Each rule includes an active alarm forwarding template, a clear alarm forwarding template, and an update alarm forwarding template, which are used to determine rule conversion template information when forwarding these three types of alarm messages, wherein each template includes several rule conversion template detailed information.

6. The customizable alarm subscription and forwarding device according to claim 4, characterized in that: The alarm subscription module includes: The alarm receiving submodule is used to receive the standardized real-time alarm stream from the message middleware; The rule matching submodule is used to parse the alarm attribute information, assign the alarms that meet the subscription rules to the corresponding subscription rules, and discard the alarms that do not meet the subscription rules; The alarm forwarding submodule is used to construct alarm content according to the subscription template for forwarding; The forwarding execution submodule is used to perform different forwarding actions according to different subscription types.

7. 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 method according to any one of claims 1 to 3 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the method according to any one of claims 1 to 3.