An alarm analysis method based on template matching and related equipment

The alarm parsing method based on template matching and cluster analysis solves the problems of low efficiency of manual configuration and omission of unknown alarms in SNMP Trap alarm parsing, realizes automated parsing rule generation and system self-optimization, and improves network operation and maintenance efficiency and accuracy.

CN123185044APending Publication Date: 2026-11-27CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611176655.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-04
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In existing technologies, the parsing of SNMP Trap alarms relies on manual configuration of parsing rules, which results in a large workload, low efficiency, easy omission of unknown alarms, high maintenance costs, and difficulty in adapting to changes in the network environment.

Method used

An alarm parsing method based on template matching is adopted. By using Bloom filters and rule template libraries, parsing rules are automatically generated. Unknown alarms are identified through template matching and cluster analysis. The rule template library and Bloom filters are updated to adapt to changes in the network environment.

Benefits of technology

It significantly reduces configuration workload, automatically identifies unknown alarms, avoids missing important faults, and enables the system to improve itself without the need for continuous manual maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123185044A_ABST
    Figure CN123185044A_ABST
Patent Text Reader

Abstract

The application discloses an alarm analysis method based on template matching and related equipment, and the application marks the message which does not hit the black and white list as unknown message through a bloom filter shunting mechanism; for the completely unknown message which fails to match, further clustering analysis is carried out and the message is sent to an auditing object, a brand-new alarm type caused by device firmware upgrade or new device network entry can be actively found, and important faults can be avoided from being missed; the automatically generated analysis rule and clustering statistical information are audited and confirmed by the auditing object, and the rule template library and / or the bloom filter are updated according to the auditing instruction, so that the system can continuously self-improve with the change of network environment, a large amount of resources does not need to be continuously manually invested for rule maintenance, a long-term stable optimization closed loop is formed, and the application can be widely applied to the technical field of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to an alarm parsing method and related equipment based on template matching. Background Technology

[0002] With the rapid development of information technology and the continuous expansion of network scale, the management and monitoring of network devices has become increasingly complex. In modern network environments, thousands of routers, switches, firewalls, servers, and other devices require real-time monitoring to promptly detect and handle network faults. The Simple Network Management Protocol (SNMP), as a widely used network management protocol, has become the de facto standard for network device monitoring.

[0003] One of the core mechanisms of the SNMP protocol is Trap alerts. When a network device experiences a specific event or a state change, it proactively sends a Trap message to the network management system. These Trap messages contain rich alert information, such as device identifier, event type, severity level, and timestamp. However, because devices from different vendors use different object identifiers (OIDs) and variable binding formats, parsing and processing Trap messages becomes exceptionally complex.

[0004] Traditional SNMP Trap alarm handling methods primarily rely on manual configuration of parsing rules. Network administrators need to manually write parsing rules for each device model and each alarm type to convert the raw Trap message into readable alarm information. This method has the following significant drawbacks: 1. Heavy workload and low efficiency: In large network environments containing devices from multiple vendors, administrators need to configure hundreds or even thousands of parsing rules. Each rule requires carefully written expressions to match key fields in the Trap message and map these fields to standardized alarm attributes. This process is not only time-consuming and labor-intensive but also prone to errors.

[0005] 2. Unknown alarms are easily missed: When a new device joins the network or a device firmware upgrade generates a new type of alarm, if the corresponding parsing rules are not pre-configured, these alarms will be ignored by the system or displayed as unrecognizable messages, resulting in important network faults being missed.

[0006] 3. High maintenance costs: As the network environment changes, the resolution rules need to be constantly updated and maintained. Administrators need to regularly check the accuracy of the rules and add new rules, a process that requires a continuous investment of significant human resources. Summary of the Invention

[0007] The main objective of this invention is to propose an alarm parsing method, apparatus, electronic device, storage medium, and program product based on template matching, aiming to solve at least one problem of the prior art.

[0008] To achieve the above objectives, one aspect of the present invention proposes an alarm parsing method based on template matching, the method comprising: Obtain historical alarm message samples and a pre-configured rule template library, and initialize a Bloom filter based on the historical alarm message samples; the Bloom filter includes a whitelist Bloom filter and a blacklist Bloom filter; Receive raw event notification messages from network devices, parse and extract the object identifier, source device IP address, and variable binding list of the raw event notification messages, use the object identifier to query the Bloom filter, and determine the message routing type of the raw event notification messages based on the query results; among which, the message routing type includes known alarm messages, known non-alarm messages, and unknown messages; Based on the object identifier, source device IP address, and variable binding list of the unknown message, the best matching template is obtained from the rule template library. Based on the best matching template and the variable binding list of the unknown message, a parsing rule is generated. If the similarity between the best matching template and the unknown message is less than a preset threshold, the unknown message is marked as a completely unknown message. Cluster analysis was performed on all completely unknown messages to obtain cluster statistics. Send the parsing rules and clustering statistics corresponding to completely unknown messages to the audit object to obtain the audit object's audit instructions, and update the rule template library and / or Bloom filter according to the audit instructions.

[0009] In some implementations, obtaining historical alarm message samples and a pre-configured rule template library, and initializing a Bloom filter based on the historical alarm message samples, includes the following steps: Retrieve historical alarm message samples, pre-configured identifier mapping tables, and alarm rule templates from the database. The identifier mapping table and alarm rule templates are loaded into the memory cache to form a rule template library; Among them, the historical alarm message samples are marked with the message type of known alarm messages or known non-alarm messages; the alarm rule template is associated with device information, sample object identifier, field mapping relationship and at least one typical message example; Extract the sample object identifiers of each historical alarm message sample, store the sample object identifiers of known alarm message types into the whitelist Bloom filter set, and store the sample object identifiers of known non-alarm message types into the blacklist Bloom filter set; wherein, the sample object identifiers are stored in the whitelist Bloom filter and blacklist Bloom filter in the form of binary vectors and hash functions.

[0010] In some implementations, receiving a raw event notification message from a network device, parsing and extracting the object identifier and variable binding list of the raw event notification message, querying a Bloom filter using the object identifier, and determining the message routing type of the raw event notification message based on the query results includes the following steps: The system receives raw event notification messages through the User Datagram Protocol (UDP) port, decodes them according to the protocol format corresponding to the raw event notification messages, and extracts the object identifier, source device IP address, and variable binding list containing multiple variable binding items carried in the raw event notification messages. Each variable binding item includes a sub-object identifier, a data type, and a specific value; Input the object identifier into the whitelist Bloom filter and the blacklist Bloom filter respectively for hash lookup; If the whitelist Bloom filter returns a hit, the original event notification message will be marked as a known alarm message and sent to the alarm reporting channel; If the blacklist Bloom filter returns a hit, the original event notification message will be marked as a known non-alarm message and discarded; If neither the whitelist Bloom filter nor the blacklist Bloom filter is hit, the original event notification message is marked as an unknown message.

