A database health state evaluation method and device, a terminal and a medium

By periodically collecting and analyzing database monitoring indicator data, and combining thresholds and weighting coefficients, the instantaneous and actual health status of the database is evaluated, solving the problem of misjudgment in existing technologies and achieving a more accurate health status assessment.

CN115904908BActive Publication Date: 2026-08-04GUANGZHOU QUYAN NETWORK TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU QUYAN NETWORK TECH CO LTD
Filing Date
2022-12-22
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing database health monitoring methods are limited and prone to misjudgment in practical applications.

Method used

By periodically collecting database monitoring indicator data, and combining it with preset monitoring indicator thresholds and health weight coefficients, the health status and score of the indicators are calculated to determine the instantaneous health status. The actual health status is then determined by the proportion within a preset time period.

Benefits of technology

It avoids misjudging short-term fluctuations in the database's state during operation as unhealthy, and provides a more accurate health status assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115904908B_ABST
    Figure CN115904908B_ABST
Patent Text Reader

Abstract

The application discloses a database health state evaluation method and device, a terminal and a medium. According to the scheme, the monitoring index data of the database is collected at a fixed time, the index health state and the index health score of each monitoring index data of the database are calculated through a formulated scoring model, the current instantaneous health state of the database is judged, the instantaneous health states in a time period are summarized for comprehensive evaluation, and the actual health state of the database is obtained, so that the technical problem that the existing database health monitoring means is relatively single and is prone to misjudgment of temporary state fluctuation in actual application is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, terminal and medium for assessing the health status of a database. Background Technology

[0002] In today's internet age, the internet and big data applications have penetrated into all walks of life. The health of a database directly affects the collection and storage of big data, as well as the normal operation of related applications. Therefore, accurately assessing the health of a database is of great significance.

[0003] Existing database instance monitoring methods typically involve periodically collecting database monitoring metrics, configuring alarm thresholds for each metric (such as CPU utilization, memory utilization, disk utilization, and QPS), and triggering an alarm when a single metric exceeds the threshold. However, this monitoring method is relatively simplistic and prone to misjudgments in practical applications. Summary of the Invention

[0004] This application provides a database health status assessment method, device, terminal, and medium to address the technical problem that existing database health monitoring methods are relatively simple and prone to misjudgment in practical applications.

[0005] To address the aforementioned technical problems, the first aspect of this application provides a database health status assessment method, comprising:

[0006] Regularly collect monitoring metrics data from the database;

[0007] Based on the monitoring indicator data, combined with preset monitoring indicator thresholds and health weight coefficients, the indicator health status and indicator health score of the monitoring indicator data are obtained, so as to determine the instantaneous health status of the database based on the indicator health status and the indicator health score. The indicator health status is obtained by comparing the monitoring indicator data with the monitoring indicator thresholds, and the indicator health score is calculated based on the monitoring indicator data, the monitoring indicator thresholds, and the health weight coefficients using a health score calculation formula.

[0008] The instantaneous health status of the database is statistically analyzed within a preset time period, and the actual health status of the database is determined based on the proportion of each instantaneous health status within the preset time period.

[0009] Preferably, the health status of the monitoring indicator data and the health status of the database are both categorized as: severe, busy, or healthy.

[0010] Preferably, the monitoring indicator thresholds include: a first threshold and a second threshold, wherein the health level indicated by the first threshold is higher than the health level indicated by the second threshold.

[0011] Preferably, the formula for calculating the health score is as follows:

[0012] F i =(D i -Y i ) / (R i -Y i )*W i

[0013] In the formula, F i To monitor the health score of indicator data i, D i Y is the current monitoring value of the monitoring indicator data i. i R is the first threshold value of the monitoring indicator data i. i W is the second threshold value for the monitoring indicator data i. i The health weight coefficient of the monitoring indicator data i.

[0014] Preferably, determining the instantaneous health status of the database based on the health status of the indicator and the health score of the indicator specifically includes:

[0015] When there is monitoring indicator data with a critical health status, the instantaneous health status of the database is determined to be critical.

