Database auditing method and device, equipment, storage medium and product

By conducting dual audits on the database for non-SQL and SQL-like problems and generating health reports, the problem of insufficient comprehensive database health analysis in the existing technology is solved, and the accuracy of audit results is improved.

CN119862171APending Publication Date: 2025-04-22CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411431628.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The existing database audit methods only scan and analyze SQL-like problems, resulting in insufficient comprehensive database health analysis and low accuracy of audit results.

Method used

A database audit method is proposed, which generates a database health report and sends the report to the user by auditing the database separately.

Benefits of technology

A comprehensive database health analysis is achieved, the accuracy of database audit results is improved, and the impact of SQL-like problems on database health is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862171A_ABST
    Figure CN119862171A_ABST
Patent Text Reader

Abstract

The invention discloses a database auditing method and device, equipment, a storage medium and a product, relates to the technical field of computers, and discloses a database auditing method which comprises the steps that non-SQL class problem auditing is conducted on a to-be-audited database, and a first auditing result is obtained; checking the SQL class problem of the to-be-checked database to obtain a second checking result; and generating a database health report of the to-be-audited database based on the first audit result and the second audit result, and sending the database health report to a user side. According to the method and the device, on the basis of checking the SQL class problem of the to-be-checked database, the non-SQL class problem of the to-be-checked database is checked, so that the influence of the SQL class problem of the database on the health condition of the database is avoided, comprehensive database health analysis is realized, and the accuracy of a database checking result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a database audit method, device, equipment, storage medium and product. Background Art

[0002] At present, with the development of information technology, database technology has become an indispensable part of enterprise operations. With the surge in data volume and the diversification of business needs, database management faces more and more challenges, especially in ensuring data security and improving operational efficiency. Therefore, how to realize the audit of database health is a technical problem that needs to be solved urgently.

[0003] In the related art, the audit of the database usually scans and analyzes the SQL problems in the database and feeds back the analysis results to the person in charge. However, this method only scans and analyzes the SQL problems in the database, and the health analysis of the database is not comprehensive enough, resulting in low accuracy of the audit results.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a database audit method, aiming to solve the technical problem of low accuracy of audit results.

[0006] To achieve the above purpose, the present application proposes a database audit method, the database audit method comprising:

[0007] Auditing the database to be audited for non-SQL issues to obtain a first audit result;

[0008] Auditing the SQL issues of the database to be audited to obtain a second audit result;

[0009] Based on the first audit result and the second audit result, a database health report of the database to be audited is generated, and the database health report is sent to a user terminal.

[0010] Optionally, after the step of generating a corresponding database health report based on the first audit result and the second audit result, and sending the database health report to the user terminal, the method includes:

[0011] Determine whether the database health report meets the preset database health condition. If the database health report does not meet the preset database health condition, send an exception handling notification to the user terminal, and receive the database to be reviewed after the exception handling sent by the user terminal;

[0012] Return to the step of auditing the non-SQL issues of the database to be audited to obtain a first audit result, until the database health report meets the preset database health condition, and then send a notification to the user end that the database is in a healthy state.

[0013] Optionally, the step of auditing the database to be audited for non-SQL issues to obtain a first audit result includes:

[0014] The database to be audited is scanned for non-SQL data to obtain a first scanning result, and the first scanning result is audited through a synchronous processing method to obtain a first audit result.

[0015] Optionally, the step of auditing the database to be audited for SQL issues to obtain a second audit result includes:

[0016] Scanning the SQL data of the database to be audited at every preset time period to obtain a second scanning result;

[0017] By means of asynchronous processing, the second scanning result is matched based on a preset SQL statement rule library to obtain a matching result;

[0018] Based on the matching result, a second audit result is determined.

[0019] Optionally, the step of generating a database health report of the database to be audited based on the first audit result and the second audit result includes:

[0020] Calculating a health index value of the database to be audited based on the first audit result and the second audit result;

[0021] Based on the first audit result, the second audit result, and the health index value, a database health report of the database to be audited is generated.

[0022] Optionally, the step of calculating the health index value of the database to be audited based on the first audit result and the second audit result includes:

[0023] Get performance reference values;

[0024] Performing performance indicator conversion on the first audit result and the second audit result respectively to obtain a first performance indicator set and a second performance indicator set;

[0025] Determining weight coefficients under different performance indicators based on the first performance indicator set and the second performance indicator set;

[0026] Based on the performance reference value and the weight coefficient, a health index calculation is performed on the first performance indicator set and the second performance indicator set through a preset normalization function to obtain a health index value of the database to be audited.

[0027] In addition, to achieve the above purpose, the present application also proposes a database auditing device, the database auditing device comprising:

[0028] A first audit module, used to audit the database to be audited for non-SQL issues and obtain a first audit result;

[0029] A second audit module is used to audit the SQL issues of the database to be audited and obtain a second audit result;

[0030] A generation module is used to generate a corresponding database health report based on the first audit result and the second audit result, and send the database health report to the user end.

[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a database auditing device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the database auditing method as described above.

[0032] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the database audit method described above are implemented.

[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the database audit method described above.

[0034] One or more technical solutions proposed in this application have at least the following technical effects:

[0035] Compared with the related art, the audit of the database usually scans and analyzes the SQL problems in the database, and feeds back the analysis results to the person in charge. However, this method only scans and analyzes the SQL problems in the database, and the health analysis of the database is not comprehensive enough, resulting in low accuracy of the audit results. In comparison, the audit platform of the present application audits the non-SQL problems of the database to be audited separately to obtain a first audit result, and audits the SQL problems of the database to be audited to obtain a second audit result. Finally, based on the first audit result and the second audit result, a database health report of the database to be audited is generated, and the database health report is sent to the user end. It is understandable that, on the basis of auditing the SQL problems of the database to be audited, the present application also audits the non-SQL problems of the database to be audited, so as to avoid the impact of database SQL problems on the health of the database, achieve a comprehensive database health analysis, and thus improve the accuracy of the database audit results. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0038] Figure 1 A flowchart of the first embodiment of the database audit method of the present application is provided;

[0039] Figure 2 This is a system architecture deployment diagram of the audit method for this application database;

[0040] Figure 3 A detailed problem-solving flow chart of the review method for this application database;

[0041] Figure 4 A flowchart of a second embodiment of the database audit method of the present application is provided;

[0042] Figure 5 This is a schematic diagram of the overall process of the review method for this application database;

[0043] Figure 6 A schematic diagram of the module structure of the audit device of the database of the embodiment of the present application;

[0044] Figure 7A schematic diagram of the device structure of the hardware operating environment involved in the database audit method in the embodiment of the present application.

[0045] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0046] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0047] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0048] The main solution of the embodiment of the present application is: audit the database to be audited for non-SQL issues to obtain a first audit result; audit the database to be audited for SQL issues to obtain a second audit result; based on the first audit result and the second audit result, generate a database health report for the database to be audited, and send the database health report to the user end.

[0049] In this embodiment, the audit platform is the executing entity. For the convenience of description, it will be referred to as the "platform" hereinafter.

[0050] In the related art, the audit of the database usually scans and analyzes the SQL problems in the database, and feeds back the analysis results to the person in charge. However, this method only scans and analyzes the SQL problems in the database, and the health analysis of the database is not comprehensive, resulting in low accuracy of the audit results.

[0051] This application provides a solution to achieve comprehensive database health analysis, thereby improving the accuracy of database audit results.

[0052] From the above embodiments, it can be seen that the audit platform of the present application obtains the first audit result by auditing the database to be audited for non-SQL issues, and obtains the second audit result by auditing the database to be audited for SQL issues. Finally, based on the first audit result and the second audit result, a database health report of the database to be audited is generated, and the database health report is sent to the user end. It is understandable that the present application, on the basis of auditing the database to be audited for SQL issues, also audits the database to be audited for non-SQL issues, so as to avoid the impact of database SQL issues on the health of the database, achieve a comprehensive database health analysis, and thus improve the accuracy of the database audit results.

[0053] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a terminal system, etc. The following takes the audit device of the database as an example to illustrate this embodiment and the following embodiments.

