A method and device for controlling alarm transmission sequence

By converting and encrypting the received alarm messages in a unified format and utilizing the Kafka message queue partitioning mechanism, the order problem in processing massive alarms is solved, and efficient and orderly multi-threaded transmission is achieved.

CN114296966BActive Publication Date: 2025-09-30BOCO INTER TELECOM CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111658242.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2025-09-30
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

When processing massive amounts of alarms, single-threaded processing cannot meet the needs, and multi-threaded processing cannot guarantee the processing order between alarms, resulting in data accumulation and parsing delays.

Method used

By receiving alarm messages and converting them into a unified format, identifying related alarm groups and encrypting key fields, determining partition values ​​based on the total number of message queue partitions, and using the Kafka message queue for multi-threaded parallel transmission, the orderly transmission of alarms is ensured.

Benefits of technology

It ensures the orderly transmission of alarms in multi-threaded processing, improves processing speed and avoids sequence confusion, meeting the requirements of processing efficiency and sequence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114296966B_ABST
    Figure CN114296966B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for controlling the transmission order of alarms, the method comprising: receiving an alarm message and converting it into a unified format, identifying and splicing a complete alarm message from the alarm message according to a preset alarm sample; determining an associated alarm group in the complete alarm message, encrypting the key fields of the alarms in the associated alarm group to obtain the key field values ​​of the alarms; determining the partition value of the alarm in the message queue according to the total number of message queue partitions and the key field values ​​of the alarms, and then determining the partition to transmit the alarms; the message queue transmits the alarms according to the order in which the alarms are received and the partition in which the alarms are located. The present invention also discloses a device for controlling the transmission order of alarms. The present invention can achieve the concurrent processing of a large number of alarms while ensuring an orderly alarm processing sequence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the communications industry, and more particularly, to a transmission technology for communications alarms. Background Art

[0002] With the further improvement of the centralization of network operation and maintenance management, the application functions integrated by network management are increasing, the amount of data that operation and maintenance needs to manage is also rapidly increasing, and the demand for multi-dimensional presentation of alarm data is also constantly emerging. At the alarm data processing layer, a single thread is used to process alarms. When the amount of alarm data from the same source increases, the alarm parsing thread cannot handle it, which will lead to alarm data processing accumulation and parsing delays, and excessive memory consumption. For ordered alarms, multi-threaded processing is used, but the processing order between alarms cannot be guaranteed.

[0003] Therefore, how to ensure the orderly transmission order of alarms when processing massive alarms becomes an urgent problem to be solved. Summary of the Invention

[0004] The present invention provides the following technical solution: a method for controlling an alarm transmission sequence, the method comprising:

[0005] Receive alarm messages and convert them into a unified format, and identify and splice complete alarm messages from the alarm messages based on preset alarm samples;

[0006] Determining an associated alarm group in the complete alarm message, and encrypting a key field of the alarm in the associated alarm group to obtain a key field value of the alarm;

[0007] Determine the partition value of the alarm in the message queue according to the total number of message queue partitions and the key field value of the alarm, and then determine the partition to transmit the alarm;

[0008] The message queue transmits alarms according to the order in which the alarms are received and the partition where the alarms are located.

[0009] Furthermore, the method of receiving the alarm data and converting it into a unified format, and identifying and splicing a complete alarm message from the alarm message according to the preset alarm sample is specifically as follows:

[0010] Receive alarm messages and convert alarm messages in different data formats into alarm messages in string format;

[0011] Intercept the alarm message according to the alarm head and tail marks in the preset alarm sample;

[0012] The intercepted alarm messages are spliced ​​into a complete alarm message.

[0013] Furthermore, the method of determining the associated alarm group in the complete alarm message and encrypting the key field of the alarm in the associated alarm group to obtain the value of the key field of the alarm is specifically:

[0014] Determining the complete alarm messages that are ordered and have consistent alarm unique identifiers as the associated alarm group;

[0015] The unique identification value of the alarm in the associated alarm group is obtained according to the encryption algorithm.

[0016] Furthermore, the method for determining the partition value of the alarm in the message queue according to the total number of message queue partitions and the key field value of the alarm is specifically:

[0017] The value of the partition of the alarm in the message queue is determined by performing a modulo operation and an absolute value operation on the unique identifier value of the alarm and the total number of message queue partitions.

[0018] Preferred:

[0019] The message queue is a Kafka message queue.

