Database Alarm Handling Method, Device, Equipment and Computer Readable Storage Medium

By obtaining the types and indicators of database alarms, the root cause of database alarms is automatically analyzed, which solves the problem of time-consuming and labor-consuming manual analysis in the existing technology, and improves the efficiency and accuracy of root cause analysis.

CN110221936BActive Publication Date: 2025-08-01WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910508774.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-06-12
Publication Date
2025-08-01
Estimated Expiration
2039-06-12

AI Technical Summary

Technical Problem

The existing database alarm mechanism in the financial field can only notify administrators of abnormal indicators, and requires manual analysis of the root cause, which is time-consuming and labor-intensive and difficult to guarantee.

Method used

By obtaining the types and indicators of database alarms, finding preset configuration tables, collecting database on-site information, and automatically analyzing the root cause, including judging host abnormal alarms and collecting CPU usage, disk throughput and other information to determine the root cause.

Benefits of technology

Automatically analyze the root cause of database alarms, improve the efficiency and accuracy of root cause analysis, and reduce the time and error of manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110221936B_ABST
    Figure CN110221936B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of fintech, and discloses a method for processing database alarms. The method includes: when it is detected that a host generates a database alarm, obtaining the database type and alarm metrics of the database alarm; looking up a preset alarm processing configuration table according to the database type and the alarm metrics to obtain the types of database on-site information to be acquired; collecting the corresponding database on-site information according to the types of the database on-site information to be acquired; and determining the root cause of the database alarm according to the database on-site information. The present invention also discloses a database alarm processing device, equipment and a computer-readable storage medium. The present invention improves the efficiency and accuracy of database root cause analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of financial technology (Fintech), and in particular to a database alarm processing method, apparatus, device, and computer-readable storage medium. Background Art

[0002] With the development of computer technology, more and more technologies (big data, distributed computing, blockchain, artificial intelligence, etc.) are being applied in the financial field. The traditional financial industry is gradually transforming into financial technology (Fintech). However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology.

[0003] In the current financial sector, transaction system databases within various financial institutions typically have alert mechanisms. These mechanisms trigger alerts based on pre-defined thresholds, notifying database administrators for action. However, these mechanisms only inform administrators of the indicators that have exhibited anomalies. Determining the root cause requires manual analysis by database administrators based on past experience and the alert indicators. This manual analysis is not only time-consuming and labor-intensive, but also relies heavily on the database administrator's personal experience, making accuracy difficult to guarantee. Summary of the Invention

[0004] The main purpose of the present invention is to propose a database alarm processing method, device, equipment and computer-readable storage medium, aiming to automatically analyze the root cause of database alarms and improve the efficiency and accuracy of root cause analysis.

[0005] To achieve the above object, the present invention provides a database alarm processing method, which includes the following steps:

[0006] When a database alarm is detected on a host, the database type and alarm indicator of the database alarm are obtained;

[0007] Searching a preset alarm processing configuration table according to the database type and the alarm indicator to obtain the type of database field information to be obtained;

[0008] According to the type of the database field information to be obtained, collecting corresponding database field information;

[0009] The root cause of the database alarm is determined according to the database field information.

[0010] Preferably, before the step of determining the root cause of the database alarm according to the database field information, the method further includes:

[0011] During the process of collecting the on-site information of the database, it is determined whether a host exception alarm is received, and the host exception alarm includes any one of a disk read-only / disk full alarm, a host downtime alarm, and a database startup process abnormal exit alarm;

[0012] If a host exception alarm is received, the cause of the host exception alarm is determined as the root cause of the database alarm;

[0013] If a host exception alarm is not received, the steps are executed: determining the root cause of the database alarm according to the on-site information of the database.

[0014] Preferably, the step of collecting the corresponding on-site information of the database according to the type of the to-be-obtained on-site information of the database includes:

[0015] When the types of the to-be-obtained on-site information of the database include storage engine information, session information, host resource information, lock wait information, and slow query information, collect the CPU usage rate, disk throughput, number of active threads of the storage engine, and number of slow query statements of the host within a preset time period;

[0016] The step of determining the root cause of the database alarm according to the on-site information of the database includes:

[0017] Determine the root cause of the database alarm according to the CPU usage rate, disk throughput, number of active threads of the storage engine, and number of slow query statements of the host within a preset time period.

[0018] Preferably, the step of determining the root cause of the database alarm according to the CPU usage rate, disk throughput, number of active threads of the storage engine, and number of slow query statements of the host within a preset time period includes:

[0019] Obtain the peak value of the number of active threads of the storage engine within the preset time period;

[0020] Judge whether the peak value is greater than or equal to a first preset threshold;

[0021] If the peak value is greater than or equal to the first preset threshold, judge whether the number of slow query statements is greater than or equal to a second preset threshold;

