Alarm message processing method, storage medium and electronic device

By splitting and merging the alarm messages in the instant communication system, the problems of message backlog and loss are solved, orderly transmission and efficient processing of messages are realized, and the stability and flexibility of the system are improved.

CN120416003APending Publication Date: 2025-08-01QINGDAO HAIER TECH +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510588235.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

When sending alarm messages, existing instant messaging systems can easily lead to backlog of messages and failure in sending messages, and even loss of important information due to limitations in network bandwidth, server processing capabilities and usage rules.

Method used

By reading the alarm message from the message queue, splitting it based on the byte length exceeding the preset threshold, and splitting it into multiple messages according to the preset rules, optimizing the message processing flow in combination with semantic analysis and merging conditions.

Benefits of technology

Ensure that messages are processed in chronological order, avoid important information being ignored, meet the size limitations of the receiver and transmission channel, reduce the difficulty of the receiver processing, and improve the success rate and response speed of the message transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120416003A_ABST
    Figure CN120416003A_ABST
Patent Text Reader

Abstract

The invention discloses an alarm message processing method, a storage medium and an electronic device, and relates to the technical field of smart home / smart home, the alarm message processing method comprises the following steps: reading an alarm message from a message queue, the alarm message being previously stored in the message queue based on a time sequence; and determining whether the byte length of the read alarm message exceeds a first preset threshold, splitting the alarm message based on the fact that the byte length of the alarm message exceeds the first preset threshold, and sending a plurality of split messages to a message receiver. According to the method, the alarm messages stored based on the time sequence in the message queue are read, the corresponding messages are processed according to the message generation sequence, whether the byte length of the read alarm messages exceeds the first preset threshold value or not is further determined, whether the corresponding alarm messages are split or not is determined, smooth transmission of the messages is achieved, and the message transmission efficiency is improved. And the situation that the key alarm content is lost due to the fact that the message is too large and cannot be sent is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of smart home / smart family, and in particular, to an alarm message processing method, a storage medium, and an electronic device. Background Art

[0002] Instant Messaging (IM) refers to services that can instantaneously send and receive Internet messages, etc. With the rapid development of IM technology, the functions of IM have become increasingly rich and have gradually developed into an integrated information platform integrating functions such as communication, information, entertainment, search, office collaboration, and customer service.

[0003] In an IM system, when an abnormal situation occurs, such as abnormal login behavior, malicious attack, IM system software failure, insufficient storage space, etc., the IM system will send an alarm message.

[0004] However, due to limitations such as network bandwidth, server processing capacity, and the usage rules of the IM platform, when the IM system sends an alarm message, there are certain frequency and size limitations, which are prone to message backlog and cannot adapt to dynamically changing alarm message volumes. Once the limit is exceeded, it will cause message sending failures and even result in the loss of some important information. Summary of the Invention

[0005] This application provides an alarm message processing method, a storage medium, and an electronic device to solve the defect in the prior art that the sending frequency per unit time is too high, resulting in alarm message sending failures and losses, and to improve the success rate of message sending and the stability of the system.

[0006] This application provides an alarm message processing method, including: reading an alarm message from a message queue, where the alarm message is stored in the message queue in advance based on the chronological order; determining whether the byte length of the read alarm message exceeds a first preset threshold, and based on the byte length of the alarm message exceeding the first preset threshold, splitting the alarm message and sending the split multiple messages to a message recipient.

[0007] According to an alarm message processing method provided by this application, splitting the alarm message based on the byte length of the alarm message exceeding the first preset threshold includes: based on the byte length of the alarm message exceeding the first preset threshold, splitting the alarm message according to the byte length of the alarm message according to a preset splitting rule; where the preset splitting rule is used to limit the message splitting quantity of the corresponding alarm message based on the first preset threshold and the byte lengths of different alarm messages.

[0008] A method for processing alarm messages provided by the present application, where the preset splitting rules include different byte length range intervals and the corresponding pre-configured message splitting quantities and message splitting methods for each byte length range interval; splitting the alarm message according to the byte length of the alarm message and the preset splitting rules, including: determining the interval range where the byte length is located according to the byte length of the alarm message in combination with the preset splitting rules, and determining the corresponding message splitting quantity and message splitting method according to the determined interval range; splitting the alarm message according to the message splitting quantity and the message splitting method.