[0054] Based on this, the present application embodiment provides a database audit method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the database audit method of this application.

[0055] In this embodiment, the database audit method includes steps S100 to S300:

[0056] Step S100, auditing the database to be audited for non-SQL issues to obtain a first audit result;

[0057] In a specific implementation, the audit method of the database is applied to an audit platform, which is connected to the audit database for data auditing. The audit database refers to a database system that needs to undergo security, compliance checks or other types of audits. The audit platform is a software system or service that is responsible for performing audit tasks and checking whether the content, configuration, access control, etc. of the database comply with established security policies and standards. The system architecture deployment of the audit method of the database is referenced in Figure 2 .

[0058] It should be noted that the non-SQL issues refer to issues related to non-SQL content in the database. Non-SQL content refers to other types of data or objects other than Structured Query Language (SQL) statements. These contents may include but are not limited to the following categories:

[0059] Configuration file: The configuration file of the database system, such as my.cnf of MySQL or init.ora of Oracle, contains the configuration parameters of the database server;

[0060] Stored procedure: A set of SQL statements to complete a specific function. These statements are stored in a named database object and can be called and executed.

[0061] Function: A user-defined function that can return a value and is used to perform calculations or manipulate data;

[0062] Trigger: A special stored procedure that is automatically executed when certain conditions are met;

[0063] View: A virtual table consisting of query results, used to simplify complex SQL operations or protect data;

[0064] Package: In some database systems, such as Oracle, a package is a collection of related stored procedures, functions, and triggers;

[0065] Sequence: A database object used to generate a numeric sequence, usually used for auto-incrementing primary keys;

[0066] Indexes: Although indexes are usually created by SQL statements, they are also a non-SQL object in the database that is used to improve data retrieval efficiency;

[0067] Permissions and roles: Permissions and role assignments that define the database operations that a user or role can perform;

[0068] Data dictionary and metadata: describes the database structure and stored information, such as table structure, column attributes, etc.

[0069] Log files: logs that record database operations, including transaction logs, error logs, etc.

[0070] Data files: files that store actual database data, such as tablespace files, data files, etc.

[0071] Backup file: database backup file, used for data recovery;

[0072] Temporary table: A table used to store temporary data, which is usually automatically deleted at the end of the database session;

[0073] Events: In some database systems, events are scheduled tasks that can be executed automatically according to specified times or conditions.

[0074] The above non-SQL contents are important components of the database system, and they jointly support the operation and management of the database.

[0075] Furthermore, non-SQL issues include, but are not limited to: problems with database configuration and parameter settings; database security issues, such as weak passwords, unauthorized access, etc.; database physical and logical design issues, such as unreasonable table structure design, data redundancy, etc.; data integrity and compliance issues, such as data loss, data inconsistency, etc.; performance issues, such as inefficient queries caused by improper index design; irregular column naming, missing primary keys in tables, and no specified tablespace for database objects, etc.

[0076] In a specific implementation, the first audit result refers to the result of auditing non-SQL issues. The first audit result generally includes: listing all detected non-SQL issues and potential risks, providing a detailed description of the issues, impacts and possible solutions, and even classifying and sorting the issues according to their severity.

[0077] In a specific implementation, the platform audits the database to be audited for non-SQL issues and obtains a first audit result, including:

[0078] The database to be audited is scanned for non-SQL data to obtain a first scanning result, and the first scanning result is audited through a synchronous processing method to obtain a first audit result.

[0079] It is understandable that since non-SQL data often does not change in a short period of time, the scanning and auditing of non-SQL data are set as synchronous tasks for processing. Specifically, the platform uses a unified database connector to first distinguish the corresponding access data type, and then calls the corresponding access program and scanning rules to perform task scanning. The database connector is mainly responsible for managing and maintaining connections for all databases. Since different databases differ in protocols, syntax, etc., the database connector needs to provide adaptability to different databases to ensure that the platform communicates with various databases correctly and efficiently.