[0011] In some implementations, each template in the rule template library is associated with device information, a sample object identifier, and field mapping relationships. Based on the object identifier of the unknown packet, the source device IP address, and the variable binding list, the best matching template is obtained from the rule template library, including the following steps: Use the first template in the rule template library as the candidate template; The first similarity is obtained by quantizing the object identifier of the unknown message and the sample object identifier of the candidate template; The second similarity is obtained by quantifying the source device IP address of the unknown message and the device information of the candidate template; The first variable structure is determined based on the variable binding list of the unknown message, and the second variable structure is determined based on the field mapping relationship of the candidate template. Based on the structure of the first and second variables, the third similarity is quantified. The first similarity, second similarity and third similarity are weighted and summed to obtain the comprehensive similarity between the unknown message and the candidate template; The next template in the rule template library is used as a candidate template. The process of quantizing the first similarity based on the object identifier of the unknown message and the sample object identifier of the candidate template is repeated until all templates in the rule template library have been traversed. The template with the highest overall similarity is selected as the best matching template.

[0012] In some implementations, parsing rules are generated based on the best-matching template and the variable binding list of unknown messages, including the following steps: Based on the field mapping relationship of the best matching template, the corresponding positions of the best matching template are replaced by the object identifier of the unknown message and the variable binding items in the variable binding list to generate parsing rules.

[0013] In some implementations, cluster analysis is performed on all completely unknown messages to obtain cluster statistics, including the following steps: Based on the object identifier of each completely unknown message, the hierarchy length and hierarchy value sequence are extracted as OID features; Based on the variable binding list for each completely unknown message, the number and type distribution of variables are extracted as variable binding features; Based on the source device IP address of each completely unknown message, network segment information is extracted as device characteristics; The OID characteristics, variable binding characteristics, and device characteristics of the same completely unknown message are combined into the feature vector of the corresponding completely unknown message; The K-Means clustering algorithm is used to iteratively cluster and group the feature vectors of all completely unknown messages to obtain the clustering results and determine the clustering statistics. The clustering statistics include the cluster center, number of message samples, first appearance time, most recent appearance time, and representative message samples for each cluster group.

[0014] In some implementations, the audit instructions include a first audit instruction for the parsing rules corresponding to each completely unknown message and a second audit instruction for each cluster group in the cluster statistics. Updating the rule template library and / or Bloom filter according to the audit instructions includes the following steps: Iterate through each first review instruction. If the first review instruction is accepted, persist the corresponding parsing rule to the official rule base and add the object identifier of the corresponding completely unknown message to the whitelist Bloom filter; otherwise, add the object identifier of the corresponding completely unknown message to the blacklist Bloom filter. Iterate through each second review instruction. If the second review instruction is confirmed as a new alarm type, write the manually entered new alarm rule template into the rule template library, generate a new parsing rule based on the new alarm rule template and write it into the formal rule library, and add the object identifier of the corresponding completely unknown message to the whitelist Bloom filter; otherwise, add the object identifier of the corresponding completely unknown message to the blacklist Bloom filter.

[0015] To achieve the above objectives, another aspect of the present invention proposes an alarm parsing device based on template matching, the device comprising: The first module is used to obtain historical alarm message samples and a pre-configured rule template library, and initialize Bloom filters based on the historical alarm message samples; the Bloom filters include whitelist Bloom filters and blacklist Bloom filters; The second module is used to receive raw event notification messages from network devices, parse and extract the object identifier, source device IP address and variable binding list of the raw event notification messages, query the Bloom filter using the object identifier, and determine the message routing type of the raw event notification messages based on the query results; among which, the message routing types include known alarm messages, known non-alarm messages and unknown messages; The third module is used to obtain the best matching template from the rule template library based on the object identifier, source device IP address and variable binding list of the unknown message, generate parsing rules based on the best matching template and the variable binding list of the unknown message, and mark the unknown message as a completely unknown message if the similarity between the best matching template and the unknown message is less than a preset threshold. The fourth module is used to perform cluster analysis on all completely unknown messages to obtain cluster statistics. The fifth module is used to send the parsing rules and clustering statistics corresponding to completely unknown messages to the audit object in order to obtain the audit instructions from the audit object, and update the rule template library and / or Bloom filter according to the audit instructions.

[0016] To achieve the above objectives, another aspect of the present invention provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned method.

[0017] To achieve the above objectives, another aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned method.

[0018] To achieve the above objectives, another aspect of the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the aforementioned method.

[0019] This invention provides at least the following beneficial effects: It offers a template-matching-based alarm parsing method, apparatus, electronic device, storage medium, and program product. This solution initializes a Bloom filter based on historical alarm message samples and a pre-configured rule template library. The Bloom filter includes a whitelist Bloom filter and a blacklist Bloom filter. It receives raw event notification messages from network devices, parses and extracts the object identifier, source device IP address, and variable binding list from the raw event notification messages, queries the Bloom filter using the object identifier, and determines the message routing type of the raw event notification messages based on the query results. The message routing... The flow types include known alarm messages, known non-alarm messages, and unknown messages. Based on the object identifier, source device IP address, and variable binding list of the unknown message, the best matching template is obtained from the rule template library. Parsing rules are generated based on the best matching template and the variable binding list of the unknown message. If the similarity between the best matching template and the unknown message is less than a preset threshold, the unknown message is marked as a completely unknown message. Cluster analysis is performed on all completely unknown messages to obtain cluster statistics. The parsing rules and cluster statistics corresponding to the completely unknown messages are sent to the audit object to obtain the audit instructions from the audit object. The rule template library and / or Bloom filter are updated according to the audit instructions. This invention initializes a Bloom filter based on historical alarm message samples and automatically generates parsing rules for unknown messages through template matching. This changes the traditional approach of manually writing parsing rules for each device model and alarm type, significantly reducing configuration workload. Through the Bloom filter's traffic diversion mechanism, messages that do not match the blacklist or whitelist are marked as unknown messages. For completely unknown messages that fail to match, further cluster analysis is performed and sent to the auditing entity. This proactively discovers new alarm types brought about by device firmware upgrades or new device access, preventing important faults from being missed. The auditing entity reviews and confirms the automatically generated parsing rules and cluster statistics, and updates the rule template library and / or Bloom filter according to the audit instructions. This allows the system to continuously improve itself as the network environment changes, without requiring continuous manual investment of large resources for rule maintenance, forming a long-term stable optimization closed loop. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of an implementation environment for the alarm parsing method based on template matching provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating the alarm parsing method based on template matching provided in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating a flowchart of the alarm parsing method based on template matching provided in an embodiment of the present invention; Figure 4This is a schematic diagram of the overall architecture of automatic parsing of SNMP Trap alarms based on template matching provided in an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the principle of the template matching algorithm provided in this embodiment of the invention; Figure 6 This is a schematic diagram of the alarm parsing device based on template matching provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of this invention; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this invention as detailed in the appended claims.

[0022] It is understood that the terms "first," "second," etc., used in this invention may be used to describe various concepts, but unless specifically stated otherwise, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of embodiments of this invention, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words "if" or "when" as used herein may be interpreted as "when," "in response to determination," or "in the event of a determination."

[0023] The terms “at least one,” “multiple,” “each,” “any,” etc., used in this invention, “at least one” includes one, two, or more than two; “multiple” includes two or more than two; “each” refers to each of the corresponding multiple; and “any” refers to any one of the multiple.

[0024] Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this invention is for descriptive purposes only and is not intended to limit the invention.