[0020] The present invention also discloses a device for controlling an alarm transmission sequence, the device comprising:

[0021] A complete alarm message acquisition unit is used to receive the alarm message and convert it into a unified format, and identify and splice the complete alarm message from the alarm message according to the preset alarm sample;

[0022] a value calculation unit, configured to determine an associated alarm group in the complete alarm message obtained by the complete alarm message obtaining unit, and encrypt a key field of the alarm in the associated alarm group to obtain a value of the key field of the alarm;

[0023] A partition determining unit, configured to determine a partition value of the alarm in the message queue according to the total number of message queue partitions and a value of a key field of the alarm, and further determine a partition to transmit the alarm;

[0024] The transmission unit, the message queue is used to transmit the alarm according to the order in which the alarms are received and the partition where the alarms are located.

[0025] Specifically, the complete alarm message obtaining unit further includes:

[0026] The format conversion module is used to receive alarm messages and convert alarm messages in different data formats into alarm messages in string format;

[0027] An alarm message interception module, configured to intercept the alarm message converted by the format conversion module according to the alarm head and tail flags in the preset alarm sample;

[0028] The alarm splicing module is used to splice the alarm messages intercepted by the alarm message intercepting module into a complete alarm message.

[0029] Specifically, the value calculation unit further includes:

[0030] An associated alarm group determining module, configured to determine the complete alarm messages that are ordered and have consistent alarm unique identifiers as the associated alarm group;

[0031] The calculation module is used to obtain the unique identification value of the alarm in the associated alarm group determined by the associated alarm group determination module according to an encryption algorithm.

[0032] Preferred:

[0033] The partition determination unit determines the value of the partition of the alarm in the message queue by performing a modulo operation and an absolute value operation on the unique identification value of the alarm obtained by the calculation module and the total number of the message queue partitions as the partition value of the alarm in the message queue.

[0034] Preferred:

[0035] The message queue is a Kafka message queue.

[0036] As can be seen from the above technical solution, the alarm transmission sequence control technology disclosed in the embodiment of the present invention can transmit alarm data in parallel through multiple threads of a message queue. By encrypting the values ​​of ordered alarm keywords, related alarm groups are extracted and transmitted using the same queue partition. This prevents the alarms of related alarm groups from being split up and processed by different threads, disrupting the order of the ordered alarms. The present invention solves the problem of controlling the order of alarm processing, improving the alarm processing speed while ensuring the order of alarm processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0038] Figure 1 A flowchart of a method for controlling an alarm transmission sequence provided by an embodiment of the present invention;

[0039] Figure 2 A flowchart of a method for splicing and identifying complete alarm messages provided in the second embodiment of the present invention;

[0040] Figure 3A flowchart of a method for obtaining values ​​of key alarm fields provided in the third embodiment of the present invention;

[0041] Figure 4 A flowchart of the method provided in Example 4 of the present invention;

[0042] Figure 5 This is a structural diagram of an alarm transmission sequence control device provided in Embodiment 5 of the present invention;

[0043] Figure 6 This is a detailed structural diagram of the device provided in Example 6 of the present invention. DETAILED DESCRIPTION

[0044] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without creative work are within the scope of protection of the present invention.

[0045] See also Figure 1 , giving the first embodiment of the present invention, as Figure 1 As shown, a method for controlling the alarm transmission sequence in the present invention is described in detail, including the following steps:

[0046] Step S1: Receive an alarm message and convert it into a unified format, and identify and splice a complete alarm message from the alarm message according to a preset alarm sample.

[0047] Since the interface types and message formats of various manufacturers are different, if the alarm messages of various manufacturers need to be processed uniformly, the alarm messages in different data formats need to be converted into a unified format.

[0048] Based on the alarm samples provided by each manufacturer, identify the complete alarm message from the alarm messages converted into a unified format.

[0049] Step S2: determining an associated alarm group in the complete alarm message, and encrypting key fields of the alarms in the associated alarm group to obtain key field values ​​of the alarms.

[0050] The so-called associated alarm group refers to alarms that have requirements on transmission timing and the same key fields. The most typical example is the active alarm and the clearing alarm corresponding to the active alarm.

[0051] If the content of the field is consistent, then the field is a key field, such as the alarm unique identifier.

[0052] In order to convert the fields into numerical values ​​for easy calculation, an encryption algorithm can be used to obtain the values ​​of the key fields. Different commonly used encryption algorithms can be used here to complete the value calculation in this step.

