A method and device for data monitoring
By configuring and storing monitoring rules, the problem of poor data monitoring flexibility in the existing technology is solved, flexible configuration and batch processing are achieved, and data reading efficiency and system ease of use are improved.
Patent Information
- Application Number
- CN201811632497.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-12-29
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2038-12-29
AI Technical Summary
Existing data monitoring technology is difficult to flexibly adapt to different user needs and data accuracy requirements, and the modification of collection scripts is complex, reducing the usability and ease of use of the system.
By configuring and storing monitoring rules, including indicators, inter-indicator operation rules and thresholds, data is collected and converted into data objects in a specific format for calculation and alarm generation. It supports expression description and batch operations, reducing dependence on collection scripts.
It achieves flexible configuration and batch processing, improves data reading efficiency and system availability, reduces the requirements for technical level, and enhances the adaptability and ease of use of the system.
Smart Images

Figure CN111381768B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to computer software industry, and more particularly to a data monitoring technology. Background Art
[0002] System monitoring includes two processing service levels, bottom-level services and middle-level services. The bottom-level services are responsible for data collection and data integration.
[0003] Data collection is done by collecting indicators and writing collection scripts. Once the collection script is determined, the generated indicators are fixed. This fixed indicator value will have great limitations on different user needs and data accuracy. For example, data capacity indicators may have different accuracy requirements in different scenarios. For example, disk capacity may need to be in K, M or G in different scenarios, but after the collection script is determined, the unit of the data is also determined accordingly. On the other hand, the indicators of the inspection results change with the user's monitoring accuracy, dimension, angle, and needs, and certain additional calculations and processing are required to meet the changes in needs. Moreover, if the inspection indicators are on different hosts, there will be different quantities of output, such as disks, processes, files, etc. Each output item is equivalent to an independent indicator and cannot be processed as a set of data.
[0004] The above changes usually require modification of the collection script or modification of the threshold setting of data analysis and addition of data calculation processing. For the monitoring of the system's own indicators, calculation processing can only be added according to the specific content during processing, which has a great impact on the standardization of products and system processes. The indicators collected by the collection script need to be modified to add new indicators. This method has high requirements for the technical level of system maintenance personnel, which greatly reduces the availability and ease of use of the system.
[0005] Therefore, a data monitoring technology that can flexibly adapt to various data requirements is in urgent need of emergence. Summary of the invention
[0006] The present invention provides the following technical solution: a data monitoring method and device, including:
[0007] Configure and store monitoring rules according to requirements, wherein the monitoring rules include indicators, operation rules between indicators, and thresholds;
[0008] Collect data and convert the collected data into data objects in a specific format;
[0009] Acquire the indicators and values in the corresponding data object according to the monitoring rules;
[0010] Operate the indicators and values in the acquired data object according to the inter-indicator operation rules in the monitoring rules;
[0011] The result of the operation is determined according to the threshold value in the monitoring indicator.
[0012] Preferred:
[0013] Describing the monitoring rule with an expression;
[0014] In the monitoring rule, the indicators of the same type and the same operation are described in an array;
[0015] Batch operations are performed according to the indicator array in the monitoring rule.
[0016] Furthermore, the data collected is converted into a data object of a specific format as follows:
[0017] Convert the collected data into PB format data;
[0018] The PB format data is converted into a secondary key-value data object, wherein the indicator data object describes the indicator name, the attribute name and the attribute value of the indicator.
[0019] Preferred:
[0020] The threshold value is a specific value or a threshold value expression;
[0021] An alarm is generated for an indicator whose calculation result exceeds a threshold.
[0022] Preferred:
[0023] The operation rules between the indicators include arithmetic operation rules and logical operation rules;
[0024] The arithmetic operation rules include mathematical operation rules and macro definitions;
[0025] The logic operation rule is an expression.
[0026] Preferred:
[0027] Before the step of acquiring the corresponding indicators and values in the data object according to the monitoring rules, the method further comprises:
[0028] Parsing the monitoring rules, and extracting expressions in the monitoring rules according to the operating system;
[0029] The expression is macro-replaced according to the target of data monitoring.
[0030] The present invention also discloses a data monitoring device, the device comprising:
[0031] A monitoring rule configuration storage unit, used to configure and store monitoring rules according to requirements, wherein the monitoring rules include indicators, operation rules between indicators, and thresholds;
[0032] A data acquisition and conversion unit, used for acquiring data and converting the acquired data into a data object in a specific format;
[0033] A monitoring data parsing unit, used to obtain indicators and values in the corresponding data object according to the monitoring rules;
[0034] A monitoring data operation unit, used to operate the indicators and values in the acquired data object according to the inter-indicator operation rules in the monitoring rules;
[0035] The monitoring result output unit determines the result of the operation according to the threshold value in the monitoring indicator.
[0036] Preferred:
[0037] The monitoring rule configuration unit describes the monitoring rule in an expression;
[0038] In the monitoring rule, the indicators of the same type and the same operation are described in an array;
[0039] Batch operations are performed according to the indicator array in the monitoring rule.
[0040] Specifically, the data acquisition and conversion unit further comprises:
[0041] A data acquisition module, used for collecting data;
[0042] A PB format conversion module, used for converting the data collected by the data collection module into PB format data;
[0043] The data object conversion module is used to convert the PB format data converted by the PB format conversion module into a secondary key value data object, wherein the indicator data object describes the indicator name, the attribute name and the attribute value of the indicator.
[0044] Preferred:
[0045] The threshold in the monitoring rule configuration storage unit is a specific value or a threshold expression;
[0046] An alarm is generated for an indicator whose calculation result exceeds a threshold.
[0047] Preferred:
[0048] The operation rules between the indicators in the monitoring rule configuration storage unit include the operation rules between the indicators including arithmetic operation rules and logical operation rules;
[0049] The arithmetic operation rules include mathematical operation rules and macro definitions;
[0050] The logic operation rule is an expression.
[0051] Preferred:
[0052] The device also includes: a parsing engine for parsing the monitoring rules; extracting the monitoring rules according to the operating system to configure a storage unit to store expressions in the monitoring rules; and performing macro replacement processing on the expressions according to the target of data monitoring.
[0053] Through the above technical solutions, it can be known that the data monitoring technology disclosed in the embodiment of the present invention can be configured on demand for single indicators and multiple indicators by flexibly configuring monitoring rules, and the collected results can be used directly, adjusted for accuracy, or calculated without modifying the collection script. The data storage of the secondary key value makes the data reading more efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0055] Figure 1 A schematic diagram of a data monitoring method provided in an embodiment of the present application;
[0056] Figure 2 A flow chart of the method provided in Example 2 of the present application;
[0057] Figure 3 A flow chart of the method provided in Example 3 of the present application;
[0058] Figure 4 A schematic diagram of the structure of a data monitoring device provided in Embodiment 4 of the present application;
[0059] Figure 5 This is a diagram of the device structure provided in Example 5 of the present application. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] See also Figure 1 , a method for data monitoring is given as an embodiment of the present invention.
[0062] Step S01: configure and store monitoring rules according to requirements, wherein the monitoring rules include indicators, operation rules between indicators, and thresholds.
[0063] Step S02: Collect data and convert the collected data into a data object in a specific format.
[0064] Step S03: Obtain the indicators and values corresponding to the data object according to the monitoring rules.
[0065] Step S04: Calculate the indicators and values in the acquired data object according to the inter-indicator calculation rules in the monitoring rules.
[0066] Step S05: Determine the result of the operation according to the threshold value in the monitoring indicator.
[0067] In order to better illustrate the present invention, Example 2 is given. Figure 2 As shown, the process of performing data monitoring of the present invention is described in detail.
[0068] Step S201: configuring and storing monitoring rules according to requirements, wherein the monitoring rules include indicators, operation rules between indicators, and thresholds.
[0069] The monitoring rule is described by an expression.
[0070] Preferably, for similar data, batch processing can be performed in the form of an array to improve processing efficiency. That is, the indicators of the same type and the same operation are described in an array in the monitoring rules; and batch operations are performed according to the indicator array in the monitoring rules.
[0071] The operation rules between the indicators include arithmetic operation rules and logical operation rules.
[0072] The operation rules between indicators can use a variety of operation methods, arithmetic operation methods and logical operation methods, and the operators used can be "|", "&", "+", "-", "*", " / ", "%".
[0073] The arithmetic operation rules include mathematical operation rules and macro definitions. Mathematical operation rules are understood as simple addition, subtraction, multiplication, division, etc., and macro definitions are the process of macro replacement, that is, replacing a certain field with the corresponding part in batches.
[0074] The logic operation rules are expressions, including but not limited to logic operation rules such as "and", "or", and "not".
[0075] The threshold is a specific value or a threshold expression.
[0076] In the case of specific values, only the result comparison value needs to be used.
[0077] Set expressions according to requirements. Taking CPU and disk data as an example, the indicators to be obtained may be CPU load, hard disk usage, total hard disk space, hard disk used space, hard disk remaining space, total hard disk space, disk used space, etc. Then the monitoring rules defined may be:
[0078] CPU load: (monitoring rule configuration for a single indicator)
[0079] 100.00-cpu_idle
[0080] Hard disk usage:
[0081] disk_chk_$CHECK_ITEM_ID$_[1..disk_chk_$CHECK_ITEM_ID$_1{total_num}]{use*1.00
[0082] +$CR$$LF$};Windows:part_max_used
[0083] Total hard disk space:
[0084] disk_chk_$CHECK_ITEM_ID$_[1..disk_chk_$CHECK_ITEM_ID$_1{total_num}]{1k_blocks / 1024.00 / 1024.00+$CR$$LF$}
[0085] Hard disk space used:
[0086] disk_chk_$CHECK_ITEM_ID$_[1..disk_chk_$CHECK_ITEM_ID$_1{total_num}]{used / 102
[0087] 4.00 / 1024.00+$CR$$LF$}
[0088] Remaining hard disk space:
[0089] disk_chk_$CHECK_ITEM_ID$_[1..disk_chk_$CHECK_ITEM_ID$_1{total_num}]{available /
[0090] 1024.00 / 1024.00+$CR$$LF$}
[0091] Total disk space:
[0092] disk_chk_$CHECK_ITEM_ID$_1{all_total / 1024.00 / 1024.00}; Windows:disk_total
[0093] Disk space used:
[0094] disk_chk_$CHECK_ITEM_ID$_1{all_used / 1024.00 / 1024.00}; Windows:disk_total-disk_free
[0095] It can be seen that through different operation processes of the above expressions, different operation results can be obtained as needed to achieve the purpose of flexible configuration.
[0096] Among them, $CHECK_ITEM_ID$ is a macro replacement method. When using the rule, replace this part with the corresponding CHECK_ITEM_ID to use the monitoring rule for different projects. If $CHECK_ITEM_ID$=10012320010228, the above disk usage space monitoring rule will become:
[0097] disk_chk_10012320010228_1{all_used / 1024.00 / 1024.00}; Windows:disk_total-disk_free
[0098] Similarly, you can also configure monitoring rules based on different operating systems:
[0099] disk_chk_$CHECK_ITEM_ID$_1{all_total / 1024.00 / 1024.00};
[0100] Windows:disk_total
[0101] The above rules configure different expressions for the LINUX and Windows operating systems.
[0102] Since the processing methods for many disks are similar, the monitoring configuration array indicator values and operation monitoring rules for these disk data can be:
[0103] disk_chk_$CHECK_ITEM_ID$_[1..disk_chk_$CHECK_ITEM_ID$_1{total_num}]{used / 1024
[0104] .00 / 1024.00+$CR$$LF$}
[0105] Step S202: Collect data, and convert the collected data into PB format data.
[0106] Collecting data means obtaining the original data, which is usually done by collecting monitoring data from the target host through the underlying data collection module. Here, the collected CPU and disk data in XML format are taken as an example.
[0107]
[0108] The collected raw data includes individual indicators and detailed values of each indicator.
[0109] Step S203: Convert the PB format data into a secondary key-value data object, where the indicator data object describes the indicator name, the attribute name and the attribute value of the indicator.
[0110] By parsing the collected raw data, it is converted into data objects according to the secondary key value mode, and its storage structure is Map <String,Map<String,String> >
[0111] Among them, the indicator object data structure is Map<attribute name, attribute value>, and the indicator object collection data structure is Map<indicator name, indicator object>, so we get Map <String,Map<String,String> >.
[0112] After the original data is converted into an indicator object, its form also changes. Taking the CPU and disk data in the above text as an example, after it is converted into an indicator object:
[0113]
[0114]
[0115] It can be seen that the storage method of indicator objects is simpler and clearer, and only the name of each indicator and the corresponding value are retained, which greatly saves storage space and saves time for obtaining search data and calculations, further improving efficiency.
[0116] Step S204: Obtain the indicators and values corresponding to the data object according to the monitoring rules.
[0117] According to the indicators involved in the expression in the monitoring rule, obtain them from the converted indicator object.
[0118] Step S205: Calculate the indicators and values in the acquired data object according to the inter-indicator calculation rules in the monitoring rules.
[0119] Substitute the obtained indicator value into the expression of the monitoring rule, perform calculations according to the calculation rules recorded in the expression, and obtain the calculation results.
[0120] For the CPU load monitoring rule, you need to read the CPU_idle value in the data object, and calculate according to the arithmetic operation 100-CPU_idle monitoring rule to obtain the calculation result of 54.8. Then, for the CPU load monitoring rule, you can directly obtain the CPU load value without performing additional script operations.
[0121] Preferably, for the disk monitoring rules mentioned above, based on the similarity of disk resources, the indicators of each disk are the same, and the calculation method is the same, so the array rule is used for processing disk_chk_$CHECK_ITEM_ID$_[1..disk_chk_$CHECK_ITEM_ID$_1{total_num}]{used / 1024.00 / 1024.00+$CR$$LF$}
[0122] Output the processing results of array monitoring rules:
[0123]
[0124] Then through for(disk_chk_10012320010228_1:disk_chk_10012320010228_7)
[0125] used / 1024.00 / 1024.00
[0126] The output is as follows:
[0127]
[0128] The used data is collected by the df command in KB. After the expression is processed, the unit becomes GB. If you need to change the output unit to MB, just modify the expression used / 1024.00 / 1024.00→used / 1024.00.
[0129] This shows that the calculation results of each disk can be obtained through an array processing monitoring rule without the need for additional script development.
[0130] Step S206: Generate an alarm for the indicator whose calculation result exceeds the threshold.
[0131] Therefore, the present invention can flexibly configure expressions, truly realize on-demand configuration, and complete various data monitoring tasks. There is no need to carry out complex secondary development, and the configuration results are directly output, which saves costs, improves efficiency, and increases flexibility.
[0132] In order to explain the working principle of the analysis monitoring rule of the present invention in detail, the third embodiment of the present invention is given. Figure 3 shown.
[0133] Step S301: parsing the monitoring rules, and extracting expressions in the monitoring rules according to the operating system.
[0134] When parsing monitoring rules, preferably all monitoring rules are read according to the host, and expressions in the monitoring rules are parsed one by one.
[0135] Due to the differences in operating systems, the monitoring rules need to be extracted according to the type of operating system.
[0136] Step S302: performing macro replacement processing on the expression according to the target of data monitoring.
[0137] The present invention also discloses a data monitoring device, and provides a fourth embodiment of the present invention, such as Figure 4 As shown, it is used to illustrate the structural features of the device.
[0138] The device includes:
[0139] The monitoring rule configuration storage unit 1 is used to configure and store monitoring rules according to requirements, wherein the monitoring rules include indicators, operation rules between indicators, and thresholds.
[0140] The monitoring rule configuration unit describes the monitoring rule in an expression.
[0141] In the monitoring rule, indicators of the same type and the same operation are described in an array.
[0142] Batch operations are performed according to the indicator array in the monitoring rule.
[0143] The threshold in the monitoring rule configuration storage unit is a specific value or a threshold expression.
[0144] The operation rules between the indicators in the monitoring rule configuration storage unit include arithmetic operation rules and logical operation rules.
[0145] The arithmetic operation rules include mathematical operation rules and macro definitions.
[0146] The logic operation rule is an expression.
[0147] The data acquisition and conversion unit 2 is used to acquire data and convert the acquired data into a data object in a specific format.
[0148] The monitoring data parsing unit 3 is used to obtain the indicators and values in the corresponding data objects according to the monitoring rules.
[0149] The monitoring data operation unit 4 is used to operate the indicators and values in the acquired data object according to the inter-indicator operation rules in the monitoring rules.
[0150] The monitoring result output unit 5 determines the result of the operation according to the threshold value in the monitoring indicator.
[0151] In order to explain the various parts of this device in more detail, Example 5 of the present invention is given. Figure 5 As shown:
[0152] The monitoring rule configuration storage unit 1 is used to configure and store monitoring rules according to requirements, wherein the monitoring rules include indicators, operation rules between indicators, and thresholds.
[0153] The data acquisition and conversion unit 2 further comprises:
[0154] A data acquisition module 21, used for collecting data;
[0155] A PB format conversion module 22, used to convert the data collected by the data collection module into PB format data;
[0156] The data object conversion module 23 is used to convert the PB format data converted by the PB format conversion module into a secondary key value data object, wherein the indicator data object describes the indicator name, the attribute name and the attribute value of the indicator.
[0157] The monitoring data parsing unit 3 is used to obtain the indicators and values in the corresponding data objects according to the monitoring rules.
[0158] The monitoring data operation unit 4 is used to operate the indicators and values in the acquired data object according to the inter-indicator operation rules in the monitoring rules.
[0159] The monitoring result output unit 5 determines the result of the operation according to the threshold value in the monitoring indicator.
[0160] The parsing engine 6 is used to parse the monitoring rules; extract expressions in the monitoring rules according to the operating system; and perform macro replacement processing on the expressions according to the target of data monitoring.
[0161] The alarm generating unit 7 is used to generate an alarm for an indicator whose calculation result exceeds a threshold.
[0162] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the corresponding processes in the above-described device embodiments can refer to the specific working processes of the aforementioned methods, which will not be repeated here.
[0163] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0164] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0165] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims and the above drawings are used to distinguish similar parts, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated herein.
[0166] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data monitoring method, characterized in that: The method comprises: Configure and store monitoring rules according to requirements, wherein the monitoring rules include indicators, operation rules between indicators, and thresholds, wherein the monitoring rules are described by expressions, and indicators of the same type and the same operation are described by arrays in the monitoring rules; Collect data and convert the collected data into data objects in a specific format; Acquire the indicators and values in the corresponding data object according to the monitoring rules; Performing operations on the indicators and values in the acquired data object according to the inter-indicator operation rules in the monitoring rules, wherein batch operations are performed according to the indicator array in the monitoring rules; Determine the result of the operation according to the threshold value in the monitoring indicator; The operation rules between the indicators include arithmetic operation rules and logical operation rules; The arithmetic operation rules include mathematical operation rules and macro definitions; The logic operation rule is an expression.
2. The method according to claim 1, characterized in that: The method for converting the collected data into a data object of a specific format is specifically as follows: Convert the collected data into PB format data; The PB format data is converted into a secondary key-value data object, wherein the indicator data object describes the indicator name, the attribute name and the attribute value of the indicator.
3. The method according to claim 2, characterized in that: The threshold is a specific value or a threshold expression; an alarm is generated for an indicator whose operation result exceeds the threshold.
4. The method according to claim 1, characterized in that: Before the step of acquiring the corresponding indicators and values in the data object according to the monitoring rules, the method further comprises: Parsing the monitoring rules, and extracting expressions in the monitoring rules according to the operating system; The expression is macro-replaced according to the target of data monitoring.
5. A data monitoring device, characterized in that: The device comprises: A monitoring rule configuration storage unit, used to configure and store monitoring rules according to requirements, wherein the monitoring rules include indicators, operation rules between indicators, and thresholds, wherein the monitoring rule configuration unit describes the monitoring rules with expressions, and describes indicators of the same type and the same operation with arrays in the monitoring rules; A data acquisition and conversion unit, used for acquiring data and converting the acquired data into a data object in a specific format; A monitoring data parsing unit, used to obtain indicators and values in the corresponding data object according to the monitoring rules; A monitoring data operation unit, used to operate the indicators and values in the acquired data object according to the inter-indicator operation rules in the monitoring rules, wherein batch operation is performed according to the indicator array in the monitoring rules; A monitoring result output unit, which determines the result of the operation according to the threshold value in the monitoring indicator; The operation rules between the indicators in the monitoring rule configuration storage unit include the operation rules between the indicators including arithmetic operation rules and logical operation rules; The arithmetic operation rules include mathematical operation rules and macro definitions; The logic operation rule is an expression.
6. The device according to claim 5, characterized in that The data acquisition and conversion unit further comprises: A data acquisition module, used for collecting data; A PB format conversion module, used for converting the data collected by the data collection module into PB format data; The data object conversion module is used to convert the PB format data converted by the PB format conversion module into a secondary key value data object, wherein the indicator data object describes the indicator name, the attribute name and the attribute value of the indicator.
7. The device according to claim 6, characterized in that: The threshold in the monitoring rule configuration storage unit is a specific value or a threshold expression; The device also includes an alarm generating unit for generating an alarm when the calculation result exceeds a threshold value.
8. The device according to claim 5, characterized in that The device also comprises: The parsing engine is used to parse the monitoring rules; extract the monitoring rules according to the operating system to configure the storage unit to store the expressions in the monitoring rules; and perform macro replacement processing on the expressions according to the target of data monitoring.
