A database fault diagnosis method based on causality
By constructing causal relationship diagrams and regression models of database monitoring indicators, the problem of complex causal relationships in database fault diagnosis is solved, and accurate fault location and efficient system recovery are achieved.
Patent Information
- Application Number
- CN202210348192.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-01
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2042-04-01
AI Technical Summary
In database fault diagnosis with existing technology, the causal relationship between monitoring indicators is complex, making it difficult for technicians to accurately screen key indicators, resulting in low fault location efficiency, and existing methods rely on anomaly detection and depth-first search, causing false positives and false negatives. Overfitting problem.
By collecting monitoring data from the database, we build a causal relationship diagram between monitoring indicators, use fault-free data to build a regression model, calculate the regression error of fault data, use preset calculation formulas to sort monitoring indicators, determine fault locations, and achieve precise faults. position.
It improves the efficiency and accuracy of fault diagnosis, simplifies operations, reduces the workload of technicians, and significantly increases the speed of system recovery.
Smart Images

Figure CN114896090B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of fault diagnosis and causal relationship construction, and in particular to a database fault diagnosis method based on causal relationship. Background Art
[0002] The monitoring indicators of the same database are interrelated and causally related. When a fault occurs in the database, multiple monitoring indicators will change at the same time, interfering with the judgment of technicians. As databases become more and more complex, it is difficult for a single technician to understand every detail of the system, and they rely more and more on monitoring. However, the number of monitoring indicators is also increasing, and understanding the relationship between monitoring indicators is becoming more and more important and difficult for technicians to maintain the system and build intelligent applications based on monitoring data.
[0003] At the same time, causal discovery is committed to finding causal relationships between variables from observational data. Causal discovery based on observational data is an emerging research direction. Although there has been some theoretical development, in practical problems, the construction results of existing methods are still far from the true causal relationship. For example, restriction-based methods rely on statistical conditional independence test tools. However, existing work has shown that there is no universally effective conditional independence test tool. On the other hand, gradient-based methods have the risk of overfitting observed data and ignoring the correctness of causal relationships.
[0004] In addition, Sage and MicroHECL, two construction methods based on causal assumptions, are designed for database characteristics, but they consider fewer types of monitoring indicators and are not universal. Existing methods lack systematic descriptions of more fine-grained monitoring such as machine CPU utilization and more diverse relationships such as service load and service latency.
[0005] Furthermore, monitoring is an important part of big data, which is used to reveal the operating status of the system and facilitate technicians to infer and solve problems when the system behaves in an unexpected way. A monitoring indicator refers to a dimension in monitoring. For example, average response time, number of visits, and access success rate are common monitoring indicators in online service systems such as search engines and online shopping.
[0006] In the prior art, manual positioning: technical personnel check each monitoring data one by one. Depth-first search: The solution based on depth-first search: First, apply anomaly detection technology to screen out abnormal monitoring indicators. Then, perform depth-first traversal along the abnormal monitoring indicators in the causal relationship graph formed between the monitoring indicators, and mark the monitoring indicator where the traversal stops as the root cause. Random walk: Some prior arts calculate the Pearson correlation coefficient, partial correlation coefficient, etc. between the monitoring indicators and the key monitoring indicators at the business level, and then calculate the transition probability matrix based on the causal relationship graph between the monitoring indicators, and finally apply random walk to score and sort each monitoring indicator.
[0007] Disadvantages of existing technologies: Manual positioning methods are time-consuming and labor-intensive. Faced with an increasing amount of monitoring data and dramatically changing monitoring indicators, it is a real problem for database diagnosis that technicians cannot keep up, which seriously lags behind the system's recovery to normal. The method based on depth-first search relies on the performance of anomaly detection technology. False positives and false negatives in anomaly detection will cause the depth-first search method to miss the monitoring indicators that point to the root cause of the system failure. At present, the working mechanism of random walks is unclear, and there is no basis for the calculation of the transition probability matrix. In practical applications, the performance of diagnostic methods based on random walks varies greatly in different databases.
[0008] When a failure occurs, multiple monitoring indicators will change at the same time, interfering with the technicians' judgment. As the system becomes more and more complex, it is difficult for a single technician to understand every detail in the system, and they rely more and more on monitoring. However, the number of monitoring indicators is also increasing. Therefore, when a failure occurs, how to select the most critical one or several monitoring indicators from a large number of monitoring indicators and assist technicians to restore the system to normal becomes an urgent problem to be solved. Summary of the invention
[0009] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.
[0010] To this end, the purpose of the present invention is to propose a database fault diagnosis method based on causality, which can achieve accurate fault location by constructing the causal relationship of monitoring indicators, so as to screen the most critical one or several monitoring indicators from a large number of monitoring indicators and assist technicians to restore the system to normal.
[0011] To achieve the above object, the present invention proposes a database fault diagnosis method based on causality, comprising:
[0012] Collect monitoring data of monitoring indicators of a preset time period in a database, and construct a cause-effect relationship diagram between the monitoring indicators; wherein the monitoring data includes fault data and non-fault data; based on the cause-effect relationship diagram, construct a regression model for the monitoring indicators using the non-fault data; calculate the regression error of the fault data through the regression model; based on the regression error, calculate each of the monitoring indicators through a preset calculation formula to sort the monitoring indicators and obtain an arrangement order of the monitoring indicators; determine the fault location of the database according to the arrangement order of the monitoring indicators and based on the monitoring indicators.
[0013] The causal relationship-based database fault diagnosis method of the embodiment of the present invention selects one or several most critical monitoring indicators from a large amount of monitoring when a fault occurs, and assists technical personnel to restore the system to normal. The implementation method is simple, easy to operate and efficient.
[0014] In addition, the database fault diagnosis method based on causality according to the above embodiment of the present invention may also have the following additional technical features:
[0015] Furthermore, the monitoring indicators include: access status, connection usage, memory usage, disk capacity usage, index usage, network traffic, node status, data query status and / or node log information.
[0016] Furthermore, the calculating of the regression error of the fault data by the regression model includes: for the pre-fault data of the fault data when the fault occurs, calculating the mean value m of the regression error of the pre-fault data to the monitoring index. i and variance s i ; and, the data of the fault process of the fault data, the regression error of the data of the fault process on the monitoring index is e ij .
[0017] Furthermore, the preset calculation formula is:
[0018] z i =max j |e ij -m i | / s i
[0019] Among them, z i It is a statistic that measures whether each monitoring indicator Vi represents a fault.
[0020] Furthermore, the monitoring indicators are constructed into a monitoring indicator set, and the construction of the causal relationship graph between the monitoring indicators includes: dividing the monitoring indicators into corresponding metavariables of the components corresponding to the database architecture, obtaining a first mapping from metavariables to the monitoring indicator set, and a second mapping from ordered metavariable pairs to the monitoring indicator set; constructing a metavariable causal relationship graph based on the causal relationship information between the database architecture and multiple metavariables; constructing a causal relationship graph between the monitoring indicators based on the metavariable causal relationship graph, the first mapping and the second mapping; and instantiating the causal relationship graph between the monitoring indicators into a causal relationship graph between the monitoring indicators of each component instance.
[0021] Furthermore, the database architecture is represented as a call relationship graph Gc=<Vc,Ec> , the causal relationship information between the multiple meta-variables includes: the relationship between the meta-variables within the component AG=<Va,Ea> ; and, mappings AP, AC, AD and AA from metavariable types to metavariable type sets; wherein the AP is a set of cause metavariables from a caller component, the AC is a set of result metavariables in a caller component, the AD is a set of result metavariables in caller components at various levels, and the AA is a set of cause metavariables from caller components at various levels.
[0022] Furthermore, based on Gc, AG, AP, AC, AD, and AA, a metavariable causal relationship diagram Gm is constructed.<Vm,Em> ,include:
[0023] For each component Ci in Vc, each metavariable type Tx in Va, add a metavariable in Vm<Ci,Tx> ; For each component Ci in Vc, for each edge Tx→Ty in Ea, add an edge in Em<Ci,Tx> →<Ci,Ty> ; For each edge Ci→Cj in Ec, each metavariable type Tx in Va, and each metavariable type Ty in AP(Tx), add an edge in Em<Ci,Ty> →<Cj,Tx> ; For each edge Ci→Cj in Ec, each metavariable type Tx in Va, and each metavariable type Ty in AC(Tx), add an edge in Em<Cj,Tx> →<Ci,Ty> For each component Cj in Vc, each ancestor component Ci of Cj in Gc, each metavariable type Tx in Va, and each metavariable type Ty in AD(Tx), add an edge in Em<Cj,Tx> →<Ci,Ty> ; For each component Cj in Vc, each ancestor component Ci of Cj in Gc, each metavariable type Tx in Va, and each metavariable type Ty in AA(Tx), add an edge in Em<Ci,Ty> →<Cj,Tx> .
[0024] Furthermore, the causal relationship diagram between the monitoring indicators is G=<V,E> , traverse the metavariable causal relationship graph Gm in topological order and start from the metavariable with the least cause variable. For each metavariable MVi traversed in sequence, perform the following steps in sequence: make For each monitoring indicator Vy in M(MVi), perform the first case processing; for each cause metavariable MVj of MVi in Gm, perform the second case processing; for each monitoring indicator Vx in P(MVi) and each monitoring indicator Vy in R(MVi), add Vx→Vy to E; if Then let R(MVi)=P(MVi).
[0025] Furthermore, the processing of the first case includes: if RM(Vy) contains only one metavariable MVi, Vy is added to R(MVi) and V respectively; if RM(Vy) contains multiple metavariables, but there are metavariables in RM(Vy) other than MVi that have not been accessed when constructing the causal relationship diagram between the monitoring indicators, no operation is performed; if RM(Vy) contains multiple metavariables, and all metavariables in RM(Vy) other than MVi have been accessed when constructing the causal relationship diagram between the monitoring indicators, then
[0026] Add Vy to P(MVi) and V respectively; and, for each monitoring indicator Vx in the metavariable MVj and R(MVj) except MVi in RM(Vy), add Vx→Vy to E; the second case processing includes: if Then for each monitoring indicator Vx in R(MVj), add Vx to P(MVi); if Then for each monitoring indicator Vx in R(MVj) and each monitoring indicator Vy in IV(MVj,MVi), add Vy to P(MVi) and V respectively, and add Vx→Vy to E.
[0027] Furthermore, the causal relationship graph G between the monitoring indicators is instantiated into a causal relationship graph Gi between the monitoring indicators of each component instance. For each edge in E<Ci,x> →<Cj,y> , where x and y are monitoring indicator names, and are processed in the following two cases: If Ci = Cj, then for each instance u of component Ci,<Ci,u,x> →<Ci,u,y> Add graph Gi; if Ci≠Cj, then for each instance u of component Ci and each instance v of component Cj,<Ci,u,x> →<Cj,v,y> Added figure Gi.
[0028] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0030] Figure 1 A flowchart of a database fault diagnosis method based on causality according to an embodiment of the present invention;
[0031] Figure 2 A schematic diagram of the overall process of constructing a causal relationship of monitoring indicators according to an embodiment of the present invention;
[0032] Figure 3 The figure is an example diagram of the calling relationship between the SQL processing logic and the memory architecture of the Oracle database according to an embodiment of the present invention. DETAILED DESCRIPTION
[0033] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present invention will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0034] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0035] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0036] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0037] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may include that the first and second features are in direct contact, or may include that the first and second features are not in direct contact but are in contact through another feature between them. Moreover, a first feature being "above", "above" and "above" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is higher in level than the second feature. A first feature being "below", "below" and "below" a second feature includes that the first feature is directly above and obliquely above the second feature, or simply indicates that the first feature is lower in level than the second feature.
[0038] The following describes a database fault diagnosis method based on causality according to an embodiment of the present invention with reference to the accompanying drawings.
[0039] Figure 1 The flowchart of a database fault diagnosis method based on causality according to an embodiment of the present invention.
[0040] like Figure 1 As shown, the method includes but is not limited to the following steps:
[0041] Step S1, collecting monitoring data of monitoring indicators in a preset time period from a database, and constructing a cause-effect relationship diagram between the monitoring indicators; wherein the monitoring data includes fault data and non-fault data.
[0042] Specifically, the operating status of the database, including problems to be optimized and / or fault problems, will be reflected in the specific status indicator characteristic information. In order to realize the automatic optimization processing of the database, the embodiment of the present invention needs to pre-set some status indicators as monitoring objects, and collect the corresponding database monitoring indicators by monitoring these status indicators. Among them, the monitoring is carried out continuously so as to timely discover the problems existing in the database cluster. These preset status indicators include but are not limited to the following indicators: access status, connection number occupancy, memory occupancy, disk capacity occupancy, index usage, network traffic, node status, data query status and / or node log information.
[0043] The preset time period can be selected according to the time to be optimized and / or the faults to be concerned about. In this embodiment, monitoring data corresponding to the preset time period is collected from the state information of the monitored database and stored in the database, so as to facilitate the construction of a cause-effect relationship diagram for the monitoring data. The monitoring data includes fault data and non-fault data.
[0044] It is understandable that the present invention maps the database failure to intervention in the causal inference theory, and assumes that the intervention that causes the change of the monitoring index is the failure that needs to be considered in the database according to the Occam's razor principle.<V,E> , V is the set of all monitoring indicators, E is the set of edges (causal relationships) between monitoring indicators, and the set of parent nodes (causal variables) of any monitoring indicator Vi in G is Pa(Vi). According to the causal inference theory, the following judgment conditions can be obtained:
[0045] “A monitoring indicator Vi is part of the intervention” is equivalent to “P(Vi|Pa(Vi)=pa(Vi),do(Vi=vi))≠P(Vi|Pa(Vi)=pa(Vi))”;
[0046] Among them, "do" stands for the do-calculus, which is the mathematical symbol for "intervention" in causal inference;
[0047] P(Vi|Pa(Vi)=pa(Vi),do(Vi=vi)) on the left side of the inequality sign represents the probability distribution after intervention, that is, the distribution of the values of the monitoring indicator Vi when the cause variable takes a given value after the fault occurs;
[0048] P(Vi|Pa(Vi)=pa(Vi)) on the right side of the inequality sign represents the intervention distribution when no intervention occurs, that is, the value distribution of the monitoring indicator Vi when the cause variable takes a given value before the fault occurs.
[0049] Furthermore, in order to better understand the relationship construction, the present embodiment describes the monitoring indicators as monitoring variables, and the database architecture can be represented as a call relationship graph Gc=<Vc,Ec> . Taking an Oracle database as an example, each SQL request needs to execute three components in the architecture after being received by the database server: parsing (Parse), hard parsing (HardParse), and execution (Execute). In this example, Vc = {Server, Parse, HardParse, Execute} is the component set, and Ec = {Server→Parse, Server→HardParse, Server→Execute} is the call relationship between components. The call relationship graph can have different granularities. For example, the memory structure of the Oracle database can be subdivided into BufferCache, Redo Log Buffer, etc., and these components further occupy memory resources (respectively "call" memory). Figure 3 This is an example of the calling relationship between the SQL processing logic and memory architecture within the Oracle database, such as Figure 3 shown.
[0050] For the monitoring indicators of each component in the database, the present invention divides them into four categories of metavariables: input distribution (I), output distribution (O), response time distribution (L), and resource utilization distribution (S). Among them, the monitoring indicators that cannot be classified into the first three categories can be considered to describe some abstract resources in the system and thus be classified into the fourth category. A metavariable (MV) is a tuple of a component and a metavariable type. For example, a metavariable<Server,L> Describes the overall response time distribution of the database. The "SQL time per second" of the database can be included in this metavariable.
[0051] In view of the characteristics of the database, the present invention introduces the following five groups of causal assumptions between meta-variables.
[0052] 1) The relationship between the meta-variables in the component is AG (Assumed Graph). AG =<Va,Ea> , where Va={I,O,L,S} represents all metavariable types. Ea={I→O,I→L,I→S,L→O,S→O,S→L} represents the relationship between metavariables within a component. The input (I) of the database is considered as the cause of other metavariables, the output (O) is considered as the result of other metavariables, and the resource utilization (S) is considered as a constraint on the response time (L).
[0053] 2) The cause metavariable set AP (Assumed Parents) from the calling component. AP is a mapping from metavariable type to metavariable type set. Specifically, AP(I) = {I}. For example, in the aforementioned Oracle database, the input of HardParse is determined by the input of Server. That is, the output, response time, and resource utilization of a component are not directly affected by the caller.
[0054] 3) The result metavariable set AC (Assumed Children) in the calling component. AC is a mapping from metavariable type to metavariable type set. Specifically, AC(O) = {O}, AC(L) = {L}. For example, in the aforementioned Oracle database, the output and response time of the Server are affected by components such as Parse, HardParse, and Execute. That is, the input and resource utilization of a component cannot directly affect the caller.
[0055] 4) The set of result meta-variables AD (Assumed Descendents) of each level of calling component. AD is a mapping from the meta-variable type to the set of meta-variable types. Specifically, AD(O) = {O}. For example, in the aforementioned Oracle database, the output of Server is affected by the output of HardParse and then by the output of Data Dictionary Cache. The difference in the meaning between AD(O) and AC(O) is that monitoring the output distribution of HardParse may miss some information in the output distribution of Data Dictionary Cache, and AD(O) explicitly adds this limitation in combination with the characteristics of the database. And that is, the cascading effect of other meta-variable types is not considered.
[0056] 5) The set of cause meta-variables AA (Assumed Ancestors) from each level of calling component. AA is a mapping from the meta-variable type to the set of meta-variable types. In the present invention, for the integrity of the design, the present invention still explicitly defines AA.
[0057] The above causal assumptions enrich the types of monitoring metrics and the relationships between monitoring metrics discussed in the prior art. Based on the database architecture information and the causal assumptions between meta-variables, the present invention first refines the database architecture into the causal relationships between meta-variables, and then into the causal relationships between monitoring variables. Table 1 summarizes the notations used in the present invention and their meanings.
[0058] Table 1
[0059]
[0060]
[0061] As an example, as Figure 2 shown:
[0062] First, for the division of monitoring variables: technicians divide the monitoring variables into the corresponding meta-variables of the database corresponding components, and obtain the following two pieces of information:
[0063] Step 1-1: The mapping M from the meta-variable to the set of monitoring variables, the first mapping. For example, M(<Server,L>) = {<Server, SQL time per second>} means that the monitoring variable "SQL time per second" of Server belongs to the meta-variable <Server,L>. The same monitoring variable can correspond to the meta-variables of multiple components. For example, "performing logical reads" as a separate monitoring variable is calculated from the input distributions of two components, Server and BufferCache.
[0064] Step 1-2: Mapping IV (Intermediating Variables) from ordered meta-variable pairs to monitoring variable sets, i.e., the second mapping. For example, IV (<BufferCache,T> ,<Storage,T> )={<Oracle,db file parallel read>}, indicating that the monitoring variable "db file parallel read" of the Oracle database is a metavariable<BufferCache,T> Metavariable<Storage,T> A mediating variable that affects<BufferCache,T> right<Storage,T> The impact is reflected through "db file parallel read", and<BufferCache,T> no<Storage,T> The direct cause.
[0065] Furthermore, the metavariable causal relationship is constructed:
[0066] Based on Gc, AG, AP, AC, AD, and AA, a causal relationship diagram Gm is constructed between metavariables.<Vm,Em> This step is broken down into the following steps:
[0067] Step 2-1: For each component Ci in Vc and each metavariable type Tx in Va, add a metavariable in Vm<Ci,Tx> .
[0068] Step 2-2: For each component Ci in Vc, for each edge Tx→Ty in Ea, add an edge in Em<Ci,Tx> →<Ci,Ty> .
[0069] Step 2-3: For each edge Ci→Cj in Ec, each metavariable type Tx in Va, and each metavariable type Ty in AP(Tx), add an edge in Em<Ci,Ty> →<Cj,Tx> .
[0070] Step 2-4: For each edge Ci→Cj in Ec, each metavariable type Tx in Va, and each metavariable type Ty in AC(Tx), add an edge in Em<Cj,Tx> →<Ci,Ty> .
[0071] Step 2-5: For each component Cj in Vc, each ancestor component Ci of Cj in Gc, each metavariable type Tx in Va, and each metavariable type Ty in AD(Tx), add an edge in Em<Cj,Tx> →<Ci,Ty> .
[0072] “Each ancestor component Ci of Cj in Gc” means that there are some components Cx, Cy, ..., Cz such that Ci→Cx,
[0073] Cx→Cy, ..., Cz→Cj are all elements of Ec, or Ci→Cj are elements of Ec.
[0074] Step 2-6: For each component Cj in Vc, each ancestor component Ci of Cj in Gc, each metavariable type Tx in Va, and each metavariable type Ty in AA(Tx), add an edge in Em<Ci,Ty> →<Cj,Tx> .
[0075] Furthermore, monitor the variables filling:
[0076] Construct a monitoring variable causal relationship diagram G based on Gm, M, and IV<V,E> The design of this step requires special consideration of the following two factors:
[0077] A metavariable may not have a corresponding monitoring variable. To this end, let R be a mapping from metavariables to monitoring variables. For any metavariable MVi, R(MVi) represents the monitoring variables contained in MVi for the result metavariable of MVi; when MVi has no corresponding monitoring variable, R(MVi) inherits the monitoring variables of the cause metavariable of MVi in Gm.
[0078] A monitoring variable may correspond to multiple metavariables. For this reason, let RM be a mapping from monitoring variables to metavariable sets. RM has the opposite meaning to M. For any monitoring variable Vi, RM(Vi) represents all metavariables corresponding to Vi.
[0079] Traverse Gm in topological order and start from the metavariable with the least cause variables. For each metavariable MVi traversed in sequence, perform the following steps in sequence:
[0080] Step 3-1: Order make
[0081] Step 3-2: For each monitoring variable Vy in M(MVi), process it in the following three cases:
[0082] Step 3-2-1: If RM(Vy) contains only one metavariable MVi, add Vy to R(MVi) and V respectively.
[0083] Step 3-2-2: If RM(Vy) contains multiple metavariables, but there are metavariables in RM(Vy) other than MVi that have not been visited in the topological traversal of Gm starting from the metavariable with the least cause variables, no operation is performed. This step is to avoid introducing self-loops when one monitoring variable corresponds to multiple metavariables.
[0084] Step 3-2-3: If RM(Vy) contains multiple metavariables, and all metavariables in RM(Vy) except MVi have been visited in the above steps, then:
[0085] Add Vy to P(MVi) and V respectively;
[0086] For each metavariable MVj in RM(Vy) except MVi and each monitored variable Vx in R(MVj), add Vx→Vy to E.
[0087] Step 3-3: For each cause metavariable MVj of MVi in Gm, the following two cases are processed:
[0088] Step 3-3-1: If Then for each monitored variable Vx in R(MVj), add Vx to P(MVi).
[0089] Step 3-3-2: If Then for each monitored variable Vx in R(MVj) and each monitored variable Vy in IV(MVj,MVi), add Vy to P(MVi) and V respectively, and add Vx→Vy to E.
[0090] Step 3-4: For each monitored variable Vx in P(MVi) and each monitored variable Vy in R(MVi), add Vx→Vy to E.
[0091] Step 3-5: If Then let R(MVi)=P(MVi).
[0092] Furthermore, the component is instantiated:
[0093] In a database, the same component may have multiple instances. For example, the database can adopt the master-slave mode, and the database DB corresponds to two instance databases DB1 and DB2; in the aforementioned Oracle database, multiple storage devices can be used. The obtained G is instantiated into a causal relationship graph Gi between the monitoring variables of each component instance. For each edge in E<Ci,x> →<Cj,y> , where x and y are the names of monitoring variables, and are processed in the following two cases:
[0094] Step 4-1: If Ci = Cj, then for each instance u of component Ci,<Ci,u,x> →<Ci,u,y> Added figure Gi.
[0095] Step 4-2: If Ci≠Cj, then for each instance u of component Ci and each instance v of component Cj,<Ci,u,x> →<Cj,v,y> Added figure Gi.
[0096] As an implementation method, the causal assumptions and step monitoring variable division and metavariable causal relationship construction in the present invention are proposed for the database. Causal assumptions and metavariable causal relationship construction methods unique to other technical fields are not included in the present invention. However, if other technical fields also adopt the technical route of first constructing metavariable causal relationships and then constructing monitoring variable causal relationship diagrams by filling in monitoring variables, the step monitoring variable filling and component instantiation of the present invention are also applicable. The specific values of the five groups of causal assumptions AG, AP, AC, AD, and AA proposed in the present invention as key parameters should not be regarded as limitations on the present invention. Within the design framework of the present invention, replacing the causal assumptions can still construct monitoring variable causal relationships through the steps included in the present invention.
[0097] Step S2, based on the cause-effect relationship diagram, a regression model is constructed for the monitoring indicators using the fault-free data.
[0098] Specifically, for each monitoring variable Vi, a regression model of Vi versus Pa(Vi) is constructed using fault-free data.
[0099] The embodiment of the present invention does not specifically limit the design of the regression model. Those skilled in the art can select existing regression techniques according to the characteristics of the system, such as linear regression, support vector regression (SVR) using nonlinear kernel functions, recursive neural networks (RNN) suitable for time series with obvious autoregressive characteristics, etc.
[0100] Furthermore, the regression model can be constructed using historical data before a fault occurs, or it can be constructed online when a fault occurs with the help of data from a period of time before the fault occurs. The former has a large amount of data and sufficient time, so a complex regression model can be used; the latter uses data that is close to the latest state of the system, but due to the timeliness of fault diagnosis, a lightweight regression model needs to be used.
[0101] Step S3, calculating the regression error of the fault data through the regression model.
[0102] Specifically, after a fault occurs, the constructed regression model is applied to the data of a period of time during the fault process (for example, 10 minutes before the fault is discovered) and a period of time before the fault (for example, 2 hours before the detected fault occurs, which does not overlap with the previous period). For each monitoring variable Vi, the regression error of each data point of Vi in these two periods is calculated:
[0103] For the pre-fault data, the mean value m of the regression error of Vi is calculated i and variance s i .
[0104] For the data during the fault process, the regression error of Vi is recorded as e ij .
[0105] Step S4, based on the regression error, each monitoring indicator is calculated by a preset calculation formula to sort the monitoring indicators to obtain an arrangement order of the monitoring indicators.
[0106] Specifically, after a fault occurs, z is calculated for each monitoring variable Vi i =max j |e ij -m i | / s i Among them, z i It is a statistic that measures whether each monitoring indicator Vi represents a fault. This formula is used to unify the standard deviation of the regression errors of different monitoring variables for easy comparison. The monitoring indicator arrangement order is obtained by sorting the monitoring indicators.
[0107] Step S5, arranging the order according to the monitoring indicators, and determining the fault location of the database based on the monitoring indicators.
[0108] Specifically, after a fault occurs, according to the z calculated above i By sorting the monitoring variables, the technician can determine the location of the database failure as early as possible when checking the monitoring variables in the order recommended by the present invention.
[0109] The beneficial effects of the embodiments of the present invention can be measured by the recall rate when only the top k monitoring variables are considered, denoted as AC@k. Based on the monitoring data and fault cases collected from the Oracle database, Table 2 compares the present invention with the prior art. Compared with these three solutions, the present invention significantly improves the performance of fault diagnosis. The three solutions compared are:
[0110] Depth-first search is performed, and thresholds are set for the Pearson correlation coefficients of monitoring variables and business indicators during traversal.
[0111] Random walk, calculates the transition probability matrix based on the partial correlation coefficients of monitoring variables and business indicators.
[0112] ENMF,builds ARX models between monitored variables pairwise and models the fault propagation,process.
[0113] Table 2 Effects of different fault diagnosis techniques
[0114] Fault diagnosis technology AC@1 AC@3 AC@5 Depth-First Search 0.278 0.419 0.449 Random Walk 0.101 0.338 0.475 ENMF 0.126 0.293 0.389 The present invention 0.328 0.601 0.677
[0115] In the embodiments of the present invention, accurate fault location can be achieved by constructing a causal relationship among monitoring indicators, so as to select the most critical one or several monitoring indicators from a large number of monitoring indicators and assist technical personnel in restoring the system to normal.
[0116] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0117] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention without departing from the principles and purpose of the present invention.
Claims
1. A database fault diagnosis method based on causality, It is characterized in that The following steps are involved: Collect monitoring data of monitoring indicators of a preset time period in the database, and construct a causal relationship diagram between the monitoring indicators; wherein the monitoring data includes fault data and non-fault data; wherein, The database architecture is represented by a call relationship graph Gc=<Vc,Ec> , causal relationship information between multiple meta-variables, including: The relationship between metavariables within a component AG<Va,Ea> ;as well as, A mapping from metavariable types to metavariable type sets: AP, AC, AD, and AA; wherein the AP is a set of cause metavariables from a caller component, the AC is a set of result metavariables in a caller component, the AD is a set of result metavariables in caller components at various levels, and the AA is a set of cause metavariables from caller components at various levels; Construct the metavariable causal relationship diagram Gm based on Gc, AG, AP, AC, AD, and AA.<Vm,Em> ,include: For each component Ci in Vc, each metavariable type Tx in Va, add a metavariable in Vm<Ci,Tx> ; For each component Ci in Vc, for each edge Tx→Ty in Ea, add an edge in Em<Ci,Tx> →<Ci,Ty> ; For each edge Ci→Cj in Ec, each metavariable type Tx in Va, and each metavariable type Ty in AP(Tx), add an edge in Em<Ci,Ty> →<Cj,Tx> ; For each edge Ci→Cj in Ec, each metavariable type Tx in Va, and each metavariable type Ty in AC(Tx), add an edge in Em<Cj,Tx> →<Ci,Ty> ; For each component Cj in Vc, each ancestor component Ci of Cj in Gc, each metavariable type Tx in Va, and each metavariable type Ty in AD(Tx), add an edge in Em<Cj,Tx> →<Ci,Ty> ; For each component Cj in Vc, each ancestor component Ci of Cj in Gc, each metavariable type Tx in Va, and each metavariable type Ty in AA(Tx), add an edge in Em<Ci,Ty> →<Cj,Tx> ; The causal relationship diagram between the monitoring indicators is G=<V,E> , traverse the metavariable causal relationship graph Gm in topological order and start from the metavariable with the least causal variables. For each metavariable MVi traversed in sequence, perform the following steps in sequence: make make For each monitoring indicator Vy in M(MVi), the first case processing is performed; For each cause metavariable MVj of MVi in Gm, the second case is processed; For each monitoring indicator Vx in P(MVi) and each monitoring indicator Vy in R(MVi), add Vx→Vy to E; like Then let R(MVi)=P(MVi); The processing of the first situation includes: If RM(Vy) contains only one metavariable MVi, then Vy is added to R(MVi) and V respectively; If RM(Vy) contains multiple metavariables, but there are metavariables in RM(Vy) other than MVi that have not been accessed when constructing the causal relationship graph between the monitoring indicators, no operation is performed; If RM(Vy) contains multiple metavariables, and all metavariables in RM(Vy) except MVi have been visited when constructing the causal relationship diagram between the monitoring indicators, then Add Vy to P(MVi) and V respectively; and, For each monitoring indicator Vx in the metavariable MVj and R(MVj) except MVi in RM(Vy), add Vx→Vy to E; The processing of the second situation includes: like Then for each monitoring indicator Vx in R(MVj), add Vx to P(MVi); like Then for each monitoring index Vx in R(MVj) and each monitoring index Vy in IV(MVj,MVi), add Vy to P(MVi) and V respectively, and add Vx→Vy to E; Based on the cause-effect relationship diagram, a regression model is constructed for the monitoring index using the fault-free data; Calculating the regression error of the fault data by using the regression model; Based on the regression error, each of the monitoring indicators is calculated by a preset calculation formula to sort the monitoring indicators to obtain an arrangement order of the monitoring indicators; The monitoring indicators are arranged in order, and the fault location of the database is determined based on the monitoring indicators.
2. The method according to claim 1, It is characterized in that The monitoring indicators include: access status, connection usage, memory usage, disk capacity usage, index usage, network traffic, node status, data query status and / or node log information.
3. The method according to claim 1, It is characterized in that The calculating the regression error of the fault data by using the regression model includes: For the pre-fault data of the fault data when the fault occurs, the mean value m of the regression error of the pre-fault data to the monitoring index is calculated i and variance s i ;as well as, The data of the fault process of the fault data is calculated, and the regression error of the data of the fault process to the monitoring index is calculated as e ij .
4. The method according to claim 1, It is characterized in that The preset calculation formula is: z i =max j |e ij -m i | / s i Among them, z i It is a statistic that measures whether each monitoring indicator Vi represents a fault.
5. The method according to claim 1, It is characterized in that The monitoring indicators are constructed into a monitoring indicator set, and the step of constructing a causal relationship diagram between the monitoring indicators includes: Dividing the monitoring indicators into corresponding metavariables of the corresponding components of the database architecture, obtaining a first mapping from the metavariables to the monitoring indicator set, and a second mapping from the ordered metavariable pairs to the monitoring indicator set; Constructing a metavariable causal relationship graph based on the database architecture and causal relationship information between multiple metavariables; Constructing a causal relationship diagram between the monitoring indicators based on the metavariable causal relationship diagram, the first mapping, and the second mapping; The causal relationship diagram between the monitoring indicators is instantiated as a causal relationship diagram between the monitoring indicators of each component instance.
6. The method according to claim 1, It is characterized in that The causal relationship graph G between the monitoring indicators is instantiated into the causal relationship graph Gi between the monitoring indicators of each component instance. For each edge in E<Ci,x> →<Cj,y> , where x and y are the names of monitoring indicators, and are processed in the following two situations: If Ci = Cj, then for each instance u of component Ci,<Ci,u,x> →<Ci,u,y> Add graph Gi; If Ci≠Cj, then for each instance u of component Ci and each instance v of component Cj,<Ci,u,x> →<Cj,v,y> Added figure Gi.