[0053] Since the contents of the key fields are consistent, the values ​​are also the same after the encryption algorithm.

[0054] Step S3: Determine the partition value of the alarm in the message queue according to the total number of message queue partitions and the key field value of the alarm, and then determine the partition to transmit the alarm.

[0055] The value of the partition of the alarm in the message queue is determined by performing a modulo operation and an absolute value operation on the unique identifier value of the alarm and the total number of message queue partitions.

[0056] Since the key field content is consistent and the values ​​obtained through the encryption algorithm are also the same, the values ​​of the modulo and absolute value operations on the total number of partitions are also the same, thereby ensuring that alarms in related alarm groups can enter the same queue partition.

[0057] Step S4: the message queue transmits the alarm according to the order in which the alarms are received and the partition where the alarms are located.

[0058] The message queue can be a Kafka message queue.

[0059] The rebalance technology of Kafka consumers in the Kafka message queue is used to realize the correspondence between transmission and queue partitions.

[0060] Since active alarms and the clear alarm messages corresponding to active alarms are stored in the same partition in sequence, they will be received, processed and sent by the same parsing and sending process during parsing. The processing of the same parsing and sending process is single-threaded, so after the parsing and sending process is successfully initialized, the order between the active alarms and the clear alarm messages corresponding to the active alarms received is normal and will not be processed in a disorderly manner.

[0061] To sum up, the technical solution of the present invention can support a large number of alarm processing, divert data from the source side, and perform multi-threaded processing. After the orderly related alarm groups use the technology of the present invention, they will enter the same thread for processing in sequence, ensuring the processing order of the alarms and meeting the requirements of processing efficiency and processing order.

[0062] For the second embodiment of the present invention, please refer to the attached Figure 2 , step S1 is described in detail, wherein the method of receiving the alarm data and converting it into a unified format, and identifying and splicing a complete alarm message in the alarm message according to the preset alarm sample is specifically as follows:

[0063] Step S11: receiving an alarm message, and converting the alarm message in different data formats into an alarm message in a character string format.

[0064] For example, converting byte messages into string messages.

[0065] Step S12: intercepting the alarm message according to the alarm head and tail flags in the preset alarm sample.

[0066] The alarm message with the message head and tail marks is cut out as a complete one. The alarm message with only the message head mark but no message tail mark is cached and waits for the next alarm message to come and continue to search for the message tail mark. After finding it, it is assembled into a complete message.

[0067] Step S13: splicing the intercepted alarm messages into a complete alarm message.

[0068] For the third embodiment of the present invention, please refer to the attached Figure 3 , step S2 is described in detail, wherein the method of determining the associated alarm group in the complete alarm message and encrypting the key fields of the alarm in the associated alarm group to obtain the value of the key fields of the alarm is specifically as follows:

[0069] Step S21: Determine the complete alarm messages that are ordered and have consistent alarm unique identifiers as the associated alarm group.

[0070] Related alarm groups are ordered alarms with consistent unique alarm identifiers. These related alarm groups are highly relevant to the business, as evidenced by the alarm data samples and field business meanings provided by the manufacturer. For example, in alarm data, there are active alarms and their corresponding cleared alarms.

[0071] Step S22: Obtain the unique identification value of the alarm in the associated alarm group according to the encryption algorithm.

[0072] The alarm unique identifier is a key field that identifies the same active alarm and the corresponding cleared alarm. Therefore, the alarm unique identifier is used as the key field for associating alarm groups. If other fields can uniquely identify alarms, they can also be designated as key fields.

[0073] For the fourth embodiment of the present invention, please refer to the attached Figure 4 , with examples to illustrate how to complete the control of alarm transmission sequence:

[0074] Step S31: receiving an alarm message, and converting the alarm message in different data formats into an alarm message in a character string format.

[0075] Step S32: intercepting the alarm message according to the alarm head and tail marks in the preset alarm sample.

[0076] Step S33: splicing the intercepted alarm messages into a complete alarm message.

[0077] Step S34: Determine the complete alarm messages that are ordered and have consistent alarm unique identifiers as the associated alarm group.

[0078] like:

[0079] Active alarm message: ("alarmStatus":1)

[0080] {"alarmSeq":4,"alarmTitle":"PDH 2M physical interface signal loss (LOS)","alarmStatus":1,"alarmType":"communicationsAlarm","origSeverity":1,"eventTime":"2016-08-05 17:58:15","alarmId":"86930282"…………}