[0009] A method for processing alarm messages provided by the present application, where the preset splitting rules include different byte length range intervals and the corresponding pre-configured message splitting quantities for each byte length range interval; splitting the alarm message according to the byte length of the alarm message and the preset splitting rules, including: determining the interval range where the byte length is located according to the byte length of the alarm message in combination with the preset splitting rules, and determining the corresponding message splitting quantity according to the determined interval range; performing semantic analysis on the alarm message, identifying the sentence structure, and splitting the alarm message in combination with the message splitting quantity.

[0010] A method for processing alarm messages provided by the present application, after splitting the alarm message, including: generating and storing a splitting log according to the byte length of the alarm message, the message splitting quantity, the byte length of each split message, and the splitting time.

[0011] A method for processing alarm messages provided by the present application, where reading alarm messages from the message queue includes at least two messages. After reading the alarm messages from the message queue, it further includes: traversing all the read alarm messages, checking whether the byte length of each alarm message is less than a first preset threshold, and selecting all the alarm messages with a byte length less than the first preset threshold to obtain a first message set; selecting at least two alarm messages from the first message set, and determining whether the selected alarm messages meet the preset merging condition. The preset merging condition is used to limit that the sum of the byte lengths of the selected alarm messages is less than or equal to a second preset threshold, and the sum of the byte lengths of the selected alarm messages and the byte length of any other unselected alarm message in the first message set is greater than the second preset threshold, and the second preset threshold is less than or equal to the first preset threshold; based on the selected alarm messages meeting the preset merging condition, splicing the corresponding alarm messages.

[0012] A method for processing alarm messages provided by the present application, before reading the alarm messages from the message queue, including: receiving the alarm information sent by the message sender, and generating an alarm message according to the alarm information in a preset message format; storing the alarm message in the message queue.

[0013] The present application also provides an alarm message processing device, including: a consumption control module that reads alarm messages from a message queue, where the alarm messages are stored in the message queue in a chronological order; a message sending module that determines whether the byte length of the read alarm message exceeds a first preset threshold, and based on the byte length of the alarm message exceeding the first preset threshold, splits the alarm message and sends the multiple split messages to a message recipient.

[0014] The present application also provides an electronic device, including a memory and a processor, where a computer program is stored in the memory, and the processor is configured to execute the computer program to implement the alarm message processing method as described in any one of the above.

[0015] The present application also provides a computer-readable storage medium, where the computer-readable storage medium includes a stored program, and when the program runs, it executes to implement the alarm message processing method as described in any one of the above.

[0016] The present application also provides a computer program product, including a computer program, where when the computer program is executed by a processor, it implements the alarm message processing method as described in any one of the above.

[0017] The alarm message processing method, storage medium, and electronic device provided by the present application read the alarm messages stored in the message queue in a chronological order to process the corresponding messages in the order of message generation, thereby preventing the problem of important information being ignored or the processing process being chaotic due to out-of-order messages, enabling the entire alarm message processing mechanism to operate in an orderly manner, ensuring that all alarms can be given due attention and processing to the greatest extent, and further determining whether the byte length of the read alarm message exceeds a first preset threshold to split the message when it exceeds the first preset threshold, thereby ensuring that the message meets the size limit requirements of the recipient, transmission channel, storage system, etc., realizing the smooth transmission of the message, avoiding the situation of losing key alarm content due to the message being too large to be sent, and splitting the alarm message into multiple relatively short messages to reduce the processing difficulty of the message recipient for the message, reducing the resource consumption and error probability of the message recipient in parsing and other links, thereby accelerating the response speed to the alarm content, making appropriate decisions and operations in a timely manner according to the alarm, and making the message recipient more flexible when upgrading and expanding its processing capabilities in the future. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.

[0019] In order to more clearly illustrate the embodiments of the present application 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0020] Figure 1 Schematic diagram of a hardware environment for an alarm message processing method according to an embodiment of the present application; Figure 2 This is a flowchart of the alarm message processing method provided by this application; Figure 3 This is a structural diagram of the alarm message processing device provided by this application; Figure 4 It is a structural diagram of the electronic device provided in this application. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0023] According to one aspect of the embodiment of the present application, a method for processing an alarm message is provided. The method for processing an alarm message is widely used in smart home, smart home, smart home device ecology, smart home ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for processing an alarm message can be applied to Figure 1In the hardware environment composed of the terminal device 102 and the server 104 as shown. As Figure 1 shown, the server 104 is connected to the terminal device 102 through a network, and can be used to provide services (such as application services, etc.) for the terminal or the client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data operation services for the server 104.