[0080] Furthermore, a database connector is implemented, and a layered architecture is adopted to decouple modules such as link management, data extraction, and error handling, and encapsulate them separately. Through clear interface definitions and specification definitions, each module can run and work independently, while being able to collaborate and interact through interfaces. It also supports the expansion and access of new types of databases in the future. That is, this application supports multiple database types such as MYSQL, ORACLE, TDSQL, etc. through database connectors and access layer separation, realizes unified audit management across databases, and supports the expansion and addition of new databases.

[0081] Step S200, auditing the database to be audited for SQL issues to obtain a second audit result;

[0082] It should be noted that SQL issues involve the SQL (Structured Query Language) level of the database, including but not limited to: SQL injection vulnerabilities: security vulnerabilities in the application that allow attackers to insert malicious SQL code; SQL performance issues: inefficient queries, which may be due to improper query design, lack of indexes, or unreasonable database structure; SQL syntax errors: incorrectly written SQL statements may lead to execution failure or return incorrect results; SQL permission issues: improper permission settings may lead to data leakage or unauthorized data modification.

[0083] In a specific implementation, the second audit result refers to the result of auditing SQL-related problems. The second audit result generally includes: listing all detected SQL-related problems and potential risks, providing a detailed description of the problem, impact and possible solutions, and even classifying and sorting the problem according to its severity.

[0084] In a specific implementation, the platform audits the database to be audited for SQL-related issues and obtains a second audit result, including: scanning the database to be audited for SQL-related data at preset time intervals to obtain a second scan result; matching the second scan result based on a preset SQL statement rule library through asynchronous processing to obtain a matching result; and determining a second audit result based on the matching result.

[0085] In a specific implementation, the platform scans the SQL data of the database to be audited at every preset time period to obtain a second scanning result. Specifically, the platform obtains the historical execution records of the audit database through the scanning module at every preset time period and saves them to the local database. The preset time period refers to a predefined time interval, such as daily, weekly or monthly. This time period is used to determine the frequency of scanning to ensure the continuity and timeliness of database audits. Specifically, since the SQL data in the database changes dynamically, regular audits can help to promptly discover and resolve new problems. The platform can ensure the continued compliance and security of the database through continuous scanning, and regular scanning can help database administrators better manage risks and reduce potential negative impacts by promptly discovering and fixing problems.

[0086] In the specific implementation, after determining the second scan result, the platform performs SQL statement auditing through an asynchronous task, and then saves the audit result to the database. The specific audit method is to match the second scan result based on the preset SQL statement rule library to obtain a matching result, wherein the rule scan for SQL-related problems includes full table scan, implicit conversion, query lack of predicates, etc. The rules in the SQL statement rule library support extension and addition. For example, the rules in the SQL statement rule library include the top 10 SQL statements in terms of resource consumption; the top 10 SQL statements in terms of execution time; SQL statements whose query returns a number of results greater than a threshold; SQL statements whose update / insert / delete data is greater than a threshold; SQL statements whose memory consumption exceeds 100M, etc. If the SQL statement executed in the database to be audited meets the above rule problems, it will be identified as a problem with the corresponding rule.

[0087] Step S300: Generate a database health report of the database to be audited based on the first audit result and the second audit result, and send the database health report to the user end.

[0088] It should be noted that the health report of the database is generated based on two different rounds of audit results. Figure 3 The first audit result involves the audit of non-SQL issues, such as database configuration, physical and logical design, data integrity, etc. The second audit result involves the audit of SQL issues, such as SQL query efficiency, security, grammatical correctness, etc. These two rounds of audit results provide a comprehensive view of the health status of the database. The database health report includes a detailed list of issues, a distribution map of audit violations, health indicators and specific audit results. Preferably, the database health report can use special calculation formulas to perform real-time analysis on the collected data and generate a detailed database diagnostic report.

[0089] In a specific implementation, after the platform completes the database health report, the report will be sent to the user or database administrator. This can be done via email, web interface, API call or other communication methods. The user end can be the database administrator's computer, mobile device or other system that receives the report.

[0090] In a specific implementation, the platform generates a database health report of the database to be audited based on the first audit result and the second audit result, including:

[0091] Based on the first audit result and the second audit result, a health index value of the database to be audited is calculated; based on the first audit result, the second audit result and the health index value, a database health report of the database to be audited is generated.