[0081] Active alarms correspond to cleared alarm messages: ("alarmStatus":0)

[0082] {"alarmSeq":5,"alarmTitle":"PDH 2M physical interface signal loss (LOS)","alarmStatus":0,"alarmType":"communicationsAlarm","origSeverity":1,"eventTime":"2016-08-05 17:59:15","alarmId":"86930282"…………}

[0083] It can be seen that the "alarmId" of the active alarm and the cleared alarm corresponding to the active alarm are the same, so they can be determined to be related alarm groups. The "alarmId" is the key field of the alarm.

[0084] According to the business logic, the active alarm message and the cleared alarm message corresponding to the active alarm message obtain the key field alarmId value of 86930282.

[0085] Step S35: Obtain the unique identification value of the alarm in the associated alarm group according to the encryption algorithm.

[0086] Perform MD5 calculation on the alarm unique identifier alarmId value 86930282:

[0087] The value is -2368048004118371479.

[0088] Step S36: Determine the value of the partition of the message queue as the partition value of the alarm by performing a modulo operation and an absolute value operation on the unique identifier value of the alarm.

[0089] The total number of Kafka message queue partitions is 12.

[0090] Take the modulus of the MD5 calculated value and the total number of partitions, that is, calculate with the remainder method, and then take the absolute value after taking the modulus: |-2368048004118371479%12|=7, and the partition value is 7.

[0091] Step S37: Determine the partition to which the alarm is transmitted according to the partition value.

[0092] This active alarm and the corresponding clear alarm message are sent to partition 7 in the Kafka message channel.

[0093] Step S38: The message queue transmits the alarm according to the order in which the alarms are received and the partition where the alarms are located.

[0094] Active alarm messages and cleared alarms corresponding to active alarm messages are placed into the 7 partitions in the order in which they are received, that is, if an active alarm is received now, it is placed into the 7 partitions first.

[0095] The same receiving and sending process will take messages from partition 7 and send them in sequence, ensuring that the order of active alarms and the corresponding cleared alarms is not disordered.

[0096] Therefore, in the same partition, active alarms and cleared alarms corresponding to active alarms are processed according to the order in which the alarms are received, which can ensure the orderly processing order of alarms and prevent active alarms and their corresponding cleared alarms from being sent to different processing threads due to the large number of threads, resulting in disordered order.

[0097] The present invention also discloses a control device for alarm transmission sequence. The fifth embodiment is given below. Figure 5 , the structure of the device is described in detail, the device includes a complete alarm message acquisition unit 1, a value calculation unit 2, a partition determination unit 3, and a transmission unit 4, wherein:

[0098] The complete alarm message acquisition unit 1 is used to receive the alarm message and convert it into a unified format, and identify and splice the complete alarm message from the alarm message according to the preset alarm sample;

[0099] A value calculation unit 2 is used to determine an associated alarm group in the complete alarm message obtained by the complete alarm message obtaining unit, and encrypt the key fields of the alarms in the associated alarm group to obtain the values ​​of the key fields of the alarms;

[0100] Partition determination unit 3, used to determine the partition value of the alarm in the message queue according to the total number of message queue partitions and the key field value of the alarm, and then determine the partition to transmit the alarm;

[0101] The transmission unit 4, the message queue is used to transmit the alarm according to the order in which the alarms are received and the partition where the alarms are located.

[0102] In order to better illustrate the structure and working principle of each unit, the following is a sixth embodiment of the present application, combined with the attached Figure 6 For detailed explanation:

[0103] The complete alarm message acquisition unit 1 further includes:

[0104] The format conversion module 11 is used to receive the alarm message and convert the alarm message in different data formats into the alarm message in the string format;

[0105] An alarm message interception module 12 is used to intercept the alarm message converted by the format conversion module according to the alarm head and tail flags in the preset alarm sample;

[0106] The alarm splicing module 13 is used to splice the alarm messages intercepted by the alarm message intercepting module into a complete alarm message.

[0107] The value calculation unit 2 further includes:

[0108] An associated alarm group determining module 21 is configured to determine the complete alarm messages that are ordered and have consistent alarm unique identifiers as the associated alarm group;

[0109] The calculation module 22 is configured to obtain, according to an encryption algorithm, a unique identification value of the alarm in the associated alarm group determined by the associated alarm group determination module.

