A method for processing monitoring data based on time series database
By using the combined solution of data collector and time series database in the real-time monitoring system, the problem of low efficiency of monitoring data storage and query is solved, efficient storage and fast query are achieved, and the monitoring data processing capability and query speed are improved.
Patent Information
- Application Number
- CN202011210796.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-03
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2040-11-03
AI Technical Summary
In modern real-time monitoring systems, thousands of monitoring points generate a large amount of data every second, causing data storage and query to become major problems. It is difficult for existing technologies to efficiently process and query monitoring data.
Use a data collector to collect monitoring data and store it in a time series database through a message queue. Record the collection time point of each data, unify the query entrance of the time series database, limit the amount and frequency of query information, set alarm rules and notify users , use a time series database cluster to store data, and obtain the unique identification code of the device to query historical data.
It achieves efficient storage and fast query of monitoring data, significantly improves the processing capacity and query speed of monitoring data, reduces the pressure on a single service, prevents inferior queries, and ensures database stability and data integrity.
Smart Images

Figure CN112434063B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to a method for processing monitoring data based on a time series database. Background Art
[0002] Modern society is an era of highly shared information, rapid development of the Internet and mobile communication technologies. The data collected and generated by various real-time monitoring, inspection and analysis equipment have typical characteristics: fast generation frequency, each monitoring point can produce multiple data within one second, seriously dependent on collection time, each data requires corresponding to a unique time, and there are many measuring points and large amounts of information.
[0003] Conventional real-time monitoring systems have tens of thousands of monitoring points, which generate data every second and tens of GB of data every day. Data storage and data query have become the most important issues at present. Summary of the invention
[0004] The main technical problem solved by the present invention is to provide a monitoring data processing method based on a time series database, which can efficiently store monitoring data, greatly improve the processing capability of monitoring data, and also improve the query speed.
[0005] In order to solve the above technical problems, a technical solution adopted by the present invention is: to provide a method for processing monitoring data based on a time series database, characterized in that it includes: using a data collector to collect the required monitoring data; storing the collected monitoring data in the time series database in the form of a message queue, and recording the collection time point of each monitoring data, and displaying the monitoring data on the interface; unifying the query entry of the time series database, and uniformly limiting the amount of information queried in the time series database and the frequency of queries; setting various forms of alarm rules, and generating an alarm and notifying the user when the alarm condition is met.
[0006] Furthermore, the method also includes: storing the collected monitoring data in a time series database cluster manner.
[0007] Furthermore, the method also includes: while recording the collection time point of each monitoring data, obtaining the unique identification code of the device corresponding to the monitoring data, and saving the unique identification code of the device in a time series database; when it is determined to query the device through the unique identification code, all historical data of the device are queried and displayed through a matching program.
[0008] Furthermore, when it is determined that the device is queried through the unique identification code, the step of querying and displaying all the historical monitoring data of the device through a matching program includes: obtaining the configuration information to be queried, and uniformly querying the historical monitoring data within a preset period from the time series database according to the unique identification code of the device associated with the configuration information, and uniformly outputting the monitoring data to the interface for display.
[0009] Furthermore, the method also includes: when it is determined that new monitoring data needs to be added, sending the data collector to the device corresponding to the monitoring data.
[0010] Furthermore, there are multiple time series databases, and the step of unifying the query entrance of the time series database includes: setting corresponding query entrances of the time series database for different types of devices; and setting the opening and closing conditions of each query entrance of the time series database.
[0011] Furthermore, the method also includes: when a query statement is input through a query entry, if it is determined that the device corresponding to the query statement does not correspond to the query entry, the query entry is closed so that the query statement cannot enter the time series database for query, and a prompt is popped up, and a query entry corresponding to the device corresponding to the query statement is popped up; if it is determined that the device corresponding to the query statement corresponds to the query entry, the query statement is input into the time series database for query through the query entry.
[0012] Furthermore, the step of uniformly limiting the amount of information queried in the time series database and the frequency of queries includes: setting a threshold for the amount of information queried by different types of devices in the time series database; setting a threshold for the number of queries and a query time period for different types of devices in the time series database.
[0013] Furthermore, the method also includes: when it is determined that the amount of information queried by a certain device in a time series database exceeds a threshold within a preset time period, an alarm is generated and sent to the staff who are on duty, and the query entrance of the current time series database is closed; when it is determined that the number of times a certain device queries the time series database within the query time period exceeds a number threshold, an alarm is generated and sent to the staff who are on duty, and the query entrance of the current time series database is closed; when it is determined that a certain device does not query the time series database within the query time period, an alarm is generated and sent to the staff who are on duty, and the query entrance of the current time series database is closed.
[0014] Furthermore, the method also includes: controlling the storage period of the historical monitoring data of the equipment in the time series database according to different types of equipment.
[0015] The beneficial effects of the present invention are as follows: Different from the prior art, the monitoring data processing method based on the time series database disclosed by the present invention includes: using a data collector to collect the required monitoring data; storing the collected monitoring data in the time series database in the form of a message queue, and recording the collection time point of each monitoring data item, and displaying the monitoring data on the interface; unifying the query entry of the time series database, and uniformly limiting the amount of information queried by the time series database and the frequency of queries; setting various forms of alarm rules, and generating an alarm and notifying the user when the alarm condition is met. In the above manner, the monitoring data processing method based on the time series database disclosed by the present invention can efficiently store monitoring data, greatly improve the processing capacity of monitoring data, and also improve the query speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flow chart of a method for processing monitoring data based on a time series database of the present invention. DETAILED DESCRIPTION
[0017] The present invention is described in detail below with reference to the accompanying drawings and embodiments.
[0018] like Figure 1 As shown, the method for processing monitoring data based on the time series database includes the following steps:
[0019] Step S101: Use a data collector to collect required monitoring data.
[0020] The data collector is a self-developed product that can perform high-intensity identification and collection of monitoring data. Specifically, the data collector pre-stores the pre-stored identification code of the device to be collected. Therefore, before collecting monitoring data, the data collector first parses the monitoring data to obtain the unique identification code of the device corresponding to the monitoring data, and collects the monitoring data when it is determined that the unique identification code is the same as the pre-stored identification code. In other words, the data collector does not collect monitoring data randomly, but collects monitoring data in a targeted manner.
[0021] Step S102: The collected monitoring data is stored in a time series database in the form of a message queue, and the collection time point of each monitoring data is recorded, and the monitoring data is displayed on an interface.
[0022] It should be understood that in step S102, the monitoring data is stored in the time series database in the form of a message queue (i.e., a Kafka message queue), which can realize the storage of massive data. In this way, by using Kafka and InfluxDB (time series database) to solve the problem of massive data processing, the time spent on data dumping will be greatly reduced, thereby ensuring the timeliness of monitoring.
[0023] Step S103: unify the query entry of the time series database, and uniformly limit the amount of information queried and the frequency of queries of the time series database.
[0024] It should be understood that in step S103, the query entry of the time series database is unified, and the amount of information and the query frequency of the time series database are uniformly restricted, mainly to prevent inferior queries and ensure the stability of the database.
[0025] Step S104: Setting various forms of alarm rules, and generating an alarm and notifying the user when the alarm condition is met.
[0026] Furthermore, the monitoring data processing method based on the time series database also includes: storing the collected monitoring data in a time series database cluster manner, which can reduce the pressure of data reading and writing of a single service, and multi-point storage also ensures the integrity of the data.
[0027] Furthermore, the method for processing monitoring data based on the time series database also includes:
[0028] Step A1: While recording the collection time point of each piece of monitoring data, obtain the unique identification code of the device corresponding to the monitoring data, and save the unique identification code of the device in the time series database.
[0029] Step A2: When it is determined that the device is queried through the unique identification code, all historical data of the device are queried and displayed through a matching program.
[0030] It should be understood that the query can be made by inputting a query statement, and the query statement is protected with a unique identification code, wherein the matching program is independently written by the user. In step A2, all historical data of the device are queried and displayed, so that the user can view the overall situation of the device.
[0031] In this embodiment, when it is determined to query the device through the unique identification code, the step of querying and displaying all the historical monitoring data of the device through the matching program includes: obtaining the configuration information to be queried, and uniformly querying the historical monitoring data within a preset period from the time series database according to the unique identification code of the device associated with the configuration information, and uniformly outputting the monitoring data to the interface for display.
[0032] Furthermore, the monitoring data processing method based on the time series database also includes: controlling the storage time limit of the historical monitoring data of the device in the time series database according to different types of devices. In other words, the storage time of the historical monitoring data of the device can be controlled according to the importance of the device.
[0033] Specifically, the retention period of historical monitoring data of devices in the control time series database is controlled according to different types of devices: when the level of the device is determined to be a high-level device, the retention period of historical monitoring data of the device in the control time series database is controlled to be longer; when the level of the device is determined to be a low-level device, the retention period of historical monitoring data of the device in the control time series database is controlled to be shorter.
[0034] Alternatively, the storage time limit of the historical monitoring data of the device in the control time series database according to different types of devices includes: when the number of times the device is queried in the preset query time period is more, the storage time limit of the historical monitoring data of the device in the control time series database is longer; when the number of times the device is queried in the preset query time period is less, the storage time limit of the historical monitoring data of the device in the control time series database is shorter. It should be understood that the preset query time period is a time set by the user, such as one month, two months, three months or half a year.
[0035] Furthermore, the monitoring data processing method based on the time series database also includes: when it is determined that new monitoring data needs to be added, the data collector is sent to the device corresponding to the monitoring data. In other words, the monitoring platform can be flexibly connected as needed, that is, when a new monitored device needs to be added, the data collector only needs to be sent to the target device normally, and the application page on the monitoring platform can timely display the monitoring data of the device for real-time monitoring.
[0036] In summary, this embodiment uses a time series database to store monitoring data, so that massive time series big data can be efficiently stored and quickly processed. It is an important technology for solving massive data processing and greatly improves the processing ability of time-related data. Compared with relational databases, its storage space is halved, the query speed is greatly improved, and the query performance is far higher than that of relational databases.
[0037] Furthermore, in order to prevent inferior queries, in this embodiment, there are multiple time series databases. In step S103, the step of unifying the query entry of the time series database includes:
[0038] Step S1031: Set corresponding query entries of the time series database for different types of devices. That is, each query entry of the time series database corresponds to a device, and not all devices can be queried from the query entry of the time series database.
[0039] Step S1032: Setting the opening and closing conditions of the query entry of each time series database. That is, not all devices can be queried from the query entry of the time series database, only the corresponding devices can be queried from the query entry of the time series database.
[0040] Furthermore, the method for processing monitoring data based on the time series database also includes:
[0041] Step B1: When a query statement is input through a query entry, if it is determined that the device corresponding to the query statement does not correspond to the query entry, the query entry is closed so that the query statement cannot enter the time series database for query, and a prompt message is popped up, and a query entry corresponding to the device corresponding to the query statement is popped up.
[0042] Step B2: If it is determined that the device corresponding to the query statement corresponds to the query entry, the query statement is input into the time series database through the query entry for query.
[0043] It should be understood that step B1 and step B2 are specific operations for setting the opening and closing conditions of the query entry of each time series database.
[0044] In this embodiment, in step S103, the step of uniformly limiting the amount of information queried in the time series database and the frequency of queries includes:
[0045] Step S1033: Setting a threshold for the amount of information that different types of devices query in the time series database. In other words, the amount of information queried is also limited, which can effectively prevent inferior queries.
[0046] Step S1034: Setting the number of times and query time periods for different types of devices to query the time series database. In other words, there are also requirements for the number of queries and time periods, which can effectively prevent inferior queries.
[0047] Furthermore, the method for processing monitoring data based on the time series database also includes:
[0048] Step B3: When it is determined that the amount of information queried by a certain device in the time series database exceeds a threshold within a preset time period, an alarm is generated and sent to the staff who are on duty, and the query entry of the current time series database is closed.
[0049] Step B4: When it is determined that the number of queries of a certain device in the time series database during the query time period exceeds the number threshold, an alarm is generated and sent to the staff who are on duty, and the query entry of the current time series database is closed.
[0050] Step B5: When it is determined that a certain device does not query the time series database within the query time period, an alarm is generated and sent to the staff who are on duty, and the query entry of the current time series database is closed.
[0051] In summary, the method for processing monitoring data based on a time series database disclosed in the present invention includes: using a data collector to collect the required monitoring data; storing the collected monitoring data in a time series database in the form of a message queue, and recording the collection time point of each monitoring data item, and displaying the monitoring data on an interface; unifying the query entry of the time series database, and uniformly limiting the amount of information queried by the time series database and the frequency of queries; setting various forms of alarm rules, and generating an alarm and notifying the user when the alarm condition is met. In the above manner, the method for processing monitoring data based on a time series database disclosed in the present invention can efficiently store monitoring data, greatly improve the processing capacity of monitoring data, and also improve the query speed.
[0052] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for processing monitoring data based on a time series database, characterized in that: include: Use data collector to collect required monitoring data; The collected monitoring data is stored in the time series database in the form of a message queue, and the collection time point of each monitoring data is recorded, and the monitoring data is displayed on the interface; Unify the query entry of the time series database and uniformly limit the amount of information and frequency of queries in the time series database; Set various alarm rules and generate alarms and notify users when the alarm conditions are met; The method further includes: While recording the collection time point of each piece of monitoring data, obtain the unique identification code of the device corresponding to the monitoring data, and save the unique identification code of the device in the time series database; When it is determined that the device is queried through the unique identification code, all historical data of the device are queried and displayed through a matching program; The step of querying and displaying all the historical monitoring data of the device through a matching program when determining to query the device through the unique identification code includes: Obtain the configuration information to be queried, and uniformly query the historical monitoring data within the preset period from the time series database according to the unique identification code of the device associated with the configuration information, and uniformly output the monitoring data to the interface for display; The data collector pre-stores a pre-stored identification code of the device to be collected. Before collecting monitoring data, the data collector first parses the monitoring data to obtain a unique identification code of the device corresponding to the monitoring data, and collects the monitoring data when it is determined that the unique identification code is the same as the pre-stored identification code; The method further includes: Control the storage period of historical monitoring data of equipment in the time series database according to different types of equipment; Specifically, the storage period of the historical monitoring data of the device in the control time series database according to different types of devices includes: when the level of the device is determined to be a high-level device, the storage period of the historical monitoring data of the device in the control time series database is longer, and when the level of the device is determined to be a low-level device, the storage period of the historical monitoring data of the device in the control time series database is shorter; Alternatively, the retention period of historical monitoring data of devices in the control time series database may be controlled according to different types of devices: the more times a device is queried within a preset query time period, the longer the retention period of historical monitoring data of the device in the control time series database is; the fewer times a device is queried within the preset query time period, the shorter the retention period of historical monitoring data of the device in the control time series database is.
2. The processing method according to claim 1, characterized in that: The method further includes: The collected monitoring data is stored in a time series database cluster.
3. The processing method according to claim 1, characterized in that: The method also includes: when it is determined that new monitoring data needs to be added, sending the data collector to the device corresponding to the monitoring data.
4. The processing method according to claim 1, characterized in that: There are multiple time series databases, and the step of unifying the query entry of the time series databases includes: Setting corresponding query entries of the time series database for different types of devices; Set the opening and closing conditions of each query entry of the time series database.
5. The processing method according to claim 4, characterized in that: The method further includes: When a query statement is input through a query entry, if it is determined that the device corresponding to the query statement does not correspond to the query entry, the query entry is closed so that the query statement cannot enter the time series database for query, and a prompt message is popped up, and a query entry corresponding to the device corresponding to the query statement is popped up; If it is determined that the device corresponding to the query statement corresponds to the query entry, the query statement is input into the time series database through the query entry for query.
6. The processing method according to claim 5, characterized in that: The step of uniformly limiting the amount of information queried in the time series database and the frequency of queries includes: Set thresholds for the amount of information that different types of devices query in the time series database; Set the query times and query time periods for different types of devices in the time series database.
7. The processing method according to claim 6, characterized in that: The method further includes: When it is determined that the amount of information queried by a certain device in the time series database exceeds a threshold within a preset time period, an alarm is generated and sent to the staff who are on duty, and the query entry of the current time series database is closed; When it is determined that the number of queries of a certain device in the time series database exceeds the number threshold within the query time period, an alarm is generated and sent to the staff in the working state, and the query entrance of the current time series database is closed; When it is determined that a certain device does not query the time series database within the query time period, an alarm is generated and sent to the staff who are on duty, and the query entrance of the current time series database is closed.