[0024] The above network can include but is not limited to at least one of the following: wired network, wireless network. The above wired network can include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network. The above wireless network can include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 is not limited to being a PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projection device, smart TV, smart clothes hanger, smart curtain, smart audio and video, smart socket, smart speaker, smart sound box, smart fresh air device, smart kitchen and bathroom equipment, smart bathroom equipment, smart floor sweeping robot, smart window cleaning robot, smart mopping robot, smart air purification device, smart steam box, smart microwave oven, smart kitchen water heater, smart purifier, smart water dispenser, smart door lock, etc.

[0025] Figure 2 A flowchart showing a method for processing alarm messages is shown. The method includes: S21, read the alarm message from the message queue, and the alarm message was previously stored in the message queue based on the chronological order; S22, determine whether the byte length of the read alarm message exceeds a first preset threshold, and based on the byte length of the alarm message exceeding the first preset threshold, split the alarm message and send the split multiple messages to the message recipient.

[0026] It should be noted that the step numbers "S2N" in this specification do not represent the sequence of the alarm message processing method. The alarm message processing method of the present invention will be specifically described below.

[0027] Step S21, read the alarm message from the message queue, and the alarm message was previously stored in the message queue based on the chronological order.

[0028] In this embodiment, reading the alarm message from the message queue includes: reading the alarm message from the message queue based on a preset time interval and a preset reading quantity.

[0029] It should be noted that by presetting the time interval and the preset read quantity, the message sending frequency is controlled to avoid a large number of messages being read in a short period of time, thereby preventing the server from being overloaded due to processing too many messages, ensuring that the server processes messages smoothly within each time period, maintaining a stable working state, and avoiding message sending failures. Additionally, the preset time interval and the preset read quantity can be reasonably set according to the processing capacity of the server and the usage limitations or prior experience of the instant messaging platform, so as to adjust the sending frequency according to actual needs, flexibly cope with different message loads, facilitate the system to reasonably allocate processing resources, ensure that the system has enough time to accurately process each message, guarantee the quality of network communication, and avoid situations where message sending fails.

[0030] In an optional embodiment, before reading the alarm message from the message queue, it includes: receiving the alarm information sent by the message sender, and generating an alarm message in a preset message format according to the alarm information; storing the alarm message in the message queue. It should be noted that by presetting the message format, the standardization of messages is achieved, enabling different message senders and message receivers to follow the same rules for message interaction, thereby improving the compatibility of the system and reducing the difficulty and cost of system development and integration. Additionally, the message sender can be other platforms that send messages to the message sender.

[0031] Furthermore, generating an alarm message in a preset message format according to the alarm information includes: allocating a unique message identifier ID according to the alarm information; extracting the core content of the alarm information to obtain the message content; assembling according to the message ID, the message content, and the generation time determined based on the corresponding time of the system in a preset message format to obtain the alarm message.

[0032] It should be added that the message ID can be created using an algorithm such as UUID (Universally Unique Identifier) to ensure uniqueness throughout the system, facilitating subsequent tracking and management of messages. Additionally, the core content of the alarm information is used to represent the key information of the alarm information. For example, if the alarm information is about the CPU overload situation of a certain server, then the message content can be "The CPU of server [server name] has reached [specific percentage], and it is overloaded". The specific core content extracted can be configured according to actual design requirements and will not be further limited here.

[0033] It should be noted that by using the message ID as the unique identifier for each alarm message, it is convenient to quickly locate the message through the message ID in the entire message processing process, and by extracting the core content of the alarm information, it is ensured that the alarm information can be completely transmitted, avoiding the situation where information loss causes inability to process immediately. By recording the generation time, subsequent alarm messages can be processed in chronological order, ensuring that the alarms generated first are processed first, and processing in chronological order can also help to understand the sequence of fault occurrences when there are fault-related alarms, so as to more accurately locate the root cause of the fault.

[0034] In addition, storing the alarm message into the message queue includes: inserting the content of the alarm message and the generation time of the alarm message into the corresponding position in the message queue in the order of generation time; wherein, the message queue is an ordered set zset created in advance in the Remote Dictionary Server (abbreviated as Redis). It should be noted that by using the zset structure of Redis to maintain an ordered queue, it is ensured that the messages are processed in chronological order, realizing an ordered message queue for caching and managing alarm messages, ensuring efficient management and scheduling of alarm information.