[0025] To facilitate understanding of the technical solution of this invention, the following explanations are provided regarding the technical terms that may be involved in the technical solution of this invention: SNMP (Simple Network Management Protocol): An application layer protocol used for the management and monitoring of network devices, defining the communication specifications between the administrator (NMS) and the agent.

[0026] SNMP Trap: An event notification message actively sent by the SNMP Agent of a network device to the NMS, used to report changes in device status or fault information.

[0027] MIB (Management Information Base): A structured database used to store manageable parameter information for network devices. The MIB is organized in a tree structure, with each manageable device parameter (such as interface bandwidth, CPU utilization, and port status) corresponding to a unique "address," or OID (Object Identifier). For example, the "operating status of device Ethernet interface 1" will be assigned a specific OID, which the management system can use to accurately read or modify the parameter. The MIB stores the data's name, type, and access permissions (such as read-only or write).

[0028] Trap OID (Object Identifier): A unique identifier for managed objects in the MIB. It uses a hierarchical structure to distinguish different types of Trap messages.

[0029] Rule Template: A structured template built based on known alarm parsing rules, containing reusable rule elements such as OID features and alarm field mappings.

[0030] Bloom Filter: An efficient data structure consisting of a binary vector and multiple hash functions, used to quickly determine whether an element belongs to a set. It features high space efficiency, fast query speed, and allows for an extremely low false positive rate.

[0031] Existing solutions in related technologies suffer from problems such as high manual configuration workload and insufficient ability to handle unknown alarms. Therefore, there is an urgent need for an alarm parsing method that can automatically generate parsing rules and intelligently identify unknown alarms.

[0032] In view of this, this invention provides an alarm parsing method and related equipment based on template matching. This method obtains historical alarm message samples and a pre-configured rule template library, and initializes a Bloom filter based on the historical alarm message samples. The Bloom filter includes a whitelist Bloom filter and a blacklist Bloom filter. It receives raw event notification messages from network devices, parses and extracts the object identifier, source device IP address, and variable binding list of the raw event notification message, queries the Bloom filter using the object identifier, and determines the message routing type of the raw event notification message based on the query result. The message routing type includes known alarms. The system identifies and handles messages, including known non-alarm messages and unknown messages. Based on the object identifier, source device IP address, and variable binding list of the unknown message, it matches the best matching template from the rule template library. Based on the best matching template and the variable binding list of the unknown message, it generates parsing rules. If the similarity between the best matching template and the unknown message is less than a preset threshold, the unknown message is marked as a completely unknown message. It performs cluster analysis on all completely unknown messages to obtain cluster statistics. The system then sends the parsing rules and cluster statistics corresponding to the completely unknown messages to the auditing entity to obtain audit instructions. Based on these instructions, it updates the rule template library and / or the Bloom filter. This invention initializes a Bloom filter based on historical alarm message samples and automatically generates parsing rules for unknown messages through template matching. This changes the traditional approach of manually writing parsing rules for each device model and alarm type, significantly reducing configuration workload. Through the Bloom filter's traffic diversion mechanism, messages that do not match the blacklist or whitelist are marked as unknown messages. For completely unknown messages that fail to match (similarity below the threshold), further cluster analysis is performed and the messages are sent to the auditing entity. This proactively discovers new alarm types brought about by device firmware upgrades or new device access, preventing important faults from being missed. The auditing entity reviews and confirms the automatically generated parsing rules and cluster statistics, and updates the rule template library and / or Bloom filter according to the audit instructions. This allows the system to continuously improve itself as the network environment changes, without requiring a large amount of manual resources for rule maintenance, forming a long-term stable optimization loop.

[0033] It is understood that the template-matching-based alarm parsing method provided by this invention can be applied to any computer device with data processing and computing capabilities, and this computer device can be various terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal can be a smartphone, tablet, laptop, or desktop computer, but it is not limited to these.

[0034] like Figure 1 The diagram shown is a schematic representation of an implementation environment provided by an embodiment of the present invention. (Refer to...) Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected via a network, either wirelessly or via a wired connection, to complete data transmission and exchange.

[0035] Server 101 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0036] Additionally, server 101 can also be a node server in a blockchain network. Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms.

[0037] Terminal 102 can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. Terminal 102 and server 101 can be directly or indirectly connected via wired or wireless communication, and this embodiment of the invention does not impose any limitations.

[0038] For example, based on Figure 1 The implementation environment shown in this embodiment of the invention provides an alarm parsing method based on template matching. The following description uses the application of this alarm parsing method based on template matching in server 101 as an example. It can be understood that this alarm parsing method based on template matching can also be applied to terminal 102.

[0039] Reference Figure 2 , Figure 2 This is an optional flowchart of the template matching-based alarm parsing method provided in the embodiments of the present invention. The execution subject of the template matching-based alarm parsing method can be any of the aforementioned computer devices (including servers or terminals). Figure 2 The method may include, but is not limited to, steps S100 to S500.

[0040] Step S100: Obtain historical alarm message samples and a pre-configured rule template library, and initialize a Bloom filter based on the historical alarm message samples; Among them, Bloom filters include whitelist Bloom filters and blacklist Bloom filters; It should be noted that in some embodiments, step S100 may include the following steps: obtaining historical alarm message samples and pre-configured identifier mapping tables and alarm rule templates from the database, and loading the identifier mapping tables and alarm rule templates into the memory cache to form a rule template library; wherein, the historical alarm message samples are marked with message types of known alarm messages or known non-alarm messages; the alarm rule templates are associated with device information, sample object identifiers, field mapping relationships and at least one typical message example; extracting the sample object identifiers of each historical alarm message sample, storing the sample object identifiers of message types of known alarm messages into the set of whitelist Bloom filters, and storing the sample object identifiers of message types of known non-alarm messages into the set of blacklist Bloom filters; wherein, the sample object identifiers are stored in the whitelist Bloom filters and blacklist Bloom filters in the form of binary vectors and hash functions.

[0041] For example, in some specific implementations, the pre-configured rule template library can be implemented as follows: the rule template library contains OIDs and alarm rule templates for different network devices. In specific implementations, firstly, an OID mapping table is configured according to the device model, manufacturer information, and alarm type. Then, a corresponding alarm rule template is written for each OID, and field mapping relationships are set so that after receiving a Trap message, the variables in the message are bound to the corresponding positions in the template. Simultaneously, one or more typical messages can be recorded for each template for subsequent calculation of message similarity.

[0042] Step S200: Receive the original event notification message from the network device, parse and extract the object identifier, source device IP address and variable binding list of the original event notification message, query the Bloom filter using the object identifier, and determine the message routing type of the original event notification message based on the query result; Among them, the message routing types include known alarm messages, known non-alarm messages, and unknown messages; It should be noted that in some embodiments, step S200 may include the following steps: receiving the original event notification message through the User Datagram Protocol (UDP) port, decoding it according to the protocol format corresponding to the original event notification message, and extracting the object identifier, source device IP address, and variable binding list containing multiple variable binding items carried in the original event notification message; wherein, each variable binding item includes a sub-object identifier, data type, and specific value; inputting the object identifier into the whitelist Bloom filter and the blacklist Bloom filter respectively for hash lookup; if the whitelist Bloom filter returns a hit, marking the original event notification message as a known alarm message and sending it to the alarm reporting channel; if the blacklist Bloom filter returns a hit, marking the original event notification message as a known non-alarm message and discarding it; if neither the whitelist Bloom filter nor the blacklist Bloom filter returns a hit, marking the original event notification message as an unknown message.

