Abnormal warning method and device, system, electronic device, and storage medium

By obtaining monitoring configuration information and creating scheduler objects in the database, data is collected directly from the database, which solves the problem of inability to monitor in real time and provide timely warning in the existing technology, improves operating efficiency and saves hardware resources.

CN110851316BActive Publication Date: 2024-09-20BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201810949805.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-08-20
Publication Date
2024-09-20
Estimated Expiration
2038-08-20

AI Technical Summary

Technical Problem

The existing technology cannot monitor database data in real time, resulting in the inability to provide timely warnings, and requires a large amount of hardware resources, which reduces operating efficiency and increases costs.

Method used

By obtaining the monitoring configuration information of the database, a scheduler object is created to regularly collect indicator data, and based on the indicator threshold information, it is judged whether to trigger an abnormality warning, and the data is directly queried from the database to avoid data duplication.

Benefits of technology

Real-time monitoring of database data is achieved, timely warning is achieved, hardware resources and operation time are saved, and costs are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110851316B
    Figure CN110851316B
Patent Text Reader

Abstract

The present disclosure is about an abnormal warning method and device, system, electronic device, and storage medium, and relates to the field of big data technology. The method includes: obtaining monitoring configuration information provided for data in a database, wherein the monitoring configuration information includes monitoring frequency and index threshold information; creating a scheduler object according to the monitoring frequency, and detecting whether the scheduler object reaches a trigger time; when the scheduler object reaches the trigger time, collecting data in the database to obtain index data of a monitoring point; judging whether the index data of the monitoring point meets the index threshold information, and performing abnormal warning when the index data of the monitoring point meets the index threshold information. The present disclosure can monitor the data in the database in real time, thereby achieving real-time warning.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In the Internet e-commerce system, the operation of the system is affected by factors such as the network, human factors and external dependent systems, and some unpredictable abnormal situations may occur. In order to quickly discover the abnormal situation of the system, it is necessary to regularly analyze the business data to determine whether abnormal warning is needed.

[0003] In related technologies, the big data platform will query the data in each business database at regular intervals every day, and copy a copy to its own platform for storage. The big data platform will perform data analysis by running the tasks set by the user, and determine whether to issue an early warning notification based on the analysis results. In this way, since business data can only be copied at regular intervals and the database cannot be monitored in real time, timely early warnings cannot be issued; the big data platform needs to store the data of each business system, so a large amount of hardware resources are required, which is costly; in addition, the big data platform needs to copy the data of each business database, which reduces operational efficiency.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the present disclosure is to provide an abnormal warning method, device and system, electronic equipment, and storage medium, thereby overcoming the problems of being unable to monitor data in a database in real time and unable to issue timely warnings due to limitations and defects of related technologies, at least to a certain extent.

[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0007] According to one aspect of the present disclosure, there is provided an abnormality warning method, comprising: obtaining monitoring configuration information provided for data in a database, the monitoring configuration information comprising monitoring frequency and indicator threshold information; creating a scheduler object according to the monitoring frequency, and detecting whether the scheduler object has reached a trigger time; when the scheduler object reaches the trigger time, collecting data in the database to obtain indicator data of a monitoring point; determining whether the indicator data of the monitoring point meets the indicator threshold information, and issuing an abnormality warning when the indicator data of the monitoring point meets the indicator threshold information.

[0008] In an exemplary embodiment of the present disclosure, creating a scheduler object according to the monitoring frequency includes: loading the monitoring data of the monitoring point in an enabled state based on the monitoring frequency; dynamically creating the scheduler object according to the monitoring data, and saving the scheduler object to a scheduler container.

[0009] In an exemplary embodiment of the present disclosure, dynamically creating the scheduler object based on the monitoring data includes: periodically querying the database for monitoring data that is in an enabled state at the monitoring point, and comparing the monitoring data with the first reference data in the scheduler container; if there is new configuration data in the monitoring data other than the first reference data, dynamically creating a scheduler object corresponding to the new configuration data and saving it to the scheduler container; if it is determined that the first reference data does not exist in the monitoring data that is in an enabled state at the monitoring point, closing the scheduler object in the scheduler container.

[0010] In an exemplary embodiment of the present disclosure, the monitoring configuration information includes database address information and query statements, and collecting data in the database to obtain indicator data of the monitoring point includes: creating a database link object through the database address information, and storing the database link object in a collector container; and executing the query statement through the database link object to collect data in the database to obtain the indicator data of the monitoring point.