[0035] It should be noted that when storing the alarm message into the message queue, the generation time and message content of the alarm message are added to the zset, so that the new message is inserted into the corresponding position of the zset according to the generation time, realizing the automatic sorting of the alarm messages stored in the zset by time. In addition, when the zset is adopted in the message queue, reading messages from the message queue can use the ZRANGE command to obtain the messages in the message queue, and the parameters of the ZRANGE command can be configured to adjust the number of messages obtained. The ZRANGE command can obtain the members within the specified index range, and usually can obtain the message content with the smallest generation time, that is, the earliest generated alarm message.

[0036] In an optional embodiment, after reading the alarm message from the message queue, it includes: deleting the read alarm message from the message queue. Similarly, the deletion can be implemented using the ERM command, such as r.zerm(“message_queue”,message1).

[0037] In an optional embodiment, the method further includes: regularly checking the size of the message queue. If the size of the message queue exceeds the queue size threshold, expired messages can be deleted based on the generation time and valid time of each alarm message in the queue, or receiving messages can be paused until the size of the message queue does not exceed the queue size threshold. It should be added that the size of the message queue can be determined according to the byte length of all alarm messages stored in the message queue.

[0038] In an alternative embodiment, reading the alarm messages from the message queue includes at least two. After reading the alarm messages from the message queue, it further includes: traversing all the read alarm messages, checking whether the byte length of each alarm message is less than a first preset threshold, and selecting all the alarm messages with a byte length less than the first preset threshold to obtain a first message set; selecting at least two alarm messages from the first message set, and determining whether the selected alarm messages meet a preset merging condition. The preset merging condition is used to limit that the total byte length of the selected alarm messages is less than or equal to a second preset threshold, and the sum of the byte lengths of the selected alarm messages and the byte length of any other unselected alarm message in the first message set is greater than the second preset threshold, and the second preset threshold is less than or equal to the first preset threshold; based on the selected alarm messages meeting the preset merging condition, splicing the corresponding alarm messages.

[0039] It should be added that the first preset threshold can be determined according to the server processing capacity and the limitations of the corresponding real-time communication platform. For example, it can be 32 kb. The second preset threshold can be set with reference to the first preset threshold and will not be further limited here. In addition, by splicing the alarm messages to merge the messages, the transmission efficiency is improved, the overhead of multiple transmissions is reduced, and the utilization of network bandwidth and server resources is optimized.

[0040] In an alternative embodiment, the preset merging condition is further used to determine the alarm messages that can be merged based on service requirements and the relevance of the message content. Accordingly, determining whether each selected alarm message meets the preset merging condition includes: based on the preset merging condition, determining the alarm information in the first message set that can be merged into the same message to obtain the same group of messages to be merged; for each group of messages to be merged, selecting at least two alarm messages to be merged to obtain a second combination; determining that the total byte length of all the alarm messages to be merged in the second combination is less than or equal to the second preset threshold, and the sum of the byte lengths of all the alarm messages to be merged in the second combination and the byte length of the other alarm messages outside the second combination in the message combination to be merged is greater than the second preset threshold, then it is determined that the alarm messages in the second combination meet the preset merging condition and can be merged into the same message.

[0041] It should be added that determining the alarm messages that can be merged based on service requirements and the relevance of the message content can judge which messages can be merged according to factors such as the theme, source, and generation time of the alarm messages. For example, messages from the same monitoring system, generated within a short period (such as within 5 minutes), and with related themes (such as all about server performance metrics) can be considered for merging, and will not be further limited here.

[0042] In an alternative embodiment, after concatenating the corresponding alarm messages based on the selected alarm messages meeting the preset merging conditions, it includes: marking the messages according to the priority, so that the message recipient can process the alarm messages according to the priority first, improving the processing efficiency of the alarm messages. It should be added that the message recipient can be an instant messaging platform.

[0043] In an alternative embodiment, after checking whether the byte length of each alarm message is less than the first preset threshold, it further includes: based on the byte length of the alarm message being equal to the first preset threshold, directly sending the corresponding alarm message to the message recipient; based on the byte length of the alarm message exceeding the first preset threshold, performing step S22.

[0044] Step S22, determining whether the byte length of the read alarm message exceeds the first preset threshold, and based on the byte length of the alarm message exceeding the first preset threshold, splitting the alarm message and sending the split multiple messages to the message recipient.

[0045] In this embodiment, based on the byte length of the alarm message exceeding the first preset threshold, splitting the alarm message includes: based on the byte length of the alarm message exceeding the first preset threshold, according to the byte length of the alarm message, splitting the alarm message according to the preset splitting rule; wherein, the preset splitting rule is used to limit the message splitting quantity of the corresponding alarm message based on the first preset threshold and the byte lengths of different alarm messages.