[0043] For example, in some specific implementations, SNMP Trap alarm messages from network devices are received in real time, and a Bloom filter is used for blacklisting and whitelisting. During Bloom filter initialization, OIDs of known alarm messages are added to the whitelist, and OIDs of known non-alarm messages are added to the blacklist. When a new Trap alarm is received, the system first performs a fast hash lookup on the OID to determine whether further processing is required.

[0044] Specifically, the alarm filtering implementation based on Bloom filters uses two independent Bloom filters to manage the whitelist and blacklist respectively. The whitelist Bloom filter stores the OIDs of known alarms; these OIDs' messages have already generated alarm rules, so creating new rules is unnecessary. The blacklist Bloom filter stores known non-alarm OIDs that need to be ignored; these OIDs typically generate noisy or irrelevant messages.

[0045] This invention significantly improves system filtering efficiency through the application of a Bloom filter. Memory usage is greatly reduced compared to traditional hash table methods, resulting in a significant improvement in response time.

[0046] Step S300: Based on the object identifier, source device IP address and variable binding list of the unknown message, the best matching template is obtained from the rule template library. Based on the best matching template and the variable binding list of the unknown message, a parsing rule is generated. If the similarity between the best matching template and the unknown message is less than a preset threshold, the unknown message is marked as a completely unknown message. It should be noted that each template in the rule template library is associated with device information, sample object identifiers, and field mapping relationships. In some embodiments, the best matching template is obtained from the rule template library based on the object identifier of the unknown message, the source device IP address, and the variable binding list. This may include the following steps: taking the first template in the rule template library as a candidate template; quantifying a first similarity based on the object identifier of the unknown message and the sample object identifier of the candidate template; quantifying a second similarity based on the source device IP address of the unknown message and the device information of the candidate template; determining a first variable structure based on the variable binding list of the unknown message and a second variable structure based on the field mapping relationship of the candidate template; quantifying a third similarity based on the first and second variable structures; performing a weighted sum of the first, second, and third similarities to obtain the comprehensive similarity between the unknown message and the candidate template; taking the next template in the rule template library as a candidate template and returning to execute the step of quantifying the first similarity based on the object identifier of the unknown message and the sample object identifier of the candidate template, until all templates in the rule template library have been traversed; and taking the template with the highest comprehensive similarity as the best matching template.

[0047] For example, in some specific implementations, for unknown messages that are neither in the whitelist nor the blacklist after filtering, the system selects the best matching template from the rule template library based on a template matching algorithm. First, feature information is extracted from SNMP Trap alarms, including OID structure, variable binding content and format, and device information. Then, the similarity score between the unknown alarm and each template is calculated, and a weighted algorithm is used to comprehensively evaluate OID similarity, variable binding similarity, and device similarity. When the similarity reaches a preset threshold, the corresponding parsing rule is automatically generated.

[0048] Specifically, the implementation of the similarity calculation algorithm: The similarity is calculated according to the following logic, and each calculation result is normalized and assigned a weight to finally obtain the total similarity (comprehensive similarity).

[0049] OID: The difference in OID length, the number of consecutive identical OID levels starting from the first level, and the difference in value between each level of OID starting from the first level. Variable binding characteristics: differences in the number of variables, differences in the types and value lengths of variables in the same order; Device characteristics: similarity of source device IP address control segment, whether the device types are the same; In some preferred implementations, each template in the rule template library is associated with a typical message. The fourth similarity can be quantified based on the unknown message and the typical message. The final comprehensive similarity can be obtained by weighted summation of the first to fourth similarities.

[0050] It should be noted that, in some embodiments, generating parsing rules based on the best matching template and the variable binding list of the unknown message may include the following steps: based on the field mapping relationship of the best matching template, using the object identifier of the unknown message and each variable binding item in the variable binding list to replace characters at the corresponding positions of the best matching template to generate parsing rules.

[0051] For example, in some specific implementations, the rule generation and verification mechanism is as follows: when a template matches successfully and the similarity exceeds a threshold, the system automatically generates parsing rules. This includes replacing the OID of the matched rule template with the Trap OID of the current unknown message, and replacing the OID of the variable binding in the field mapping with the OID of the current unknown message at the same position in the variable binding list of the template message example.

[0052] Step S400: Perform cluster analysis on all completely unknown messages to obtain cluster statistics; It should be noted that, in some embodiments, step S400 may include the following steps: extracting the hierarchical length and hierarchical numerical sequence as OID features based on the object identifier of each completely unknown message; extracting the variable quantity and type distribution as variable binding features based on the variable binding list of each completely unknown message; extracting network segment information as device features based on the source device IP address of each completely unknown message; combining the OID features, variable binding features, and device features of the same completely unknown message into the feature vector of the corresponding completely unknown message; using the K-Means clustering algorithm to iteratively cluster and group the feature vectors of all completely unknown messages to obtain the clustering results and determine the clustering statistics; wherein, the clustering statistics include the cluster center, message sample quantity, first occurrence time, most recent occurrence time, and representative message sample corresponding to each cluster group.

[0053] For example, in some specific implementations, for unknown messages that cannot be matched with any template, the system performs cluster analysis and stores the samples. Specifically, it extracts key feature vectors of unknown alarms, uses a clustering algorithm to group the feature vectors, identifies alarm patterns with similar features, and generates alarm feature descriptions and statistical information for each cluster.

[0054] Specifically, for unknown alarms that cannot be matched, the system extracts feature vectors for cluster analysis. The features used to generate the feature vectors are the same as those used in the similarity algorithm. The extracted features are then clustered using the K-Meas. This invention can promptly detect entirely new Trap alarm types and notify manual verification in a timely manner, preventing important alarms from being missed.

[0055] Step S500: Send the parsing rules and clustering statistics corresponding to the completely unknown message to the audit object to obtain the audit instruction from the audit object, and update the rule template library and / or Bloom filter according to the audit instruction; It should be noted that the audit instructions include a first audit instruction for the parsing rules corresponding to each completely unknown message and a second audit instruction for each cluster group in the cluster statistics. In some embodiments, updating the rule template library and / or Bloom filter according to the audit instructions may include the following steps: traversing each first audit instruction, if the first audit instruction is accepted, persisting the corresponding parsing rule to the formal rule library and adding the object identifier of the corresponding completely unknown message to the whitelist Bloom filter; otherwise, adding the object identifier of the corresponding completely unknown message to the blacklist Bloom filter; traversing each second audit instruction, if the second audit instruction is confirmed as a new alarm type, writing the manually input new alarm rule template to the rule template library, generating a new parsing rule based on the new alarm rule template and writing it to the formal rule library, and adding the object identifier of the corresponding completely unknown message to the whitelist Bloom filter; otherwise, adding the object identifier of the corresponding completely unknown message to the blacklist Bloom filter.