[0022] If the number of slow query statements is greater than or equal to the second preset threshold, judge whether the host resources are exhausted according to the CPU usage rate and the disk throughput;

[0023] If the host resources are not exhausted, determine that the number of threads running full is the root cause of the database alarm.

[0024] Preferably, the step of determining whether the host resources are exhausted according to the CPU usage rate and the disk throughput includes:

[0025] Determining whether the number of times the CPU usage rate and the disk throughput reach the full load within the preset time period reaches a preset number of times;

[0026] If the number of times the CPU usage rate and the disk throughput reach the full load within the preset time period does not reach the preset number of times, it is determined that the host resources are not exhausted.

[0027] Preferably, after the step of determining whether the number of times the CPU usage rate and the disk throughput reach the full load within the preset time period reaches a preset number of times, it further includes:

[0028] If the number of times the CPU usage rate or the disk throughput reaches the full load within the preset time period reaches the preset number of times, it is determined that the host resources are exhausted, and the exhaustion of the host resources is determined as the root cause of the database alarm.

[0029] Preferably, the step of, if the number of times the CPU usage rate or the disk throughput reaches the full load within the preset time period reaches the preset number of times, determining that the host resources are exhausted and determining the exhaustion of the host resources as the root cause of the database alarm includes:

[0030] If only the number of times the CPU usage rate reaches the full load within the preset time period reaches the preset number of times, it is determined that the CPU resources of the host are exhausted, and the exhaustion of the CPU resources of the host is determined as the root cause of the database alarm;

[0031] If only the number of times the disk throughput reaches the full load within the preset time period reaches the preset number of times, it is determined that the disk throughput resources of the host are exhausted, and the exhaustion of the disk throughput resources of the host is determined as the root cause of the database alarm;

[0032] If the number of times the CPU usage rate and the disk throughput reach the full load within the preset time period both reach the preset number of times, it is determined that the CPU resources and the disk throughput resources of the host are exhausted simultaneously, and the simultaneous exhaustion of the CPU resources and the disk throughput resources of the host is determined as the root cause of the database alarm.

[0033] Preferably, the database alarm processing method further includes:

[0034] After correlating the database type, the alarm metrics, the database on-site information, and the determined root cause of the database alarm, send them to the front-end page for display.

[0035] In addition, to achieve the above object, the present invention further provides a database alarm processing device, which includes:

[0036] An acquisition module, configured to acquire the database type and alarm metrics of the database alarm when it is detected that the host generates a database alarm;

[0037] A search module, configured to search a preset alarm processing configuration table according to the database type and the alarm metrics to obtain the types of database on-site information to be acquired;

[0038] An acquisition module, configured to acquire corresponding database on-site information according to the types of the database on-site information to be acquired;

[0039] A first determination module, configured to determine the root cause of the database alarm according to the database on-site information.

[0040] Preferably, the database alarm processing device further includes:

[0041] A judgment module, configured to judge whether a host exception alarm is received during the process of acquiring the database on-site information, where the host exception alarm includes any one of a disk read-only / disk full alarm, a host downtime alarm, and a database startup process abnormal exit alarm;

[0042] A second determination module, configured to determine the alarm cause of the host exception alarm as the root cause of the database alarm when the host exception alarm is received;

[0043] The first determination module is further configured to determine the root cause of the database alarm according to the database on-site information when the host exception alarm is not received.

[0044] Preferably, the acquisition module is further configured to acquire the CPU usage rate, disk throughput, active thread number of the storage engine, and the number of slow query statements of the host within a preset time period when the types of the database on-site information to be acquired include storage engine information, session information, host resource information, lock wait information, and slow query information;

[0045] The first determination module is further configured to determine the root cause of the database alarm according to the CPU usage rate, disk throughput, active thread number of the storage engine, and the number of slow query statements of the host within a preset time period.

[0046] Preferably, the first determination module is further configured to:

[0047] Acquire the peak value of the active thread number of the storage engine within the preset time period;

[0048] Judge whether the peak value is greater than or equal to a first preset threshold;

[0049] If the peak value is greater than or equal to the first preset threshold, determine whether the number of slow query statements is greater than or equal to the second preset threshold;

[0050] If the number of slow query statements is greater than or equal to the second preset threshold, determine whether the host resources are exhausted according to the CPU usage rate and the disk throughput;

[0051] If the host resources are not exhausted, determine that running the thread count to the maximum is the root cause of the database alarm.

[0052] Preferably, the first determination module is further configured to:

[0053] Determine whether the number of times the CPU usage rate and the disk throughput reach the maximum within the preset time period reaches a preset number of times;

[0054] If the number of times the CPU usage rate and the disk throughput reach the maximum within the preset time period do not reach the preset number of times, determine that the host resources are not exhausted.

