A root cause analysis method and system for heterogeneous database compatibility anomalies

By obtaining the running information of heterogeneous databases, converting the query statements into abstract syntax trees, determining the dependency analysis results, copying the running environment, comparing the results step by step, and automatically performing root cause analysis, solving the complex and time-consuming process of heterogeneous database compatible exception analysis. The problem of improving efficiency and reducing human resource consumption.

CN118331769BActive Publication Date: 2025-01-07CHINA EVERBRIGHT BANK +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410213232.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-27
Publication Date
2025-01-07
Estimated Expiration
2044-02-27

AI Technical Summary

Technical Problem

The root cause of heterogeneous databases is complicated in the analysis process, relies on manual experience, is time-consuming and labor-intensive, and lacks efficient automation methods.

Method used

By obtaining the running information of heterogeneous databases, converting the query statements into abstract syntax trees, determining the dependency analysis results, copying the running environment, comparing the results step by step, and automatically performing root cause analysis to reduce dependence on manual experience.

Benefits of technology

It improves the efficiency of heterogeneous database compatible anomaly analysis, reduces human resources consumption, and realizes automated root cause analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118331769B_ABST
    Figure CN118331769B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for root cause analysis of heterogeneous database compatibility anomalies, wherein the method comprises: step 1: determining a source library, a target library and a query statement according to operation information of the heterogeneous database; step 2: converting the query statement into an abstract syntax tree; step 3: determining the dependency analysis result of the dependency analysis according to the abstract syntax tree; step 4: copying the operation environment according to the dependency analysis result; step 5: executing the query statement in layers in the operation environment and recursively comparing the results step by step downwards to perform root cause analysis. A method and system for root cause analysis of heterogeneous database compatibility anomalies of the present invention determines a source library, a target library and a query statement according to operation information, converts the query statement into an abstract syntax tree, determines the dependency analysis result of the dependency analysis and copies the operation environment. Executing the query statement in layers in the operation environment and recursively comparing the results step by step downwards to perform automatic root cause analysis does not rely on manual experience and is more efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a root cause analysis method and system for heterogeneous database compatibility anomalies. Background Art

[0002] A heterogeneous database is a system that consists of different types of databases that may use different data models, storage structures, or query languages. They can be relational databases, document databases, key-value databases, graph databases, and other types of databases. The goal of a heterogeneous database system is to allow multiple types of databases to be integrated and managed in a single system.

[0003] The invention patent with application number: CN201910748972.1 discloses a unified access method for heterogeneous database data and related equipment, wherein the method includes: obtaining the data structure of the data source, and establishing a database template based on the data structure; receiving SQL statement information input by the user, and obtaining the request information in the SQL statement information; after inputting the user request information into the database template, obtaining the database path corresponding to the user request information, and according to the database path, traversing the database to obtain the data to be queried by the SQL statement information input by the user.

[0004] The above application establishes a database template so that different heterogeneous databases can be queried using the same SQL statement. However, different types of databases differ in data models, storage structures, and query languages, which lead to compatibility issues during integration and operation. The root cause of query compatibility anomalies in heterogeneous databases involves: operating environment, initial settings, connection settings, data, queries, concurrency, transactions, and concurrency. The analysis process is relatively complicated. At present, when performing root cause analysis of heterogeneous database compatibility anomalies, senior test engineers or DBAs restore the relevant operating environment on the original system or test system, and then make guesses based on personal experience, combined with actual query or subquery running results, and manually compare the differences to locate the cause. The root cause analysis process consumes a lot of manpower and time.

[0005] In view of this, there is an urgent need for a root cause analysis method and system for heterogeneous database compatibility anomalies to at least solve the above-mentioned deficiencies. Summary of the invention

[0006] One of the purposes of the present invention is to provide a root cause analysis method for heterogeneous database compatibility anomalies, which determines the source library, the target library, the first query statement of the source library, and the second query statement of the target library according to the acquired operation information of the heterogeneous database, converts the query statement into an abstract syntax tree, determines the dependency analysis result of the dependency analysis, and copies the operation environment according to the dependency analysis result. The first query statement and the second query statement are executed in layers in the operation environment, and the results are recursively compared downward step by step, and the root cause analysis is automatically performed, which does not rely on manual experience and is more efficient.

[0007] An embodiment of the present invention provides a method for analyzing the root cause of a heterogeneous database compatibility anomaly, comprising:

[0008] Step 1: Obtain operation information of the heterogeneous database, and determine the source database, the target database, the first query statement of the source database, and the second query statement of the target database according to the operation information;

[0009] Step 2: convert the first query statement into a first abstract syntax tree, and at the same time, convert the second query statement into a second abstract syntax tree;

[0010] Step 3: Determine a dependency analysis result of the dependency analysis according to the first abstract syntax tree and the second abstract syntax tree;

[0011] Step 4: Copy the operating environment based on the dependency analysis results;

[0012] Step 5: Execute the first query statement and the second query statement in a hierarchical manner in the running environment, and recursively compare the results step by step to perform corresponding root cause analysis.

[0013] Preferably, step 1: obtaining operation information of the heterogeneous database, and determining the source database, the target database, the first query statement of the source database, and the second query statement of the target database according to the operation information, includes:

[0014] Determine, according to the operation information, a first database instance running the original SQL and a second database instance running the compatible SQL;

[0015] Determine a first running result of the original SQL, and at the same time, determine a second running result of the compatible SQL;

[0016] Compare the first running result with the second running result, use the abnormal compatible SQL as the second query statement, and use the second database instance running the second query statement as the target database;

[0017] The original SQL corresponding to the abnormal compatible SQL is determined as the first query statement, and the first database instance running the first query statement is used as the source database.

[0018] Preferably, step 3: determining a dependency analysis result of the dependency analysis according to the first abstract syntax tree and the second abstract syntax tree includes:

[0019] Parsing the first abstract syntax tree and the second abstract syntax tree to determine a pre-screened dependent object list;

[0020] Merge and remove duplicates from the pre-screened dependent object lists to obtain a dependent object list;

[0021] According to the list of dependent objects, determine the data form and use the data form as the result of dependency analysis.

[0022] Preferably, step 4: copying the operating environment according to the dependency analysis result includes:

[0023] Build table objects, stored procedures, and stored functions based on dependency analysis results;

[0024] Determine the data replication strategy based on the data volume of table objects, stored procedures, and stored functions. The data replication strategies include serial replication and parallel replication.

[0025] Determine the pre-verification replication result according to the data replication strategy;

[0026] The pre-verification copy result is verified. If the verification passes, the pre-verification copy result is used as the operating environment.

[0027] Preferably, step 5: hierarchically executing the first query statement and the second query statement in the running environment, and recursively comparing the results step by step downward to perform corresponding root cause analysis, including:

[0028] Step 501: Determine the highest layer and the lowest layer of the current detection range;

[0029] Step 502: Based on the dichotomy principle, determine the query level according to the highest level of the current detection range and the lowest level of the current detection range;

[0030] Step 503: Determine the comparison result according to the query level;

[0031] Step 504: If the comparison result is consistent, in the next detection, the bottom layer of the detection range of the next detection is set to the next level of the query level;

[0032] Step 505: If the comparison result is inconsistent, in the next detection, the highest level of the detection range of the next detection is set to the previous level of the query level;

[0033] Step 506: Repeat steps 502 to 505 until the root cause level is determined;

[0034] Step 507: Analyze the root cause level and determine the root cause analysis result.

[0035] Preferably, step 507: parsing the root cause level and determining the root cause analysis result includes:

[0036] Determine a single subquery at the root cause level, split the single subquery into grammatical elements at the clause level, and determine the split elements;

[0037] Generate external observables using debug statements, temporary variables, or output temporary tables for the change steps of the split elements;

[0038] Compare the corresponding external observable items of the source and target libraries to determine the root cause analysis results.

[0039] Preferably, the corresponding external observable items of the source library and the target library are compared to determine the root cause analysis result, including:

[0040] Determine a root cause node of the root cause analysis result in the second abstract syntax tree;

[0041] Based on a preset first marking rule, mark the root node to obtain a marked syntax tree;

[0042] Based on the preset visualization rules, the marked syntax tree is visualized.

[0043] Preferably, comparing corresponding external observable items of the source library and the target library to determine the root cause analysis result further includes:

[0044] Get the change order of the change steps corresponding to the external observables;

[0045] According to the change order, a first observation flowchart of the external observable items of the source library and a second observation flowchart of the external observable items of the target library are established;

[0046] According to the first observation flowchart and the second observation flowchart, external observable items are compared according to the observation process, and inconsistent external observable items at the same observation process node are determined and used as marked observation items;

[0047] Based on the preset second marking rule, the marked observation item is marked correspondingly in the second observation flow chart, and a reminder message of the root cause analysis result to be verified is generated at the marked position;

[0048] Get the sight information of database managers;

[0049] According to the line of sight information, determine the current observation process node, and at the same time, determine the problem process node where the marked observation item is located;

[0050] Get the node distance between the current observation process node and the problem process node;

[0051] Get the scaling information of the visualization interface;

[0052] Determine the jump instruction of the observation flow chart according to the scaling information and the node distance;

[0053] According to the jump instructions in the observed flowchart, execute the jump operation of the visual interface;

[0054] After the jump operation of the visual interface is executed, the database administrator obtains the verification input of the reminder information of the root cause analysis result verification;

[0055] Based on the verified input, determine the root cause analysis results.

[0056] A method for analyzing root causes of heterogeneous database compatibility anomalies provided by an embodiment of the present invention further includes:

[0057] Step 6: Determine the exception resolution strategy based on the root cause analysis results, and perform corresponding repairs based on the exception resolution strategy;

[0058] Based on the root cause analysis results, determine the exception resolution strategy, including:

[0059] Get historical compatibility exception repair events;

[0060] Based on historical compatible anomaly repair events, train the anomaly repair strategy to determine the model;

[0061] Determine the model based on the root cause analysis results and the anomaly repair strategy, and determine the anomaly repair strategy.

[0062] Preferably, training an anomaly repair strategy determination model based on historical compatible anomaly repair events includes:

[0063] Acquire a first database combination attribute of the heterogeneous database, and determine a first database combination description array based on the first database combination attribute;

[0064] Parse the historical compatibility exception repair event, and obtain the second database combination attribute of the target library in the historical compatibility exception repair event;