[0016] When there are no monitoring indicators with a severe health status but there are monitoring indicators with a busy health status, the sum of the health scores of each busy monitoring indicator is calculated. If the sum of the health scores reaches a preset sum threshold, the instantaneous health status of the database is determined to be severe; otherwise, the instantaneous health status of the database is determined to be busy.

[0017] If there is no monitoring indicator data with a critical or busy health status, then the instantaneous health status of the database is determined to be healthy.

[0018] Preferably, determining the actual health status of the database based on the proportion of each instantaneous health status within a preset time period specifically includes:

[0019] When the proportion of severe transient health status exceeds the first proportion threshold, the actual health status of the database is determined to be severe.

[0020] When the proportion of severe transient health status does not exceed the first proportion threshold but exceeds the second proportion threshold, the actual health status of the database is determined to be busy.

[0021] When the proportion of severe transient health states does not exceed the second proportion threshold, the actual health state of the database is determined to be healthy.

[0022] Preferably, the monitoring metrics data specifically include: CPU utilization, memory utilization, disk utilization, disk IO bandwidth utilization, IOPS utilization, connection utilization, QPS, and the number of slow logs, or CPU utilization, memory utilization, connection utilization, bandwidth utilization, flow control attempts, QPS, and the number of slow log occurrences.

[0023] A second aspect of this application provides a database health status assessment device, comprising:

[0024] The indicator data acquisition unit is used to periodically collect monitoring indicator data from the database.

[0025] The instantaneous health status determination unit is used to obtain the indicator health status and indicator health score of the monitoring indicator data based on the monitoring indicator data and in combination with the preset monitoring indicator threshold and health weight coefficient, so as to determine the instantaneous health status of the database based on the indicator health status and the indicator health score. The indicator health status is obtained by comparing the monitoring indicator data with the monitoring indicator threshold, and the indicator health score is calculated based on the monitoring indicator data, the monitoring indicator threshold and the health weight coefficient through a health score calculation formula.

[0026] The actual health status determination unit is used to statistically analyze the instantaneous health status of the database within a preset time period, and determine the actual health status of the database based on the proportion of each instantaneous health status within the preset time period.

[0027] A third aspect of this application provides a database health status assessment terminal, comprising: a memory and a processor;

[0028] The memory is used to store program code, which corresponds to the database health status assessment method provided in the first aspect of this application.

[0029] The processor is used to execute the program code.

[0030] The fourth aspect of this application provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores program code, the program code corresponding to the database health status assessment method provided in the first aspect of this application.

[0031] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0032] The proposed solution collects monitoring index data from the database at regular intervals. Using a defined scoring model, it calculates the health status and health score of each monitoring index data, thereby determining the current instantaneous health status of the database. Then, by summarizing the instantaneous health status over a period of time, a comprehensive evaluation is performed to obtain the actual health status of the database. This solution solves the technical problem that existing database health monitoring methods are relatively simple and prone to misjudging temporary fluctuations in practical applications. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0034] Figure 1 This is a flowchart illustrating an embodiment of a database health status assessment method provided in this application.

[0035] Figure 2 This is a flowchart illustrating another embodiment of a database health status assessment method provided in this application.

[0036] Figure 3 This is a flowchart illustrating one embodiment of a database health status assessment device provided in this application. Detailed Implementation

[0037] Existing monitoring methods are relatively limited, only allowing the configuration of alarm thresholds for a single monitoring metric at a single monitoring point. Exceeding the threshold triggers an alarm. However, this situation could simply be due to a temporary increase in workload over a short period, causing increased pressure, and does not necessarily indicate that the database instance is unhealthy. Current monitoring methods cannot effectively identify such special states, leading to misjudgments.

[0038] In view of this, embodiments of this application provide a database health status assessment method, apparatus, terminal, and medium to solve the technical problem that existing database health monitoring methods are relatively simple and prone to misjudgment in practical applications.

[0039] To make the inventive objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0040] Please see Figure 1 The first embodiment of this application provides a database health status assessment method, including:

[0041] Step 101: Periodically collect monitoring indicator data from the database.