[0056] For example, in some specific implementations, the correctness of automatically generated parsing rules is manually verified, and the rules are selected to be officially added to the rule base, added to the blacklist, or ignored directly. For unknown messages that cannot match any template, the meaning of the message is manually confirmed, and the rules and rule templates are manually created for it, added to the blacklist, or ignored directly. Specifically, after manual review and approval, the OID should be added to the whitelist Bloom filter, and the blacklist Bloom filter should also be updated when manually selecting to add it to the blacklist.

[0057] To explain in detail the principle of the technical solution of the present invention, the overall process of the present invention will be described below with reference to some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and should not be regarded as a limitation of the present invention.

[0058] First, it's important to note that in the field of data filtering, Bloom filters, as a highly efficient probabilistic data structure, have been widely used in scenarios such as duplicate data detection and spam filtering. Bloom filters can achieve fast member lookups with extremely low memory usage, making them ideal for filtering large-scale data streams. However, there is currently no effective solution for applying Bloom filters to SNMP Trap alarm filtering.

[0059] Template matching, as an important method in pattern recognition, has wide applications in text processing, image recognition, bioinformatics, and many other fields. Template matching quickly finds the best match by calculating the similarity between the object to be matched and a predefined template. In SNMP Trap alarm parsing, alarm messages from devices of the same manufacturer often share certain similarities in structure and content, making template matching a viable application.

[0060] This invention provides an alarm parsing method based on template matching, such as... Figure 3 The diagram illustrates a flowchart of the method of this invention, demonstrating the complete processing flow from receiving Trap alarms to outputting parsing results, including main steps such as initialization, receiving and filtering, template matching, rule generation, and handling unknown alarms; Figure 4 The diagram illustrates the overall architecture of the template-matching-based automatic SNMP Trap alarm parsing system provided in this embodiment of the invention. It showcases examples of each core module and their interrelationships, as well as the interaction between the system and external network devices and the network management system. In some specific implementations, the method includes: pre-configuring a rule template library containing different types of OIDs and alarm message templates; after receiving SNMP Trap messages, using a Bloom filter for blacklist / whitelist filtering to exclude known alarm messages and known non-alarm messages; for the filtered unknown messages, selecting the best matching template from the rule template library based on a template matching algorithm; automatically generating corresponding parsing rules when the matching similarity reaches a preset threshold; performing cluster analysis on unmatched unknown messages and storing samples; finally, notifying manual processing to review the automatically generated parsing rules and manually identifying the clustered and stored unknown message samples. This invention solves the technical problems of low efficiency, high workload, and easy omission of unknown alarms in traditional manual configuration of SNMP Trap alarm parsing rules. It achieves automatic generation of alarm parsing rules and automatic discovery of unknown alarms, reducing configuration workload by more than 90% and significantly improving the efficiency and accuracy of network operation and maintenance.

[0061] Specifically, the purpose of this invention is to overcome the shortcomings of existing technologies and provide an automatic parsing method for SNMP Trap alarms based on template matching. More specifically, this invention aims to solve the following technical problems: 1. Reduce manual configuration workload: Through an automated rule generation mechanism, the workload of network administrators in manually configuring and parsing rules is greatly reduced, improving the efficiency of system deployment and maintenance.

[0062] 2. Improve the ability to handle unknown alarms: Through intelligent template matching and cluster analysis algorithms, automatically identify and process alarms of unknown types, reducing the risk of missing important faults.

[0063] 3. Improve system filtering efficiency: Adopt efficient data structures such as Bloom filters, optimize the alarm message filtering mechanism, reduce system resource consumption, and improve processing performance.

[0064] To achieve the above objectives, this invention provides an automatic parsing method for SNMP Trap alarms based on template matching, which includes the following core steps: Step 1: Pre-configure the rule template library; Step 2: Receive and filter SNMP Trap alarms; Step 3: Template matching and rule generation; Step 4: Handling unknown alarms; Step 5: Manual verification.

[0065] In some specific embodiments, the method of the present invention can be implemented as follows: Step 1: Pre-configure the rule template library; The rule template library contains OIDs and alarm rule templates for different network devices. In practice, firstly, an OID mapping table is configured based on device model, manufacturer information, and alarm type. Then, a corresponding alarm rule template is written for each OID, setting field mapping relationships so that upon receiving a Trap message, the variables in the message are bound to the corresponding positions in the template. Simultaneously, one or more typical messages are recorded for each template for subsequent calculation of message similarity.

[0066] Step 2: Receive and filter SNMP Trap alarms; The system receives SNMP Trap alarm messages from network devices in real time and uses a Bloom filter for blacklisting and whitelisting. During Bloom filter initialization, OIDs of known alarm messages are added to the whitelist, and OIDs of known non-alarm messages are added to the blacklist. When a new Trap alarm is received, the system first performs a fast hash lookup on the OID to determine if further processing is required.

[0067] Beneficial effects: By applying a Bloom filter, the system's filtering efficiency is significantly improved. Memory usage is greatly reduced compared to traditional hash table methods, resulting in a significant improvement in response time.

[0068] Step 3: Template matching and rule generation; For unknown packets that are neither in the whitelist nor the blacklist after filtering, the system selects the best matching template from the rule template library based on a template matching algorithm. First, feature information is extracted from SNMP Trap alarms, including OID structure, variable binding content and format, and device information. Then, the similarity score between the unknown alarm and each template is calculated, and a weighted algorithm is used to comprehensively evaluate OID similarity, variable binding similarity, and device similarity. When the similarity reaches a preset threshold, the corresponding parsing rule is automatically generated.

[0069] Beneficial effects: Through an automated rule generation mechanism, more than 90% of the manual configuration work is automated.

[0070] Step 4: Handling unknown alarms; For unknown messages that cannot be matched with any template, the system performs cluster analysis and stores the samples. Specifically, it extracts the key feature vectors of unknown alarms, uses a clustering algorithm to group the feature vectors, identifies alarm patterns with similar features, and generates alarm feature descriptions and statistical information for each cluster.

[0071] Beneficial effects: It can promptly identify new Trap alarm types and notify manual verification in a timely manner, preventing important alarms from being missed. Step 5: Manual verification; For automatically generated parsing rules, their correctness is manually verified, and options are selected such as officially adding them to the rule base, adding them to the blacklist, or ignoring them directly. For unknown messages that cannot match any template, the meaning of the message is manually confirmed, and options are selected such as manually creating rules and rule templates for them, adding them to the blacklist, or ignoring them directly.

[0072] In some specific application scenarios, the technical solution of this invention can be implemented using the following configuration and environment: System hardware configuration: CPU: Intel Xeon E5-2680 v4, 8 cores and 16 threads, 2.4GHz; Memory: 32GB DDR4 ECC memory; Storage: 2TB SATA hard drives, configured as a RAID1 array; Network: Dual Gigabit Ethernet cards, supporting network redundancy; The system is deployed using virtualization and runs on the VMware vSphere 6.5 platform. The virtual machine is configured with 8 vCPUs, 16GB of memory, and 500GB of storage space, and the operating system is CTYunOS.