[0046] Specifically, the preset splitting rule includes different byte length range intervals and the corresponding previously configured message splitting quantities and message splitting methods for each byte length range interval; splitting the alarm message according to the byte length of the alarm message and the preset splitting rule includes: according to the byte length of the alarm message, combining the preset splitting rule, determining the interval range where the byte length is located, and according to the determined interval range, determining the corresponding message splitting quantity and message splitting method; splitting the alarm message according to the message splitting quantity and the message splitting method.

[0047] It should be added that the message splitting method includes uniform splitting or a specific splitting method according to the requirements of the business logic. The specific splitting method can be reasonably divided according to the semantic paragraphs and can be specifically configured according to the actual design requirements.

[0048] Furthermore, when the message splitting method is uniform splitting, splitting the alarm message according to the message splitting quantity and the message splitting method includes: splitting the alarm message uniformly according to the message splitting quantity, so that the byte lengths of the split groups are the same. In addition, when the message splitting method is a specific splitting method, the specific splitting method can refer to the method of splitting the alarm message by semantic analysis below, and will not be repeated here.

[0049] In an alternative embodiment, the preset splitting rule includes different byte length ranges and the corresponding number of message splits configured in advance for each byte length range. Accordingly, splitting the alarm message according to the preset splitting rule based on the byte length of the alarm message includes: determining the range of the byte length based on the byte length of the alarm message in combination with the preset splitting rule, and determining the corresponding number of message splits according to the determined range; performing semantic analysis on the alarm message to identify the sentence structure, and splitting the alarm message in combination with the number of message splits.

[0050] It should be added that performing semantic analysis on the alarm message to identify the sentence structure and splitting the alarm message in combination with the number of message splits can be implemented by using the sentence segmentation algorithm in natural language processing. Input the alarm message and the number of message splits into the sentence segmentation algorithm for semantic analysis, and perform segmentation at the breakpoints where the semantics is appropriate in combination with the number of message splits.

[0051] In an alternative embodiment, determining whether the byte length of the read alarm message exceeds a first preset threshold further includes: based on the byte length of the read alarm message not exceeding the first preset threshold, sending the read alarm message to the message recipient.

[0052] In an alternative embodiment, after splitting the alarm message, it includes: generating and storing a split log according to the byte length of the alarm message, the number of message splits, the byte length of each split message, and the split time.

[0053] In an alternative embodiment, after sending the read alarm message or the multiple split messages to the message recipient, it includes: monitoring the message sending result, re-storing the messages that fail to be sent into the message queue, and updating the generation time of the corresponding messages based on the time stored in the message queue to continue queuing for the next sending. It should be added that by re-storing the messages that fail to be sent into the message queue, it is ensured that the messages are successfully sent, improving the reliability and success rate of message transmission.

[0054] In summary, in the embodiments of the present invention, by reading the alarm messages stored in the message queue based on the chronological order, the corresponding messages are processed in the order of generation, thereby preventing the problem that important information is ignored or the processing flow is chaotic due to the disorder of the messages, enabling the entire alarm message processing mechanism to operate in an orderly manner, ensuring that all alarms can be given due attention and processing to the greatest extent, and further determining whether the byte length of the read alarm message exceeds a first preset threshold, and splitting the message when it exceeds the first preset threshold, so as to ensure that the message meets the size limit requirements of the receiving party, the transmission channel, and the storage system, etc., realizing the smooth transmission of the message, and avoiding the situation that key alarm content is lost due to the message being too large to be sent. And by splitting the alarm message into multiple relatively short messages, the processing difficulty of the message for the receiving party is reduced, and the resource consumption and error probability in the parsing and other links of the message receiving party are reduced, thereby accelerating the response speed to the alarm content, making appropriate decisions and operations in a timely manner according to the alarm, and making the message receiving party more flexible when upgrading and expanding its processing capabilities in the future.

[0055] The alarm message processing device provided by the present application will be described below. The alarm message processing device described below can be correspondingly referred to the alarm message processing method described above.

[0056] Figure 3 The structural schematic diagram of an alarm message processing device is shown. The device includes: A consumption control module 31, which reads alarm messages from the message queue, and the alarm messages are stored in the message queue based on the chronological order in advance; A message sending module 32, which determines whether the byte length of the read alarm message exceeds a first preset threshold, and based on the fact that the byte length of the alarm message exceeds the first preset threshold, splits the alarm message and sends the split multiple messages to the message receiving party.

