A mass alarm processing method, device and equipment and storage medium
Patent Information
- Application Number
- CN202311126250.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-01
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2043-09-01
AI Technical Summary
[0005]本申请提供一种海量告警处理方法、装置、设备及存储介质,用以解决海量告警处理时,数据库资源消耗多,处理效率低的问题
[0046]存储器存储计算机执行指令;
Smart Images

Figure CN117112586B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet of Things (IoT) technology, and in particular to a method, apparatus, device, and storage medium for handling massive alarms. Background Technology
[0002] With the rapid development of the Internet of Things (IoT) industry, the scale of device management and control by IoT platforms is also constantly increasing, and the massive alarm processing puts enormous pressure on the database.
[0003] Currently, existing alarm handling technologies generally involve receiving alarm messages, writing them into an OLTP database, and then directly manipulating the alarm messages.
[0004] However, existing alarm processing technologies suffer from high database resource consumption and low processing efficiency when dealing with massive amounts of alarm data. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for handling massive alarms, in order to solve the problems of high database resource consumption and low processing efficiency when handling massive alarms.
[0006] Firstly, this application provides a method for processing massive alarm data, including:
[0007] Obtain target alarm data, which is alarm data from a massive amount of alarm data;
[0008] If the data type of the target alarm data meets the real-time requirements, then determine the initialization information of the target alarm data;
[0009] The initialization information of the target alarm data is written into the OLAP database and the OLTP database respectively, resulting in an alarm data table and an alarm data table copy. The alarm data table is a data table in the OLAP database, and the alarm data table copy is a data table copy in the OLTP database.
[0010] Receive write commands and data information sent by the platform management unit. The data information is the information input by the platform management unit in response to the user's initialization information.
[0011] Based on the data information, update the initialization information in the alarm data table copy to obtain the updated information;
[0012] According to the write command, the updated information is synchronized to the alarm data table to obtain the target alarm data table.
[0013] In this application, the method further includes, before obtaining the target alarm data:
[0014] Based on the message middleware, obtain the initial massive amount of alarm data;
[0015] Determine the amount of initial massive alarm data to be acquired and the acquisition time;
[0016] If the initial massive alarm data volume meets the preset data volume requirement, or if the acquisition time of the initial massive alarm data and the current time meet the preset acquisition time interval requirement, then the initial massive alarm data is determined to be massive alarm data.
[0017] In this application, the initial massive amount of alarm data is obtained, including:
[0018] Obtain a massive amount of alarm messages;
[0019] Send a large number of alarm messages to the alarm receiving unit;
[0020] The alarm receiving unit is controlled to query dimension information in the cache.
[0021] Based on the dimensional information, the dimensions of the massive alarm messages are supplemented to obtain the initial massive alarm data.
[0022] In this application, after obtaining the target alarm data, the method further includes:
[0023] If the data type of the target alarm data does not meet the real-time requirements, then determine the initialization information of the target alarm data;
[0024] The target alarm data and its initialization information are written into an OLAP database to obtain the target alarm data table.
[0025] In this application, after writing the target alarm data and its initialization information into an OLAP database to obtain the target alarm data table, the method further includes:
[0026] According to the preset merging period, the alarm data in the target alarm data table is merged to obtain the first target alarm table.
[0027] In this application, after merging the alarm data in the target alarm data table according to a preset merging period to obtain the first target alarm table, the method further includes:
[0028] An index is constructed based on the alarm occurrence time in the first target alarm table. The index is used to query target alarm data.
[0029] In this application, if the data type of the target alarm data meets the real-time requirements, the initialization information of the target alarm data is determined, including:
[0030] If the data type of the target alarm data meets the real-time requirements, then determine the version number, processing status, processing opinion, and read status of the target alarm data;
[0031] The version number, processing status, processing opinion, and read status of the target alarm data are initialized to obtain the initialized version number, initialized processing status, initialized processing opinion, and initialized read status. The initialized version number represents the alarm occurrence time, the initialized processing status is empty, the initialized processing opinion is empty, and the initialized read status is unread.
[0032] The initialization information of the target alarm data is determined based on the initialization version number, initialization processing status, initialization processing opinion, and initialization read status.
[0033] In this application, the initialization information in the alarm data table copy is updated based on the data information to obtain the updated information, including:
[0034] Determine the target processing status, target processing opinion, target read status, current time, and current time version number in the data information, where the target processing status is "processed" and the target read status is "read".
[0035] Based on the target processing status, target processing opinion, target read status, current time, and current time version number in the data information, update the initialization version number, initialization processing status, initialization processing opinion, and initial read status in the initialization information to obtain updated information.
[0036] In this application, after synchronizing the update information to the alarm data table according to the write instruction to obtain the target alarm data table, the method further includes:
[0037] Based on the primary key information of the target alarm data in the target alarm data table, the target alarm data in the target alarm data table is grouped to obtain the second target alarm table, where the primary key information represents the type of target alarm data.
[0038] Secondly, this application provides a massive alarm processing device, including:
[0039] The acquisition module is used to acquire target alarm data, which is alarm data from a massive amount of alarm data;
[0040] The determination module is used to determine the initialization information of the target alarm data if the data type of the target alarm data meets the real-time requirements.
[0041] The write module is used to write the initialization information of the target alarm data into the OLAP database and the OLTP database respectively, to obtain the alarm data table and the alarm data table copy. The alarm data table is a data table in the OLAP database, and the alarm data table copy is a data table copy in the OLTP database.
[0042] The receiving module is used to receive write commands and data information sent by the platform management unit. The data information is the information input by the platform management unit in response to the user's initialization information.
[0043] The update module is used to update the initialization information in the alarm data table copy based on the data information to obtain the updated information;
[0044] The synchronization module is used to synchronize the updated information to the alarm data table according to the write command, so as to obtain the target alarm data table.
[0045] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0046] The memory stores the instructions that the computer executes;
[0047] The processor executes computer execution instructions stored in memory to implement the method as described in any one of the mass alarm processing methods as claimed.
[0048] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the massive alarm processing method of this application.
[0049] This application provides a method, apparatus, device, and storage medium for handling massive alarms. The method involves receiving alarm messages through an alarm receiving unit, completing the dimensions of the alarm messages to obtain alarm data, and then sending the alarm data to a message middleware to initialize the alarm data, resulting in initialized alarm data. If the alarm data meets real-time requirements, the initialized alarm data is written to both an OLAP database and an OLTP database, resulting in an alarm data table and a copy of the alarm data table. In response to data information sent by a platform management unit, the copy of the alarm data table in the OLTP database is updated, and the updated information is synchronized to the alarm data table in the OLAP database. Then, the data is grouped and processed according to primary key information. If the alarm data does not meet real-time requirements, the initialized alarm data is written to the OLAP database. In response to data information and write commands sent by the platform management unit, the alarm data in the OLAP database is extracted, updated, and then written back to the OLAP database. The data is then merged according to a preset period. This massive alarm processing method improves the processing efficiency of massive alarm data. Attached Figure Description
[0050] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0051] Figure 1 A flowchart illustrating the massive alarm processing method provided in this application embodiment;
[0052] Figure 2 A flowchart illustrating another method for handling massive alarms provided in this application embodiment;
[0053] Figure 3 A schematic diagram of the structure of the massive alarm processing device provided in the embodiments of this application;
[0054] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0055] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation
[0056] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0057] In existing technologies, alarm processing is generally done by writing to an OLTP database and then directly manipulating the alarm messages. When the number of alarm data to be processed reaches tens of millions, it will put a heavy burden on the database, consume too much database resources, and make it difficult to meet business needs.
[0058] To address the aforementioned issues, this application proposes a massive data processing method. The method involves receiving alarm messages through an alarm receiving unit, completing the dimensions of the alarm messages to obtain alarm data, and then sending the alarm data to a message middleware to initialize the alarm data, resulting in initialized alarm data. If the alarm data meets real-time requirements, the initialized alarm data is written to both an OLAP database and an OLTP database, resulting in an alarm data table and an alarm data table copy. In response to data information sent by the platform management unit, the alarm data table copy in the OLTP database is updated, and the updated information is synchronized to the alarm data table in the OLAP database. Then, the data is grouped and processed according to primary key information. If the alarm data does not meet real-time requirements, the initialized alarm data is written to the OLAP database. In response to data information and write commands sent by the platform management unit, the alarm data in the OLAP database is extracted, updated, and then written back to the OLAP database. Finally, the data is merged according to a preset period. The massive alarm processing method proposed in this application combines OLAP and OLTP databases and performs different processing based on whether real-time requirements are met, thereby improving the processing efficiency of massive alarm data.
[0059] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0060] The execution entity of the determination method provided in this application embodiment can be a massive alarm processing system. This massive alarm processing system can be used for log alarm processing, enterprise alarm processing, monitoring alarm processing, etc. This embodiment does not impose any particular restrictions on the implementation method of the execution entity, as long as the execution entity can obtain the target alarm data, where the target alarm data is the alarm data in the massive alarm data; if the data type of the target alarm data meets the real-time requirements, then the initialization information of the target alarm data is determined; the initialization information of the target alarm data is written into an OLAP database and an OLTP database respectively, obtaining an alarm data table and an alarm data table copy, where the alarm data table is a data table in the OLAP database and the alarm data table copy is a data table copy in the OLTP database; a write command and data information sent by the platform management unit are received, where the data information is the information input by the platform management unit in response to the user's initialization information; based on the data information, the initialization information in the alarm data table copy is updated to obtain updated information; based on the write command, the updated information is synchronized to the alarm data table to obtain the target alarm data table.
[0061] OLAP (Online Analytical Processing) databases refer to databases that support complex analytical operations, emphasize decision support, perform analysis based on large amounts of historical data, and have low real-time requirements. Examples include Hive and Clickhouse.
[0062] OLTP (Online Transaction Processing) databases refer to databases that perform transactional queries strongly related to functionality and business logic, emphasizing high concurrency and low latency operations. Examples include application backend databases such as MySQL and Oracle.
[0063] Figure 1 This is a flowchart illustrating the massive alarm processing method provided in this embodiment. The executing entity of this method can be a massive alarm processing system; however, this embodiment does not impose any particular limitation. Figure 1 As shown, the method may include:
[0064] S101. Obtain target alarm data, where target alarm data is alarm data from a large amount of alarm data.
[0065] Among them, massive alarm data can refer to the data generated by processing a large number of alarm messages. Massive alarm messages can refer to alarm messages with a quantity of tens of millions. When the number of alarm messages reaches tens of millions, it will continuously consume database resources and put heavy pressure on the database.
[0066] In this embodiment of the application, before obtaining the target alarm data, the method further includes:
[0067] The initial massive amount of alarm data is obtained based on the message middleware.
[0068] Message middleware refers to a supporting software system that provides synchronous or asynchronous, reliable message transmission for application systems in a network environment, based on queue and message passing technologies. In this embodiment, the message middleware used is Kafka. Massive alarm data can refer to alarm data in the tens of millions or more.
[0069] Determine the amount of initial massive alarm data to be acquired and the acquisition time.
[0070] The data volume can refer to the number of massive alarm data. In this embodiment, the preset data volume can be ten million. When the number of alarm data reaches ten million, it indicates that the alarm data meets the preset quantity requirement, and the alarm data that meets the preset quantity requirement is determined to be massive alarm data.
[0071] The acquisition time can refer to the time when the massive alarm system receives the alarm message from the IoT (Internet of Things) device. In this embodiment, the preset acquisition time interval can be 15 minutes, the acquisition time can be 7:30, and the current time can be 7:45. When the time difference between the current time and the acquisition time is the same as the preset acquisition time interval, it indicates that the alarm data meets the requirements of the preset acquisition time interval. The alarm data that meets the requirements of the preset acquisition time interval is determined to be massive alarm data.
[0072] If the initial massive alarm data volume meets the preset data volume requirement, or if the acquisition time of the initial massive alarm data and the current time meet the preset acquisition time interval requirement, then the initial massive alarm data is determined to be massive alarm data.
[0073] Among them, satisfying the preset quantity requirement and satisfying the preset acquisition time interval requirement are related by OR. When either requirement is satisfied, the step of determining the initial massive alarm data as massive alarm data is executed.
[0074] In this embodiment of the application, obtaining the initial massive alarm data includes:
[0075] Obtain a massive amount of alarm messages;
[0076] Send a large number of alarm messages to the alarm receiving unit.
[0077] Among them, the alarm receiving unit can refer to the unit in the massive alarm processing system that receives alarm messages sent by IoT devices.
[0078] The alarm receiving unit controls the query of dimension information in the cache.
[0079] Among them, dimension information can refer to the descriptive content of the data, which can be represented by text, time, numerical value, etc. In the embodiments of this application, dimension information can be information such as the time of receiving the alarm message, the source of the alarm message, the location of the alarm message, and the type of the alarm message.
[0080] Based on the dimensional information, the dimensions of the massive alarm messages are supplemented to obtain the initial massive alarm data.
[0081] Dimension completion refers to filling the alarm message with the dimension information corresponding to the alarm message. For example, if alarm message 1 is a message from the IoT device's enabled status and is sent to the massive alarm processing system at 18:00, then the alarm reception time will be filled with 18:00, the alarm source will be filled with IoT device, and the alarm type will be filled with IoT device enabled status.
[0082] S102. If the data type of the target alarm data meets the real-time requirements, then determine the initialization information of the target alarm data.
[0083] Real-time performance refers to the varying nature of target alarm data at different times, determining its validity within a specific timeframe. In this embodiment, real-time performance is a requirement for the timeliness of target alarm data. For example, device status alarms are alarm data with real-time requirements; when a device malfunctions, administrators need to be notified promptly. Alarms providing operational information, on the other hand, do not have real-time requirements; they are interface prompts provided by the platform when a user first enters the platform.
[0084] The initialization information may refer to the initial version number, initial processing status, initial processing opinion, and initial read status of the target alarm data. In this embodiment, the initial version number of the target alarm data is the alarm occurrence time, the initial processing status is unprocessed, the initial processing opinion is empty, and the initial read status is unread.
[0085] In this embodiment of the application, if the data type of the target alarm data meets the real-time requirements, the initialization information of the target alarm data is determined, including:
[0086] If the data type of the target alarm data meets the real-time requirements, then determine the version number, processing status, processing opinion, and read status of the target alarm data;
[0087] The version number, processing status, processing opinion, and read status of the target alarm data are initialized to obtain the initial version number, initial processing status, initial processing opinion, and initial read status. Among them, the initial version number represents the alarm occurrence time, the initial processing status is empty, the initial processing opinion is empty, and the initial read status is unread.
[0088] The initialization process can refer to the process of assigning values to the declared object. In this embodiment, the initialization process is the process of assigning values to the version number, processing status, processing opinion, and read status of the target alarm data.
[0089] The initialization information of the target alarm data is determined based on the initialization version number, initialization processing status, initialization processing opinion, and initialization read status.
[0090] S103. Write the initialization information of the target alarm data into the OLAP database and the OLTP database respectively to obtain the alarm data table and the alarm data table copy. The alarm data table is a data table in the OLAP database, and the alarm data table copy is a data table copy in the OLTP database.
[0091] In this embodiment of the application, the OLAP database may refer to the Clickhouse database, and the OLTP database may refer to the MySQL database.
[0092] S104. Receive the write command and data information sent by the platform management unit. The data information is the information input by the platform management unit in response to the user's initialization information.
[0093] The platform management unit can refer to the management platform and the mini-program. In this embodiment, the management platform unit responds to the user's operation, initializes information, obtains data information, and then sends the data information and write instructions to the Clickhouse database.
[0094] S105. Based on the data information, update the initialization information in the alarm data table copy to obtain the updated information.
[0095] In this embodiment of the application, the initialization information in the alarm data table copy is updated according to the data information to obtain the updated information, including:
[0096] Determine the target processing status, target processing opinion, target read status, current time, and current time version number in the data information, where the target processing status is "processed" and the target read status is "read".
[0097] Among them, the target processing status can refer to whether the alarm data has been processed, the target processing opinion can refer to the user's processing requirements for the alarm data through the platform, the target read status can refer to whether the alarm data has been viewed and known by the user, and the current time version number can refer to the identifier that the current time is used as the version number. By querying the version number with the most recent time, the latest alarm data can be found.
[0098] Based on the target processing status, target processing opinion, target read status, current time, and current time version number in the data information, update the initialization version number, initialization processing status, initialization processing opinion, and initial read status in the initialization information to obtain updated information.
[0099] S106. According to the write command, the update information is synchronized to the alarm data table to obtain the target alarm data table.
[0100] In this embodiment of the application, after obtaining the target alarm data, the method further includes:
[0101] If the data type of the target alarm data does not meet the real-time requirements, then determine the initialization information of the target alarm data;
[0102] The target alarm data and its initialization information are written into an OLAP database to obtain the target alarm data table.
[0103] In this embodiment of the application, after writing the target alarm data and its initialization information into an OLAP database to obtain a target alarm data table, the method further includes:
[0104] According to the preset merging period, the alarm data in the target alarm data table is merged to obtain the first target alarm table.
[0105] In this embodiment of the application, the preset merging period can refer to 15 minutes. For example, if the current time is 7:30, when the time reaches 7:45, the current alarm data in the target alarm data table is merged to obtain the first target alarm table.
[0106] In this embodiment of the application, after merging the alarm data in the target alarm data table according to a preset merging period to obtain a first target alarm table, the method further includes:
[0107] An index is constructed based on the alarm occurrence time in the first target alarm table. The index is used to query target alarm data.
[0108] The alarm occurrence time can refer to the preset time for reading the alarm message in the alarm message, and the index can refer to the data in the database table or view used for fast access. The index can be created on a single column or multiple columns.
[0109] In this embodiment of the application, after synchronizing the update information to the alarm data table according to the write instruction to obtain the target alarm data table, the method further includes:
[0110] Based on the primary key information of the target alarm data in the target alarm data table, the target alarm data in the target alarm data table is grouped to obtain the second target alarm table, where the primary key information represents the type of target alarm data.
[0111] The primary key information can refer to a unique identifier in a database relational table. In this embodiment, the primary key information is used to distinguish the same alarm data in different versions.
[0112] This application provides a method for handling massive alarms. An alarm receiving unit receives alarm messages, completes the dimensions of the alarm messages to obtain alarm data, and then sends the alarm data to a message middleware to initialize the alarm data, obtaining initialized alarm data. If the alarm data meets real-time requirements, the initialized alarm data is written to both an OLAP database and an OLTP database to obtain an alarm data table and an alarm data table copy. In response to data information sent by a platform management unit, the alarm data table copy in the OLTP database is updated to obtain update information, which is then synchronized to the alarm data table in the OLAP database. The data is then grouped and processed according to primary key information. If the alarm data does not meet real-time requirements, the initialized alarm data is written to the OLAP database. In response to data information and write commands sent by the platform management unit, alarm data is extracted from the OLAP database, updated, and then written back to the OLAP database. The data is then merged according to a preset period. The massive alarm processing method proposed in this application combines OLAP and OLTP databases and performs different processing based on whether real-time requirements are met, thereby improving the processing efficiency of massive alarm data.
[0113] Figure 2 A flowchart illustrating another method for handling massive alarms provided in this application embodiment is shown below. Figure 2 As shown, this method for handling massive alarms includes:
[0114] S201. The alarm receiving unit receives alarm messages sent by IoT devices, queries the dimension information in the cache, and completes the dimensions of the alarm messages.
[0115] S202. Send the alarm message with the dimensions completed to the message middleware. The alarm data is stored in the cache at the device granularity according to the dimension information.
[0116] S203. Create an alarm fact table and add alarm processing fields, including version number, alarm processing status, alarm processing comments, and whether the alarm has been read.
[0117] S204. When the preset time threshold or preset quantity threshold is met, the alarm messages in the message middleware are written in batches to the alarm fact table of the OLAP database, and the alarm processing field is initialized.
[0118] The initial alarm processing field can specify the version number and the alarm occurrence time. The alarm processing status defaults to unprocessed. The alarm read status defaults to unread. The alarm processing opinion defaults to null.
[0119] S205. If the alarm message meets the real-time requirements, write the alarm message to the OLTP database and synchronize the changed data to the OLAP database based on the binlog (binary log).
[0120] S206. Based on actual needs, perform operations on the alarm messages in the alarm fact table and rewrite them into the alarm fact table.
[0121] In this context, depending on actual needs, it can refer to the information fed back by the platform in response to user operations. For example, the platform may receive a user's instruction to clear alarm information from the most recent month. Operations on alarm messages in the alarm fact table may refer to updating the content of the alarm processing field. For example, updating the version number to the current time, updating the alarm processing status record to processed, updating the alarm read status record to read, and supplementing the alarm processing comments.
[0122] S207. If the alarm message meets the real-time requirements, then in the alarm fact table, group the alarm messages according to their primary key information and query the latest alarm record.
[0123] S208. If the alarm messages do not meet the real-time requirements, the alarm messages in the alarm fact table will be periodically merged.
[0124] Figure 3 This is a schematic diagram of the structure of the massive alarm processing device provided in the embodiments of this application. Figure 3 As shown, the massive alarm processing device 30 includes: an acquisition module 301, a determination module 302, a writing module 303, a receiving module 304, an update module 305, and a synchronization module 306. Wherein:
[0125] The acquisition module 301 is used to acquire target alarm data, wherein the target alarm data is alarm data from a massive amount of alarm data;
[0126] The determination module 302 is used to determine the initialization information of the target alarm data if the data type of the target alarm data meets the real-time requirements.
[0127] The writing module 303 is used to write the initialization information of the target alarm data into the OLAP database and the OLTP database respectively, to obtain the alarm data table and the alarm data table copy. The alarm data table is a data table in the OLAP database, and the alarm data table copy is a data table copy in the OLTP database.
[0128] The receiving module 304 is used to receive write instructions and data information sent by the platform management unit. The data information is the information input by the platform management unit in response to the user's initialization information.
[0129] The update module 305 is used to update the initialization information in the alarm data table copy according to the data information to obtain the updated information;
[0130] The synchronization module 306 is used to synchronize the updated information to the alarm data table according to the write command, so as to obtain the target alarm data table.
[0131] In this embodiment of the application, the acquisition module 301 can also be specifically used for:
[0132] Based on the message middleware, obtain the initial massive amount of alarm data;
[0133] Determine the amount of initial massive alarm data to be acquired and the acquisition time;
[0134] If the initial massive alarm data volume meets the preset data volume requirement, or if the acquisition time of the initial massive alarm data and the current time meet the preset acquisition time interval requirement, then the initial massive alarm data is determined to be massive alarm data.
[0135] In this embodiment of the application, the acquisition module 301 can also be specifically used for:
[0136] Obtain a massive amount of alarm messages;
[0137] Send a large number of alarm messages to the alarm receiving unit;
[0138] The alarm receiving unit is controlled to query dimension information in the cache.
[0139] Based on the dimensional information, the dimensions of the massive alarm messages are supplemented to obtain the initial massive alarm data.
[0140] In this embodiment of the application, the determining module 302 can also be specifically used for:
[0141] If the data type of the target alarm data does not meet the real-time requirements, then determine the initialization information of the target alarm data;
[0142] The target alarm data and its initialization information are written into an OLAP database to obtain the target alarm data table.
[0143] In this embodiment of the application, the determining module 302 can also be specifically used for:
[0144] If the data type of the target alarm data meets the real-time requirements, then determine the version number, processing status, processing opinion, and read status of the target alarm data;
[0145] The version number, processing status, processing opinion, and read status of the target alarm data are initialized to obtain the initialized version number, initialized processing status, initialized processing opinion, and initialized read status. The initialized version number represents the alarm occurrence time, the initialized processing status is empty, the initialized processing opinion is empty, and the initialized read status is unread.
[0146] The initialization information of the target alarm data is determined based on the initialization version number, initialization processing status, initialization processing opinion, and initialization read status.
[0147] In this embodiment of the application, the determining module 302 can also be specifically used for:
[0148] Determine the target processing status, target processing opinion, target read status, current time, and current time version number in the data information, where the target processing status is "processed" and the target read status is "read".
[0149] Based on the target processing status, target processing opinion, target read status, current time, and current time version number in the data information, update the initialization version number, initialization processing status, initialization processing opinion, and initial read status in the initialization information to obtain updated information.
[0150] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 40 includes:
[0151] The electronic device 40 may include a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a communication component 403, and other components. The processor 401, memory 402, and communication component 403 are connected via a bus 404.
[0152] In the specific implementation process, at least one processor 401 executes computer execution instructions stored in memory 402, causing at least one processor 401 to execute the above-mentioned massive alarm processing method.
[0153] The specific implementation process of processor 401 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0154] In the above Figure 4 In the illustrated embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0155] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0156] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0157] In some embodiments, a computer program product is also provided, including a computer program or instructions that, when executed by a processor, implement the steps in any of the above-described methods for handling massive alarms.
[0158] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0159] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0160] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute the steps in any of the mass alarm processing methods provided in embodiments of this application.
[0161] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0162] According to one aspect of this application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium.
[0163] Since the instructions stored in the storage medium can execute the steps in any of the massive alarm processing methods provided in the embodiments of this application, the beneficial effects that any of the massive alarm processing methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0164] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0165] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for handling massive alarms, characterized in that, The method is applied to a massive alarm processing system and is as follows: Acquire target alarm data, wherein the target alarm data is alarm data from a massive amount of alarm data; If the data type of the target alarm data meets the real-time requirements, then the initialization information of the target alarm data is determined. The initialization information refers to the initial version number, initial processing status, initial processing opinion, and initial read status of the target alarm data. The initial version number is the alarm occurrence time of the target alarm data, the initial processing status is unprocessed, the initial processing opinion is empty, and the initial read status is unread. The initialization information of the target alarm data is written into an OLAP (Online Analytical Processing) database and an OLTP (Online Transaction Processing) database respectively to obtain an alarm data table and an alarm data table copy. The alarm data table is a data table in the OLAP database, and the alarm data table copy is a data table copy in the OLTP database. The system receives write instructions and data information sent by the platform management unit, wherein the data information is information input by the platform management unit in response to the user's initialization information. Based on the data information, the initialization information in the copy of the alarm data table is updated to obtain the updated information, including the target processing status, target processing opinion, target read status, current time, and version number of the current time. The target processing status indicates whether the alarm data has been processed, the target processing opinion indicates the user's processing requirements for the alarm data through the platform, the target read status indicates whether the alarm data has been viewed and known by the user, and the version number of the current time indicates that the current time is used as the version number. According to the write instruction, the update information is synchronized to the alarm data table to obtain the target alarm data table; If the data type of the target alarm data does not meet the real-time requirements, then the initialization information of the target alarm data is determined; The target alarm data and its initialization information are written into an OLAP database to obtain a target alarm data table. The alarm data in the target alarm data table are merged to obtain a first target alarm table. An index for the first target alarm table is constructed based on the alarm occurrence time in the first target alarm table. The index is used to query the target alarm data.
2. The method according to claim 1, characterized in that, Before acquiring the target alarm data, the method further includes: Based on the message middleware, obtain the initial massive amount of alarm data; Determine the amount of initial massive alarm data and the acquisition time; If the amount of the initial massive alarm data meets the preset data amount requirement, or if the acquisition time of the initial massive alarm data and the current time meet the preset acquisition time interval requirement, then the initial massive alarm data is determined to be massive alarm data.
3. The method according to claim 2, characterized in that, The acquisition of initial massive alarm data includes: Obtain a massive amount of alarm messages; Send the massive number of alarm messages to the alarm receiving unit; The alarm receiving unit is controlled to query the dimension information in the cache; Based on the dimensional information, the massive alarm messages are augmented with dimensions to obtain the initial massive alarm data.
4. The method according to claim 1, characterized in that, The alarm data in the target alarm data table are merged to obtain the first target alarm table, which includes: According to the preset merging period, the alarm data in the target alarm data table is merged to obtain the first target alarm table.
5. The method according to claim 1, characterized in that, If the data type of the target alarm data meets the real-time requirements, then the initialization information of the target alarm data is determined, including: If the data type of the target alarm data meets the real-time requirements, then determine the version number, processing status, processing opinion, and read status of the target alarm data; The version number, processing status, processing opinion, and read status of the target alarm data are initialized to obtain the initialized version number, initialized processing status, initialized processing opinion, and initialized read status. The initialized version number represents the alarm occurrence time, the initialized processing status is empty, the initialized processing opinion is empty, and the initialized read status is unread. The initialization information of the target alarm data is determined based on the initialization version number, the initialization processing status, the initialization processing opinion, and the initialization read status.
6. The method according to claim 1, characterized in that, Based on the data information, the initialization information in the alarm data table copy is updated to obtain updated information, including: Determine the target processing status, target processing opinion, target read status, current time, and version number of the current time in the data information, wherein the target processing status is a processed status and the target read status is a read status; Based on the target processing status, target processing opinion, target read status, current time, and version number of the current time in the data information, the initialization version number, initialization processing status, initialization processing opinion, and initial read status in the initialization information are updated to obtain updated information.
7. The method according to claim 1, characterized in that, After synchronizing the updated information to the alarm data table according to the write instruction to obtain the target alarm data table, the method further includes: Based on the primary key information of the target alarm data in the target alarm data table, the target alarm data in the target alarm data table is grouped to obtain a second target alarm table, wherein the primary key information represents the type of the target alarm data.
8. A massive alarm processing device, characterized in that, include: The acquisition module is used to acquire target alarm data, wherein the target alarm data is alarm data from a massive amount of alarm data; The determination module is used to determine the initialization information of the target alarm data if the data type of the target alarm data meets the real-time requirements. The initialization information refers to the initial version number, initial processing status, initial processing opinion, and initial read status of the target alarm data. The initial version number is the alarm occurrence time of the target alarm data, the initial processing status is unprocessed, the initial processing opinion is empty, and the initial read status is unread. The writing module is used to write the initialization information of the target alarm data into an OLAP (Online Analytical Processing) database and an OLTP (Online Transaction Processing) database respectively, to obtain an alarm data table and an alarm data table copy, wherein the alarm data table is a data table in the OLAP database and the alarm data table copy is a data table copy in the OLTP database; The receiving module is used to receive write instructions and data information sent by the platform management unit, wherein the data information is the information input by the platform management unit in response to the user's initialization information; The update module is used to update the initialization information in the copy of the alarm data table according to the data information to obtain the updated information, including the target processing status, target processing opinion, target read status, current time, and version number of the current time. The target processing status indicates whether the alarm data has been processed, the target processing opinion indicates the user's processing requirements for the alarm data through the platform, the target read status indicates whether the alarm data has been viewed and known by the user, and the version number of the current time indicates that the current time is used as the version number. The synchronization module is used to synchronize the updated information to the alarm data table according to the write instruction, so as to obtain the target alarm data table; The writing module is also used to determine the initialization information of the target alarm data if the data type of the target alarm data does not meet the real-time requirements; The target alarm data and its initialization information are written into an OLAP database to obtain a target alarm data table. The alarm data in the target alarm data table are merged to obtain a first target alarm table. An index for the first target alarm table is constructed based on the alarm occurrence time in the first target alarm table. The index is used to query the target alarm data.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the massive alarm processing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the massive alarm processing method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Alarm storm processing method and alarm storm processing system
CN104753700A
Communication network warning method and warning system
CN1992632A