[0073] Software operating environment: Operating system: CTYunOS (China Telecom Cloud); Java runtime environment: OpenJDK 21; Database: MySQL 8.4.7; Caching system: Redis 7.2.12; Message queue: Apache Kafka 4.1.0; Web server: Nginx 1.29.3; Application framework: Spring Boot 3.5.0.

[0074] Various network devices (routers, switches, firewalls, servers, etc.) are configured with SNMP Trap, pointing to the system's Trap receiving server IP address, such as 192.168.200.100:162. All devices use the SNMPv2c protocol, with the community string being "public".

[0075] In some specific application scenarios, the detailed implementation of the rule template library of the present invention is as follows: OID Mapping Table Configuration: The core of the rule template library is the OID mapping table, which establishes the correspondence between devices, manufacturers, alarm types, and OIDs. Table 1 shows a simplified example of an OID mapping table: Table 1

[0076] The OID mapping table is stored in the database in JSON format. When the system starts, the mapping table is loaded into the memory cache to improve query efficiency.

[0077] Examples of alarm rule template design in some specific application scenarios are as follows: Alert rule templates are used to match variable bindings in Trap messages. Each template contains the following elements: Template ID (templateId): A unique identifier; OID(OID): The corresponding OID; Alarm Name: The default name for automatically generated alarm rules; Alarm Type: The default type for automatically generated alarm rules; Alarm Level: The default level for automatically generated alarm rules; Variable Expression: Used to extract key information from the variable bindings of the Trap message and map it to the message template; Alarm template: Used to define the format of alarm messages reported to other systems for processing; Priority: The default priority of automatically generated alarm rules. When a Trap message can match multiple rules, the priority determines which rule to match. Typical messages (messageSamples): Typical messages for this rule template, used to calculate the similarity between unknown messages and this rule template; Comments: Notes or comments; The following is a sample alarm rule template (this is only an example of the template style; the actual content and format can be adjusted according to needs and should not be considered a limitation on the technical solution of this invention): { "templateId": "3", "OID": "1.3.6.1.4.1.2011.5.22.1.6.1", "alarmName": "Alarm from Vendor A", "alarmType": "Interface alarm", "alarmLevel": "2", "variableExpression": "[{\"key\": \"alarmProblem\", \"value\": \"${GetByLine(1)}\"}, {\"key\": \"locationInfo\", \"value\": \"Interface Index:${GetByOID(1.3.6.1.4.1.2011.5.22.1.6.2)}\"}]", "alarmTemplate": "{\"ALARMTYPE\":\"${alarmType}\",\"VENDOR\":\"${vendor}\",\"EQUIPMENTNAME\":\"${devName}\",\"IPADDRESS\":\"${ip}\",\"ALARMTITLE\":\"${alarmName}\",\"EVENTTIME\":\"${even tTime}\",\"STATE\":${alarmState},\"ALARMID\":\"${alarmId}\",\"ALARMLEVEL\":\"${alarmLevel}\",\"LOCATIONINFO\":\"${locationInfo}\",\"ALARM_PROBLEM\":\"${alarmProblem}\"}", "priority": 500, "messageSamples": [{"trapOid": "1.3.6.1.4.1.2011.5.22.1.6.1","sourceIp": "10.42.3.1","varBinds": [{"oid": "1.3.6.1.4.1.2011.5.22.1.6.2","type": "i","value": "255"},{"oid": "1.3.6.1.4.1.2011.5.22.1.6.2","type": "i","value": "128"}]}],{"trapOid": "1.3.6.1.4.1.2011.5.22.1.6.1","sourceIp": "10.42.3.1","varBinds": [{"oid": "1.3.6.1.4.1.2011.5.22.1.6.2","type": "i","value": "254"},{"oid": "1.3.6.1.4.1.2011.5.22.1.6.2","type": "i","value": "127"}]}], "comment": "" } like Figure 5 The diagram illustrates the principle of the template matching algorithm in this embodiment of the invention, demonstrating the specific processes of feature extraction, similarity calculation, weighted evaluation, and template selection, and illustrating how to select the best matching template from multiple candidate templates. In some specific application scenarios, alarm filtering based on Bloom filters can be implemented as follows: The system uses two separate Bloom filters to manage the whitelist and blacklist respectively: Whitelist Bloom filter: Stores the OIDs of known alarms. The messages of these OIDs have already generated alarm rules, so there is no need to create new rules.

[0078] Blacklist Bloom filter: Stores known non-alarm OIDs that need to be ignored, as these OIDs often generate noisy or irrelevant messages.

[0079] In some specific application scenarios, feature extraction algorithms can be implemented as follows: Extract the following features from unknown messages: OID structural characteristics: OID length, OID hierarchical structure, OID numerical range; Variable binding characteristics: number of variables, distribution of variable types, and length of variable values; Device characteristics: source device IP address range, associated device type.

[0080] In some specific application scenarios, similarity calculation algorithms can be implemented as follows: The similarity is calculated according to the following logic, and each calculation result is normalized and assigned a weight to finally obtain the total similarity.

[0081] OID: The difference in OID length, the number of consecutive identical OID levels starting from the first level, and the difference in value between each level of OID starting from the first level. Variable binding characteristics: differences in the number of variables, differences in the types and value lengths of variables in the same order; Device characteristics: similarity of source device IP ground control segment, whether the device types are the same.

[0082] In some specific application scenarios, the generation and verification mechanism can be implemented as follows: When a template match is successful and the similarity exceeds a threshold, the system automatically generates parsing rules. This includes replacing the OID of the matched rule template with the Trap OID of the current unknown message, and replacing the OID of the variable binding in the field mapping with the OID of the current unknown message at the same position in the variable binding list of the template message example.

[0083] In some specific application scenarios, validity verification can be implemented as follows: The validity verification mechanism includes: Syntax validation: Checks the syntax of the message template, such as whether the message template is valid JSON; Logical validation: Validates the completeness and correctness of the field mapping, and verifies whether each field used in the message template is a built-in field or is defined in the field mapping; Compatibility check: Check for conflicts with other rules. If conflicts are found, please indicate them in the remarks.

[0084] In some specific application scenarios, cluster analysis of unknown alarms can be implemented as follows: For unknown alarms that cannot be matched, the system extracts feature vectors for cluster analysis. The features used to generate the feature vectors are the same as those used in the similarity algorithm. The extracted features are then clustered using the K-Meas.

[0085] The extended implementation of this invention includes three dimensions: cloud computing environment deployment, edge computing integration, and artificial intelligence enhancement. Regarding cloud computing deployment, this invention can encapsulate each functional module using Docker containers, combined with Kubernetes container orchestration to achieve automatic scaling and fault recovery. Simultaneously, the Trap message receiving module, filtering module, feature extraction module, similarity calculation module, rule generation and verification module, and unknown alarm clustering module are separated into independent microservices. Data is transmitted through RESTful interfaces or Kafka, and service communication is managed using a service mesh (such as Istio), enabling independent deployment and upgrades of each service. Regarding edge computing integration, this invention can deploy lightweight processing nodes at the network edge. The edge layer completes local alarm preprocessing, preliminary filtering, and simple matching; the aggregation layer performs complex template matching and rule generation; and the central layer is responsible for global policy management and statistical analysis. Collaborative processing is achieved through rule synchronization between edge nodes, model update distribution from the central node, and a distributed learning mechanism. Furthermore, this invention can also integrate artificial intelligence technology, using deep learning models (such as neural networks) for template matching to improve matching accuracy, or introduce large language models to automatically generate alarm descriptions and processing suggestions, further reducing human intervention and comprehensively improving the intelligence level of the system.