[0057] In this embodiment, the consumption control module 31 is used to: read alarm messages from the message queue based on a preset time interval and a preset reading quantity.

[0058] In an alternative embodiment, the device further includes: a message generation module, which receives the alarm information sent by the message sending party before reading the alarm messages from the message queue, and generates alarm messages according to the alarm information in a preset message format; a queue storage module, which stores the alarm messages in the message queue.

[0059] Furthermore, the message generation module includes: an identification assignment unit that assigns a unique message identification ID according to the alarm information; a content extraction unit that extracts the core content of the alarm information to obtain the message content; and a message generation unit that assembles according to a preset message format based on the message ID, the message content, and the generation time determined based on the corresponding time of the system to obtain the alarm message.

[0060] In addition, the queue storage module is used to: insert the content of the alarm message and the generation time of the alarm message into the corresponding position in the message queue in the order of the generation time; wherein, the message queue is an ordered set zset created in advance in the remote dictionary service Redis.

[0061] It should be noted that when storing the alarm message in the message queue, the generation time and the message content of the alarm message are added to the zset, so that the new message is inserted into the corresponding position of the zset according to the generation time, and the alarm messages stored in the zset are automatically sorted by time.

[0062] In an alternative embodiment, the device further includes: a message deletion module that deletes the read alarm message from the message queue after reading the alarm message from the message queue. Similarly, the deletion can be implemented using the ERM command, such as r.zerm(“message_queue”,message1).

[0063] In an alternative embodiment, the device further includes: an inspection module that regularly checks the size of the message queue. If the size of the message queue exceeds the queue size threshold, the deletion module can delete the expired messages or pause receiving messages based on the generation time and the valid time of each alarm message in the queue until the size of the message queue does not exceed the queue size threshold.

[0064] In an alternative embodiment, the consumption control module 31 further includes: a traversal unit that reads at least two alarm messages from the message queue. After reading the alarm messages from the message queue, it traverses all the read alarm messages, checks whether the byte length of each alarm message is less than the first preset threshold, and selects all the alarm messages with a byte length less than the first preset threshold to obtain the first message set; a merging judgment unit that selects at least two alarm messages from the first message set and determines whether the selected alarm messages meet the preset merging condition. The preset merging condition is used to limit that the total byte length of the selected alarm messages is less than or equal to the second preset threshold, and the sum of the byte lengths of the selected alarm messages and the byte length of any other unselected alarm message in the first message set is greater than the second preset threshold, and the second preset threshold is less than or equal to the first preset threshold; a merging unit that splices the corresponding alarm messages based on the selected alarm messages meeting the preset merging condition.

[0065] It should be added that the consumption control module 31 further includes: a calling unit, which, after the consumption control module merges the corresponding messages or reads the corresponding alarm messages, calls the message sending module 32 to send the corresponding processed messages to the message recipient.

[0066] In an alternative embodiment, the preset merging condition is further used to determine the alarm messages that can be merged based on the business requirements and the relevance of the message content. Accordingly, the merging judgment unit includes: a merging combination judgment subunit, which determines, based on the preset merging condition, the alarm information in the first message set that can be merged into the same message to obtain the same group of messages to be merged; a combination selection subunit, which selects at least two alarm messages to be merged for each group of messages to be merged to obtain a second combination; and a length judgment subunit, which determines that the total byte length of all the alarm messages to be merged in the second combination is less than or equal to a second preset threshold, and the sum of the byte lengths of all the alarm messages to be merged in the second combination and the byte lengths of the other alarm messages outside the second combination in the message combination to be merged is greater than the second preset threshold, then determines that the alarm messages in the second combination meet the preset merging condition and can be merged into the same message.

[0067] In an alternative embodiment, the consumption control module 31 further includes: a marking unit, which, after splicing the corresponding alarm messages based on the selected alarm messages meeting the preset merging condition, marks the messages according to the priority, so as to facilitate the message recipient to process the alarm messages according to the priority first and improve the processing efficiency of the alarm messages.

[0068] In an alternative embodiment, the consumption control module 31 further includes: a calling unit, which, after checking whether the byte length of each alarm message is less than a first preset threshold, based on the byte length of the alarm message being equal to the first preset threshold, calls the message sending module 32 to directly send the corresponding alarm message to the message recipient; based on the byte length of the alarm message exceeding the first preset threshold, calls the message sending module 32 to perform message splitting and sending.

[0069] The message sending module 32 includes: a splitting unit, which, based on the byte length of the alarm message exceeding the first preset threshold, splits the alarm message according to the byte length of the alarm message and a preset splitting rule; wherein, the preset splitting rule is used to limit the message splitting quantity of the corresponding alarm message based on the first preset threshold and the byte lengths of different alarm messages.