[0092] In a specific implementation, the process of calculating the health index value of the database to be audited based on the first audit result and the second audit result can be understood as the platform calculating a quantitative indicator, namely, the "health index value", through the audit results of the first round (non-SQL issues) and the second round (SQL issues). This index value is a numerical representation of the health status of the database, which may be determined based on a series of scoring criteria or algorithms.

[0093] The health index value may take into account various factors, such as the number of issues found, the severity of the issues, potential security risks, performance bottlenecks, etc. It combines these factors to provide a snapshot of the overall health of the database. This index value can be a percentage, score, or other form of measurement that is used to visually represent the health level of the database. For example, an index value close to 100% or a high score may indicate that the database is in good health, while a low score may indicate that there are more issues that need attention.

[0094] In the specific implementation, after calculating the health index value, the platform will combine the results of the two rounds of audits to generate a detailed database health report. This report will include: the specific value of the health index value and what this value represents; a detailed description of the main problems and risks found in the two rounds of audits; a comprehensive evaluation of database performance, security, stability, etc.; improvement suggestions and repair measures to help database administrators solve the problems found and optimize database performance. The purpose of the report is to provide database administrators with a clear guide to help them understand the current status of the database and take appropriate actions to improve the health of the database. The purpose of this process is to provide a systematic and quantitative method to evaluate the health of the database and provide practical feedback and suggestions so that database administrators or responsible persons can take actions to maintain and improve the performance and security of the database.

[0095] In a specific implementation, the platform calculates the health index value of the database to be audited based on the first audit result and the second audit result, including:

[0096] Obtain a performance reference value; perform performance indicator conversion on the first audit result and the second audit result respectively to obtain a first performance indicator set and a second performance indicator set; determine weight coefficients under different performance indicators based on the first performance indicator set and the second performance indicator set; based on the performance reference value and the weight coefficient, calculate the health index of the first performance indicator set and the second performance indicator set through a preset normalization function to obtain a health index value of the database to be audited.

[0097] It should be noted that the performance reference values ​​refer to a set of predefined standards or benchmarks used to evaluate the performance of a database. These reference values ​​may come from industry standards, best practices, historical data, or target performance of database design.

[0098] In the specific implementation, the first audit result and the second audit result include the problems and situations found in the database audit, where performance indicator conversion refers to converting these audit results into quantifiable performance indicators. Through performance indicator conversion, the platform can obtain two sets of performance indicator sets: the first performance indicator set (related to non-SQL problems) and the second performance indicator set (related to SQL problems).

[0099] Furthermore, the weight coefficient refers to the importance of different performance indicators when evaluating database performance. For example, for some database applications, response time may be more important than resource utilization, so there will be different weights. The determination of the weight coefficient is usually based on business needs, performance goals, and the role of the database.

[0100] In the specific implementation, the normalization function is a mathematical method used to convert different performance indicators into a unified metric so that they can be compared and weighted fairly. Through the normalization function, combined with the performance reference value and the weight coefficient, the health index of each performance indicator can be calculated. Among them, the health index value is a comprehensive indicator that reflects the overall performance and health of the database. The health index value is calculated by comprehensively considering all relevant performance indicators, reference values, weight coefficients, and applying normalization. This index can be used to evaluate whether the performance of the database meets expectations and whether optimization measures need to be taken.

[0101] In the specific implementation, after determining the first performance indicator set and the second performance indicator set, they are defined as: V1 and V2, which represent the two key performance indicator sets of the system. At the same time, it is also necessary to determine the performance reference values: R1, R2, R3, etc. These reference values ​​can be industry standards, historical averages, or thresholds required by the system. Furthermore, the system health index (SHI), that is, the health index value of the database to be audited, can be calculated by the following formula:

[0102] SHI=(w*normalize(V1,R1))+(w2*normalize(V2,R2))+...+(wn*normalize(Vn,Rn))

