Data monitoring method and device, server and storage medium
By configuring data monitoring rule templates and automating server processing, the problem of time-consuming monitoring rule configuration was solved, enabling rapid acquisition of monitoring results and improving monitoring efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-22
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, the process of developers adding or modifying monitoring rules for metrics to be monitored is time-consuming and cannot obtain monitoring results quickly and in real time, resulting in low monitoring efficiency.
Data monitoring rules and attribute information are configured through a preset data monitoring rule template, generating data monitoring rules and attribute information, and adding them to the data monitoring rule library. The server determines the effective rules based on the rule library, executes query statements to obtain query values and standard values, calculates deviation information and compares it with the threshold to obtain monitoring results.
It enables the rapid and timely acquisition of monitoring results for the metrics to be monitored, improving monitoring efficiency and reducing the steps of manually writing scripts and conducting tests.
Smart Images

Figure CN115145792B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data query, and in particular to a data monitoring method, device, server, and storage medium. Background Technology
[0002] Currently, developers need to follow this process when adding or modifying monitoring rules for metrics: 1) Developers write scripts to obtain the actual and standard values of the metrics; 2) Testers assist in verifying the scripts; 3) Developers configure the scripts' scheduling tasks; 4) Version control personnel schedule new versions of the scripts; 5) After completing the above steps, the monitoring rules for the added or modified metrics are configured on the server. This entire process is time-consuming, cannot provide rapid, real-time monitoring results, and has low monitoring efficiency. Summary of the Invention
[0003] This application provides a data monitoring method, apparatus, server, and storage medium, aiming to improve the monitoring efficiency of the indicators to be monitored.
[0004] In a first aspect, embodiments of this application provide a data monitoring method, including:
[0005] Obtain data monitoring rules and attribute information of the data monitoring rules, wherein the data monitoring rules and attribute information are configured by the user based on a preset data monitoring rule template;
[0006] The data monitoring rules and the attribute information are added to the data monitoring rule library to update the data monitoring rule library;
[0007] Based on the attribute information of each data monitoring rule in the data monitoring rule base, the effective data monitoring rule is determined from the data monitoring rule base;
[0008] Execute the query statement in the effective data monitoring rule to obtain the query value and standard value of the indicator to be monitored in the effective data monitoring rule;
[0009] The deviation information between the query value and the standard value is calculated, and the deviation information is compared with the threshold information in the effective data monitoring rules to obtain the monitoring result of the indicator to be monitored.
[0010] Secondly, embodiments of this application also provide a data monitoring device, the data monitoring device comprising:
[0011] The acquisition module is used to acquire data monitoring rules and attribute information of the data monitoring rules, wherein the data monitoring rules and attribute information are configured by the user based on a preset data monitoring rule template;
[0012] The data update module is used to add the data monitoring rules and the attribute information to the data monitoring rule library to update the data monitoring rule library;
[0013] The determination module is used to determine the effective data monitoring rule from the data monitoring rule base based on the attribute information of each data monitoring rule in the data monitoring rule base;
[0014] The query statement execution module is used to execute the query statements in the effective data monitoring rules to obtain the query values and standard values of the indicators to be monitored in the effective data monitoring rules.
[0015] The calculation and comparison module is used to calculate the deviation information between the query value and the standard value, and compare the deviation information with the threshold information in the effective data monitoring rules to obtain the monitoring result of the indicator to be monitored.
[0016] Thirdly, embodiments of this application also provide a server, the server including a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the steps of the data monitoring method described above.
[0017] Fourthly, embodiments of this application also provide a storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of the data monitoring method described above.
[0018] This application provides a data monitoring method, apparatus, server, and storage medium. Users configure data monitoring rules and attribute information, including query statements for the indicators to be monitored, through data monitoring rule templates. Users do not need to write script code, nor do testers need to test the script code. The configured data monitoring rules and attribute information can be directly sent to the server, which adds them to a data monitoring rule library. Based on the attribute information of each data monitoring rule in the library, the server determines the effective data monitoring rule, executes the query statement within the effective rule, obtains the query value and standard value of the indicator to be monitored, calculates the deviation between the query value and the standard value, and compares the deviation with the threshold information in the effective rule to obtain the monitoring result of the indicator. This allows for quick and timely acquisition of the monitoring result, effectively improving the monitoring efficiency of the indicator. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of a scenario for implementing the data monitoring method provided in the embodiments of this application;
[0021] Figure 2 This is a flowchart illustrating a data monitoring method provided in an embodiment of this application;
[0022] Figure 3 This is a schematic block diagram of a data monitoring device provided in an embodiment of this application;
[0023] Figure 4 This is a schematic block diagram of the structure of a server provided in an embodiment of this application.
[0024] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and the accompanying drawings. Detailed Implementation
[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0027] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0028] Please see Figure 1 , Figure 1 This is a schematic diagram of a scenario implementing the data monitoring method provided in the embodiments of this application. For example... Figure 1As shown, this scenario includes a terminal device 100 and a server 200, which are communicatively connected. Users can configure or modify data monitoring rules and their attribute information through the terminal device 100. The terminal device 100 then sends the configured or modified data monitoring rules and their attribute information to the server 200. Based on the configured or modified data monitoring rules and their attribute information, the server 200 updates the data monitoring rule database.
[0029] In one embodiment, the terminal device 100 displays a rule configuration page, which includes a data monitoring rule template; it obtains information input by the user in the data monitoring rule module, and generates data monitoring rules and their attribute information based on the user's input and the data monitoring rule template; the terminal device 100 sends the generated data monitoring rules and their attribute information to the server 200. The data monitoring rules may include the metrics to be monitored, the corresponding data dictionary, query statements, and threshold information, etc., while the attribute information may include the effective time range, execution frequency, start time, and alarm handling personnel's email address, etc.
[0030] In one embodiment, after obtaining the data monitoring rules and attribute information of the data monitoring rules sent by the terminal device 100, the server 200 adds the data monitoring rules and attribute information to the data monitoring rule library to update the data monitoring rule library; based on the attribute information of each data monitoring rule in the data monitoring rule library, the server 200 determines the effective data monitoring rules from the data monitoring rule library; executes the query statement in the effective data monitoring rule to obtain the query value and standard value of the indicator to be monitored in the effective data monitoring rule; calculates the deviation information between the query value and the standard value, and compares the deviation information with the threshold information in the effective data monitoring rule to obtain the monitoring result of the indicator to be monitored.
[0031] The terminal device 100 may include mobile phones, tablets, laptops, desktop computers, etc. The server 200 may be a standalone server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0032] The following will combine Figure 1 The scenarios described herein provide a detailed introduction to the data monitoring method provided by the embodiments of this application. It should be noted that... Figure 1The scenarios described are only used to explain the data monitoring method provided in the embodiments of this application, but do not constitute a limitation on the application scenarios of the data monitoring method provided in the embodiments of this application.
[0033] Please see Figure 2 , Figure 2 This is a flowchart illustrating a data monitoring method provided in an embodiment of this application.
[0034] like Figure 2 As shown, the data monitoring method includes steps S101 to S105.
[0035] Step S101: Obtain the data monitoring rules and their attribute information.
[0036] The data monitoring rules and their attribute information are configured by the user based on a preset data monitoring rule template. The data monitoring rule template may include the following fields: the metric to be monitored, the data dictionary, the query statement, the threshold information, the effective time range, the execution frequency, the start time, and the email address of the alarm handler. The data monitoring rule may include the metric to be monitored, the corresponding data dictionary, the query statement, and the threshold information, etc. The attribute information may include the effective time range, execution frequency, start time, and the email address of the alarm handler, etc. The data dictionary includes the database name, the data table name, the field name, and the query statement.
[0037] For example, the terminal device displays a rule configuration page, which includes a data monitoring rule template; obtains information input by the user in the data monitoring rule module, and generates data monitoring rules and their attribute information based on the information input by the user in the data monitoring rule module and the data monitoring rule template; the terminal device sends the generated data monitoring rules and their attribute information to the server.
[0038] Step S102: Add the data monitoring rules and attribute information to the data monitoring rule base to update the data monitoring rule base.
[0039] For example, the data monitoring rules sent by the terminal device are as follows: the indicator to be monitored is field F, the query statement is selectmax(field F) from table C, the effective time range is from 00:00 on June 16, 2022 to 00:00 on June 17, 2022, the execution frequency is once every 6 hours, and the start time is 00:00 on June 16, 2022. The data monitoring rules in the data monitoring rule base before the update are shown in Table 1. After adding the data monitoring rules sent by the terminal device to the data monitoring rule base to update the data monitoring rule base, the data monitoring rules in the updated data monitoring rule base are shown in Table 2.
[0040] Table 1
[0041]
[0042]
[0043] Table 2
[0044]
[0045] Understandably, users can delete data monitoring rules in the data monitoring rule base through their terminal devices, and they can also modify data monitoring rules and / or the attribute information of data monitoring rules in the data monitoring rule base through their terminal devices.
[0046] Step S103: Based on the attribute information of each data monitoring rule in the data monitoring rule base, determine the effective data monitoring rule from the data monitoring rule base.
[0047] The attribute information of the data monitoring rule can include the effective time range, execution frequency, and start time of the data monitoring rule. The effective time range refers to the time period during which the data monitoring rule is valid, the execution frequency refers to the frequency at which the data monitoring rule is executed, and the start time refers to the moment when the data monitoring rule is first executed.
[0048] In one embodiment, multiple execution time points for the data monitoring rules are determined based on the effective time range, execution frequency, and startup time. Data monitoring rules whose execution time points match the current system time point are retrieved from the data monitoring rule base, and these retrieved data monitoring rules are determined as effective data monitoring rules. Here, the execution time point is the moment when the data monitoring rule is executed, and the server can periodically determine the effective data monitoring rules. For example, the server determines the effective data monitoring rules every two hours.
[0049] For example, as shown in Table 2, the data monitoring rules with rule numbers L_001, L_002, and L_003 have the same effective time range, execution frequency, and start time. Specifically, the effective time range, execution frequency, and start time are 00:00 on June 13, 2022 to 00:00 on June 14, 2022, executed every 4 hours, and 2:00 on June 13, 2022, respectively. Therefore, we can determine that the multiple execution times for data monitoring rules with rule numbers 001, 002, and 003 include 2:00 on June 13, 2022, 6:00 on June 13, 2022, 10:00 on June 13, 2022, 14:00 on June 13, 2022, 18:00 on June 13, 2022, 22:00 on June 13, 2022, and 22:00 on June 13, 2022. At the current system time point of 10:00 on June 13, 2022, the data monitoring rules with rule numbers L_001, L_002, and L_003 can be determined as effective data monitoring rules.
[0050] Step S104: Execute the query statement in the effective data monitoring rule to obtain the query value and standard value of the monitored indicator in the effective data monitoring rule.
[0051] For example, if the effective data monitoring rules are rule numbers L_001, L_002, and L_003, then the query statements `select count(field A) from table A`, `select sum(field B) from table A`, and `select max(field C) from table A` will be executed to obtain the query value and standard value of field A, the query value and standard value of field B, and the query value and standard value of field C. The query value of the monitored metric is the actual value of the monitored metric obtained from the data table when the query statements are executed.
[0052] In one embodiment, when there are multiple effective data monitoring rules, the data table containing the monitored metric in each effective data monitoring rule is determined. If the data tables containing the monitored metric are all the same in each effective data monitoring rule, the query statements in each effective data monitoring rule are reconstructed to obtain a first target query statement. The first target query statement is then executed to obtain the query value and standard value of the monitored metric in each effective data monitoring rule. By reconstructing the query statements for the same data table and then executing the reconstructed query statements, repeated queries on the same data table can be avoided, thereby reducing the number of concurrent tasks.
[0053] For example, when the effective data monitoring rules are rule numbers L_001, L_002, and L_003, as shown in Table 2, fields A, B, and C all reside in table A. Therefore, the query statements `select count(field A) from table A`, `select sum(field B) from table A`, and `select max(field C) from table A` are restructured. The restructured query statements are:
[0054] form A
[0055] Insert Owlwrite Table query value partition(list_no=`L_001') select count(fieldA)
[0056] Insert OwnerWrite Table query value partition(list_no=`L_002′) select sum(field B)
[0057] The SQL statement `insert Owlwrite table query value partition(list_no=`L_003′) select max(field C)` is executed, and then the refactored query statement is executed to obtain the query value and standard value of field A, the query value and standard value of field B, and the query value and standard value of field C.
[0058] In one embodiment, when the data tables in which the monitored metrics reside in each effective data monitoring rule are different, the query statements in each effective data monitoring rule are executed concurrently to obtain the query value and standard value of the monitored metric in each effective data monitoring rule. By executing the query statements in each effective data monitoring rule concurrently when the data tables in which the monitored metrics reside are different, the query value and standard value of each monitored metric can be obtained simultaneously, thus improving query efficiency.
[0059] For example, when the effective data monitoring rules are rule numbers L_004, L_005, and L_006, as shown in Table 2, the data table containing field D is table B, the data table containing field E is table C, and the data table containing field F is table D. Since the data tables containing fields D, E, and F are different, the query statements `select count(field D) from table B where filter condition AA`, `select sum(field E) from table C where filter condition BB`, and `select max(field F) from table D` are executed concurrently to obtain the query value and standard value of field D, the query value and standard value of field E, and the query value and standard value of field F.
[0060] In one embodiment, when the monitored metrics in some of the effective data monitoring rules are located in the same data table, and the monitored metrics in some of the data monitoring rules are located in different data tables, the effective data monitoring rules corresponding to the same data tables are divided into a first data monitoring rule group; the remaining data monitoring rules among the multiple effective data monitoring rules are divided into a second data monitoring rule group; the query statements in each data monitoring rule in the first data monitoring rule group are reconstructed to obtain a second target query statement; and the second target query statement and the query statements in each data monitoring rule in the second data monitoring rule group are executed concurrently.
[0061] For example, when the effective data monitoring rules are rule numbers L_001, L_002, L_003, L_004, L_005, and L_006, as shown in Table 2, since fields A, B, and C are all located in table A, and fields D, E, and F are located in different tables, the data monitoring rules with rule numbers L_001, L_002, and L_003 are divided into the first data monitoring rule group, and the remaining data monitoring rules with rule numbers L_004, L_005, and L_006 are divided into the second data monitoring rule group.
[0062] Step S105: Calculate the deviation information between the query value and the standard value, and compare the deviation information with the threshold information in the effective data monitoring rules to obtain the monitoring results of the indicator to be monitored.
[0063] The deviation information can include the deviation value, absolute deviation value, or percentage of the deviation value relative to the standard value between the query value of the monitored indicator and the standard value of the monitored indicator. The threshold information can include the deviation value threshold, the absolute deviation value threshold, or the percentage threshold. For example, if the query value of field A is N1 and the standard value of field A is N2, then the deviation information between the query value of field A and the standard value of field A can include the deviation value N1-N2, the absolute deviation value |N1-N2|, or the percentage of the deviation value relative to the standard value (N1-N2) / N2.
[0064] For example, when the deviation information is less than or equal to the threshold information, the monitoring result is determined to be normal; when the deviation information is greater than the threshold information, the monitoring result is determined to be abnormal.
[0065] In one embodiment, when the monitoring result is abnormal, an abnormal alarm message for the monitored metric is generated, and this alarm message is sent to the email address of the alarm handler listed in the attribute information. The alarm handler's email address is the email address of the person handling the abnormality. The abnormal alarm message may include the rule number, the monitored metric, the data table corresponding to the monitored metric, the query value of the monitored metric, the standard value of the monitored metric, the threshold information of the monitored metric, and the alarm handler, etc. By sending the abnormal alarm message to the alarm handler's email address, the alarm handler is promptly informed of the abnormal monitoring result.
[0066] The data monitoring method provided in the above embodiments determines the effective data monitoring rules from the data monitoring rule base based on the attribute information of each data monitoring rule in the data monitoring rule base, and then executes the query statement in the effective data monitoring rule to obtain the query value and standard value of the indicator to be monitored in the effective data monitoring rule. It calculates the deviation information between the query value and the standard value and compares the deviation information with the threshold information in the effective data monitoring rule to obtain the monitoring result of the indicator to be monitored. This allows for the rapid and timely acquisition of the monitoring result of the indicator to be monitored, effectively improving the monitoring efficiency of the indicator to be monitored.
[0067] Please see Figure 3 , Figure 3 This is a schematic block diagram of a data monitoring device provided in an embodiment of this application.
[0068] like Figure 3 As shown, the data monitoring device 300 includes:
[0069] The acquisition module 310 is used to acquire data monitoring rules and attribute information of the data monitoring rules, wherein the data monitoring rules and attribute information are configured by the user based on a preset data monitoring rule template;
[0070] The data update module 320 is used to add the data monitoring rules and the attribute information to the data monitoring rule library to update the data monitoring rule library;
[0071] The determining module 330 is used to determine the effective data monitoring rule from the data monitoring rule base based on the attribute information of each data monitoring rule in the data monitoring rule base;
[0072] The query statement execution module 340 is used to execute the query statement in the effective data monitoring rule to obtain the query value and standard value of the indicator to be monitored in the effective data monitoring rule;
[0073] The calculation and comparison module 350 is used to calculate the deviation information between the query value and the standard value, and compare the deviation information with the threshold information in the effective data monitoring rules to obtain the monitoring result of the indicator to be monitored.
[0074] In one embodiment, the attribute information includes the effective time range, execution frequency, and start time of the data monitoring rules, and the determining module 330 is further configured to:
[0075] Based on the effective time range, execution frequency, and start time, multiple execution time points of the data monitoring rule are determined;
[0076] The data monitoring rules corresponding to the execution time point that is the same as the current system time point are obtained from the data monitoring rule base, and the obtained data monitoring rules are determined as effective data monitoring rules.
[0077] In one embodiment, the query statement execution module 340 is further configured to:
[0078] When there are multiple effective data monitoring rules, determine the data table where the monitored metric is located in each effective data monitoring rule;
[0079] When the data table containing the monitored metrics is the same in each effective data monitoring rule, the query statement in each effective data monitoring rule is reconstructed to obtain the first target query statement.
[0080] Execute the first target query statement to obtain the query value and standard value of the monitored metric in each effective data monitoring rule.
[0081] In one embodiment, the query statement execution module 340 is further configured to:
[0082] When the data tables containing the monitored metrics in each effective data monitoring rule are different, the query statements in each effective data monitoring rule are executed concurrently to obtain the query value and standard value of the monitored metrics in each effective data monitoring rule.
[0083] In one embodiment, the query statement execution module 340 is further configured to:
[0084] When some of the data tables are the same and some of the data tables are different, the effective data monitoring rules corresponding to the data tables that are the same are divided into the first data monitoring rule group.
[0085] The remaining data monitoring rules among the multiple active data monitoring rules are divided into a second data monitoring rule group;
[0086] The query statements within each data monitoring rule in the first data monitoring rule group are reconstructed to obtain the second target query statement;
[0087] The second target query statement and the query statements within each data monitoring rule in the second data monitoring rule group are executed concurrently.
[0088] In one embodiment, the calculation comparison module 350 is further configured to:
[0089] When the deviation information is less than or equal to the threshold information, the monitoring result is determined to be normal;
[0090] When the deviation information is greater than the threshold information, the monitoring result is determined to be abnormal.
[0091] In one embodiment, the data monitoring device 300 further includes:
[0092] The alarm module is used to generate an abnormal alarm message for the monitored indicator when the monitoring result is abnormal, and to send the abnormal alarm message to the email address of the alarm handling personnel in the attribute information.
[0093] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the above-described device and its modules and units can be referred to the corresponding processes in the aforementioned data monitoring method embodiments, and will not be repeated here.
[0094] The apparatus provided in the above embodiments can be implemented as a computer program, which can be used in, for example... Figure 4 It is running on the server shown.
[0095] Please see Figure 4 , Figure 4 This is a schematic block diagram of the structure of a server provided in an embodiment of this application.
[0096] like Figure 4 As shown, the server includes a processor, memory, and network interface connected via a system bus, wherein the memory may include storage media and internal memory.
[0097] The storage medium may store the operating system and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any data monitoring method.
[0098] The processor provides computing and control capabilities to support the operation of the entire server.
[0099] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that... Figure 4The structure shown is merely a block diagram of a portion of the structure related to the solution of this application and does not constitute a limitation on the server to which the solution of this application is applied. A specific server may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0100] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0101] In one embodiment, the processor is used to run a computer program stored in memory to perform the following steps:
[0102] Obtain data monitoring rules and attribute information of the data monitoring rules, wherein the data monitoring rules and attribute information are configured by the user based on a preset data monitoring rule template;
[0103] The data monitoring rules and the attribute information are added to the data monitoring rule library to update the data monitoring rule library;
[0104] Based on the attribute information of each data monitoring rule in the data monitoring rule base, the effective data monitoring rule is determined from the data monitoring rule base;
[0105] Execute the query statement in the effective data monitoring rule to obtain the query value and standard value of the indicator to be monitored in the effective data monitoring rule;
[0106] The deviation information between the query value and the standard value is calculated, and the deviation information is compared with the threshold information in the effective data monitoring rules to obtain the monitoring result of the indicator to be monitored.
[0107] In one embodiment, the attribute information includes the effective time range, execution frequency, and start time of the data monitoring rule. When the processor determines the effective data monitoring rule from the data monitoring rule base based on the attribute information of each data monitoring rule in the data monitoring rule base, it is configured to:
[0108] Based on the effective time range, execution frequency, and start time, multiple execution time points of the data monitoring rule are determined;
[0109] The data monitoring rules corresponding to the execution time point that is the same as the current system time point are obtained from the data monitoring rule base, and the obtained data monitoring rules are determined as effective data monitoring rules.
[0110] In one embodiment, when the processor executes the query statement in the effective data monitoring rule, it is configured to:
[0111] When there are multiple effective data monitoring rules, determine the data table where the monitored metric is located in each effective data monitoring rule;
[0112] When the data table containing the monitored metrics is the same in each effective data monitoring rule, the query statement in each effective data monitoring rule is reconstructed to obtain the first target query statement.
[0113] Execute the first target query statement to obtain the query value and standard value of the monitored metric in each effective data monitoring rule.
[0114] In one embodiment, after determining the data table containing the monitored metric in each effective data monitoring rule, the processor is further configured to:
[0115] When the data tables containing the monitored metrics in each effective data monitoring rule are different, the query statements in each effective data monitoring rule are executed concurrently to obtain the query value and standard value of the monitored metrics in each effective data monitoring rule.
[0116] In one embodiment, after determining the data table containing the monitored metric in each effective data monitoring rule, the processor is further configured to:
[0117] When some of the data tables are the same and some of the data tables are different, the effective data monitoring rules corresponding to the data tables that are the same are divided into the first data monitoring rule group.
[0118] The remaining data monitoring rules among the multiple active data monitoring rules are divided into a second data monitoring rule group;
[0119] The query statements within each data monitoring rule in the first data monitoring rule group are reconstructed to obtain the second target query statement;
[0120] The second target query statement and the query statements within each data monitoring rule in the second data monitoring rule group are executed concurrently.
[0121] In one embodiment, when the processor compares the deviation information with the threshold information in the effective data monitoring rules to obtain the monitoring result of the indicator to be monitored, it is configured to:
[0122] When the deviation information is less than or equal to the threshold information, the monitoring result is determined to be normal;
[0123] When the deviation information is greater than the threshold information, the monitoring result is determined to be abnormal.
[0124] In one embodiment, after comparing the deviation information with the threshold information in the effective data monitoring rules to obtain the monitoring result of the indicator to be monitored, the processor is further configured to:
[0125] When the monitoring result is abnormal, an abnormal alarm message is generated for the monitored indicator, and the abnormal alarm message is sent to the email address of the alarm handling personnel in the attribute information.
[0126] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the server described above can be referred to the corresponding process in the aforementioned data monitoring method embodiments, and will not be repeated here.
[0127] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a server (which may be a personal computer, a server, or a network server, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0128] This application also provides a storage medium storing a computer program, the computer program including program instructions, and the method implemented when the program instructions are executed can be found in various embodiments of the data monitoring method of this application.
[0129] The storage medium can be volatile or non-volatile. It can be an internal storage unit of the server as described in the foregoing embodiments, such as the server's hard drive or memory. Alternatively, it can be an external storage server, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card.
[0130] Furthermore, the storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store the operating system, applications required for at least one function, etc.; and the data storage area may store data created based on the use of blockchain nodes, etc.
[0131] The blockchain referred to in this application is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.
[0132] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0133] It should also be understood that the term "and / or" as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. It should be noted that, herein, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0134] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. The above descriptions are merely specific implementations of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data monitoring method, characterized in that, include: Obtain data monitoring rules and attribute information of the data monitoring rules, wherein the data monitoring rules and attribute information are configured by the user based on a preset data monitoring rule template; The data monitoring rules and the attribute information are added to the data monitoring rule library to update the data monitoring rule library; Based on the attribute information of each data monitoring rule in the data monitoring rule base, the effective data monitoring rule is determined from the data monitoring rule base; Execute the query statement in the effective data monitoring rule to obtain the query value and standard value of the indicator to be monitored in the effective data monitoring rule; Calculate the deviation information between the query value and the standard value, and compare the deviation information with the threshold information in the effective data monitoring rules to obtain the monitoring result of the indicator to be monitored; The execution of the query statement in the effective data monitoring rule includes: When there are multiple effective data monitoring rules, determine the data table where the monitored metric is located in each effective data monitoring rule; When the data table containing the monitored metrics is the same in each effective data monitoring rule, the query statement in each effective data monitoring rule is reconstructed to obtain the first target query statement. Execute the first target query statement to obtain the query value and standard value of the monitored metric in each of the effective data monitoring rules; When the data tables containing the monitored metrics in each effective data monitoring rule are different, the query statements in each effective data monitoring rule are executed concurrently to obtain the query value and standard value of the monitored metrics in each effective data monitoring rule. When some of the data tables are the same and some of the data tables are different, the effective data monitoring rules corresponding to the data tables that are the same are divided into the first data monitoring rule group. The remaining data monitoring rules among the multiple active data monitoring rules are divided into a second data monitoring rule group; The query statements within each data monitoring rule in the first data monitoring rule group are reconstructed to obtain the second target query statement; Concurrently execute the second target query statement and the query statements within each data monitoring rule in the second data monitoring rule group to obtain the query value and standard value of the monitored metric in each effective data monitoring rule.
2. The data monitoring method according to claim 1, characterized in that, The attribute information includes the effective time range, execution frequency, and start time of the data monitoring rules. The step of determining the effective data monitoring rules from the data monitoring rule base based on the attribute information of each data monitoring rule in the data monitoring rule base includes: Based on the effective time range, execution frequency, and start time, multiple execution time points of the data monitoring rule are determined; The data monitoring rules corresponding to the execution time point that is the same as the current system time point are obtained from the data monitoring rule base, and the obtained data monitoring rules are determined as effective data monitoring rules.
3. The data monitoring method according to claim 1 or 2, characterized in that, The step of comparing the deviation information with the threshold information in the effective data monitoring rules to obtain the monitoring result of the indicator to be monitored includes: When the deviation information is less than or equal to the threshold information, the monitoring result is determined to be normal; When the deviation information is greater than the threshold information, the monitoring result is determined to be abnormal.
4. The data monitoring method according to claim 3, characterized in that, After comparing the deviation information with the threshold information in the effective data monitoring rules to obtain the monitoring result of the indicator to be monitored, the method further includes: When the monitoring result is abnormal, an abnormal alarm message is generated for the monitored indicator, and the abnormal alarm message is sent to the email address of the alarm handling personnel in the attribute information.
5. A data monitoring device, characterized in that, The data monitoring device includes: The acquisition module is used to acquire data monitoring rules and attribute information of the data monitoring rules, wherein the data monitoring rules and attribute information are configured by the user based on a preset data monitoring rule template; The data update module is used to add the data monitoring rules and the attribute information to the data monitoring rule library to update the data monitoring rule library; The determination module is used to determine the effective data monitoring rule from the data monitoring rule base based on the attribute information of each data monitoring rule in the data monitoring rule base; The query statement execution module is used to execute the query statements in the effective data monitoring rules to obtain the query values and standard values of the indicators to be monitored in the effective data monitoring rules. The calculation and comparison module is used to calculate the deviation information between the query value and the standard value, and compare the deviation information with the threshold information in the effective data monitoring rules to obtain the monitoring result of the indicator to be monitored; The query statement execution module is further configured to: determine the data table containing the monitored metric in each effective data monitoring rule when there are multiple effective data monitoring rules; reconstruct the query statement in each effective data monitoring rule to obtain a first target query statement when the data tables containing the monitored metric in each effective data monitoring rule are the same; execute the first target query statement to obtain the query value and standard value of the monitored metric in each effective data monitoring rule; and concurrently execute the query statements in each effective data monitoring rule to obtain the value of each effective data monitoring metric when the data tables containing the monitored metric in each effective data monitoring rule are different. The monitoring rules specify the query value and standard value of the monitored metric. When some data tables are identical and others are different, the effective data monitoring rules corresponding to the identical data tables are divided into a first data monitoring rule group. The remaining data monitoring rules among the multiple effective data monitoring rules are divided into a second data monitoring rule group. The query statement within each data monitoring rule in the first data monitoring rule group is reconstructed to obtain a second target query statement. The second target query statement and the query statements within each data monitoring rule in the second data monitoring rule group are executed concurrently to obtain the query value and standard value of the monitored metric in each effective data monitoring rule.
6. A server, characterized in that, The server includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, it implements the steps of the data monitoring method as described in any one of claims 1 to 4.
7. A storage medium for computer-readable storage, characterized in that, The storage medium stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the data monitoring method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Risk target identification method and equipment
CN111178704A
Data monitoring method and device
CN113297039A