[0070] Specifically, the preset splitting rules include different byte length range intervals and the corresponding pre-configured message splitting quantities and message splitting methods for each byte length range interval; the splitting unit includes: a first splitting information determination subunit, which determines the range of the byte length interval according to the byte length of the alarm message, in combination with the preset splitting rules, and determines the corresponding message splitting quantity and message splitting method according to the determined range; a first splitting subunit, which splits the alarm message according to the message splitting quantity and the message splitting method.

[0071] It should be added that the message splitting method includes uniform splitting or a specific splitting method required by the business logic. The specific splitting method can be reasonably divided according to semantic paragraphs and can be specifically configured according to actual design requirements.

[0072] Further, when the message splitting method is uniform splitting, the first splitting subunit is used to: uniformly split the alarm message according to the message splitting quantity, so that the byte lengths of the groups obtained by splitting are the same. In addition, when the message splitting method is a specific splitting method, the specific splitting method can refer to the method of splitting the alarm message by semantic analysis below and will not be repeated here.

[0073] In an alternative embodiment, the preset splitting rules include different byte length range intervals and the corresponding pre-configured message splitting quantities for each byte length range interval. Correspondingly, the splitting unit includes: a second splitting information determination subunit, which determines the range of the byte length interval according to the byte length of the alarm message, in combination with the preset splitting rules, and determines the corresponding message splitting quantity according to the determined range; a second splitting subunit, which performs semantic analysis on the alarm message, identifies the sentence structure, and splits the alarm message in combination with the message splitting quantity.

[0074] In an alternative embodiment, the message sending module 32 further includes: a message sending unit, which sends the read alarm message to the message recipient based on the byte length of the read alarm message not exceeding the first preset threshold.

[0075] In an alternative embodiment, the device further includes: a log generation module, which generates and stores a split log according to the byte length of the alarm message, the message splitting quantity, the byte lengths of the split messages, and the split time after splitting the alarm message.

[0076] In an alternative embodiment, the device further includes: a failure handling module, which monitors the message sending result after sending the read alarm message or the split multiple messages to the message recipient, re-stores the messages that failed to be sent into the message queue, and updates the generation time of the corresponding messages based on the time stored in the message queue to continue queuing and waiting for the next send.

[0077] In summary, in the embodiment of the present invention, the consumption control module reads the alarm messages stored in the message queue based on the chronological order, so as to process the corresponding messages in the order of generation of the messages, thereby preventing the problem that important information is ignored or the processing process is chaotic due to the disorder of the messages, enabling the entire alarm message processing mechanism to operate in an orderly manner, ensuring that all alarms can receive due attention and processing to the greatest extent, and further determining whether the byte length of the read alarm message exceeds a first preset threshold through the message sending module, so as to split the message when it exceeds the first preset threshold, thereby ensuring that the message meets the size limit requirements of the receiving party, the transmission channel, and the storage system, etc., realizing the smooth transmission of the message, avoiding the situation that key alarm content is lost due to the message being too large to be sent, and splitting the alarm message into multiple relatively short messages to reduce the processing difficulty of the message receiving party, reducing the resource consumption and error probability of the message receiving party in parsing and other links, thereby accelerating the response speed to the alarm content, making appropriate decisions and operations in a timely manner according to the alarm, and making the message receiving party more flexible when upgrading and expanding its processing capabilities in the future.

[0078] Figure 4 An entity structure diagram of an electronic device is exemplified, as Figure 4 shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communication bus 440. Among them, the processor 410, the communications interface 420, and the memory 430 complete mutual communication through the communication bus 440. The processor 410 can call the logical instructions in the memory 430 to execute the alarm message processing method, and the method includes: reading the alarm message from the message queue, where the alarm message is stored in the message queue based on the chronological order in advance; determining whether the byte length of the read alarm message exceeds a first preset threshold, and based on the byte length of the alarm message exceeding the first preset threshold, splitting the alarm message, and sending the split multiple messages to the message receiving party.

[0079] In addition, when the logical instructions in the above-mentioned memory 430 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.

[0080] On the other hand, the present application also provides a computer program product. The computer program product includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the alarm message processing method provided by the above-mentioned various methods. The method includes: reading an alarm message from a message queue, where the alarm message is stored in the message queue in advance based on the chronological order; determining whether the byte length of the read alarm message exceeds a first preset threshold, and based on the byte length of the alarm message exceeding the first preset threshold, splitting the alarm message and sending the split multiple messages to a message recipient.