[0055] Preferably, the first determination module is further configured to:

[0056] If the number of times the CPU usage rate or the disk throughput reaches the maximum within the preset time period reaches the preset number of times, determine that the host resources are exhausted, and determine that the exhaustion of the host resources is the root cause of the database alarm.

[0057] Preferably, the first determination module is further configured to:

[0058] If only the number of times the CPU usage rate reaches the maximum within the preset time period reaches the preset number of times, determine that the CPU resources of the host are exhausted, and determine that the exhaustion of the CPU resources of the host is the root cause of the database alarm;

[0059] If only the number of times the disk throughput reaches the maximum within the preset time period reaches the preset number of times, determine that the disk throughput resources of the host are exhausted, and determine that the exhaustion of the disk throughput resources of the host is the root cause of the database alarm;

[0060] If the number of times the CPU usage rate and the disk throughput reach the maximum within the preset time period both reach the preset number of times, determine that the CPU resources and the disk throughput resources of the host are exhausted at the same time, and determine that the exhaustion of the CPU resources and the disk throughput resources of the host at the same time is the root cause of the database alarm.

[0061] Preferably, the database alarm processing device further includes:

[0062] A sending module, configured to associate the database type, the alarm metrics, the on-site database information, and the determined root cause of the database alarm, and then send the associated information to a front-end page for display.

[0063] In addition, to achieve the above object, the present invention also provides a database alarm processing device, which includes: a memory, a processor, and a database alarm processing program stored on the memory and executable on the processor. When the database alarm processing program is executed by the processor, the steps of the above-mentioned database alarm processing method are implemented.

[0064] In addition, to achieve the above object, the present invention also provides a computer-readable storage medium, on which a database alarm processing program is stored. When the database alarm processing program is executed by a processor, the steps of the above-mentioned database alarm processing method are implemented.

[0065] When the present invention detects that a host generates a database alarm, it obtains the database type and alarm metrics of the database alarm; searches a preset alarm processing configuration table according to the database type and the alarm metrics to obtain the types of on-site database information to be acquired; collects the corresponding on-site database information according to the types of on-site database information to be acquired; and determines the root cause of the database alarm according to the on-site database information. Compared with the existing manual analysis, this method realizes the automatic analysis of the root cause of database alarms according to the database type and alarm metrics, improving the efficiency and accuracy of root cause analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 is a schematic diagram of the device structure of the hardware operating environment related to the embodiment solution of the present invention;

[0067] Figure 2 is a schematic flowchart of the first embodiment of the database alarm processing method of the present invention.

[0068] The implementation, functional features, and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0069] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0070] As Figure 1 shown, Figure 1 is a schematic diagram of the device structure of the hardware operating environment related to the embodiment solution of the present invention.

[0071] The database alarm processing device in the embodiment of the present invention can be a device such as a PC or a server.

[0072] As Figure 1 shown, the database alarm processing device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to implement the connection and communication between these components. The user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0073] Those skilled in the art can understand that Figure 1 the device structure shown in

[0074] As Figure 1 shown, the memory 1005, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a database alarm processing program.

[0075] In Figure 1 the device shown, the network interface 1004 is mainly used to connect to the background server and communicate with the background server for data; the user interface 1003 is mainly used to connect to the client (user side) and communicate with the client for data; and the processor 1001 may be used to call the database alarm processing program stored in the memory 1005 and execute the operations in the following embodiments of the database alarm processing method.

[0076] Based on the above hardware structure, an embodiment of the database alarm processing method of the present invention is proposed.

[0077] Referring to Figure 2 , Figure 2 which is a schematic flowchart of the first embodiment of the database alarm processing method of the present invention, the method includes:

[0078] Step S10, when it is detected that the host generates a database alarm, obtain the database type and alarm metrics of the database alarm;

[0079] The database alarm processing method of this embodiment is applied to a database alarm processing device, which can monitor and process the database alarms generated by the host in real time.

[0080] Taking the financial scenario as an example, the transaction system databases of various financial institutions currently running on the host generally have an alarm mechanism. However, this alarm mechanism can only tell the administrator what metrics have anomalies, and there may be multiple root causes for the anomalies. For example, if a resource-consuming statement is running online, it will cause an increase in alarm metrics such as CPU, IO (disk throughput), active connection count, and the number of slow query statements. Sometimes, just due to business activity promotion (such as discounts, offers, etc.), resulting in a high concurrent volume of normal statements, this phenomenon of multiple metric anomalies will also occur. To achieve accurate analysis of the root cause of database alarms, this embodiment proposes a database alarm processing method.