[0065] Determine a second database combination description array according to the second database combination attribute;

[0066] Projecting the first database combination description array onto the second database combination description array to determine difference array attributes, the difference array attributes including: difference difference value and difference array label;

[0067] According to the difference array attribute, it is determined whether there is a target number of step difference difference values ​​greater than a preset first threshold and / or a difference difference value corresponding to any trigger array tag greater than a preset second threshold. If so, the corresponding historical compatible abnormal repair event is used as the elimination data;

[0068] The historical compatible anomaly repair events except the excluded data are used as training data, and the anomaly repair strategy is trained to determine the model based on the training data.

[0069] A root cause analysis system for heterogeneous database compatibility anomalies provided by an embodiment of the present invention includes:

[0070] A query statement determination subsystem is used to obtain operation information of the heterogeneous database and determine the source database, the target database, the first query statement of the source database and the second query statement of the target database according to the operation information;

[0071] An abstract syntax tree determination subsystem, used to convert the first query statement into a first abstract syntax tree, and at the same time, convert the second query statement into a second abstract syntax tree;

[0072] A dependency analysis result determination subsystem, configured to determine a dependency analysis result of a dependency analysis based on the first abstract syntax tree and the second abstract syntax tree;

[0073] The operating environment replication subsystem is used to replicate the operating environment based on the dependency analysis results;

[0074] The root cause analysis subsystem is used to execute the first query statement and the second query statement in a hierarchical manner in the operating environment, and recursively compare the results step by step downward to perform corresponding root cause analysis.

[0075] The beneficial effects of the present invention are:

[0076] The present invention determines the source library, the target library, the first query statement of the source library and the second query statement of the target library according to the operation information of the acquired heterogeneous database, converts the query statement into an abstract syntax tree, determines the dependency analysis result of the dependency analysis, and copies the operation environment according to the dependency analysis result. The first query statement and the second query statement are executed in layers in the operation environment, and the results are compared recursively downward step by step, and the root cause analysis is automatically performed, which does not rely on manual experience and is more efficient.

[0077] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures specifically pointed out in the present application documents.

[0078] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0080] Figure 1 A schematic diagram of a root cause analysis method for a heterogeneous database compatibility anomaly in an embodiment of the present invention;

[0081] Figure 2 The figure is a schematic diagram of a root cause analysis system for heterogeneous database compatibility anomalies according to an embodiment of the present invention. DETAILED DESCRIPTION

[0082] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0083] The embodiment of the present invention provides a method for analyzing the root cause of a heterogeneous database compatibility anomaly. Figure 1 As shown, including:

[0084] Step 1: Obtain the operation information of the heterogeneous database, and determine the source database, the target database, the first query statement of the source database, and the second query statement of the target database according to the operation information; wherein the operation information includes: database type and version, connection information, data model and structure information, query language and syntax information, data storage and index information, data replication and synchronization information, performance indicators and monitoring information, data consistency and conversion rules, etc.; the target database is: the database instance where the abnormally running compatible SQL in the heterogeneous database is located, such as: EverSQL instance; the source database is: the independent original database instance corresponding to the target database, such as: Oracle 19c instance; the first query statement is: the abnormally running compatible SQL corresponds to the SQL statement in the source database; the second query statement is: the abnormally running compatible SQL in the target database;

[0085] Step 2: converting the first query statement into a first abstract syntax tree, and converting the second query statement into a second abstract syntax tree; wherein the abstract syntax tree is a tree structure used to represent the abstract syntax structure of a program or statement, and is an intermediate representation generated in the syntax analysis stage, and is used to further analyze, convert and execute the program;

[0086] Step 3: Determine the dependency analysis result of the dependency analysis according to the first abstract syntax tree and the second abstract syntax tree; wherein the dependency analysis is: analyzing the syntax structure and logic of the abstract syntax tree, determining the minimum operable leaf node of the abstract syntax tree, such as the dependent objects of functions, stored procedures, etc., and summarizing the corresponding relationship between the dependent objects and the minimum operable leaf nodes to generate a dependency object list as the dependency analysis result;

[0087] Step 4: copy the operating environment according to the dependency analysis result; when copying the operating environment according to the dependency analysis result, the environment, configuration, objects and associated data are copied;

[0088] Step 5: hierarchically execute the first query statement and the second query statement in the running environment, and recursively compare the results level by level to perform corresponding root cause analysis. Wherein, recursively comparing level by level means: comparing the first abstract syntax tree and the second abstract syntax tree level by level according to the level of the abstract syntax tree to determine the root cause analysis result.

[0089] The working principle and beneficial effects of the above technical solution are:

[0090] The present application determines the source library, the target library, the first query statement of the source library and the second query statement of the target library based on the operation information of the acquired heterogeneous database, converts the query statement into an abstract syntax tree, determines the dependency analysis result of the dependency analysis, and copies the operation environment based on the dependency analysis result. The first query statement and the second query statement are executed in layers in the operation environment, and the results are compared recursively downward step by step, and the root cause analysis is automatically performed, which does not rely on manual experience and is more efficient.

[0091] In one embodiment, step 1: obtaining operation information of a heterogeneous database, and determining a source database, a target database, a first query statement of the source database, and a second query statement of the target database according to the operation information, includes:

[0092] According to the operation information, a first database instance running the original SQL and a second database instance running the compatible SQL are determined; wherein the first database instance is: a database of a different type; the original SQL is: an SQL statement executed in the first database instance; the second database instance is: a compatible database of a different type in a heterogeneous database; the compatible SQL is: an SQL statement executed in the second database instance;

[0093] Determine a first running result of the original SQL, and at the same time, determine a second running result of the compatible SQL;

[0094] Compare the first running result with the second running result, use the abnormal compatible SQL as the second query statement, and use the second database instance running the second query statement as the target database; wherein the abnormal compatible SQL is: when the first running result and the second running result are different, the compatible SQL corresponding to the second running result;

[0095] The original SQL corresponding to the abnormal compatible SQL is determined as the first query statement, and the first database instance running the first query statement is used as the source database.

[0096] The working principle and beneficial effects of the above technical solution are:

[0097] This application determines the first database instance, the second database instance, the first running result of the original SQL, and the second running result of the compatible SQL based on the acquired running information. Compare the first running result and the second running result, determine the abnormal compatible SQL as the second query statement, and use the second database instance running the second query statement as the target library. In addition, determine the original SQL corresponding to the abnormal compatible SQL as the first query statement and the first database instance running the first query statement as the source library, which improves the accuracy of obtaining the first query statement and the second query statement.

[0098] In one embodiment, step 3: determining a dependency analysis result of the dependency analysis according to the first abstract syntax tree and the second abstract syntax tree includes:

[0099] Parse the first abstract syntax tree and the second abstract syntax tree to determine a pre-screened dependent object list; wherein the pre-screened dependent object list is: split the abstract syntax tree, determine the minimum operable leaf node, such as: dependent objects of stored procedures and stored functions, data table lists of stored procedures and stored functions, etc., summarize the obtained dependent objects and data table lists, and obtain the pre-screened dependent object list;

[0100] The pre-screened dependent object list is merged and deduplicated to obtain a dependent object list; wherein the dependent object list is: the stored procedure and stored function lists in the pre-screened dependent object list are merged and deduplicated, and definitions are obtained through the metadata table of the source library or the target library, and the data table list of the dependent objects and data table list of the stored procedure and stored function are recursively obtained;

[0101] According to the dependent object list, a data form is determined and used as a dependency analysis result. The data form is obtained by removing derived tables from physical table objects in the dependent object list and merging and deduplicating them.

[0102] The working principle and beneficial effects of the above technical solution are:

[0103] The present application parses the abstract syntax tree to determine the pre-screened dependent object list, merges and deduplicates the pre-screened dependent object list, obtains the definition through the metadata table of the source library or the target library, recursively obtains the dependent objects of the stored procedures and stored functions and the dependent object list of the data table list, and obtains the dependency analysis result by removing the derived table from the physical table objects in the dependent object list and merging and deduplicating them, thereby improving the comprehensiveness of the dependency analysis, and the deduplication operation also improves the subsequent attribution efficiency.

[0104] In one embodiment, step 4: copying the operating environment according to the dependency analysis result includes:

[0105] Build table objects, stored procedures, and stored functions based on dependency analysis results;

[0106] Determine the data replication strategy according to the data volume of table objects, stored procedures and stored functions. The data replication strategy includes: serial replication and parallel replication. When the data volume is greater than the preset data volume threshold, parallel replication is performed, otherwise, serial replication is performed.

[0107] Determine a pre-verification replication result according to the data replication strategy; wherein the pre-verification replication result is: a pre-verification operating environment replicated according to the data replication strategy;

[0108] The pre-verification copy result is verified, and if the verification is passed, the pre-verification copy result is used as the operating environment. When the pre-verification copy result is verified, the consistency of the copied environment and the original environment is verified, and if they are consistent, the corresponding pre-verification copy result is used as the operating environment.

[0109] The working principle and beneficial effects of the above technical solution are:

[0110] This application determines the data replication strategy according to the amount of data in the constructed table objects, stored procedures, and stored functions, and determines the pre-verified replication results to improve the replication efficiency of the operating environment. The pre-verified replication results that have passed the consistency verification are determined as the operating environment, and the operating environment is more suitable.

[0111] In one embodiment, step 5: hierarchically executing the first query statement and the second query statement in the running environment, and recursively comparing the results step by step downward to perform corresponding root cause analysis, including:

[0112] Step 501: Determine the highest layer and the lowest layer of the current detection range;

[0113] Step 502: Based on the dichotomy principle, the query level is determined according to the highest level of the current detection range and the lowest level of the current detection range; wherein the determination model for determining the query level based on the dichotomy principle is:

[0114]

[0115] Among them, Round is the query level, H t is the highest layer of the current detection range, L t The bottom layer of the current detection range;

[0116] Step 503: determining a comparison result according to the query level; wherein the comparison result is: a comparison result of the output of the first abstract syntax tree at the query level and the output of the second abstract syntax tree at the query level, and the comparison result is divided into: consistent and inconsistent;

[0117] Step 504: If the comparison result is consistent, in the next detection, the bottom layer of the detection range of the next detection is set to the next level of the query level;