[0042] If the monitored database is a relational database such as MySQL or a distributed file storage database such as MongoDB, the monitoring metrics may include: CPU utilization, memory utilization, disk utilization, disk I / O bandwidth utilization, IOPS utilization, connection utilization, QPS, and the number of slow log entries. If the monitored database is an in-memory database such as Redis, the monitoring metrics may include: CPU utilization, memory utilization, connection utilization, bandwidth utilization, flow control attempts, QPS, and the number of slow log entries.

[0043] Step 102: Based on the monitoring indicator data, combined with the preset monitoring indicator thresholds and health weight coefficients, obtain the indicator health status and indicator health score of the monitoring indicator data, so as to determine the instantaneous health status of the database based on the indicator health status and indicator health score.

[0044] It should be noted that, firstly, the collection of various monitoring indicators in the database is triggered periodically through preset timed triggering logic. Then, based on the collected monitoring indicator data, combined with preset monitoring indicator thresholds and health weight coefficients, the health status and health score of the monitoring indicator data are obtained through comparison and calculation. Finally, based on the health status and health score of each monitoring indicator, the instantaneous health status of the database at the current moment is determined.

[0045] In the embodiments provided in this application, the health status of the monitoring indicators and the health status of the database can be divided into three categories: red, yellow, and green, representing three states: severe, busy, and healthy, respectively. Among them, severe-red: indicates that the current state is severely unhealthy and needs to be followed up and dealt with immediately; busy-yellow: indicates that the current state is busy and needs to be closely monitored; and healthy-green: indicates that the current state is healthy and idle.

[0046] Among them, the health status of the indicator is obtained by comparing the monitoring indicator data with the monitoring indicator threshold, and the health score of the indicator is calculated based on the monitoring indicator data, the monitoring indicator threshold, and the health weight coefficient, using the health score calculation formula.

[0047] Step 103: Statistically analyze the instantaneous health status of the database within a preset time period, and determine the actual health status of the database based on the proportion of each instantaneous health status within the preset time period.

[0048] Next, by repeatedly executing steps 101 and 102 within a preset time period, the instantaneous health status of multiple databases is obtained. The instantaneous health status obtained within the preset time period is then statistically analyzed. Based on the proportion of each instantaneous health status within the preset time period, the actual health status of the database is determined.

[0049] The solution in this embodiment collects monitoring index data of the database at regular intervals. Through a defined scoring model, it calculates the health status and health score of each monitoring index data of the database, thereby determining the current instantaneous health status of the database. Then, by summarizing the instantaneous health status over a period of time, a comprehensive evaluation is performed to obtain the actual health status of the database. This method avoids judging transient state fluctuations during database operation as unhealthy, and solves the technical problem that existing database health monitoring methods are relatively simple and prone to misjudging temporary state fluctuations in practical applications.

[0050] The above content is a detailed description of the first embodiment of the database health status assessment method provided by this application. The following is a detailed description of the second embodiment of the database health status assessment method provided by this application.

[0051] Please see Figure 2 Based on the content of the first embodiment described above, the second embodiment of this application provides a database health status assessment method, the specific scheme of which is as follows:

[0052] Furthermore, the monitoring indicator thresholds include: a first-level threshold and a second-level threshold, wherein the health level indicated by the first-level threshold is higher than that indicated by the second-level threshold.

[0053] In this embodiment, the settings for the monitoring indicator thresholds and health weight coefficients for each monitoring indicator can be referenced in Tables 1 and 2:

[0054] Table 1 Examples of MySQL monitoring metrics and related parameters

[0055]

[0056] Table 2 Examples of Redis monitoring metrics and related parameters

[0057]

[0058]

[0059] Furthermore, the specific formula for calculating the health score is as follows:

[0060] F i =(D i -Y i ) / (R i -Y i )*W i

[0061] In the formula, F i To monitor the health score of indicator data i, D i Y represents the current monitoring value of monitoring indicator data i. i R is the first threshold value for monitoring indicator data i. i W is the second threshold for monitoring indicator data i. i The health weight coefficient for monitoring indicator data i.

[0062] Example 1: For instance, if the current CPU usage of MySQL is 50%, then:

[0063] F CPU = (50% - 30%) / (80% - 30%) * 0.7 = 0.28.

[0064] Example 2: For instance, if the current MySQL CPU usage is 100%, then:

[0065] F CPU = (100% - 30%) / (80% - 30%) * 0.7 = 0.98.

[0066] Furthermore, step 102 in the above embodiments may include the following steps:

[0067] Step 1021: Based on the monitoring indicator data, combined with the preset monitoring indicator thresholds and health weight coefficients, obtain the indicator health status and indicator health score of the monitoring indicator data.

[0068] Step 1022: When there is monitoring indicator data with a severe health status, the instantaneous health status of the database is determined to be severe.

[0069] Step 1023: When there are no monitoring indicator data with a severe health status but there are monitoring indicator data with a busy health status, calculate the sum of the health scores of each busy monitoring indicator data. If the sum of the health scores reaches the preset sum of scores threshold, determine that the instantaneous health status of the database is severe; otherwise, determine that the instantaneous health status of the database is busy.

[0070] Step 1024: When there is no monitoring indicator data with a critical or busy health status, the instantaneous health status of the database is determined to be healthy.

[0071] It should be noted that, assuming each minute is a data collection point, all monitoring indicator data from the database are retrieved. Based on a set threshold, each monitoring indicator is scored and labeled with a health status (red, yellow, green). Finally, the health status of the current data collection point is calculated: if any monitoring indicator under the current data collection point is red, then the health status of this data collection point is red; when no monitoring indicator is red, but there are yellow indicators, all yellow indicators are aggregated, their health scores are added together, and then it is determined whether the accumulated value exceeds a preset accumulated score threshold (default is 3 points, which can be configured according to actual needs). If the accumulated value exceeds the accumulated score threshold, the status of this data collection point is red; otherwise, it is yellow; if no monitoring indicator is red or yellow, the status of this data collection point is green.

[0072] Furthermore, step 103 in the above embodiments may include the following steps:

[0073] Step 1031: Statistically analyze the instantaneous health status of the database within a preset time period;

[0074] Step 1032: When the proportion of severe transient health status exceeds the first proportion threshold, the actual health status of the database is determined to be severe.

[0075] Step 1033: When the proportion of severe transient health status does not exceed the first proportion threshold but exceeds the second proportion threshold, the actual health status of the database is determined to be busy.

[0076] Step 1034: When the proportion of severe transient health status does not exceed the second proportion threshold, the actual health status of the database is determined to be healthy.

[0077] It should be noted that, taking the last 24 hours as an example, all health point data within the last 24 hours are obtained, and the database health status is determined based on the percentage of times the red status point is triggered. If the number of red triggers within the period exceeds 50%, the final result is red; if the percentage of red triggers within the period is greater than 20% but less than 50%, the final result is yellow; otherwise, it is green.

[0078] The above content is a detailed description of the second embodiment of the database health status assessment method provided by this application. The following is a detailed description of an embodiment of a database health status assessment device, terminal and storage medium provided by this application.

[0079] Please see Figure 3 The third embodiment of this application provides a database health status assessment device, including:

[0080] The indicator data acquisition unit 201 is used to periodically collect monitoring indicator data from the database;

[0081] The instantaneous health status determination unit 202 is used to obtain the health status and health score of the monitoring indicator data based on the monitoring indicator data and the preset monitoring indicator threshold and health weight coefficient, so as to determine the instantaneous health status of the database based on the health status and health score. The health status is obtained by comparing the monitoring indicator data with the monitoring indicator threshold, and the health score is calculated based on the monitoring indicator data, the monitoring indicator threshold and the health weight coefficient through the health score calculation formula.

[0082] The actual health status determination unit 203 is used to statistically analyze the instantaneous health status of the database within a preset time period and determine the actual health status of the database based on the proportion of each instantaneous health status within the preset time period.

[0083] The fourth embodiment of this application provides a database health status assessment terminal, including: a memory and a processor;

[0084] The memory is used to store program code, which corresponds to the database health status assessment method provided in the first or second embodiment of this application.

[0085] The processor is used to execute program code to implement the database health status assessment method provided in the first or second embodiment of this application.

[0086] The fifth embodiment of this application provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores program code, which corresponds to the database health status assessment method provided in the first aspect of this application.