[0081] Specifically, when the database alarm processing device detects that the host generates a database alarm, it can analyze the database alarm information to obtain the database type and alarm metrics carried therein. Among them, the database type refers to the type of the database that currently generates the alarm, including but not limited to relational databases (such as MySQL, TDSQL (Tencent Distributed MySQL), ORACLE), in-memory databases (such as shared memory, REDIS), non-relational databases (such as MONGODB), big data type databases (such as HIVE, HBASE), etc. The alarm metrics refer to the database metrics that currently have anomalies, including but not limited to master-slave switchover, active connection count, CPU usage, disk throughput, memory usage, etc.

[0082] Step S20: Look up the preset alarm processing configuration table according to the database type and the alarm metrics to obtain the types of database on-site information to be acquired;

[0083] In this embodiment, an alarm processing configuration table is preset. The alarm processing configuration table at least stores the corresponding relationship between the database type, alarm metrics, and the types of database on-site information to be acquired. In addition, the alarm processing configuration table can also store information such as alarm values, alarm levels, and analysis programs corresponding to the database type and alarm metrics.

[0084] Furthermore, the types of database on-site information to be acquired include one or a combination of multiple of storage engine information, session information, host resource information, lock wait information, slow query information, active session history information, and execution plan information. Specifically in implementation, the types of database on-site information to be acquired can be flexibly set according to actual analysis needs.

[0085] In one implementation manner, the configuration in the alarm processing configuration table is shown in the following table:

[0086]

[0087]

[0088] After obtaining the database type and alarm metrics of the current database alarm, query the preset alarm handling configuration table according to the obtained database type and alarm metrics, and the types of database on-site information to be obtained can be obtained, that is, the types of database on-site information that need to be retained.

[0089] For example, if the database type of the current database alarm is TDSQL and the alarm metric is master-slave switchover, query the above alarm handling configuration table, and the types of database on-site information to be obtained include storage engine information, session information, host resource information, lock wait information, slow queries, etc.; if the database type of the current database alarm is ORACLE and the alarm metric is the number of active connections, query the above alarm handling configuration table, and the types of database on-site information to be obtained include session information, host resource information, lock wait information, ASH (Active Session History) information, execution plan, etc. In addition, for some database alarms with relatively low alarm levels, such as Minor (general) and Warning (reminder) levels, they can be not processed, that is, there is no need to perform root cause analysis on them to save system resources.

[0090] Step S30: Collect the corresponding database on-site information according to the types of the database on-site information to be obtained.

[0091] In this step, according to the types of the database on-site information to be obtained queried above, collect the corresponding database on-site information for subsequent analysis. Among them, the database on-site information includes but is not limited to the number of active threads of the storage engine, data page usage, the statements currently being processed and their corresponding processing status, CPU usage, disk throughput, the number of slow query statements, etc.

[0092] Step S40: Determine the root cause of the database alarm according to the database on-site information.

[0093] In this step, the preset analysis rules can be used to analyze the above database on-site information, so as to determine the root cause of the database alarm. Among them, the analysis rules can be flexibly set according to past analysis experience, and the determined root causes of the database alarm include but are not limited to full CPU load, full IO load, full storage engine thread pool, statement exception, etc.

[0094] In this embodiment, when a database alarm is detected on the host, the database type and alarm metrics of the database alarm are obtained; according to the database type and the alarm metrics, a preset alarm handling configuration table is searched to obtain the types of database on-site information to be acquired; according to the types of the database on-site information to be acquired, the corresponding database on-site information is collected; and according to the database on-site information, the root cause of the database alarm is determined. Compared with the existing manual analysis, this method realizes automatically analyzing the root cause of the database alarm according to the database type and alarm metrics, improving the efficiency and accuracy of root cause analysis.

[0095] Further, based on the first embodiment of the database alarm handling method of the present invention, a second embodiment of the database alarm handling method of the present invention is proposed.

[0096] In this embodiment, before the above step S40, it may further include: during the process of collecting the database on-site information, determining whether a host exception alarm is received, where the host exception alarm includes any one of a disk read-only / disk full alarm, a host downtime alarm, and a database startup process abnormal exit alarm; if a host exception alarm is received, determining the alarm cause of the host exception alarm as the root cause of the database alarm; if a host exception alarm is not received, executing the step: determining the root cause of the database alarm according to the database on-site information.

[0097] In this embodiment, taking the TDSQL master-slave switch as an example, the logic for triggering the master-slave switch is to perform a heartbeat check on the TDSQL database at a preset time interval. If the number of consecutive detections of the TDSQL database being unwritable reaches a predetermined number, the master-slave switch will be triggered. The reasons for the database being unwritable include: 1. Disk read-only / disk full; 2. Host downtime and unavailability; 3. The mysqld (mysqld is the command used to start the mysql database) process exits abnormally; 4. CPU load is full; 5. IO load is full; 6. The storage engine thread pool is full. The first three can be intuitively judged according to the host exception alarm. That is, during the process of collecting the database on-site information, it is determined whether a host exception alarm is received. The host exception alarm includes any one of a disk read-only / disk full alarm, a host downtime alarm, and a database startup process abnormal exit alarm. If a host exception alarm is received, it is very likely that the database on-site information cannot be collected normally. At this time, directly determining the alarm cause of the host exception alarm (disk read-only / disk full, host downtime, or database startup process abnormal exit) as the root cause of the database alarm; conversely, if a host exception alarm is not received, the root cause of the database alarm needs to be determined through the collected database on-site information.