[0011] In an exemplary embodiment of the present disclosure, creating a database link object through the database address information includes: periodically querying the database address information of the database in an enabled state, and comparing the database address information of the database in an enabled state with the second reference data in the collector container; if it is detected that there is new configuration data other than the second reference data in the database address information of the database in an enabled state, dynamically creating a database link object corresponding to the new configuration data and saving it to the collector container; if it is detected that the second reference data does not exist in the database address information of the database in an enabled state, closing the database link object in the collector container.

[0012] In an exemplary embodiment of the present disclosure, executing the query statement through the database link object to collect data from the database to obtain the indicator data of the monitoring point includes: determining the database information identifier and the monitoring point identifier according to the primary key identifier in the database address information, and determining the target database link object from the collector container according to the database information identifier; executing the query statement through the target database link object to collect data from the database from the monitoring point represented by the monitoring point identifier to obtain the indicator data corresponding to the monitoring point.

[0013] In an exemplary embodiment of the present disclosure, the indicator threshold information includes an indicator threshold and a logical symbol, and determining whether the indicator data of the monitoring point meets the indicator threshold information, and issuing an abnormal warning when the indicator data of the monitoring point meets the indicator threshold information includes: comparing the indicator data with the indicator threshold and the logical symbol in the indicator threshold information; if the indicator data matches the indicator threshold and the logical symbol, issuing an abnormal warning.

[0014] According to one aspect of the present disclosure, there is provided an abnormality warning device, comprising: a configuration information acquisition module, used to obtain monitoring configuration information provided for data in a database, the monitoring configuration information including monitoring frequency and index threshold information; an object creation module, used to create a scheduler object according to the monitoring frequency, and detect whether the scheduler object has reached a trigger time; a data collection module, used to collect data in the database to obtain index data of a monitoring point when the scheduler object reaches the trigger time; and a warning execution module, used to determine whether the index data of the monitoring point meets the index threshold information, and to issue an abnormality warning when the index data of the monitoring point meets the index threshold information.

[0015] According to one aspect of the present disclosure, there is provided an abnormality warning system, including: a controller, used to store monitoring configuration information provided for data in a database, the monitoring configuration information including monitoring frequency, indicator threshold information, database address information and query statements; a scheduler container, used to create a scheduler object according to the monitoring frequency; a collector container, used to create a database link object after creating the scheduler object, and use the database link object to execute query statements to obtain indicator data of monitoring points to determine whether to issue an abnormality warning.

[0016] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned abnormal warning methods by executing the executable instructions.

[0017] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the abnormality warning method described in any one of the above is implemented.

[0018] In an abnormal warning method, device, system, electronic device and computer-readable storage medium provided in the exemplary embodiments of the present disclosure, on the one hand, real-time monitoring of data in the database can be achieved through the monitoring frequency configured by the data in the database, and abnormal warning can be made in time; on the other hand, when the scheduler object reaches the trigger time, data is automatically collected in real time to obtain the indicator data of the monitoring point, and the database can be directly queried without copying a copy to the big data platform, which saves operation time and improves operation efficiency; on the other hand, since the indicator data of the monitoring point can be directly obtained without copying the data in the database, a large amount of hardware resources is saved and costs are reduced.

[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0021] Figure 1 The following schematically shows a flow chart of an abnormality warning method in an exemplary embodiment of the present disclosure.

[0022] Figure 2 A system architecture diagram for implementing an abnormality warning method in an exemplary embodiment of the present disclosure is schematically shown.

[0023] Figure 3 The flowchart of creating a scheduler object in an exemplary embodiment of the present disclosure is schematically shown.

[0024] Figure 4 A specific flow chart of creating a scheduler object in an exemplary embodiment of the present disclosure is schematically shown.

[0025] Figure 5 The flowchart of creating a database link object in an exemplary embodiment of the present disclosure is schematically shown.

[0026] Figure 6 A specific flow chart of creating a database link object in an exemplary embodiment of the present disclosure is schematically shown.

[0027] Figure 7 The flowchart of performing early warning in an exemplary embodiment of the present disclosure is schematically shown.

[0028] Figure 8 A block diagram schematically shows an abnormality warning device in an exemplary embodiment of the present disclosure.