[0086] In summary, this invention proposes a method to perform similarity analysis on unknown Trap alarm messages, automatically generate alarm rules for highly similar Trap alarm messages, cluster low-similarity messages, and notify operations and maintenance personnel. The proposed method reduces the probability of missing important alarms and improves the efficiency of adapting to important alarms. Furthermore, this invention proposes using a Bloom filter to quickly confirm whether a Trap message is an unknown message.

[0087] Specifically, the technical solution of the present invention achieves at least the following technical innovations: Technical point 1: Template matching and rule generation; For unknown messages, the system selects the best matching template from the rule template library based on the template matching algorithm and automatically generates the corresponding parsing rules.

[0088] Beneficial effects: Through an automated rule generation mechanism, this invention can automate more than 90% of the manual configuration work in traditional methods.

[0089] Technical Point 2: Bloom filters are used for blacklist and whitelist filtering; By using a Bloom filter, we can quickly distinguish which messages are known alarms that can be reported directly, which messages can be ignored, and which messages are unknown and require manual verification.

[0090] Beneficial effects: Significantly improves filtering efficiency, reduces memory usage, and increases the speed at which the system processes alarms.

[0091] Technical point 3: Automatically identify and report unknown alarms; Equipment upgrades may introduce entirely new alarm types, which alarm system administrators may not be aware of and may not have configured rules for these new alarms in a timely manner. This invention can efficiently identify unknown alarms through Bloom filters, cluster them, and then notify manual verification.

[0092] Beneficial effects: Timely notification to operations and maintenance personnel of newly discovered alarm types, preventing important new alarms from being overlooked. Clustering unknown messages reduces the workload of manual identification.

[0093] Specifically, this invention automatically finds the alarm template with the highest similarity based on a template matching algorithm, generates SNMPTrap alarm parsing rules, and reduces the workload of manual configuration; it improves the efficiency of alarm Trap OID filtering by using a Bloom filter; and it notifies manual verification after clustering unknown alarm messages, reducing the workload of manual identification. Compared with the prior art, this invention has at least the following beneficial effects: 1. Reduces the manual configuration work of alarm rules for new alarm types; 2. Improves alarm filtering efficiency; 3. Promptly notifies maintenance personnel of the discovery of new alarm types, preventing important new alarms from being ignored.

[0094] like Figure 6 As shown, this embodiment of the invention also provides an alarm parsing device 900 based on template matching, which can implement the above-described method. This device may include: The first module 901 is used to obtain historical alarm message samples and a pre-configured rule template library, and initialize Bloom filters based on the historical alarm message samples; wherein, the Bloom filters include whitelist Bloom filters and blacklist Bloom filters; The second module 902 is used to receive raw event notification messages from network devices, parse and extract the object identifier, source device IP address and variable binding list of the raw event notification messages, query the Bloom filter using the object identifier, and determine the message routing type of the raw event notification messages based on the query results; wherein, the message routing type includes known alarm messages, known non-alarm messages and unknown messages; The third module 903 is used to obtain the best matching template from the rule template library based on the object identifier, source device IP address and variable binding list of the unknown message, generate parsing rules based on the best matching template and the variable binding list of the unknown message, and mark the unknown message as a completely unknown message if the similarity between the best matching template and the unknown message is less than a preset threshold. Module 4, 904, is used to perform cluster analysis on all completely unknown messages to obtain cluster statistics. Module 5, 905, is used to send the parsing rules and clustering statistics corresponding to completely unknown messages to the audit object in order to obtain the audit instructions from the audit object and update the rule template library and / or Bloom filter according to the audit instructions.

[0095] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0096] This invention also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0097] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0098] like Figure 7 As shown, Figure 7 The hardware structure of an electronic device 1000 according to another embodiment is illustrated. The electronic device 1000 includes: The processor 1001 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (aSIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention. The memory 1002 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RaM). The memory 1002 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1002 and is called and executed by the processor 1001. Input / output interface 1003 is used to implement information input and output; The communication interface 1004 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1005 transmits information between various components of the device (e.g., processor 1001, memory 1002, input / output interface 1003, and communication interface 1004); The processor 1001, memory 1002, input / output interface 1003 and communication interface 1004 are connected to each other within the device via bus 1005.

[0099] The electronic device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0100] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0101] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0102] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0103] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0104] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0105] The alarm parsing method, apparatus, electronic device, storage medium, and program product based on template matching provided in this invention initialize a Bloom filter based on historical alarm message samples and a pre-configured rule template library. The Bloom filter includes a whitelist Bloom filter and a blacklist Bloom filter. The method receives raw event notification messages from network devices, parses and extracts the object identifier, source device IP address, and variable binding list from the raw event notification messages, queries the Bloom filter using the object identifier, and determines the message routing type of the raw event notification message based on the query result. The message routing type includes known... The system identifies alarm messages, known non-alarm messages, and unknown messages. Based on the object identifier, source device IP address, and variable binding list of the unknown message, it matches the best matching template from the rule template library. Based on the best matching template and the variable binding list of the unknown message, it generates parsing rules. If the similarity between the best matching template and the unknown message is less than a preset threshold, the unknown message is marked as a completely unknown message. It performs cluster analysis on all completely unknown messages to obtain cluster statistics. The system then sends the parsing rules and cluster statistics corresponding to the completely unknown messages to the auditing entity to obtain audit instructions. Based on these instructions, it updates the rule template library and / or the Bloom filter. This invention initializes a Bloom filter based on historical alarm message samples and automatically generates parsing rules for unknown messages through template matching. This changes the traditional approach of manually writing parsing rules for each device model and alarm type, significantly reducing configuration workload. Through the Bloom filter's traffic diversion mechanism, messages that do not match the blacklist or whitelist are marked as unknown messages. For completely unknown messages that fail to match (similarity below the threshold), further cluster analysis is performed and the messages are sent to the auditing entity. This proactively discovers new alarm types brought about by device firmware upgrades or new device access, preventing important faults from being missed. The auditing entity reviews and confirms the automatically generated parsing rules and cluster statistics, and updates the rule template library and / or Bloom filter according to the audit instructions. This allows the system to continuously improve itself as the network environment changes, without requiring a large amount of manual resources for rule maintenance, forming a long-term stable optimization loop.

[0106] The embodiments described in this invention are for the purpose of more clearly illustrating the technical solutions of the embodiments of this invention, and do not constitute a limitation on the technical solutions provided by the embodiments of this invention. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this invention are also applicable to similar technical problems.

[0107] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present invention, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0108] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0109] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0110] The preferred embodiments of the present invention have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and spirit of the present invention should be within the scope of the claims of the present invention.

Claims