[0118] Step 505: If the comparison result is inconsistent, in the next detection, the highest level of the detection range of the next detection is set to the previous level of the query level;

[0119] Step 506: Repeat steps 502 to 505 until the root cause level is determined. For example, for a 5-layer query, first search for layer 3. If they are consistent, continue searching in layers 4 and 5. If layer 5 is inconsistent, it is necessary to further determine whether layer 4 is consistent. If layer 4 is consistent and layer 5 is inconsistent, the Nth layer is inconsistent, but layer N-1 is consistent. Then the location of the inconsistent level has been completed, which is layer 5.

[0120] Step 507: Analyze the root cause level and determine the root cause analysis result.

[0121] The working principle and beneficial effects of the above technical solution are:

[0122] This application introduces the principle of binary search, and determines the query level according to the highest level and the lowest level of the current detection range. The query level is determined to correspond to the comparison result of the first abstract syntax tree and the second abstract syntax tree, and subsequent operations are performed according to the difference in the comparison results. The binary search or divide-and-conquer method is used to recursively narrow the scope of the problem step by step, and the analysis process converges quickly.

[0123] In one embodiment, step 507: parsing the root cause level and determining the root cause analysis result includes:

[0124] Determine a single subquery at the root cause level, and split the single subquery into clause-level syntax elements to determine the split elements. The split elements include, for example, projection columns, JOIN, conditions, GROUP BY, window functions / aggregate functions, DISTINCT, ORDER BY, and LIMIT.

[0125] Generate external observables for the change steps of split elements using debugging statements, temporary variables, or output temporary tables, where the external observables are, for example: DBMS_OUTPUT.PUT_LINE (for assignment statements); SELECT INTOvar (for query result variable storage); SELECT INTO tmp_table (for query result temporary table storage);

[0126] Compare the corresponding external observable items of the source and target libraries to determine the root cause analysis results.

[0127] The working principle and beneficial effects of the above technical solution are:

[0128] This application determines a single subquery at the root cause level, and splits the single subquery into clause-level grammatical elements to obtain split elements. Use debugging statements, temporary variables, or output temporary tables to generate external observable items for the change steps of the split elements, compare the corresponding external observable items of the source and target libraries, and determine the root cause analysis results. The observability of the root cause analysis is higher.

[0129] In one embodiment, the corresponding external observable items of the source library and the target library are compared to determine the root cause analysis result, including:

[0130] Determine a root cause node of the root cause analysis result in the second abstract syntax tree; wherein the root cause node is: a tree node where the root cause analysis result is located;

[0131] Based on a preset first marking rule, the root cause node is marked to obtain a marked syntax tree; wherein the preset first marking rule is manually preset, for example: marking the root cause node in red;

[0132] Based on the preset visualization rules, the marked syntax tree is visualized, wherein the preset visualization rules are: using the computer platform of the root cause analysis to visualize the graphical interface of the marked syntax tree.

[0133] The working principle and beneficial effects of the above technical solution are:

[0134] This application introduces a first marking rule, marks the root cause node in the second abstract syntax tree accordingly, obtains a marked syntax tree, and visualizes the marked syntax tree based on the visualization rule, which is convenient for the staff to check the subsequent anomalies and is more user-friendly.

[0135] In one embodiment, comparing corresponding external observable items of the source library and the target library to determine the root cause analysis result further includes:

[0136] Get the change order of the change steps corresponding to the external observable; where the change order is: the step sequence of the change steps;

[0137] According to the change order, a first observation flow chart of the external observable items of the source library and a second observation flow chart of the external observable items of the target library are established; wherein the observation flow chart is: an observation process of the external observable items represented in a graphical manner;

[0138] According to the first observation flowchart and the second observation flowchart, external observable items are compared according to the observation process, and inconsistent external observable items at the same observation process node are determined and used as marked observation items;

[0139] Based on the preset second marking rule, the marked observation item is marked in the second observation flow chart, and a reminder message of the root cause analysis result to be verified is generated at the marked position; wherein the preset second marking rule is: how to mark the external observable item; the reminder message of the root cause analysis result to be verified is: the root cause analysis result generated by the system according to the marked observation item, and the marked observation item is highlighted;

[0140] Obtaining the sight line information of the database manager; wherein the sight line information is: a sight line point set of the database manager;

[0141] According to the line of sight information, the current observation process node is determined, and at the same time, the problem process node where the marked observation item is located is determined; wherein the current observation process node is: the external observable item currently being observed corresponds to the process node in the second observation flow chart;

[0142] Get the node distance between the current observation process node and the problem process node; where the node distance is: the interval between the observation process nodes;

[0143] Obtaining zoom ratio information of a visualization interface; wherein the visualization interface is: a device interface for a database administrator to view and observe a flow chart; the zoom ratio information includes: an interface control instruction corresponding to a preset zoom ratio;

[0144] Determine the jump instruction of the observation flow chart according to the scaling information and the node distance; wherein the jump instruction of the observation flow chart is: a computer control instruction for controlling the visualization interface to display the problem process node;

[0145] According to the jump instructions in the observed flowchart, execute the jump operation of the visual interface;