[0029] Fig. 9 A block diagram of an abnormality warning system in an exemplary embodiment of the present disclosure is schematically shown.

[0030] Fig.10 A block diagram schematically shows an electronic device in an exemplary embodiment of the present disclosure.

[0031] Fig.11 A program product in an exemplary embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0033] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0034] In this example implementation, an abnormality warning method is first provided, which can be applied to real-time monitoring of data in a database, thereby monitoring in real time whether the system is abnormal. The abnormality warning method may include the following steps:

[0035] In step S110, monitoring configuration information provided for the data in the database is obtained, wherein the monitoring configuration information includes monitoring frequency and indicator threshold information;

[0036] In step S120, a scheduler object is created according to the monitoring frequency, and a trigger time is detected for the scheduler object;

[0037] In step S130, when the scheduler object reaches the trigger time, the data in the database is collected to obtain the indicator data of the monitoring point;

[0038] In step S140, it is determined whether the indicator data of the monitoring point meets the indicator threshold information, and an abnormal warning is issued when the indicator data of the monitoring point meets the indicator threshold information.

[0039] In the abnormal warning method provided by this exemplary embodiment, on the one hand, by configuring the monitoring frequency of the data in the database, real-time monitoring of the data in the database can be achieved, and then abnormal warning can be made in time; on the other hand, the indicator data of the monitoring point is obtained when the scheduler object reaches the trigger time, so that the database can be directly queried without copying a copy to the big data platform, saving operation time and improving operation efficiency; on the other hand, the indicator data of the monitoring point is obtained when the scheduler object reaches the trigger time without copying the data in the database, saving a lot of hardware resources and reducing costs.

[0040] Next, the abnormality early warning method in this exemplary embodiment is described in detail.

[0041] In step S110, monitoring configuration information provided for the data in the database is obtained, where the monitoring configuration information includes monitoring frequency and indicator threshold information.

[0042] In this exemplary embodiment, the database may be a business database or other databases. If it is a business database, it is mainly used to serve business operations, which may include multiple data tables, and the data tables may include all data related to business 1, business 2, and business 3. Developers can configure corresponding monitoring configuration information for the data in the business database, and monitor the data in the database based on the monitoring configuration information to determine whether the data has changed, thereby determining whether the system is abnormal. The monitoring configuration information may include but is not limited to monitoring frequency, database address information, indicator threshold information, and query statements. Among them, the monitoring frequency refers to the frequency used to monitor the data in the database, and real-time monitoring can be achieved through the monitoring frequency; the database address information is used to indicate which data in the database is monitored; the indicator threshold information is used to determine whether to issue an early warning; the query statement can be understood as a monitoring statement, which is used to collect and monitor the data contained in the data table in the database. The query statement can be, for example, SQL (Structured Query Language).

[0043] Specifically, the configured database address information may be represented by Table 1, the configured monitoring frequency may be represented by Table 2, and the configured indicator threshold information may be represented by Table 3.

[0044] As can be seen from Table 1, the primary key identifier, i.e., the primary key ID, is represented by the field db_info_id. The field status represents the database's enabled or disabled state. When the value of the field status is 1, it indicates an enabled state, and when the value of the field status is 2, it indicates a disabled state.

[0045] Fields name Data Types Remark db_info_id Primary Key ID Long db_type Database Type Int 1. MySQL 2. Oracle db_address Database address Varchar db_name Database Name Varchar db_port Database Port Int User_name username Varchar password password Varchar status Enable Disabled State Int 1 Enable, 2 Disable

[0046] Table 1

[0047] In Table 2, monitor_info_id is used to represent the primary key ID. The database information ID represented by the db_info_id field is consistent with the primary key ID in Table 1. Therefore, Table 1 and Table 2 are associated through the same field db_info_id. The monitor_sql field represents the configured SQL statement. The status field represents the enable / disable status of the monitoring point. When the value of the status field is 1, it means that the monitoring point is in the enabled state. When the value of the status field is 2, it means that the monitoring point is in the disabled state.

[0048] Fields name Data Types Remark monitor_info_id Primary key identifier Long db_info_id Database information identifier Int Primary key identifier in the database address information table Monitory_key Monitoring logo Varchar descr_key Monitoring Description Varchar For display cron Monitoring frequency Varchar 0 0 / 5Query every 5 minutes monitor_sql SQL Statements Varchar Select count(1)from table_order status Enable Disabled State Int 1 Enable, 2 Disable