[0081] In yet another aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium includes a stored program. When the program runs, it executes the alarm message processing method provided by the above-mentioned various methods. The method includes: reading an alarm message from a message queue, where the alarm message is stored in the message queue in advance based on the chronological order; determining whether the byte length of the read alarm message exceeds a first preset threshold, and based on the byte length of the alarm message exceeding the first preset threshold, splitting the alarm message and sending the split multiple messages to a message recipient.

[0082] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative efforts.

[0083] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for processing an alarm message, characterized in that, Including: Read an alarm message from a message queue, where the alarm message was previously stored in the message queue based on a chronological order; Determine whether the byte length of the read alarm message exceeds a first preset threshold, and based on the fact that the byte length of the alarm message exceeds the first preset threshold, split the alarm message and send the multiple split messages to a message recipient.

2. The alarm message processing method according to claim 1, wherein Based on the fact that the byte length of the alarm message exceeds the first preset threshold, splitting the alarm message includes: Based on the fact that the byte length of the alarm message exceeds the first preset threshold, according to the byte length of the alarm message, split the alarm message according to a preset splitting rule; wherein, the preset splitting rule is used to limit the message splitting quantity of the corresponding alarm message based on the first preset threshold and the byte lengths of different alarm messages.

3. The alarm message processing method according to claim 2, wherein The preset splitting rule includes different byte length range intervals and the message splitting quantity and message splitting method configured in advance corresponding to each byte length range interval; According to the byte length of the alarm message, splitting the alarm message according to a preset splitting rule includes: According to the byte length of the alarm message, in combination with the preset splitting rule, determine the interval range where the byte length is located, and according to the determined interval range, determine the corresponding message splitting quantity and message splitting method; According to the message splitting quantity, split the alarm message according to the message splitting method.

4. The warning message processing method according to claim 2, wherein The preset splitting rule includes different byte length range intervals and the message splitting quantity configured in advance corresponding to each byte length range interval; According to the byte length of the alarm message, splitting the alarm message according to a preset splitting rule includes: According to the byte length of the alarm message, in combination with the preset splitting rule, determine the interval range where the byte length is located, and according to the determined interval range, determine the corresponding message splitting quantity; Perform semantic analysis on the alarm message, identify the sentence structure, and in combination with the message splitting quantity, split the alarm message.

5. The alarm message processing method according to claim 2, wherein After splitting the alarm message, it includes: Generate a splitting log and store it according to the byte length of the alarm message, the message splitting quantity, the byte lengths of the split messages, and the splitting time.

6. The alarm message processing method according to claim 1, wherein Reading at least two alarm messages from the message queue, after reading the alarm messages from the message queue, it further includes: Traverse all the read alarm messages, check whether the byte length of each alarm message is less than the first preset threshold, and select all the alarm messages with a byte length less than the first preset threshold to obtain a first message set; Select at least two alarm messages from the first message set, and determine whether the selected alarm messages meet a preset merging condition, where the preset merging condition is used to limit that the sum of the byte lengths of the selected alarm messages is less than or equal to a second preset threshold, and the sum of the byte lengths of the selected alarm messages and the sum of the byte lengths of any other unselected alarm message in the first message set is greater than the second preset threshold, and the second preset threshold is less than or equal to the first preset threshold; Based on the selected alarm messages meeting the preset merging conditions, splice the corresponding alarm messages.

7. The alarm message processing method according to claim 1, wherein Before reading the alarm messages from the message queue, it includes: Receive the alarm information sent by the message sender, and generate alarm messages according to the alarm information in a preset message format; Store the alarm messages into the message queue.

8. An alarm message processing device, characterized in that, It includes: A consumption control module that reads alarm messages from the message queue, and the alarm messages are stored in the message queue based on the chronological order previously; A message sending module that determines whether the byte length of the read alarm message exceeds a first preset threshold, and based on the byte length of the alarm message exceeding the first preset threshold, split the alarm message and send the multiple split messages to the message receiver.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when running.

10. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.

Citation Information

Patent Citations

  • Method and server for sending message

    CN103166832A

  • Distributed type alarm monitoring method and system based on cloud storage

    CN103905533A

  • Message sending and message displaying method and device

    CN104767669A

  • Data request processing method and device, storage medium and electronic device

    CN110290217A

  • Data uploading method and device, network speed detection method and internetwork connector

    CN119276804A