[0098] The above method considers the situation where a host exception alarm is received during the process of collecting on-site information of the database. In this situation, by determining the cause of the host exception alarm as the root cause of the database alarm, an accurate determination of the root cause of the database alarm is achieved, and the efficiency of root cause analysis is improved.

[0099] Further, based on the first embodiment of the database alarm processing method of the present invention, a third embodiment of the database alarm processing method of the present invention is proposed.

[0100] In this embodiment, the above step S30 may include: when the types of the on-site information of the database to be acquired include storage engine information, session information, host resource information, lock wait information, and slow query information, collecting the CPU usage rate, disk throughput, number of active threads of the storage engine, and number of slow query statements of the host within a preset time period; correspondingly, step S40 may include: determining the root cause of the database alarm according to the CPU usage rate, disk throughput, number of active threads of the storage engine, and number of slow query statements of the host within a preset time period.

[0101] In this embodiment, still taking the TDSQL master-slave switch as an example, if the types of the on-site information of the database to be acquired corresponding to the TDSQL master-slave switch in the alarm processing configuration table include storage engine information, session information, host resource information, lock wait information, and slow query information, the CPU usage rate, disk throughput, number of active threads of the storage engine, and number of slow query statements of the host within a preset time period can be collected correspondingly, and the root cause of the database alarm is determined according to the CPU usage rate, disk throughput, number of active threads of the storage engine, and number of slow query statements of the host collected within a preset time period.

[0102] Further, the step of determining the root cause of the database alarm according to the CPU usage rate, disk throughput, number of active threads of the storage engine, and number of slow query statements of the host within a preset time period includes: obtaining the peak value of the number of active threads of the storage engine within the preset time period; determining whether the peak value is greater than or equal to a first preset threshold; if the peak value is greater than or equal to the first preset threshold, determining whether the number of slow query statements is greater than or equal to a second preset threshold; if the number of slow query statements is greater than or equal to the second preset threshold, determining whether the host resources are exhausted according to the CPU usage rate and the disk throughput; if the host resources are not exhausted, determining that the number of threads running full is the root cause of the database alarm.

[0103] Among them, the first preset threshold, the second preset threshold, and the preset time period can be flexibly set according to experience. For example, if the peak value of the active threads of the storage engine within 10s is greater than 64 and the number of slow query statements is greater than 100, it is very likely that the database alarm is caused by the full running of the number of threads. At this time, further judge whether the host resources are exhausted according to the CPU usage rate and disk throughput. If the host resources are not exhausted, it can be determined that the root cause of the database alarm is the full running of the number of threads.

[0104] Further, the step of judging whether the host resources are exhausted according to the CPU usage rate and the disk throughput includes: judging whether the number of times the CPU usage rate and the disk throughput reach the full running state within the preset time period reaches a preset number of times; if the number of times the CPU usage rate and the disk throughput reach the full running state within the preset time period does not reach the preset number of times, it is determined that the host resources are not exhausted.

[0105] In this embodiment, it is possible to judge whether the host resources are exhausted by the CPU usage rate and the disk throughput. Specifically, if the number of times the CPU usage rate reaches the full running state or the number of times the disk throughput reaches the full running state within the preset time period does not reach the preset number of times, it can be determined that the host resources are not exhausted. Among them, the CPU usage rate and the disk throughput reaching the full running state mean that the CPU usage rate and the disk throughput reach 100%.

[0106] Of course, judging whether the host resources are exhausted is not limited to the above method. For example, it is also possible to judge whether the CPU usage rate and the disk throughput are continuously greater than or equal to a preset threshold within the preset time period. If the CPU usage rate and the disk throughput are not continuously greater than or equal to the preset threshold within the preset time period, it can be determined that the host resources are not exhausted, and it can be flexibly set during specific implementation.

[0107] Further, after the step of judging whether the number of times the CPU usage rate and the disk throughput reach the full running state within the preset time period reaches the preset number of times, it may further include: if the number of times the CPU usage rate or the disk throughput reaches the full running state within the preset time period reaches the preset number of times, it is determined that the host resources are exhausted, and the exhaustion of the host resources is determined as the root cause of the database alarm.