[0049] Table 2

[0050] In Table 3, the monitor_info_id field is used to represent the monitoring ID, which is consistent with the primary key ID in Table 2. Therefore, Table 2 and Table 3 are associated through the same field monitor_info_id. In addition, monitor_info_id is also a field included in the SQL statement. In addition, logical symbols can also be configured, such as >, >=, <, <=, etc.; and warning types can also be configured, such as warnings through SMS, email, instant messaging tools, etc.

[0051]

[0052] Table 3

[0053] In Internet e-commerce systems or other Internet systems, in order to ensure data security, the permissions and passwords for software to access the database are centrally managed by the database management system. Figure 2In the controller part, after configuring the monitoring configuration information such as database address information, SQL statements, monitoring frequency, indicator threshold information, etc., the system can save the monitoring configuration information to the MySQL database. At the same time, the system asynchronously applies for access rights and passwords from the database management system. After the application is successful, the password is updated to the MySQL database. Then a message indicating the end of the user configuration process is sent to MQ (MagicQuant, a programmatic trading platform) to drive subsequent operations. The entire system adopts an event-driven architecture to ensure timely monitoring of data in the database and rapid detection of system anomalies.

[0054] Figure 2 The architecture diagram of the abnormal warning system is shown in FIG, which includes a controller, a scheduler container and a collector container. The controller is used to store monitoring configuration information for monitoring data in the database. The monitoring configuration information may include but is not limited to monitoring frequency, database address information, indicator threshold information and query statements. The scheduler container includes a message receiving service, a Schedule self-checking service, a dynamic scheduling collection unit, a dynamic creation Schedule service, and a monitoring frequency configuration information loading service. The scheduler container is a data structure stored in a Key-Value key value pair, and the corresponding Value can be quickly located according to the value of the Key. The scheduler container may include multiple schedulers, each of which can be represented by a record, and each record may include all the fields shown in Table 2. The collector container is also a data structure stored in a Key-Value key value pair, and the corresponding Value can be quickly located according to the value of the Key. The collector container may include multiple collectors, each of which can be represented by a record, and each record may include all the fields shown in Table 1. The collector container includes a message receiving service, a database link self-checking service, a dynamic creation database link service, and a database address information loading service. Among them, the scheduler container dynamically creates a Schedule object according to the monitoring frequency configured in the controller, and the collector container creates a database link object according to the configured database address information, and enables the database link object to execute the configured SQL statement to perform data collection and early warning judgment.

[0055] In step S120, a scheduler object is created according to the monitoring frequency, and it is detected whether the scheduler object reaches the trigger time.

[0056] In this exemplary embodiment, when the system starts, the configured monitoring frequency will be automatically loaded, so that a scheduler object will be created according to the monitoring frequency to monitor the data in the database in real time. The monitoring frequency can be set according to actual needs, for example, it can be set to once every 1 minute or once every 5 minutes, etc. Figure 2As shown, after the message receiving service in the scheduler container receives the message sent by the controller, it calls the dynamically created Schedule service to create a scheduler object, namely the Schedule object. Figure 3 As shown, the specific steps of creating a scheduler object according to the monitoring frequency include: Step S301, when the system starts, query the monitoring data obtained by monitoring the data in the database when the monitoring point is in an enabled state from the data table of the monitoring frequency. Step S302, dynamically create a scheduler object according to the monitoring frequency field cron in Table 2, that is, dynamically create a Schedule object according to the monitoring data when the monitoring point is in an enabled state. Step S303, save the created Schedule object to the scheduler container. It should be noted that if the monitoring point is in an inactive state, there is no need to create a Schedule object to monitor the SQL statement and the data in the database.