[0087] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the terminals, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0088] In the several embodiments provided in this application, it should be understood that the disclosed terminals, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.

[0089] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0090] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0091] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0092] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0093] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for assessing the health status of a database, characterized in that, include: Regularly collect monitoring metrics data from the database; Based on the monitoring indicator data, combined with preset monitoring indicator thresholds and health weight coefficients, the indicator health status and indicator health score of the monitoring indicator data are obtained. This allows for the determination of the instantaneous health status of the database based on the indicator health status and the indicator health score. The indicator health status is obtained by comparing the monitoring indicator data with the monitoring indicator thresholds, which include a first threshold and a second threshold. The first threshold represents a higher level of health than the second threshold. The health score calculation formula is as follows: In the formula, To monitor the health score of indicator data i, The current monitoring value of the monitoring indicator data i is... The first threshold value for the monitoring indicator data i is... The second threshold value for the monitoring indicator data i is... The health weight coefficient of the monitoring indicator data i; The instantaneous health status of the database is statistically analyzed within a preset time period, and the actual health status of the database is determined based on the proportion of each instantaneous health status within the preset time period.

2. The database health status assessment method according to claim 1, characterized in that, The health status of the monitoring indicator data and the health status of the database are both categorized as: severe, busy, or healthy.

3. The database health status assessment method according to claim 2, characterized in that, Determining the instantaneous health status of the database based on the health status and health score of the indicators specifically includes: When there is monitoring indicator data with a critical health status, the instantaneous health status of the database is determined to be critical. When there are no monitoring indicators with a severe health status but there are monitoring indicators with a busy health status, the sum of the health scores of each busy monitoring indicator is calculated. If the sum of the health scores reaches a preset sum threshold, the instantaneous health status of the database is determined to be severe; otherwise, the instantaneous health status of the database is determined to be busy. If there is no monitoring indicator data with a critical or busy health status, then the instantaneous health status of the database is determined to be healthy.

4. The database health status assessment method according to claim 2, characterized in that, The step of determining the actual health status of the database based on the proportion of each instantaneous health status within a preset time period specifically includes: When the proportion of severe transient health status exceeds the first proportion threshold, the actual health status of the database is determined to be severe. When the proportion of severe transient health status does not exceed the first proportion threshold but exceeds the second proportion threshold, the actual health status of the database is determined to be busy. When the proportion of severe transient health states does not exceed the second proportion threshold, the actual health state of the database is determined to be healthy.

5. The database health status assessment method according to claim 1, characterized in that, The monitoring metrics data specifically include: CPU utilization, memory utilization, disk utilization, disk IO bandwidth utilization, IOPS utilization, connection utilization, QPS, and the number of slow logs, or CPU utilization, memory utilization, connection utilization, bandwidth utilization, flow control attempts, QPS, and the number of slow log occurrences.

6. A database health status assessment device, characterized in that, include: The indicator data acquisition unit is used to periodically collect monitoring indicator data from the database. The instantaneous health status determination unit is used to obtain the indicator health status and indicator health score of the monitoring indicator data based on the monitoring indicator data and a preset monitoring indicator threshold and health weight coefficient, so as to determine the instantaneous health status of the database based on the indicator health status and the indicator health score. The indicator health status is obtained by comparing the monitoring indicator data with the monitoring indicator threshold, which includes a first threshold and a second threshold, wherein the health level indicated by the first threshold is higher than the health level indicated by the second threshold. The health score calculation formula is as follows: In the formula, To monitor the health score of indicator data i, The current monitoring value of the monitoring indicator data i is... The first threshold value for the monitoring indicator data i is... The second threshold value for the monitoring indicator data i is... The health weight coefficient of the monitoring indicator data i; The actual health status determination unit is used to statistically analyze the instantaneous health status of the database within a preset time period, and determine the actual health status of the database based on the proportion of each instantaneous health status within the preset time period.

7. A database health status assessment terminal, characterized in that, include: Memory and processor; The memory is used to store program code, which corresponds to the database health status assessment method according to any one of claims 1 to 5; The processor is used to execute the program code.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program code corresponding to the database health status assessment method according to any one of claims 1 to 5.