[0146] After the jump operation of the visual interface is executed, the database administrator obtains the verification input of the reminder information for verifying the root cause analysis result; wherein the verification input is: confirmation of the reminder information, including: confirmation that the automatically generated root cause analysis result is correct, and confirmation that the automatically generated root cause analysis result is wrong and the actual root cause analysis result input manually;

[0147] Based on the verified input, determine the root cause analysis results.

[0148] The working principle and beneficial effects of the above technical solution are:

[0149] The present application introduces a change order for the change steps, establishes an observation flowchart based on the change order, and compares external observable items according to the observation process to determine the marked observation items that are inconsistent at the same observation process node. A second marking rule is introduced to mark the marked observation items and reminder information of the root cause analysis results to be verified in the second observation flowchart. According to the line of sight information of the database administrator obtained, the current observation process node is determined, and at the same time, the problem process node where the marked observation item is located is determined. The scaling information of the visualization interface is introduced, and the observation flowchart jump instruction is determined based on the node distance. After the computer executes the observation flowchart jump instruction, the database administrator's verification input for the reminder information of the root cause analysis results to be verified is determined, and the root cause analysis results are determined based on the verification input. The root cause analysis results are automatically generated and quickly located for manual verification, which reduces the misjudgment of the root cause analysis results and makes manual verification more efficient.

[0150] An embodiment of the present invention provides a method for analyzing root causes of heterogeneous database compatibility anomalies, further comprising:

[0151] Step 6: Determine the exception resolution strategy based on the root cause analysis results, and perform corresponding repairs based on the exception resolution strategy; the exception resolution strategy is: a repair strategy for heterogeneous database compatibility exceptions;

[0152] Based on the root cause analysis results, determine the exception resolution strategy, including:

[0153] Obtain historical compatibility exception repair events; where historical compatibility exception repair events are: manual repair events when heterogeneous database compatibility exceptions occurred in the past;

[0154] According to historical compatible anomaly repair events, train an anomaly repair strategy determination model; wherein, when training the anomaly repair strategy determination model, use a machine learning or neural network model to learn the manual repair strategies in historical compatible anomaly repair events to obtain the anomaly repair strategy determination model;

[0155] Determine the model based on the root cause analysis results and the anomaly repair strategy, and determine the anomaly repair strategy.

[0156] The working principle and beneficial effects of the above technical solution are:

[0157] After the root cause analysis of heterogeneous database compatibility anomalies is completed, corresponding anomaly resolution must be performed based on the root cause analysis results. Therefore, this application introduces historical compatibility anomaly repair events and trains an anomaly repair strategy determination model. The anomaly repair strategy is determined based on the root cause analysis results and the anomaly repair strategy determination model. No manual determination is required, human interference is eliminated, and the rationality of anomaly repair strategy acquisition is improved.

[0158] In one embodiment, training an anomaly repair strategy determination model based on historical compatible anomaly repair events includes:

[0159] A first database combination attribute of a heterogeneous database is obtained, and based on the first database combination attribute, a first database combination description array is determined; wherein the first database combination attribute is: what type of databases the heterogeneous database is composed of and how they are combined; the first database combination description array is a description matrix of database combination relationships determined based on a preset description matrix construction template and the first database combination attribute, wherein the rows of the database combination description array represent the order of combination, and the columns represent the types of combined databases; the description matrix construction template is a template manually preset for generating a description matrix of database combination relationships in accordance with the database combination attribute;

[0160] Parse the historical compatibility exception repair event to obtain the second database combination attribute of the target database in the historical compatibility exception repair event; wherein the target database is: the heterogeneous database repaired in the historical compatibility exception repair event; the second database combination attribute is: what type of databases the heterogeneous database repaired in the historical compatibility exception repair event is composed of and how they are combined;

[0161] Determine a second database combination description array according to the second database combination attribute; wherein the generation principle of the second database combination description array is the same as the first database combination description array;

[0162] The first database combination description array is projected onto the second database combination description array to determine difference array attributes, where the difference array attributes include: difference difference values ​​and difference array labels; wherein the difference difference values ​​are: the difference values ​​of elements at each array position (matrix element position) when the first database combination description array is projected onto the second database combination description array; and the difference array labels are: the row labels and column labels of the first database combination description array and the second database combination description array;

[0163] According to the difference array attribute, it is determined whether there is a target number of step difference difference values ​​greater than a preset first threshold and / or a difference difference value corresponding to any trigger array tag is greater than a preset second threshold. If so, the corresponding historical compatible abnormal repair event is used as the rejection data; wherein the step difference difference value is: the difference difference value greater than the preset third threshold; the preset first threshold, second threshold, third threshold and trigger array tag are all preset manually;

[0164] The historical compatible anomaly repair events other than the excluded data are used as training data, and the anomaly repair strategy determination model is trained based on the training data. When the anomaly repair strategy determination model is trained based on the training data, the corresponding model training is obtained based on a neural network algorithm or a machine learning algorithm.

[0165] The working principle and beneficial effects of the above technical solution are:

[0166] When training the anomaly repair strategy determination model, not all repair processes in historical compatible anomaly repair events are suitable for training. For example, when the database type and combination order of the heterogeneous database in the historical compatible anomaly repair event are significantly different from the database type and combination order of the heterogeneous database in this solution, the trained anomaly repair strategy determination model is not suitable. Therefore, the first database combination attribute of the heterogeneous database is introduced to determine the first database combination description array. At the same time, the historical compatible anomaly repair event is parsed to determine the second database combination description array of the second database combination attribute of the target library in the historical compatible anomaly repair event, and the first database combination description array is projected onto the second database combination description array to determine the difference difference and the difference array label. If the number of targets with step difference difference is greater than the preset first threshold and / or the difference difference corresponding to any trigger array label is greater than the preset second threshold, the corresponding historical compatible anomaly repair event is eliminated, and the remaining historical compatible anomaly repair events are used as training data. According to the training data, the anomaly repair strategy determination model is trained, thereby improving the suitability of the anomaly repair strategy determination model training.

[0167] The embodiment of the present invention provides a root cause analysis system for heterogeneous database compatibility anomalies, such as Figure 2 As shown, including:

[0168] The query statement determination subsystem 1 is used to obtain the operation information of the heterogeneous database, and determine the source database, the target database, the first query statement of the source database, and the second query statement of the target database according to the operation information;

[0169] Abstract syntax tree determination subsystem 2, used to convert the first query statement into a first abstract syntax tree, and at the same time, convert the second query statement into a second abstract syntax tree;

[0170] A dependency analysis result determination subsystem 3, used to determine a dependency analysis result of the dependency analysis according to the first abstract syntax tree and the second abstract syntax tree;

[0171] The operating environment replication subsystem 4 is used to replicate the operating environment according to the dependency analysis result;

[0172] The root cause analysis subsystem 5 is used to execute the first query statement and the second query statement in a hierarchical manner in the operating environment, and recursively compare the results step by step downward to perform corresponding root cause analysis.

[0173] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A root cause analysis method for heterogeneous database compatibility anomalies, characterized in that: include: Step 1: Obtain the operation information of the heterogeneous database, and determine the source database, the target database, the first query statement of the source database, and the second query statement of the target database according to the operation information, wherein the operation information includes: database type and version information, connection information, data model and structure information, query language and syntax information, data storage and index information, data replication and synchronization information, performance indicators, monitoring information, data consistency and conversion rules; the source database is: the independent original database instance corresponding to the target database; the target database is: the database instance where the compatible SQL with abnormal operation in the heterogeneous database is located; the first query statement is: the compatible SQL with abnormal operation corresponds to the SQL statement in the source database; the second query statement is: the compatible SQL statement with abnormal operation in the target database; Step 2: convert the first query statement into a first abstract syntax tree, and at the same time, convert the second query statement into a second abstract syntax tree; Step 3: Determine a dependency analysis result of the dependency analysis according to the first abstract syntax tree and the second abstract syntax tree, wherein the dependency analysis is: analyzing the syntax structure and logic of the abstract syntax tree to determine the minimum operable leaf node of the abstract syntax tree; Step 4: Copy the operating environment based on the dependency analysis results; Step 5: Execute the first query statement and the second query statement in a hierarchical manner in the running environment, and recursively compare the results step by step to perform corresponding root cause analysis.

2. A root cause analysis method for heterogeneous database compatibility anomalies as described in claim 1, characterized in that: Step 1: Obtaining the operation information of the heterogeneous database, and determining the source database, the target database, the first query statement of the source database, and the second query statement of the target database according to the operation information, including: Determine, according to the operation information, a first database instance running the original SQL and a second database instance running the compatible SQL; Determine a first running result of the original SQL, and at the same time, determine a second running result of the compatible SQL; Compare the first running result with the second running result, use the abnormal compatible SQL as the second query statement, and use the second database instance running the second query statement as the target database; The original SQL corresponding to the abnormal compatible SQL is determined as the first query statement, and the first database instance running the first query statement is used as the source database.

3. The root cause analysis method for heterogeneous database compatibility anomaly according to claim 1, characterized in that: Step 3: Determine a dependency analysis result of the dependency analysis according to the first abstract syntax tree and the second abstract syntax tree, including: Parsing the first abstract syntax tree and the second abstract syntax tree to determine a pre-screened dependent object list, wherein the pre-screened dependent object list is: a minimum operable leaf node determined by splitting the abstract syntax tree; Merge and remove duplicates from the pre-screened dependent object lists to obtain a dependent object list; According to the list of dependent objects, determine the data form and use the data form as the result of dependency analysis.

4. The root cause analysis method for heterogeneous database compatibility anomaly according to claim 1, characterized in that: Step 4: Based on the dependency analysis results, copy the operating environment, including: Build table objects, stored procedures, and stored functions based on dependency analysis results; Determine the data replication strategy based on the data volume of table objects, stored procedures, and stored functions. The data replication strategies include serial replication and parallel replication. Determine the pre-verification replication result according to the data replication strategy; The pre-verification copy result is verified. If the verification passes, the pre-verification copy result is used as the operating environment.