[0057] In order to prevent message or data loss, a compensation mechanism is provided in this exemplary embodiment. Figure 4 As shown, the specific steps of dynamically creating the scheduler object according to the monitoring data include: step S401, driving the Schedule self-check service. Step S402, the Schedule self-check service in the scheduler container periodically queries the monitoring data of the data in the database when the monitoring point is in the enabled state in the monitoring frequency table monitor_info, and the monitoring data may include the monitoring configuration information of the database, and may also include the database name, ID and other attribute information. Step S403, compare the monitoring data with the first reference data in the scheduler container, wherein the first reference data may be a scheduler, which can be specifically represented by a record. The scheduler may include all fields in Table 2, such as database information identifier, monitoring identifier, monitoring frequency and other fields. Step S404, if it is detected that when the monitoring point is in the enabled state, there is newly added configuration data in the database except the first reference data, then go to S4041, where the newly added configuration data refers to the newly added scheduler. Step S4041, create a Schedule object by dynamically creating a Schedule service, and save it in the scheduler container. For example, the scheduler container includes scheduler 1, scheduler 2, and scheduler 3. When the monitoring point is in the enabled state, it is detected that there is new configuration data in the database, such as scheduler 5, and scheduler 5 will be saved in the scheduler container. Step S405: If it is found that the scheduler in the scheduler container is in the disabled state in the database, that is, the monitoring data when the monitoring point is in the enabled state does not include the first reference data, then go to S4051. Step S4051: Close the Schedule object in the scheduler container.

[0058] It should be noted that the scheduler container is used to create a Schedule object, and after the Schedule object is created, the object for executing the SQL statement is selected from the collector container through the dynamic scheduling collection unit, thereby performing data collection.

[0059] After creating a Schedule object, you can determine whether the Schedule object has reached the trigger time. The trigger time can be set based on the last trigger time and the monitoring frequency. For example, if the monitoring frequency is once every 5 minutes and the last trigger time is 11 o'clock, then the current trigger time is 11:05. By adjusting the monitoring frequency, real-time monitoring of data in the database can be achieved, avoiding the problem of untimely monitoring caused by scheduled monitoring, improving the real-time and accuracy of monitoring, and improving system reliability.

[0060] Next, in step S130, when the scheduler object reaches the trigger time, the data in the database is collected to obtain the indicator data of the monitoring point.

[0061] In this exemplary embodiment, based on step S120, if the monitoring frequency is once every 5 minutes and the last trigger time is 11 o'clock, then when the time is 11:05, it can be considered that the Schedule object has reached the trigger time. At this time, the dynamic scheduling collection unit service in the scheduler container will call the collector container and send the field monitor_info_id representing the primary key identifier in the monitoring frequency table to the collector container, so that the collector container collects the data in the database, thereby obtaining the indicator data of the monitoring point.

[0062] In this example, an event-driven architecture that reaches a trigger time is adopted to ensure timely monitoring of data in the database and rapid detection of system anomalies.

[0063] Combination Figure 2 As shown, after receiving the message sent by the controller, the message receiving service in the collector container will call the dynamic database link creation service to dynamically create a database link object, namely the DataSourceConnection object. Figure 5As shown, the specific steps of collecting the data in the database to obtain the indicator data of the monitoring point include: step S501, when the system starts, query the database address information when the database is in the enabled state from the database address information table. Step S502, create a database link object according to the field db_info_id representing the database information identifier. Step S503, save the created database link object to the collector container. It should be noted that if the database is in an inactive state, there is no need to create a database link object to execute SQL statements. In other words, when the system starts, all the data in the database address information table will be loaded, and a database link object will be automatically created according to the information such as the database address db_address, the database name db_name, the database port db_port, the user name username, and the password password, and put it into the collector container. Among them, the primary key identifier db_info_id in the database address information table is used as the key, and the value is the database link object corresponding to the primary key identifier.

[0064] refer to Figure 6 As shown, the specific steps of creating a database link object through the database address information include: Step S601, driving the database link self-check service. Step S602, periodically querying the database address information of the database in the enabled state through the database link self-check service. Step S603, comparing the database address information of the database in the enabled state with the second reference data in the collector container, the second reference data refers to the collector, which can be represented by a record, and the collector can specifically include all the fields shown in Table 1, such as database type, database address, primary key identifier, database name, and database port, etc. Step S604, if it is detected that the database is in the enabled state, and new configuration data other than the second reference data is monitored, then go to S6041, where the new configuration data refers to the new collector. Step S6041, create a database link object by dynamically creating a database link service, and save it to the collector container. For example, the second reference data in the collector container includes collector 1, collector 2, and collector 4. If new configuration data is detected in the database when the database is in the enabled state, such as collector 3 and collector 5, collector 3 and collector 5 will be saved in the collector container. Step S605: If it is found that the database link object in the collector container is in the disabled state in the database, that is, the database address information when the database is in the enabled state does not include the second reference data, then go to S6051. Step S6051: Close the database link object in the collector container.