[0108] Specifically, if only the number of times the CPU usage reaches its limit within the preset time period reaches the preset number, it is determined that the CPU resources of the host are exhausted, and the exhaustion of the CPU resources of the host is determined as the root cause of the database alarm; if only the number of times the disk throughput reaches its limit within the preset time period reaches the preset number, it is determined that the disk throughput resources of the host are exhausted, and the exhaustion of the disk throughput resources of the host is determined as the root cause of the database alarm; if both the CPU usage and the disk throughput reach their limits within the preset time period, it is determined that both the CPU resources and the disk throughput resources of the host are exhausted, and the simultaneous exhaustion of the CPU resources and the disk throughput resources of the host is determined as the root cause of the database alarm.

[0109] In this embodiment, by implementing the past root cause analysis experience in the program, the determination of the root cause of the database alarm is realized, and the efficiency and accuracy of the root cause analysis are improved.

[0110] Furthermore, based on the first, second, and third embodiments of the database alarm processing method of the present invention, a fourth embodiment of the database alarm processing method of the present invention is proposed.

[0111] In this embodiment, the database alarm processing method may further include: after associating the database type, the alarm metric, the database site information, and the determined root cause of the database alarm, sending them to the front-end page for display.

[0112] In this embodiment, after obtaining the root cause analysis result, the database type, alarm metric, database site information, and the determined root cause of the database alarm of this root cause analysis can be associated and sent to the front-end page for display. Specifically, the associated information can be sent to a unified alarm management platform, so that the alarm management platform can push the associated information to the administrator terminal to notify the administrator to process it in time, where the push forms include but are not limited to text, voice, phone, etc., and can be flexibly set during specific implementation.

[0113] The above method facilitates the administrator to directly know the cause of the database alarm and process the alarm in time by sending information such as the database type, alarm metric, database site information, and the determined root cause of the database alarm to the front-end page for display.

[0114] The present invention also provides a database alarm processing device. The database alarm processing device includes:

[0115] An acquisition module, configured to acquire the database type and alarm metric of the database alarm when detecting that a host generates a database alarm;

[0116] A search module, configured to search a preset alarm handling configuration table according to the database type and the alarm metric, so as to obtain the types of on-site database information to be acquired;

[0117] An acquisition module, configured to acquire corresponding on-site database information according to the types of on-site database information to be acquired;

[0118] A first determination module, configured to determine the root cause of the database alarm according to the on-site database information.

[0119] Further, the database alarm handling device further includes:

[0120] A judgment module, configured to judge whether a host exception alarm is received during the process of acquiring the on-site database information, where the host exception alarm includes any one of a disk read-only / disk full alarm, a host downtime alarm, and a database startup process abnormal exit alarm;

[0121] A second determination module, configured to, when a host exception alarm is received, determine the alarm cause of the host exception alarm as the root cause of the database alarm;

[0122] The first determination module is further configured to, when a host exception alarm is not received, determine the root cause of the database alarm according to the on-site database information.

[0123] Further, the acquisition module is further configured to, when the types of on-site database information to be acquired include storage engine information, session information, host resource information, lock wait information, and slow query information, acquire the CPU usage rate, disk throughput, active thread number of the storage engine, and number of slow query statements of the host within a preset time period;

[0124] The first determination module is further configured to determine the root cause of the database alarm according to the CPU usage rate, disk throughput, active thread number of the storage engine, and number of slow query statements of the host within a preset time period.

[0125] Further, the first determination module is further configured to:

[0126] Obtain the peak value of the active thread number of the storage engine within the preset time period;

[0127] Judge whether the peak value is greater than or equal to a first preset threshold;

[0128] If the peak value is greater than or equal to the first preset threshold, then judge whether the number of slow query statements is greater than or equal to a second preset threshold;

[0129] If the number of the slow query statements is greater than or equal to a second preset threshold, it is determined whether the host resources are exhausted according to the CPU usage rate and the disk throughput;

[0130] If the host resources are not exhausted, determining that the full running of the number of threads is the root cause of the database alarm.

[0131] Further, the first determination module is further configured to:

[0132] Determine whether the number of times that the CPU usage rate and the disk throughput reach the full running state within the preset time period reaches a preset number of times;

[0133] If the number of times that the CPU usage rate and the disk throughput reach the full running state within the preset time period do not reach the preset number of times, it is determined that the host resources are not exhausted.

[0134] [[ID=!15]]Further, the first determination module is further configured to:

[0135] If the number of times that the CPU usage rate or the disk throughput reaches the full running state within the preset time period reaches the preset number of times, it is determined that the host resources are exhausted, and determining that the exhaustion of the host resources is the root cause of the database alarm.

[0136] Further, the first determination module is further configured to:

[0137] If only the number of times that the CPU usage rate reaches the full running state within the preset time period reaches the preset number of times, it is determined that the CPU resources of the host are exhausted, and determining that the exhaustion of the CPU resources of the host is the root cause of the database alarm;