[0103] Among them, w1, w2, ..., wn are weight coefficients used to indicate the importance of each variable to the system health index. These weight coefficients should be adjusted according to the actual application scenario to ensure that they can accurately reflect the impact of each variable on the system health; normalize(Vi, Ri) is a normalization function used to normalize the variable value Vi to the range of [0, 1]. The specific form of the normalization function can be selected according to the properties of the variable and the reference value. A common normalization method is to use linear transformation or nonlinear transformation (such as logarithmic transformation, exponential transformation, etc.).

[0104] For example, if V1 is an indicator where the smaller the better (such as error rate), the normalization function can be defined as: normalize(V1, R1) = 1-(V1 / R1); if V2 is an indicator where the larger the better (such as throughput), the normalization function can be defined as: normalize(V2, R2) = V2 / R2.

[0105] It should be emphasized that the above is just a simplified example. In practical applications, more variables and more complex normalization methods may need to be considered. In addition, the selection of weight coefficients is also very critical, and they should be carefully adjusted according to the characteristics and requirements of the system.

[0106] Finally, the calculated health index value SHI will be a value between [0,1], where 1 means the system is completely healthy and 0 means there are serious problems with the system. Different thresholds can be set to judge the health of the system according to actual needs.

[0107] Compared with the related art, the audit of the database usually scans and analyzes the SQL problems in the database, and feeds back the analysis results to the person in charge. However, this method only scans and analyzes the SQL problems in the database, and the health analysis of the database is not comprehensive enough, resulting in low accuracy of the audit results. In comparison, the audit platform of the present application audits the non-SQL problems of the database to be audited separately to obtain a first audit result, and audits the SQL problems of the database to be audited to obtain a second audit result. Finally, based on the first audit result and the second audit result, a database health report of the database to be audited is generated, and the database health report is sent to the user end. It is understandable that, on the basis of auditing the SQL problems of the database to be audited, the present application also audits the non-SQL problems of the database to be audited, so as to avoid the impact of database SQL problems on the health of the database, achieve a comprehensive database health analysis, and thus improve the accuracy of the database audit results.

[0108] Based on the above first embodiment, the present application also proposes another embodiment, referring to Figure 4 , the audit method of the database includes:

[0109] In a specific implementation, after the platform generates a corresponding database health report based on the first audit result and the second audit result, and sends the database health report to the user end, the method includes:

[0110] Step A100, determining whether the database health report meets the preset database health condition. If the database health report does not meet the preset database health condition, sending an exception handling notification to the user terminal, and receiving the database to be reviewed after the exception handling sent by the user terminal;

[0111] In the specific implementation, refer to Figure 5, the platform determines whether the database health report meets the preset database health conditions, that is, the platform will evaluate the database health report according to a series of predefined standards or conditions, which may include thresholds in terms of performance indicators, security compliance, data integrity, etc. The system will check the data in the health report, such as the health index value, performance indicator set, severity of the problems found, etc., to determine whether the database meets these preset health conditions. Specifically, the platform can determine whether the preset database health conditions are met based on the health index value. If the health index value of the data to be reviewed is greater than the preset health index value threshold, it means that the database health report meets the preset database health conditions; if the health index value of the data to be reviewed is less than or equal to the preset health index value threshold, it means that the database health report does not meet the preset database health conditions.

[0112] In a specific implementation, if the database health report does not meet the preset database health conditions, that is, if certain key indicators in the database health report do not meet the preset standards, or there are serious problems and risks, then the platform will consider the database to be in an unhealthy or abnormal state.

[0113] In a specific implementation, if the database health report does not meet the preset database health conditions, an exception handling notification is sent to the user end, that is, when the platform detects that the database health status does not meet the preset conditions, the platform will automatically send a notification to the user end (which may be the workstation of the database administrator or system operator). This notification will inform the user of the problems in the database and may require the user to take corresponding measures.

[0114] Furthermore, after receiving the exception handling notification, the user needs to perform corresponding processing on the database, such as fixing the discovered problems, optimizing performance, adjusting configuration, etc. After the processing is completed, the user will send the updated database status or data back to the platform for re-review. This process may involve steps such as rescanning the database, recalculating the health index, and updating the health report.

[0115] It is understandable that the above process is a closed-loop database health monitoring and exception handling mechanism, which is designed to ensure the continued healthy operation of the database. Through automatic evaluation, notification and re-review, database problems can be discovered and resolved in a timely manner, reducing potential risks and losses.