[0065] When collecting data in the database to obtain indicator data of a monitoring point, the database information identifier and the monitoring point identifier can be determined based on the primary key identifier in the database address information, and the target database link object corresponding to the database information identifier can be determined from the collector based on the database information identifier; after obtaining the target database link object, the query statement can be executed through the target database link object to collect data in the database from the monitoring point represented by the monitoring point identifier to obtain the indicator data corresponding to the monitoring point.

[0066] The method in this exemplary embodiment can create a scheduler object through the configured monitoring frequency, and then create a database link object through the scheduler object, so that the database link object can execute the configured SQL statement, and real-time data can be directly obtained from the database to monitor the data in the database. Since the monitoring frequency can be adjusted, the data in the database can be monitored at the second level, level, and hour level according to actual needs, thereby improving the real-time nature of monitoring. In addition, since data can be directly obtained from the database without copying the data in the database, operations are reduced and hardware resources are saved.

[0067] In step S140, it is determined whether the indicator data of the monitoring point meets the indicator threshold information, and an abnormal warning is issued when the indicator data of the monitoring point meets the indicator threshold information.

[0068] In this exemplary embodiment, the indicator threshold information is pre-configured, which may include configured indicator thresholds and logic symbols. The indicator threshold can be used to represent a critical value for judgment, and the critical value can be set to any appropriate value, which can be set to 8 here. Logical symbols include but are not limited to >, >=, =, <, <=, etc.

[0069] Combination Figure 7The process of database abnormality warning is illustrated as shown. Step S701, the collector container is scheduled by the dynamic scheduling collection unit in the scheduler container. Step S702, the database information identifier in Table 2 can be determined according to the primary key identifier in Table 1, and the monitoring point identifier in Table 3 can be determined according to the primary key identifier in Table 2. According to the parameter transmitted by the scheduler container, that is, the database information identifier monitor_info_id, a record can be queried from the monitoring frequency table, and the record can include all the fields in Table 2, for example, the database information identifier, the monitoring frequency, the primary key identifier, etc. Step S703, the target database link object corresponding to the database information identifier can be taken out from the collector container according to the database information identifier in the query statement. Step S704, the SQL statement monitor_sql is executed with the target database link object to monitor and collect the data in the database using the monitoring point determined by the monitoring point identifier to obtain the indicator data of the monitoring point. Step S705, a record is queried from the indicator threshold table according to the monitoring point identifier, and the record can include all the fields in Table 3 to obtain the indicator data of the monitoring point. The indicator data of the monitoring point can be understood as the data obtained by processing the indicator threshold information of the monitoring point when the database is enabled through SQL statements, which can generally be represented by a numerical value. Step S706, determine whether the indicator data of the monitoring point matches the configured indicator threshold information, and the indicator threshold information includes the indicator threshold and the logical symbol. Step S707, issue an abnormal warning when the indicator data matches the configured indicator threshold information.

[0070] In other words, the indicator threshold and the logical symbol can be combined to determine whether the indicator data of the monitoring point meets the indicator threshold information. Specifically, it can be determined whether the indicator data returned by the SQL statement matches the indicator threshold and the logical symbol. For example, the indicator data of the monitoring point returned by executing the SQL statement is 10, the configured indicator threshold is 8, and the configured logical symbol is >. Since 10>8, it can be considered that the indicator data of the monitoring point matches the indicator threshold and the logical symbol. For another example, the indicator data of the monitoring point returned by executing the SQL statement is 6, the configured indicator threshold is 8, and the configured logical symbol is >. Since 6<8, it can be considered that the indicator data of the monitoring point does not match the indicator threshold and the logical symbol.

[0071] When the indicator data of the monitoring point matches the configured indicator threshold information, an abnormal warning can be issued according to the warning personnel and warning type. The warning personnel can be the relevant person in charge, and the warning type can include any one or more of SMS, email, internal instant messaging tools or external instant messaging tools, which can be set by the user. In this example, the method can compare the configured query statement and indicator threshold information to quickly determine whether the two match, so that warnings can be issued in time, improving the real-time nature of warnings. In addition, based on the configured monitoring frequency, the data in the database can be monitored in real time to ensure the stability and reliability of the database system.

[0072] The present disclosure also provides an abnormal warning device. Figure 8 As shown, the abnormal warning device may include:

[0073] Configuration information acquisition module 801, used to obtain monitoring configuration information provided for data in the database, the monitoring configuration information including monitoring frequency and indicator threshold information;