[0138] If only the number of times that the disk throughput reaches the full running state within the preset time period reaches the preset number of times, it is determined that the disk throughput resources of the host are exhausted, and determining that the exhaustion of the disk throughput resources of the host is the root cause of the database alarm;

[0139] If the number of times that the CPU usage rate and the disk throughput reach the full running state within the preset time period both reach the preset number of times, it is determined that the CPU resources and the disk throughput resources of the host are exhausted simultaneously, and determining that the simultaneous exhaustion of the CPU resources and the disk throughput resources of the host is the root cause of the database alarm.

[0140] Further, the database alarm processing device further includes:

[0141] A sending module, configured to associate the database type, the alarm metric, the database site information, and the determined root cause of the database alarm, and send the associated information to a front-end page for display.

[0142] The methods executed by the above program modules can refer to the respective embodiments of the database alarm handling method of the present invention, which will not be elaborated here.

[0143] The present invention also provides a computer-readable storage medium.

[0144] The database alarm handling program is stored on the computer-readable storage medium of the present invention. When the database alarm handling program is executed by a processor, it implements the steps of the database alarm handling method described above.

[0145] Among them, the method implemented when the database alarm handling program running on the processor is executed can refer to the respective embodiments of the database alarm handling method of the present invention, which will not be elaborated here.

[0146] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or system including the element.

[0147] The serial numbers of the above embodiments of the present invention are only for description and do not represent the superiority or inferiority of the embodiments.

[0148] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the respective embodiments of the present invention.

[0149] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. A method for processing database alarms, characterized in that, The database alarm handling method includes the following steps: When it is detected that the host generates a database alarm, obtain the database type and alarm metrics of the database alarm; According to the database type and the alarm metrics, search a preset alarm handling configuration table to obtain the types of database on-site information to be acquired; According to the types of database on-site information to be acquired, collect the corresponding database on-site information: When the types of database on-site information to be acquired include storage engine information, session information, host resource information, lock wait information, and slow query information, collect the CPU usage rate, disk throughput, active thread count of the storage engine, and the number of slow query statements of the host within a preset time period; Determine the root cause of the database alarm according to the database on-site information: Determine the root cause of the database alarm according to the CPU usage rate, disk throughput, active thread count of the storage engine, and the number of slow query statements of the host within a preset time period.

2. The database alarm processing method according to claim 1, wherein Before the step of determining the root cause of the database alarm according to the database on-site information, it further includes: During the process of collecting the database on-site information, determine whether a host exception alarm is received, and the host exception alarm includes any one of a disk read-only / disk full alarm, a host downtime alarm, and a database startup process abnormal exit alarm; If a host exception alarm is received, determine the alarm cause of the host exception alarm as the root cause of the database alarm; If a host exception alarm is not received, execute the step: Determine the root cause of the database alarm according to the database on-site information.

3. The database alarm processing method according to claim 1, wherein The step of determining the root cause of the database alarm according to the CPU usage rate, disk throughput, active thread count of the storage engine, and the number of slow query statements of the host within a preset time period includes: Obtain the peak value of the active thread count of the storage engine within the preset time period; Determine whether the peak value is greater than or equal to a first preset threshold; If the peak value is greater than or equal to the first preset threshold, determine whether the number of slow query statements is greater than or equal to a second preset threshold; If the number of slow query statements is greater than or equal to the second preset threshold, determine whether the host resources are exhausted according to the CPU usage rate and the disk throughput; If the host resources are not exhausted, determine that the thread count is full as the root cause of the database alarm.

4. The database alarm processing method according to claim 3, characterized in that The step of determining whether the host resources are exhausted according to the CPU usage rate and the disk throughput includes: Determine whether the number of times the CPU usage rate and the disk throughput reach full within the preset time period reaches a preset number of times; If the number of times the CPU usage rate and the disk throughput reach full within the preset time period does not reach the preset number of times, determine that the host resources are not exhausted.

5. The database alarm processing method according to claim 4, characterized in that After the step of determining whether the number of times the CPU usage rate and the disk throughput reach full within the preset time period reaches a preset number of times, it further includes: If the number of times that the CPU usage rate or the disk throughput reaches the full capacity within the preset time period reaches a preset number, it is determined that the host resources are exhausted, and the exhaustion of the host resources is determined as the root cause of the database alarm.