[0116] Step A200, returns to the step of auditing the non-SQL issues of the database to be audited to obtain the first audit result, until the database health report meets the preset database health conditions, and then sends a notification to the user end that the database is in a healthy state.

[0117] In a specific implementation, after receiving the database to be audited after exception processing, the platform re-executes the audit process for the database to be audited until the database health report meets the preset database health conditions, and then sends a notification to the user end that the database is in a healthy state. That is, once the database health report meets all the preset health conditions, the platform will send a notification to the user end (such as a database administrator or system operator) to inform that the database is currently in a healthy state. The notification is a confirmation message, indicating that the database has passed all necessary audits and no problems that will affect its healthy operation have been found.

[0118] In practice, the above process is a continuous audit cycle to ensure that the health of the database meets the established standards. This process may include multiple audits and adjustments until the database fully meets the health conditions. Once these conditions are met, the client will receive a health status notification, which can ensure the stability and reliability of the database.

[0119] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the audit method of the database of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0120] This application also provides a database audit device, please refer to Figure 6 , the audit device of the database includes:

[0121] A first audit module 10 is used to audit the database to be audited for non-SQL issues and obtain a first audit result;

[0122] The second audit module 20 is used to audit the SQL issues of the database to be audited and obtain a second audit result;

[0123] The generating module 30 is used to generate a corresponding database health report based on the first audit result and the second audit result, and send the database health report to the user end.

[0124] Optionally, the database auditing device further includes:

[0125] A judgment module, used to judge whether the database health report meets the preset database health conditions, and if the database health report does not meet the preset database health conditions, send an exception handling notification to the user terminal, and receive the database to be reviewed after the exception handling sent by the user terminal;

[0126] The iteration module is used to return to the step of auditing the non-SQL issues of the audited database to obtain the first audit result, until the database health report meets the preset database health conditions, and then send a notification to the user end that the database is in a healthy state.

[0127] Optionally, the first audit module 10 includes:

[0128] The synchronous processing module is used to scan the non-SQL data in the database to be audited to obtain a first scanning result, and to audit the first scanning result through a synchronous processing method to obtain a first audit result.

[0129] Optionally, the second audit module 20 includes:

[0130] A scanning module, used for scanning the SQL data of the database to be audited at every preset time period to obtain a second scanning result;

[0131] An asynchronous processing module, used for matching the second scanning result based on a preset SQL statement rule library in an asynchronous processing manner to obtain a matching result;

[0132] The audit result determination module is used to determine the second audit result based on the matching result.

[0133] Optionally, the generating module 30 includes:

[0134] A calculation module, used for calculating the health index value of the database to be audited based on the first audit result and the second audit result;

[0135] A report generation module is used to generate a database health report of the database to be audited based on the first audit result, the second audit result and the health index value.

[0136] Optionally, the calculation module includes:

[0137] A reference value acquisition module, used to obtain performance reference values;

[0138] An indicator conversion module, used to convert the first audit result and the second audit result into performance indicators respectively to obtain a first performance indicator set and a second performance indicator set;

[0139] A weight coefficient determination module, used to determine weight coefficients under different performance indicators based on the first performance indicator set and the second performance indicator set;

[0140] A health index calculation module is used to calculate the health index of the first performance indicator set and the second performance indicator set based on the performance reference value and the weight coefficient through a preset normalization function to obtain the health index value of the database to be audited.

[0141] The database audit device provided by the present application adopts the database audit method in the above-mentioned embodiment, which can solve the technical problem of database audit. Compared with the prior art, the beneficial effects of the database audit device provided by the present application are the same as the beneficial effects of the database audit method provided by the above-mentioned embodiment, and other technical features in the database audit device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.

[0142] The present application provides a database auditing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the database auditing method in the above-mentioned embodiment one.