[0074] The object creation module 802 is used to create a scheduler object according to the monitoring frequency and detect whether the scheduler object reaches the trigger time;

[0075] A data collection module 803, used to collect data from the database to obtain indicator data of a monitoring point when the scheduler object reaches the trigger time;

[0076] The early warning execution module 804 is used to determine whether the indicator data of the monitoring point meets the indicator threshold information, and to issue an abnormal early warning when the indicator data of the monitoring point meets the indicator threshold information.

[0077] It should be noted that the specific details of each functional module in the above-mentioned abnormal warning device have been described in detail in the corresponding abnormal warning method, so they will not be repeated here.

[0078] besides, Fig. 9The structure diagram of the abnormal warning system 900 is shown in FIG. 9 , which includes a controller 901, a scheduler container 902, and a collector container 903. The controller 901 is used to store the monitoring configuration information provided for the data in the database, and the monitoring configuration information includes the monitoring frequency, the index threshold information, the database address information, and the query statement. The scheduler container 902 is used to create a scheduler object according to the monitoring frequency. The scheduler container includes a message receiving service, a Schedule self-check service, a dynamic scheduling collection unit, a dynamic creation Schedule service, and a monitoring frequency configuration information loading service. The scheduler container dynamically creates a Schedule object according to the monitoring frequency configured in the controller. The collector container 903 is used to create a database link object after creating the scheduler object and use the database link object to execute the query statement to collect the index data of the monitoring point to determine whether to issue an early warning. That is, the collector container creates a database link object according to the configured database address information, and enables the database link object to execute the configured SQL statement to perform real-time collection and early warning judgment on the data in the database.

[0079] In this exemplary embodiment, the monitoring configuration information provided by the controller for the data in the database drives the service in the scheduler container to create a Schedule object, and when the Schedule object meets the trigger time, drives the service in the collector container to create a database link object and use the database link object to execute a query statement to collect the indicator data of the monitoring point, and then determine whether to issue an abnormal warning. Through the event-driven architecture, it is ensured that the data in the database is monitored in a timely manner, and whether the database system is abnormal can be quickly discovered.

[0080] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0081] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0082] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0083] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.

[0084] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0085] Refer to the following Fig.10 The electronic device 1000 according to this embodiment of the present invention will be described. Fig.10 The electronic device 1000 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0086] like Fig.10 As shown, the electronic device 1000 is in the form of a general computing device. The components of the electronic device 1000 may include but are not limited to: the at least one processing unit 1010, the at least one storage unit 1020, and a bus 1030 connecting different system components (including the storage unit 1020 and the processing unit 1010).

[0087] The storage unit stores program codes, which can be executed by the processing unit 1010, so that the processing unit 1010 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 1010 can perform the following steps: Figure 1 Follow the steps shown in .

[0088] The storage unit 1020 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 10201 and / or a cache storage unit 10202 , and may further include a read-only storage unit (ROM) 10203 .

[0089] The storage unit 1020 may also include a program / utility 10204 having a set (at least one) of program modules 10205, such program modules 10205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0090] Bus 1030 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0091] The electronic device 1000 may also communicate with one or more external devices 1200 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1000, and / or communicate with any device that enables the electronic device 1000 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1050. Furthermore, the electronic device 1000 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1060. As shown, the network adapter 1060 communicates with other modules of the electronic device 1000 via a bus 1030. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0092] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.

[0093] refer to Fig.11As shown, a program product 1100 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.

[0094] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0095] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0096] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0097] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0098] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0099] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

Claims

1. An abnormal warning method, characterized in that: include: Acquire monitoring configuration information provided for data in a database, wherein the monitoring configuration information includes monitoring frequency and indicator threshold information; Creating a scheduler object according to the monitoring frequency, and detecting whether the scheduler object reaches a trigger time; When the scheduler object reaches the trigger time, the data in the database is collected to obtain the indicator data of the monitoring point; Determine whether the indicator data of the monitoring point meets the indicator threshold information, and issue an abnormal warning when the indicator data of the monitoring point meets the indicator threshold information; Wherein, creating a scheduler object according to the monitoring frequency includes: Loading the monitoring data of the monitoring point in an enabled state based on the monitoring frequency; Periodically querying the database for monitoring data in an enabled state at the monitoring point, and comparing the monitoring data with first reference data in the scheduler container; If there is new configuration data in addition to the first reference data in the monitoring data, a scheduler object corresponding to the new configuration data is dynamically created and saved in the scheduler container.