6. The database alarm processing method according to claim 5, characterized in that The step of, if the number of times that the CPU usage rate or the disk throughput reaches the full capacity within the preset time period reaches a preset number, determining that the host resources are exhausted and determining the exhaustion of the host resources as the root cause of the database alarm includes: If only the number of times that the CPU usage rate reaches the full capacity within the preset time period reaches a preset number, it is determined that the CPU resources of the host are exhausted, and the exhaustion of the CPU resources of the host is determined as the root cause of the database alarm; If only the number of times that the disk throughput reaches the full capacity within the preset time period reaches a preset number, it is determined that the disk throughput resources of the host are exhausted, and the exhaustion of the disk throughput resources of the host is determined as the root cause of the database alarm; If the number of times that both the CPU usage rate and the disk throughput reach the full capacity within the preset time period reach a preset number, it is determined that both the CPU resources and the disk throughput resources of the host are exhausted, and the simultaneous exhaustion of the CPU resources and the disk throughput resources of the host is determined as the root cause of the database alarm.

7. The database alarm processing method according to any one of claims 1 to 6, characterized in that The database alarm processing method further includes: After associating the database type, the alarm metric, the database on-site information, and the determined root cause of the database alarm, sending them to the front-end page for display.

8. A database alarm processing device, characterized in that, The database alarm processing device includes: An acquisition module, configured to acquire the database type and the alarm metric of the database alarm when detecting that a database alarm is generated by a host; A search module, configured to search a preset alarm processing configuration table according to the database type and the alarm metric to obtain the types of database on-site information to be acquired; A collection module, configured to collect the corresponding database on-site information according to the types of database on-site information to be acquired; the collection module is further configured to, when the types of database on-site information to be acquired include storage engine information, session information, host resource information, lock wait information, and slow query information, collect the CPU usage rate, disk throughput, active thread count of the storage engine, and the number of slow query statements of the host within a preset time period; A first determination module, configured to determine the root cause of the database alarm according to the database on-site information; the first determination module is further configured to determine the root cause of the database alarm according to the CPU usage rate, disk throughput, active thread count of the storage engine, and the number of slow query statements of the host within a preset time period.

9. The database alarm processing device according to claim 8, wherein The database alarm processing device further includes: A judgment module, configured to judge whether a host exception alarm is received during the process of collecting the database on-site information, where the host exception alarm includes any one of a disk read-only / disk full alarm, a host downtime alarm, and a database startup process abnormal exit alarm; [[ID= The first determination module is further configured to determine the root cause of the database alarm according to the on-site information of the database when no host exception alarm is received.

10. The database alarm processing device according to claim 8, characterized in that, The first determination module is further configured to: Obtain the peak value of the active thread count of the storage engine within the preset time period; Determine whether the peak value is greater than or equal to a first preset threshold; If the peak value is greater than or equal to the first preset threshold, determine whether the number of slow query statements is greater than or equal to a second preset threshold; If the number of slow query statements is greater than or equal to the second preset threshold, determine whether the host resources are exhausted according to the CPU usage rate and the disk throughput; If the host resources are not exhausted, determine that the full running of the thread count is the root cause of the database alarm.

11. The database alarm processing device according to claim 10, characterized in that, The first determination module is further configured to: Determine whether the number of times the CPU usage rate and the disk throughput reach the full running state within the preset time period reaches a preset number of times; If the number of times the CPU usage rate and the disk throughput reach the full running state within the preset time period does not reach the preset number of times, determine that the host resources are not exhausted.

12. The database alarm processing device according to claim 11, wherein The first determination module is further configured to: If the number of times the CPU usage rate or the disk throughput reaches the full running state within the preset time period reaches the preset number of times, determine that the host resources are exhausted, and determine that the exhaustion of the host resources is the root cause of the database alarm; 13. The database alarm processing device according to claim 12, wherein The first determination module is further configured to: If only the number of times the CPU usage rate reaches the full running state within the preset time period reaches the preset number of times, determine that the CPU resources of the host are exhausted, and determine that the exhaustion of the CPU resources of the host is the root cause of the database alarm; If only the number of times the disk throughput reaches the full running state within the preset time period reaches the preset number of times, determine that the disk throughput resources of the host are exhausted, and determine that the exhaustion of the disk throughput resources of the host is the root cause of the database alarm; If the number of times the CPU usage rate and the disk throughput reach the full running state within the preset time period both reach the preset number of times, determine that the CPU resources and the disk throughput resources of the host are exhausted simultaneously, and determine that the simultaneous exhaustion of the CPU resources and the disk throughput resources of the host is the root cause of the database alarm.

14. A database alarm processing device, characterized in that, The database alarm processing device includes: a memory, a processor, and a database alarm processing program stored on the memory and executable on the processor. When the database alarm processing program is executed by the processor, the steps of the database alarm processing method according to any one of claims 1 to 7 are implemented.

15. A computer-readable storage medium, characterized in that, A database alarm processing program is stored on the computer-readable storage medium. When the database alarm processing program is executed by the processor, the steps of the database alarm processing method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Alarming method and alarming system

    CN104572401A

  • Comprehensive device monitoring system architecture

    CN106487585A