1. An alarm parsing method based on template matching, characterized in that, The method includes the following steps: Obtain historical alarm message samples and a pre-configured rule template library, and initialize a Bloom filter based on the historical alarm message samples; wherein, the Bloom filter includes a whitelist Bloom filter and a blacklist Bloom filter; The system receives raw event notification messages from network devices, parses and extracts the object identifier, source device IP address, and variable binding list of the raw event notification messages, uses the object identifier to query the Bloom filter, and determines the message routing type of the raw event notification messages based on the query results; wherein, the message routing type includes known alarm messages, known non-alarm messages, and unknown messages; Based on the object identifier, the source device IP address, and the variable binding list of the unknown message, the best matching template is obtained from the rule template library. Based on the best matching template and the variable binding list of the unknown message, a parsing rule is generated. If the similarity between the best matching template and the unknown message is less than a preset threshold, the unknown message is marked as a completely unknown message. Cluster analysis was performed on all the completely unknown messages to obtain cluster statistics. The parsing rules and clustering statistics corresponding to the completely unknown message are sent to the auditing object to obtain the auditing object's auditing instructions, and the rule template library and / or the Bloom filter are updated according to the auditing instructions.

2. The method according to claim 1, characterized in that, The process of obtaining historical alarm message samples and a pre-configured rule template library, and initializing a Bloom filter based on the historical alarm message samples, includes the following steps: Retrieve historical alarm message samples, pre-configured identifier mapping tables, and alarm rule templates from the database. The identifier mapping table and the alarm rule template are loaded into the memory cache to form the rule template library; The historical alarm message samples are marked with known alarm message or known non-alarm message message types; the alarm rule template is associated with device information, sample object identifier, field mapping relationship and at least one typical message example; Extract the sample object identifier from each of the historical alarm message samples, store the sample object identifiers of the message type known alarm message into the set of the whitelist Bloom filter, and store the sample object identifiers of the message type known non-alarm message into the set of the blacklist Bloom filter; wherein, the sample object identifier is stored in the whitelist Bloom filter and the blacklist Bloom filter in the form of a binary vector and a hash function.

3. The method according to claim 1, characterized in that, The process of receiving raw event notification messages from network devices, parsing and extracting the object identifier and variable binding list of the raw event notification messages, querying the Bloom filter using the object identifier, and determining the message routing type of the raw event notification messages based on the query results includes the following steps: The original event notification message is received through the User Datagram Protocol (UDP) port, decoded according to the protocol format corresponding to the original event notification message, and the object identifier, source device IP address and variable binding list containing multiple variable binding items carried in the original event notification message are extracted. Each of the variable binding items includes a sub-object identifier, a data type, and a specific value; The object identifier is input into the whitelist Bloom filter and the blacklist Bloom filter respectively for hash lookup; If the whitelist Bloom filter returns a hit, the original event notification message is marked as a known alarm message and sent to the alarm reporting channel; If the blacklist Bloom filter returns a hit, the original event notification message is marked as a known non-alarm message and discarded; If neither the whitelist Bloom filter nor the blacklist Bloom filter is hit, the original event notification message is marked as an unknown message.

4. The method according to claim 1, characterized in that, Each template in the rule template library is associated with device information, a sample object identifier, and a field mapping relationship. The process of obtaining the best matching template from the rule template library based on the object identifier of the unknown message, the source device IP address, and the variable binding list includes the following steps: The first template in the rule template library is selected as the candidate template. The first similarity is obtained by quantization based on the object identifier of the unknown message and the sample object identifier of the candidate template; A second similarity is obtained by quantifying the source device IP address of the unknown message and the device information of the candidate template; The first variable structure is determined based on the variable binding list of the unknown message, and the second variable structure is determined based on the field mapping relationship of the candidate template; Based on the first variable structure and the second variable structure, the third similarity is quantified and obtained. The first similarity, the second similarity, and the third similarity are weighted and summed to obtain the comprehensive similarity between the unknown message and the candidate template; The next template in the rule template library is used as the candidate template. The step of quantizing the first similarity based on the object identifier of the unknown message and the sample object identifier of the candidate template is returned to be executed until all templates in the rule template library have been traversed. The template with the highest overall similarity is selected as the best matching template.

5. The method according to claim 4, characterized in that, The process of generating parsing rules based on the best matching template and the variable binding list of the unknown message includes the following steps: Based on the field mapping relationship of the best matching template, the corresponding positions of the best matching template are replaced using the object identifier of the unknown message and each variable binding item in the variable binding list to generate the parsing rule.

6. The method according to claim 1, characterized in that, The step of performing cluster analysis on all the completely unknown messages to obtain cluster statistics includes the following steps: Based on the object identifier of each of the completely unknown messages, the hierarchy length and hierarchy value sequence are extracted as OID features; Based on the variable binding list for each of the completely unknown messages, the number and type distribution of variables are extracted as variable binding features; Based on the source device IP address of each of the completely unknown messages, network segment information is extracted as device characteristics; The OID feature, variable binding feature, and device feature of the same completely unknown message are combined into a feature vector of the corresponding completely unknown message; The K-Means clustering algorithm is used to iteratively cluster and group the feature vectors of all the completely unknown messages to obtain the clustering results and determine the clustering statistics. The clustering statistics include the cluster center, number of message samples, first appearance time, most recent appearance time, and representative message samples for each cluster group.

7. The method according to claim 1, characterized in that, The audit instructions include a first audit instruction for the parsing rule corresponding to each of the completely unknown messages and a second audit instruction for each cluster group in the clustering statistics. Updating the rule template library and / or the Bloom filter according to the audit instructions includes the following steps: Iterate through each of the first review instructions. If the first review instruction is accepted, persist the corresponding parsing rule to the formal rule base and add the object identifier of the corresponding completely unknown message to the whitelist Bloom filter; otherwise, add the object identifier of the corresponding completely unknown message to the blacklist Bloom filter. Iterate through each of the second review instructions. If the second review instruction is confirmed as a new alarm type, write the manually input new alarm rule template into the rule template library, generate a new parsing rule based on the new alarm rule template and write it into the formal rule library, and add the object identifier of the corresponding completely unknown message to the whitelist Bloom filter; otherwise, add the object identifier of the corresponding completely unknown message to the blacklist Bloom filter.

8. An alarm parsing device based on template matching, characterized in that, The device includes: The first module is used to obtain historical alarm message samples and a pre-configured rule template library, and initialize a Bloom filter based on the historical alarm message samples; wherein, the Bloom filter includes a whitelist Bloom filter and a blacklist Bloom filter; The second module is used to receive raw event notification messages from network devices, parse and extract the object identifier, source device IP address and variable binding list of the raw event notification messages, query the Bloom filter using the object identifier, and determine the message routing type of the raw event notification messages based on the query results; wherein, the message routing type includes known alarm messages, known non-alarm messages and unknown messages; The third module is used to obtain the best matching template from the rule template library based on the object identifier, the source device IP address and the variable binding list of the unknown message, generate parsing rules based on the best matching template and the variable binding list of the unknown message, and mark the unknown message as a completely unknown message if the similarity between the best matching template and the unknown message is less than a preset threshold. The fourth module is used to perform cluster analysis on all the completely unknown messages to obtain cluster statistics. The fifth module is used to send the parsing rules and clustering statistics corresponding to the completely unknown message to the audit object to obtain the audit instruction from the audit object, and update the rule template library and / or the Bloom filter according to the audit instruction.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 7.