2. The abnormal warning method according to claim 1, characterized in that: Dynamically creating the scheduler object according to the monitoring data also includes: If it is determined that the first reference data does not exist in the monitoring data of the monitoring point in the enabled state, the scheduler object in the scheduler container is closed.

3. The abnormal warning method according to claim 1, characterized in that: The monitoring configuration information includes database address information and query statements. Collecting data in the database to obtain indicator data of monitoring points includes: Creating a database link object through the database address information, and storing the database link object in a collector container; The query statement is executed through the database link object to collect data from the database to obtain the indicator data of the monitoring point.

4. The abnormal warning method according to claim 3, characterized in that: Creating a database link object through the database address information includes: Periodically querying the database address information of the database in an enabled state, and comparing the database address information of the database in an enabled state with the second reference data in the collector container; If it is detected that the database address information of the database in the enabled state contains newly added configuration data other than the second reference data, dynamically creating a database link object corresponding to the newly added configuration data and saving it to the collector container; If it is detected that the second reference data does not exist in the database address information of the database in the enabled state, the database link object in the collector container is closed.

5. The abnormal warning method according to claim 3, characterized in that: Executing the query statement through the database link object to collect data from the database to obtain the indicator data of the monitoring point includes: Determine the database information identifier and the monitoring point identifier according to the primary key identifier in the database address information, and determine the target database link object from the collector container according to the database information identifier; The query statement is executed through the target database link object to collect data from the database from the monitoring point represented by the monitoring point identifier to obtain the indicator data corresponding to the monitoring point.

6. The abnormal warning method according to claim 1, characterized in that: The indicator threshold information includes an indicator threshold and a logic symbol, and judging whether the indicator data of the monitoring point meets the indicator threshold information, and issuing an abnormal warning when the indicator data of the monitoring point meets the indicator threshold information includes: Comparing the indicator data with the indicator threshold and the logic symbol in the indicator threshold information; If the indicator data matches the indicator threshold and the logical symbol, an abnormality warning is issued.

7. An abnormal warning device, characterized in that: include: A configuration information acquisition module is used to acquire monitoring configuration information provided for data in a database, wherein the monitoring configuration information includes monitoring frequency and indicator threshold information; An object creation module, used to create a scheduler object according to the monitoring frequency, and detect whether the scheduler object reaches a trigger time; A data collection module, used for collecting data from the database to obtain indicator data of a monitoring point when the scheduler object reaches the trigger time; An early warning execution module is used to determine whether the indicator data of the monitoring point meets the indicator threshold information, and to issue an abnormal early warning when the indicator data of the monitoring point meets the indicator threshold information; Wherein, creating a scheduler object according to the monitoring frequency includes: Loading the monitoring data of the monitoring point in an enabled state based on the monitoring frequency; Periodically querying the database for monitoring data in an enabled state at the monitoring point, and comparing the monitoring data with first reference data in the scheduler container; If there is new configuration data in addition to the first reference data in the monitoring data, a scheduler object corresponding to the new configuration data is dynamically created and saved in the scheduler container.

8. An abnormal warning system, characterized in that: include: A controller, used to store monitoring configuration information provided for data in a database, wherein the monitoring configuration information includes monitoring frequency, indicator threshold information, database address information, and query statements; A scheduler container, used to create a scheduler object according to the monitoring frequency; A collector container, used to create a database link object after creating the scheduler object, and use the database link object to execute a query statement to obtain the indicator data of the monitoring point, determine whether the indicator data of the monitoring point meets the indicator threshold information, and issue an abnormal warning when the indicator data of the monitoring point meets the indicator threshold information; Wherein, creating a scheduler object according to the monitoring frequency includes: Loading the monitoring data of the monitoring point in an enabled state based on the monitoring frequency; Periodically querying the database for monitoring data in an enabled state at the monitoring point, and comparing the monitoring data with first reference data in the scheduler container; If there is new configuration data in addition to the first reference data in the monitoring data, a scheduler object corresponding to the new configuration data is dynamically created and saved in the scheduler container.

9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the abnormality warning method described in any one of claims 1-6 by executing the executable instructions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the abnormality warning method according to any one of claims 1 to 6 is implemented.