[0143] Reference below Figure 7 , which shows a schematic diagram of the structure of a database audit device suitable for implementing the embodiment of the present application. The database audit device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The audit device of the database shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0144] like Figure 7As shown, the audit device of the database may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM: Read Only Memory) 1002 or the program loaded from the storage device 1003 to the random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the audit device of the database are also stored. The processing device 1001, the ROM 1002 and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the audit device of the database to communicate with other devices wirelessly or by wire to exchange data. Although the audit device of the database with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0145] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0146] The database audit device provided by the present application adopts the database audit method in the above embodiment, which can solve the technical problem of database audit. Compared with the prior art, the beneficial effects of the database audit device provided by the present application are the same as the beneficial effects of the database audit method provided by the above embodiment, and the other technical features in the database audit device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0147] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0148] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0149] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, wherein the computer-readable program instructions are used to execute the database audit method in the above-mentioned embodiment.

[0150] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0151] The computer-readable storage medium may be included in the audit device of the database; or may exist independently without being assembled into the audit device of the database.

[0152] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the audit device of the database, the audit device of the database performs the audit of the database.

[0153] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0154] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0155] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0156] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned database audit method, and can solve the technical problem of database audit. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the database audit method provided by the above-mentioned embodiment, and will not be repeated here.

[0157] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned database audit method when executed by a processor.

[0158] The computer program product provided by this application can solve the technical problem of database auditing. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the database auditing method provided by the above embodiment, which will not be repeated here.

[0159] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A database audit method, characterized in that: Applied to an audit platform, the audit platform is connected to a database to be audited, and the audit method of the database includes: Auditing the database to be audited for non-SQL issues to obtain a first audit result; Auditing the SQL issues of the database to be audited to obtain a second audit result; Based on the first audit result and the second audit result, a database health report of the database to be audited is generated, and the database health report is sent to a user terminal.

2. The database audit method according to claim 1, characterized in that: After the step of generating a corresponding database health report based on the first audit result and the second audit result, and sending the database health report to the user end, the method includes: Determine whether the database health report meets the preset database health condition. If the database health report does not meet the preset database health condition, send an exception handling notification to the user terminal, and receive the database to be reviewed after the exception handling sent by the user terminal; Return to the step of auditing the non-SQL issues of the database to be audited to obtain a first audit result, until the database health report meets the preset database health condition, and then send a notification to the user end that the database is in a healthy state.

3. The database audit method according to claim 1, characterized in that: The step of auditing the database to be audited for non-SQL issues to obtain a first audit result includes: The database to be audited is scanned for non-SQL data to obtain a first scanning result, and the first scanning result is audited through a synchronous processing method to obtain a first audit result.

4. The database audit method according to claim 1, characterized in that: The step of auditing the SQL-related issues of the database to be audited to obtain a second audit result includes: Scanning the SQL data of the database to be audited at every preset time period to obtain a second scanning result; By means of asynchronous processing, the second scanning result is matched based on a preset SQL statement rule library to obtain a matching result; Based on the matching result, a second audit result is determined.

5. The database audit method according to claim 1, characterized in that: The step of generating a database health report of the database to be audited based on the first audit result and the second audit result includes: Calculating a health index value of the database to be audited based on the first audit result and the second audit result; Based on the first audit result, the second audit result, and the health index value, a database health report of the database to be audited is generated.

6. The database audit method according to claim 5, characterized in that: The step of calculating the health index value of the database to be audited based on the first audit result and the second audit result includes: Get performance reference values; Performing performance indicator conversion on the first audit result and the second audit result respectively to obtain a first performance indicator set and a second performance indicator set; Determining weight coefficients under different performance indicators based on the first performance indicator set and the second performance indicator set; Based on the performance reference value and the weight coefficient, a health index calculation is performed on the first performance indicator set and the second performance indicator set through a preset normalization function to obtain a health index value of the database to be audited.

7. A database auditing device, characterized in that: The device comprises: A first audit module, used to audit the database to be audited for non-SQL issues and obtain a first audit result; A second audit module is used to audit the SQL issues of the database to be audited and obtain a second audit result; A generation module is used to generate a corresponding database health report based on the first audit result and the second audit result, and send the database health report to the user end.

8. A database audit device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the database audit method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the database audit method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the database audit method according to any one of claims 1 to 6 are implemented.