5. The root cause analysis method for heterogeneous database compatibility anomaly according to claim 1, characterized in that: Step 5: Execute the first query statement and the second query statement in the running environment in layers, and recursively compare the results step by step to perform corresponding root cause analysis, including: Step 501: Determine the highest layer and the lowest layer of the current detection range; Step 502: Based on the dichotomy principle, determine the query level according to the highest level of the current detection range and the lowest level of the current detection range; Step 503: Determine the comparison result according to the query level; Step 504: If the comparison result is consistent, in the next detection, the bottom layer of the detection range of the next detection is set to the next level of the query level; Step 505: If the comparison result is inconsistent, in the next detection, the highest level of the detection range of the next detection is set to the previous level of the query level; Step 506: Repeat steps 502 to 505 until the root cause level is determined; Step 507: Analyze the root cause level and determine the root cause analysis result.

6. A root cause analysis method for heterogeneous database compatibility anomalies as described in claim 5, characterized in that: Step 507: Analyze the root cause level and determine the root cause analysis result, including: Determine a single subquery at the root cause level, split the single subquery into grammatical elements at the clause level, and determine the split elements; Generate external observables using debug statements, temporary variables, or output temporary tables for the change steps of the split elements; Compare the corresponding external observable items of the source and target libraries to determine the root cause analysis results.

7. A method for analyzing root causes of heterogeneous database compatibility anomalies according to claim 6, characterized in that: Compare the corresponding external observable items of the source and target libraries to determine the root cause analysis results, including: Determine a root cause node of the root cause analysis result in the second abstract syntax tree; Based on a preset first marking rule, mark the root node to obtain a marked syntax tree; Based on the preset visualization rules, the marked syntax tree is visualized.

8. The root cause analysis method for heterogeneous database compatibility anomaly according to claim 1, characterized in that: Also includes: Step 6: Determine the exception resolution strategy based on the root cause analysis results, and perform corresponding repairs based on the exception resolution strategy; Based on the root cause analysis results, determine the exception resolution strategy, including: Get historical compatibility exception repair events; Based on historical compatible anomaly repair events, train the anomaly repair strategy to determine the model; Determine the model based on the root cause analysis results and the anomaly repair strategy, and determine the anomaly repair strategy.

9. A root cause analysis method for heterogeneous database compatibility anomalies as claimed in claim 8, characterized in that: Based on historical compatible anomaly repair events, train anomaly repair strategy to determine the model, including: A first database combination attribute of a heterogeneous database is obtained, and a first database combination description array is determined based on the first database combination attribute, wherein the first database combination attribute is: a database type and a combination mode of the heterogeneous database; the first database combination description array is: a description matrix of a database combination relationship determined based on a preset description matrix construction template and the first database combination attribute, wherein the rows of the database combination description array represent a sequence of combinations, and the columns represent the types of combined databases; the description matrix construction template is a template manually preset for generating a description matrix of a database combination relationship by comparing the database combination attribute; Parse the historical compatibility exception repair event to obtain the second database combination attribute of the target database in the historical compatibility exception repair event, wherein the second database combination attribute is: the database type and combination mode of the heterogeneous database repaired in the historical compatibility exception repair event; Determine a second database combination description array according to the second database combination attribute, wherein the second database combination description array is: a description matrix of a database combination relationship determined based on a preset description matrix construction template and the second database combination attribute; Projecting the first database combination description array onto the second database combination description array to determine difference array attributes, the difference array attributes including: difference difference value and difference array label; According to the difference array attribute, it is determined whether there is a target number of step difference difference values ​​greater than a preset first threshold and / or a difference difference value corresponding to any trigger array tag greater than a preset second threshold. If so, the corresponding historical compatible abnormal repair event is used as the elimination data; The historical compatible anomaly repair events except the excluded data are used as training data, and the anomaly repair strategy is trained to determine the model based on the training data.

10. A root cause analysis system for heterogeneous database compatibility anomalies, characterized in that: include: The query statement determination subsystem is used to obtain the operation information of the heterogeneous database, and determine the source database, the target database, the first query statement of the source database and the second query statement of the target database according to the operation information, wherein the operation information is: database type and version information, connection information, data model and structure information, query language and syntax information, data storage and index information, data replication and synchronization information, performance indicators, monitoring information, data consistency and conversion rules; the source database is: the independent original database instance corresponding to the target database; the target database is: the database instance where the compatible SQL with abnormal operation in the heterogeneous database is located; the first query statement is: the compatible SQL with abnormal operation corresponds to the SQL statement in the source database; the second query statement is: the compatible SQL statement with abnormal operation in the target database; An abstract syntax tree determination subsystem, used to convert the first query statement into a first abstract syntax tree, and at the same time, convert the second query statement into a second abstract syntax tree; A dependency analysis result determination subsystem is used to determine a dependency analysis result of a dependency analysis according to the first abstract syntax tree and the second abstract syntax tree, wherein the dependency analysis is: analyzing the syntax structure and logic of the abstract syntax tree to determine the minimum operable leaf node of the abstract syntax tree; The operating environment replication subsystem is used to replicate the operating environment based on the dependency analysis results; The root cause analysis subsystem is used to execute the first query statement and the second query statement in a hierarchical manner in the operating environment, and recursively compare the results step by step downward to perform corresponding root cause analysis.

Citation Information

Patent Citations

  • Unified access method and related equipment for heterogeneous databases

    CN110597844B

  • Universal method and device for dissimilatory database, electronic equipment and storage medium

    CN116842042A

  • Structured query statement analysis method and device, equipment and storage medium

    CN117453720A