[0110] Partition determination unit 3, the partition determination unit determines the value of the partition of the alarm in the message queue as the partition value of the alarm in the message queue by performing a modulo operation and an absolute value operation on the unique identification value of the alarm obtained by the calculation module and the total number of the message queue partitions.

[0111] The transmission unit 4, the message queue is used to transmit the alarm according to the order in which the alarms are received and the partition where the alarms are located.

[0112] The message queue is a Kafka message queue.

[0113] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the corresponding processes in the above-described device embodiments can refer to the specific working processes of the aforementioned methods and will not be repeated here.

[0114] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0115] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, software units executed by a processor, or a combination of the two. The software units may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0116] The terms "first," "second," "third," "fourth," and so forth (if any) in the specification, claims, and drawings are used to distinguish similar parts and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present application described herein can be practiced in an order other than that illustrated herein.

[0117] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for controlling the alarm transmission sequence, characterized in that: The method comprises: Receive alarm messages and convert them into a unified format, and identify and splice complete alarm messages from the alarm messages based on preset alarm samples; Determining an associated alarm group in the complete alarm message, and encrypting a key field of the alarm in the associated alarm group to obtain a key field value of the alarm; Determine the partition value of the alarm in the message queue according to the total number of message queue partitions and the key field value of the alarm, and then determine the partition to transmit the alarm; The message queue transmits alarms according to the order in which the alarms are received and the partition where the alarms are located; The method of receiving the alarm data and converting it into a unified format, and identifying and splicing a complete alarm message from the alarm message according to the preset alarm sample is specifically as follows: Receive alarm messages and convert alarm messages in different data formats into alarm messages in string format; Intercept the alarm message according to the alarm head and tail marks in the preset alarm sample; Splice the intercepted alarm messages into a complete alarm message, The method of determining the associated alarm group in the complete alarm message and encrypting the key field of the alarm in the associated alarm group to obtain the value of the key field of the alarm is specifically: Determining the complete alarm messages that are ordered and have consistent alarm unique identifiers as the associated alarm group; Obtaining a unique identification value of the alarm in the associated alarm group according to an encryption algorithm; and The method for determining the partition value of the alarm in the message queue according to the total number of message queue partitions and the key field value of the alarm is specifically: The value of the partition of the alarm in the message queue is determined by performing a modulo operation and an absolute value operation on the unique identifier value of the alarm and the total number of message queue partitions.

2. The method according to claim 1, wherein: The message queue is a Kafka message queue.

3. A control device for alarm transmission sequence, characterized in that: The device comprises: A complete alarm message acquisition unit is used to receive the alarm message and convert it into a unified format, and identify and splice the complete alarm message from the alarm message according to the preset alarm sample; a value calculation unit, configured to determine an associated alarm group in the complete alarm message obtained by the complete alarm message obtaining unit, and encrypt a key field of the alarm in the associated alarm group to obtain a value of the key field of the alarm; A partition determining unit, configured to determine a partition value of the alarm in the message queue according to the total number of message queue partitions and a value of a key field of the alarm, and further determine a partition to transmit the alarm; A transmission unit, wherein the message queue is used to transmit alarms according to the order in which the alarms are received and the partitions in which the alarms are located; The complete alarm message acquisition unit further includes: The format conversion module is used to receive alarm messages and convert alarm messages in different data formats into alarm messages in string format; An alarm message interception module, configured to intercept the alarm message converted by the format conversion module according to the alarm head and tail flags in the preset alarm sample; An alarm splicing module is used to splice the alarm messages intercepted by the alarm message interception module into a complete alarm message, Wherein, the value calculation unit further includes: An associated alarm group determining module, configured to determine the complete alarm messages that are ordered and have consistent alarm unique identifiers as the associated alarm group; A calculation module, configured to obtain, according to an encryption algorithm, a unique identification value of the alarm in the associated alarm group determined by the associated alarm group determination module; and The partition determination unit determines the value of the partition of the alarm in the message queue by performing a modulo operation and an absolute value operation on the unique identification value of the alarm obtained by the calculation module and the total number of the message queue partitions as the partition value of the alarm in the message queue.

4. The device according to claim 3, characterized in that: The message queue is a Kafka message queue.

Citation Information

Patent Citations

  • High-availability distributed real-time alarm processing method and high-availability distributed real-time alarm processing system

    CN112671560A

  • Aggregation alarm method and device, electronic equipment and storage medium

    CN113377820A