A database audit method, device and database proxy server

By configuring multiple database proxy servers and management servers for distributed databases, parsing and auditing database access requests is solved, and the problem of global audit of distributed databases is improved.

CN113010494BActive Publication Date: 2025-05-02BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110288999.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-18
Publication Date
2025-05-02
Estimated Expiration
2041-03-18

AI Technical Summary

Technical Problem

How to conduct global audits of the access behavior of each tenant for distributed databases, and solve the problem that it is difficult to implement global audit of distributed databases in the existing technology.

Method used

By configuring multiple database proxy servers for distributed databases and communicating with management servers for global audits, parsing and auditing database access requests is achieved. The specific steps include obtaining the database access request and parsing results, determining whether to conduct audits based on preset audit rules, obtaining the data to be audited and sending it to the management server, and the management server generates audit results.

Benefits of technology

It realizes global audit of distributed databases, can trace and control the access behavior of each tenant, and improves the security and compliance management of the database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113010494B_ABST
    Figure CN113010494B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a database audit method, device and database proxy server, which relate to the field of database technology. The method is applied to any proxy server configured for a distributed database, including: after obtaining a database access request for a distributed database and a parsing result of the database access request, judging whether to audit the database access request based on the parsing result and a preset audit rule; if the judgment result is yes, obtaining the data to be audited in the parsing result that matches the audit rule; sending the obtained data to be audited to a management server, so that the management server generates an audit result for the audit rule based on the data to be audited sent by multiple database proxy servers. Compared with the prior art, the solution provided by the embodiment of the present invention can realize a global audit of each tenant's access behavior to a distributed database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of databases, and in particular to a database auditing method, device and database proxy server. Background Art

[0002] Currently, with the continuous development of database technology, databases have been widely used in more and more fields, and at the same time, they are also facing more and more security challenges.

[0003] Generally, in order to improve the security of the database, a database audit method (Database audit, DBAudit) can be used to record, analyze and report the user's access to the database, and use the audit results to trace and control the user's access to the database, thereby achieving compliance management of the database, alerting the risky behaviors encountered by the database, and blocking attacks on the database.

[0004] For a distributed database, each tenant can access the distributed database through multiple database proxy servers (Proxy Servers) configured by the distributed database, where different tenants can access the distributed database through different database proxy servers, and the same tenant can also access the distributed database through different database proxy servers.

[0005] Based on this, how to conduct a global audit of each tenant's access behavior to the distributed database has become an urgent problem to be solved. Summary of the invention

[0006] The purpose of the embodiments of the present invention is to provide a database audit method, device and database proxy server to implement a global audit of each tenant's access behavior to a distributed database. The specific technical solution is as follows:

[0007] In a first aspect, an embodiment of the present invention provides a database audit method, which is applied to any one of a plurality of database proxy servers configured for a distributed database, wherein the plurality of database proxy servers are communicatively connected to a preset management server for global audit; the method comprises:

[0008] After obtaining a database access request for the distributed database and a parsing result of the database access request, determining whether to audit the database access request based on the parsing result and a preset audit rule;

[0009] If the judgment result is yes, then obtaining the data to be audited that matches the audit rule in the analysis result;

[0010] The acquired data to be audited is sent to the management server, so that the management server generates an audit result for the audit rule based on the data to be audited sent by the multiple database proxy servers.

[0011] Optionally, in a specific implementation, the audit rule includes: an audit condition and an audit field corresponding to the audit condition; wherein the audit condition is a condition set for a specified field and used to indicate that an access request can be audited, and the audit field is a field in a parsed result of an access request for which data audit is to be performed when any access request satisfies the audit condition;

[0012] The step of determining whether to audit the database access request based on the analysis result and the preset audit rules includes:

[0013] Determine whether the field value of the specified field in the analysis result meets the audit condition;

[0014] The step of obtaining the data to be audited that matches the audit rule in the analysis result includes:

[0015] The field value of the audit field in the parsing result is obtained as the data to be audited.

[0016] Optionally, in a specific implementation, the specified field includes at least one of the following fields:

[0017] Tenants, access time, library tables, access operations, and database nodes.

[0018] Optionally, in a specific implementation, before the step of sending the data to be audited to the management server, the method further includes:

[0019] Cache the acquired data to be audited in the specified cache space;

[0020] The step of sending the acquired data to be audited to the management server comprises:

[0021] When the data to be audited cached in the designated cache space meets a preset sending condition, the cached data to be audited is sent to the management server;

[0022] The sending condition includes at least one of the following conditions:

[0023] The amount of cached data to be audited reaches the preset amount of data;

[0024] The time length since the last sending of the cached audit data to the management server reaches a preset time length.

[0025] Optionally, in a specific implementation, the method further includes:

[0026] Output audit rule setting interface;

[0027] Obtaining an audit rule update instruction issued by a user based on the audit rule setting interface;

[0028] Based on the audit rule update instruction, the audit rule is updated.

[0029] In a second aspect, an embodiment of the present invention provides a database auditing device, which is applied to any one of a plurality of database proxy servers configured for a distributed database, wherein the plurality of database proxy servers are communicatively connected to a preset management server for global auditing; the method comprises:

[0030] A request judgment module, configured to, after obtaining a database access request for the distributed database and a parsing result of the database access request, determine whether to audit the database access request based on the parsing result and a preset audit rule; if the judgment result is yes, trigger the data acquisition module;

[0031] The data acquisition module is used to acquire the data to be audited that matches the audit rules in the analysis result;

[0032] The data sending module is used to send the acquired data to be audited to the management server, so that the management server generates an audit result for the audit rule based on the data to be audited sent by the multiple database proxy servers.

[0033] Optionally, in a specific implementation, the audit rule includes: an audit condition and an audit field corresponding to the audit condition; wherein the audit condition is a condition set for a specified field and used to indicate that an access request can be audited, and the audit field is a field in a parsed result of an access request for which data audit is to be performed when any access request satisfies the audit condition;

[0034] The request judgment module is specifically used to: judge whether the field value of the specified field in the analysis result meets the audit condition;

[0035] The data acquisition module is specifically used to obtain the field value of the audit field in the analysis result as the data to be audited.

[0036] Optionally, in a specific implementation, the designated field includes at least one of the following fields: tenant, access time, library table, access operation, and database node.

[0037] Optionally, in a specific implementation, the device further includes:

[0038] A data cache module, used for caching the acquired data to be audited in a designated cache space before sending the data to be audited to the management server;

[0039] The data sending module is specifically used for: when the data to be audited cached in the designated cache space meets the preset sending condition, sending the cached data to be audited to the management server;

[0040] The sending condition includes at least one of the following conditions:

[0041] The amount of cached data to be audited reaches the preset amount of data;

[0042] The time length since the last sending of the cached audit data to the management server reaches a preset time length.

[0043] Optionally, in a specific implementation, the device further includes:

[0044] Interface output module, used to output the audit rule setting interface;

[0045] An instruction acquisition module, used to acquire an audit rule update instruction issued by a user based on the audit rule setting interface;

[0046] A rule changing module is used to update the audit rules based on the audit rule update instruction.

[0047] In a third aspect, an embodiment of the present invention provides a database audit system, the system comprising: a plurality of database proxy servers configured for a distributed database and a management server for global auditing, the plurality of database proxy servers being communicatively connected to the management server;

[0048] Each database proxy server is used to, after obtaining a database access request for the distributed database and a parsing result of the database access request, determine whether to audit the database access request based on the parsing result and a preset audit rule; if the judgment result is yes, obtain the data to be audited in the parsing result that matches the audit rule; and send the obtained data to be audited to the management server;

[0049] The management server is used to generate an audit result for the audit rule based on the data to be audited sent by the multiple database proxy servers.

[0050] Optionally, in a specific implementation, the management server is a server in a preset audit database cluster, and the audit database cluster further includes: a storage server;

[0051] The management server is further used to send the audit result to the storage server;

[0052] The storage server is used to store the audit results sent by the management server.

[0053] Optionally, in a specific implementation, the number of the storage servers is multiple;

[0054] The management server is specifically configured to determine a target storage server for storing the audit result from a plurality of storage servers according to a preset storage rule, and send the audit result to the target storage server.

[0055] Optionally, in a specific implementation, the audit rule includes: an audit condition and an audit field corresponding to the audit condition; wherein the audit condition is a condition set for a specified field and used to indicate that an access request can be audited, and the audit field is a field in a parsed result of an access request for which data audit is to be performed when any access request satisfies the audit condition;

[0056] Each database proxy server is specifically used to: determine whether the field value of the specified field in the analysis result meets the audit condition; if the determination result is yes, obtain the field value of the audit field in the analysis result as the data to be audited.

[0057] Optionally, in a specific implementation, the designated field includes at least one of the following fields: tenant, access time, library table, access operation, and database node.

[0058] Optionally, in a specific implementation, each database proxy server 610 is further configured to cache the acquired data to be audited in a designated cache space;

[0059] Each database proxy server is specifically used for: when the data to be audited cached in the designated cache space meets the preset sending condition, sending the cached data to be audited to the management server;

[0060] The sending condition includes at least one of the following conditions:

[0061] The amount of cached data to be audited reaches the preset amount of data;

[0062] The time length since the last sending of the cached audit data to the management server reaches a preset time length.

[0063] Optionally, in a specific implementation, each database proxy server is further used to output an audit rule setting interface; obtain an audit rule update instruction issued by a user based on the audit rule setting interface; and update the audit rules based on the audit rule update instruction.

[0064] In a fourth aspect, an embodiment of the present invention provides a database proxy server, which is a proxy server configured for a distributed database and is communicatively connected to a preset management server for global auditing, and the database proxy server includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0065] Memory, used to store computer programs;

[0066] The processor is used to implement the steps of any database audit method provided in the first aspect when executing the program stored in the memory.

[0067] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any database audit method provided in the first aspect are implemented.

[0068] In a sixth aspect, an embodiment of the present invention provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the steps of any database auditing method provided in the first aspect.

[0069] Beneficial effects of the embodiments of the present invention:

[0070] As can be seen from the above, by applying the solution provided by the embodiment of the present invention, in order to implement global auditing of each tenant's access behavior to a distributed database, a management server that is connected to multiple database proxy servers configured for the distributed database and used for global auditing can be set.

[0071] In this way, after obtaining the database access request for the distributed database and the parsing result of the database access request, any database proxy server configured for the distributed database can determine whether to audit the database access request based on the parsing result and the preset audit rules, and when the judgment result is yes, obtain the data to be audited in the parsing result that matches the audit rules. Then, the database proxy server can send the acquired data to be audited to the set management server. Therefore, after receiving the data to be audited sent by each database proxy server, the management server can generate the audit results for the above audit rules based on the data to be audited sent by each database proxy server.

[0072] Based on this, by applying the solution provided by the embodiment of the present invention, since the management server for global audit can communicate with multiple database proxy servers configured for the distributed database, the management server can obtain the global audit data for the distributed database, thereby realizing the global audit of the distributed database. In this way, it is possible to realize the global audit of the access behavior of each tenant to the distributed database. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] In order to more clearly illustrate the embodiments of the present invention 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, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.

[0074] Figure 1 It is a schematic diagram of the structure of a database audit system consisting of three database proxy servers and a management server;

[0075] Figure 2 A flowchart of a database audit method provided by an embodiment of the present invention;

[0076] Figure 3 A flowchart of another database audit method provided by an embodiment of the present invention;

[0077] Figure 4 A flowchart of another database audit method provided by an embodiment of the present invention;

[0078] Figure 5 A schematic diagram of the structure of a database auditing device provided by an embodiment of the present invention;

[0079] Figure 6 A schematic diagram of the structure of a database audit system provided by an embodiment of the present invention;

[0080] Figure 7 A schematic diagram of the structure of a database proxy server provided by an embodiment of the present invention;

[0081] Figure 8 A schematic diagram of a specific implementation of a database audit method provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0082] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.

[0083] For a distributed database, each tenant can access the distributed database through multiple database proxy servers configured by the distributed database. Different tenants can access the distributed database through different database proxy servers, and the same tenant can also access the distributed database through different database proxy servers. Based on this, how to perform a global audit of each tenant's access behavior to the distributed database has become an urgent problem to be solved.

[0084] In order to solve the above technical problems, an embodiment of the present invention provides a database audit method.

[0085] The method can be applied to any one of a plurality of database proxy servers configured for a distributed database, and the plurality of database proxy servers can be communicatively connected with a preset management server for global auditing.

[0086] In this way, the multiple database proxy servers configured for the distributed database and the preset management server for global auditing can constitute a database auditing system. For the sake of ease of description, the database proxy servers configured for the distributed database are referred to as database proxy servers, and the preset management server for global auditing is referred to as management server.

[0087] For example, Figure 1 As shown, it is a schematic diagram of the structure of a database audit system composed of three database proxy servers and a management server. The system includes: database proxy servers 110-1, 110-2 and 110-3 and management server 120. Furthermore, the database proxy servers 110-1, 110-2 and 110-3 can all be used as the execution subject of a database audit method provided by an embodiment of the present invention, and send the acquired data to be audited to the management server 120, so that the management server 120 generates an audit result for the audit rule based on the data to be audited sent by the database proxy servers 110-1, 110-2 and 110-3.

[0088] In order to respond to the user's database access request for the distributed database, each database proxy server may include a computing engine. When a tenant accesses the distributed database through a database proxy server, the database proxy server can obtain the database access request for the distributed database sent by the tenant. Then, the computing engine in the database proxy server can parse the database access request, obtain the parsing result, and generate a corresponding execution plan based on the parsing result. Then, according to the execution plan, the data storage node in the distributed database can be accessed to obtain the response result of the database access request, and the response result is fed back to the device that sent the database access request. At this point, the response to the above database access request is completed.

[0089] Furthermore, for the convenience of description, the device for executing a database audit method provided by an embodiment of the present invention may be referred to as a database audit device.

[0090] Optionally, the above-mentioned database auditing device can be added to the computing engine of the database proxy server. That is to say, a database auditing method provided by an embodiment of the present invention can be used as one of the functions that can be implemented by the computing engine. Then, the computing engine of the database proxy server can implement the parsing and response to the database access request, and can also implement a database auditing method provided by an embodiment of the present invention. In this way, the execution subject of a database auditing method provided by an embodiment of the present invention can specifically be the computing engine in the database proxy server.

[0091] Optionally, the above-mentioned database audit device can also be set as a device that is independent of the computing engine of the database proxy server and is in communication connection with the computing engine. Then, in an embodiment of the present invention, the computing engine of the database proxy server is used to implement the parsing and response to the database access request, and the database audit device is used to implement a database audit method provided by an embodiment of the present invention, wherein the database audit device can obtain the parsing result of the database access request from the above-mentioned computing engine. In this way, the execution subject of the database audit method provided by an embodiment of the present invention can specifically be the database audit device in the database proxy server.

[0092] In addition, it should be noted that, in the above two optional embodiments, the execution subject of a database audit method provided by the embodiment of the present invention can be understood as: a database proxy server.

[0093] A database audit method provided by an embodiment of the present invention may include the following steps:

[0094] After obtaining a database access request for the distributed database and a parsing result of the database access request, determining whether to audit the database access request based on the parsing result and a preset audit rule;

[0095] If the judgment result is yes, then obtaining the data to be audited that matches the audit rule in the analysis result;

[0096] The acquired data to be audited is sent to the management server, so that the management server generates an audit result for the audit rule based on the data to be audited sent by the multiple database proxy servers.

[0097] As can be seen from the above, by applying the solution provided by the embodiment of the present invention, in order to implement global auditing of each tenant's access behavior to a distributed database, a management server that is connected to multiple database proxy servers configured for the distributed database and used for global auditing can be set.

[0098] In this way, after obtaining the database access request for the distributed database and the parsing result of the database access request, any database proxy server configured for the distributed database can determine whether to audit the database access request based on the parsing result and the preset audit rules, and when the judgment result is yes, obtain the data to be audited in the parsing result that matches the audit rules. Then, the database proxy server can send the acquired data to be audited to the set management server. Therefore, after receiving the data to be audited sent by each database proxy server, the management server can generate the audit results for the above audit rules based on the data to be audited sent by each database proxy server.

[0099] Based on this, by applying the solution provided by the embodiment of the present invention, since the management server for global audit can communicate with multiple database proxy servers configured for the distributed database, the management server can obtain the global audit data for the distributed database, thereby realizing the global audit of the distributed database. In this way, it is possible to realize the global audit of the access behavior of each tenant to the distributed database.

[0100] A database audit method provided by an embodiment of the present invention is described in detail below in conjunction with the accompanying drawings.

[0101] like Figure 2 As shown, it is a flowchart of a database audit method provided by an embodiment of the present invention, such as Figure 2 As shown, the method may include the following steps:

[0102] S201: after obtaining a database access request for a distributed database and a parsing result of the database access request, judging whether to audit the database access request based on the parsing result and a preset audit rule; if the judgment result is yes, executing step S202;

[0103] After obtaining the database access request for the distributed database, the computing engine in the database proxy server can parse the database access request, thereby obtaining the parsing result of the database access request.

[0104] In this way, after obtaining the database access request for the distributed database and the parsing result of the database access request, the database proxy server can determine whether to audit the database access request based on the parsing result and the preset audit rules. If the judgment result is yes, it means that the database access request needs to be audited, so that the parsing result of the database access request contains the audit data required for the audit. Based on this, if the judgment result is yes, the database proxy server can continue to execute the subsequent step S202.

[0105] Correspondingly, if the judgment result is no, there is no need to audit the database access request, and thus, there is no need to continue to execute subsequent steps, and the database access request can be ignored.

[0106] Among them, when a database audit device setting is added to the computing engine of the database proxy server, after the computing engine of the database proxy server parses and obtains the parsing result of the database access request, the computing engine can directly obtain the database access request for the distributed database and the parsing result of the database access request, so that the computing engine can continue to execute a database audit method provided by an embodiment of the present invention.

[0107] When the database audit device is set to be independent of the computing engine of the database proxy server and is communicatively connected to the computing engine, after the computing engine parses and obtains the parsing result of the above-mentioned database access request, the database audit device can obtain the database access request for the distributed database and the parsing result of the database access request from the computing engine, and continue to execute a database audit method provided by an embodiment of the present invention.

[0108] The preset audit rules can indicate which data access requests need to be audited and what specific contents need to be audited. In order to make the solution clear and the layout clear, the specific contents of the audit rules will be introduced later.

[0109] S202: Obtaining the data to be audited that matches the audit rules in the analysis results;

[0110] Furthermore, when the judgment result of the above step S201 is yes, it means that the above acquired database access request needs to be audited, and the parsed result of the database access request contains the audited data required for the audit.

[0111] In this way, the data to be audited that matches the audit rules can be obtained from the parsing results.

[0112] S203: Send the acquired data to be audited to the management server, so that the management server generates an audit result for the audit rule based on the data to be audited sent by the multiple database proxy servers.

[0113] After the above data to be audited is obtained, the obtained data to be audited can be sent to the management server.

[0114] In this way, since the management server can communicate with multiple database proxy servers configured for the distributed database, the management server can obtain the audit data sent by each database proxy server configured for the distributed database. Therefore, the management server can obtain the audit data in the parsing results of each database access request for the distributed database sent by each tenant through each database proxy server. In other words, the management server can obtain the global audit data for the distributed database.

[0115] Based on this, the management server can generate audit results for the above preset audit rules based on the audit data sent by multiple database proxy servers. Among them, since the management server can obtain the global audit data for the distributed database, the audit results generated by the management server are global audit results for the distributed database and for the above preset audit rules. In this way, it is possible to implement a global audit of each tenant's access behavior to the distributed database.

[0116] Exemplarily, in one implementation, the management server may directly determine the acquired data to be audited sent by the multiple database proxy servers as the audit results for the audit rules.

[0117] Exemplarily, in another implementation, the management server may process the acquired audit data sent by multiple database proxy servers according to preset processing rules, thereby determining the obtained processing results as audit results for the audit rules.

[0118] For example, the management server may rearrange the acquired data to be audited sent by multiple database proxy servers according to a preset arrangement rule, and determine the rearranged data to be audited as the audit result for the audit rule.

[0119] Of course, the management server may also generate audit results for the audit rules in other ways, which are not specifically limited in the embodiment of the present invention.

[0120] Exemplarily, in one implementation, the management server may be a server in a preset audit database cluster, and the audit database cluster may further include: a storage server.

[0121] In this way, after generating the audit result for the audit rule, the management server can further send the audit result to the storage server, so that the storage server can store the received audit result.

[0122] Based on this, by applying this implementation, the audit results can be saved, so that when the audit results need to be applied again, the audit results can be directly obtained from the storage server to ensure the normal progress of subsequent applications.

[0123] Exemplarily, in another implementation, the management server may be a server in a preset audit database cluster, and the audit database cluster may further include: a plurality of storage servers.

[0124] The management server may pre-set storage rules, where the storage rules are used to indicate the types of audit results stored in each storage server.

[0125] For example, the audit database cluster includes three storage servers 1-3; storage server 1 is used to store the audit results of the audit rules with audit conditions for tenant A; storage server 2 is used to store the audit results of the audit rules with audit conditions for tenant B; storage server 3 is used to store the audit results of the audit rules with audit conditions for tenant C, etc.

[0126] Thus, after generating the audit results for the audit rules, the management server can determine the target storage server for storing the audit results from multiple storage servers according to the preset storage rules, and then the management server can send the generated audit results to the target storage server. In this way, the target storage server can store the received audit results.

[0127] Based on this, by applying this implementation method, the audit results can be classified and saved. Therefore, when the audit results need to be applied again, the audit results can be directly searched from the target storage server that saves the audit results according to the type of audit results required. Under the premise of ensuring the normal operation of subsequent applications, the time required for searching audit results can be saved and the search efficiency can be improved.

[0128] As can be seen from the above, by applying the solution provided by the embodiment of the present invention, since the management server for global audit can communicate with multiple database proxy servers configured for the distributed database, the management server can obtain the global audit data for the distributed database, thereby realizing the global audit of the distributed database. In this way, it is possible to realize the global audit of the access behavior of each tenant to the distributed database.

[0129] In addition, the solution provided by the embodiment of the present invention does not need to bind tenants and database proxy servers, and can fully utilize the high concurrency and high availability characteristics of distributed databases. Moreover, it is only necessary to set up a management server that is connected to multiple database proxy servers configured for the distributed database, without setting up a large number of system components such as a data storage system, a data analysis system, and a data aggregation system, which can reduce the data transmission chain, improve audit efficiency, and reduce the complexity of the solution.

[0130] Furthermore, since the audit result of the database access request is parsed by the computing engine in the database proxy server, when the database access request is encrypted, the audit result of the database access request can still be obtained to implement the audit of the database access request. In addition, since the computing engine can respond to the database access request normally during the audit process, the real-time business of the distributed database will not be affected.

[0131] Optionally, in a specific implementation, the audit rules include: an audit condition and an audit field corresponding to the audit condition; wherein the audit condition is a condition set for a specified field and is used to characterize that an access request can be audited, and the audit field is a field in the parsing result of the access request that is to be audited when any access request meets the audit condition.

[0132] For example, the audit condition included in the audit rule is: tenant A, and the audit fields are: access time, access operation, and library table. Then the audit rule means: for each database access request, if the sender of the database access request is tenant A, the database access request is audited, and the data to be audited obtained from the parsed result of the database access request is: the access time of the database access request, the accessed library table, and the access operation performed. In addition, in this example, the designated field is the tenant.

[0133] Exemplarily, the designated field may include at least one of the following fields: tenant, access time, library table, access operation, and database node. Of course, the designated field may also include other fields, which are not specifically limited in the embodiment of the present invention.

[0134] Exemplarily, for a database access request, the parsing result of the database access request includes: tenant A, access time is 10:29:33 on January 28, 2021, the accessed library table is library table C, and the access operation performed is a deletion operation. Then, the database access request is audited, and the data to be audited is obtained: January 28, 2021 10:29:33, library table C, and deletion operation.

[0135] Based on this, in this specific implementation, if Figure 3 As shown:

[0136] The above step S201, based on the analysis result and the preset audit rules, determines whether to audit the database access request, and may include the following step S201A:

[0137] S201A: Determine whether the field value of the specified field in the parsing result meets the audit condition;

[0138] The above step S202, obtaining the data to be audited that matches the audit rules in the analysis results, may include the following step S202A:

[0139] S202A: Obtain the field value of the audit field in the parsing result as the data to be audited.

[0140] In this specific implementation, after obtaining the parsing result of the database access request, the field value of the specified field in the parsing result can be determined first, and then it can be determined whether the field value meets the audit condition.

[0141] When the field value meets the audit condition, it can be determined that the database access request is to be audited. Then, the field value of the audit field in the parsing result can be obtained as the data to be audited.

[0142] For example, the audit condition included in the audit rule is: tenant A, and the audit fields are: access time, access operation, and library table. After obtaining a database access request and the parsing result of the database access request, it is possible to first determine whether the field value of the tenant field in the parsing result of the database access request is A. Thus, if the judgment result is yes, it is possible to further obtain the field values ​​of the access time field, access operation field, and library table field in the parsing result of the database access request, and thus use the obtained field values ​​of the access time field, access operation field, and library table field as the data to be audited.

[0143] Optionally, in a specific implementation, such as Figure 4 As shown, a database audit method provided by an embodiment of the present invention may also include the following step S200:

[0144] S200: caching the acquired data to be audited in a designated cache space;

[0145] Accordingly, in this specific implementation, the above step S203, sending the acquired data to be audited to the management server, may include the following step S203A:

[0146] S203A: When the data to be audited cached in the designated cache space meets the preset sending condition, the cached data to be audited is sent to the management server;

[0147] The sending condition includes at least one of the following conditions:

[0148] The amount of cached data to be audited reaches the preset amount of data;

[0149] The preset time has passed since the cached audit data was last sent to the management server.

[0150] In this specific implementation, after obtaining the data to be audited, the obtained data to be audited may not be sent to the management server immediately, but may be cached in a designated cache space. Furthermore, when the data to be audited cached in the designated cache space meets a preset sending condition, the cached data to be audited may be sent to the management server.

[0151] In this way, the database proxy server can transmit more audited data to the management server through one data transmission, thereby reducing the number of interactions between the database proxy server and the management server, alleviating the pressure of data interaction and saving the waste of resources caused by data interaction.

[0152] And, optionally, after the acquired data to be audited is cached in the designated cache space, the cached data to be audited can also be sorted, for example, rearranged according to designated fields, etc., thereby reducing the processing complexity of the management server in generating audit results for audit rules, reducing the processing pressure of the management server, and improving the efficiency of generating audit results.

[0153] Different audit rules can be preset according to different audit purposes. Therefore, in the actual application process, as the application scenario changes, the audit purpose may change, and thus the audit rules can be updated accordingly.

[0154] Based on this, optionally, in a specific implementation, a database audit method provided by an embodiment of the present invention may further include the following steps AC.

[0155] Step A: Output the audit rule setting interface;

[0156] Step B: obtaining an audit rule update instruction issued by the user based on the audit rule setting interface;

[0157] Step C: Update the audit rules based on the audit rule update instruction.

[0158] In this specific implementation, the database proxy server can output an audit rule setting interface, so that the user can enter new audit rules in the audit rule setting interface by inputting, clicking, etc., thereby sending audit rule update instructions to the database proxy server.

[0159] In this way, the database proxy server can obtain the audit rule update instruction issued by the user based on the audit rule setting interface, and update the audit rules based on the obtained audit rule update instruction.

[0160] Optionally, when the user sends an audit rule update instruction to the database proxy server, the user may indicate that the audit rule update instruction is only used to change the audit rules in the database proxy server. For example, the above-mentioned audit rule setting interface may include: a first update button, and the first update button is: a button for issuing an instruction to change only the audit rules in the database proxy server. After the user outputs the new audit rules, the user may click the first update button, so that the database proxy server can obtain the audit rule update instruction issued by the user based on the audit rule setting interface, and determine that the audit rule update instruction is only used to change the audit rules in the database proxy server.

[0161] Based on this, in this specific implementation, the multiple database proxy servers set for the distributed database may include different audit rules, so that multi-dimensional global auditing of the distributed database can be implemented simultaneously.

[0162] Correspondingly, optionally, when sending an audit rule update instruction to a database proxy server, the user may indicate that the audit rule update instruction is used to change the audit rules in all database proxy servers.

[0163] For example, the above-mentioned audit rule setting interface may include: a second update button, which is a button for issuing an instruction to change the audit rules in all database proxy servers set for the distributed database. After the user outputs the new audit rules, the user can click the second update button, so that the database proxy server can obtain the audit rule update instruction issued by the user based on the audit rule setting interface, and determine that the audit rule update instruction is used to change the audit rules in all database proxy servers set for the distributed database. In this way, the database proxy server that obtains the audit rule update instruction issued by the user based on the audit rule setting interface can record the updated content of the audit rules indicated by the audit rule update instruction in the audit rule library table in the distributed database, so that other database proxy servers set for the distributed database can regularly read the updated content of the audit rules from the audit rule library table and update the local audit rules according to the updated content.

[0164] Based on this, in this specific implementation, the audit rules of all database proxy servers can be changed by inputting a command once, thereby saving the time for changing the audit rules and improving the updating efficiency of the audit rules.

[0165] Correspondingly, optionally, when sending an audit rule update instruction to a database proxy server, the user may indicate that the audit rule update instruction is used to change the audit rules in some database proxy servers set for the distributed database.

[0166] For example, the above-mentioned audit rule setting interface may include: a third update button and a designated input area, the third update button is: a button for issuing an instruction to change the audit rules in some database proxy servers set for the distributed database, and the user can enter the identification information of the database proxy server whose audit rules are to be changed in the designated input area. Then, after the user outputs the new audit rules and the identification information of the database proxy server whose audit rules are to be changed, the user can click the third update button, so that the database proxy server can obtain the audit rule update instruction issued by the user based on the audit rule setting interface and the identification information entered by the user in the designated input area, and determine that the audit rule update instruction is used to change the audit rules in some database proxy servers set for the distributed database. In this way, the database proxy server that obtains the audit rule update instruction issued by the user based on the audit rule setting interface can record the audit rule update content indicated by the audit rule update instruction and the identification information entered by the user in the designated input area into the audit rule library table in the distributed database. Thus, other database proxy servers set up for the distributed database can regularly read the updated content of the audit rules from the audit rule library table, and only the database proxy server that has the identification information entered by the user in the designated input area can update the local audit rules according to the updated content.

[0167] Based on this, in this specific implementation, multiple database proxy servers set for distributed databases can include different audit rules, so that multi-dimensional global audit of distributed databases can be implemented at the same time. In addition, the audit rules of multiple database proxy servers with the same audit rules can be changed by inputting a single instruction, thereby saving time for changing the audit rules and improving the updating efficiency of the audit rules.

[0168] In order to facilitate understanding of a database audit method provided by an embodiment of the present invention, Figure 8 As shown, it is a schematic diagram of a specific implementation of a database audit method provided by an embodiment of the present invention.

[0169] Proxy1 and Proxy2 are any two database proxy servers among a plurality of database proxy servers set for a distributed database. In addition, each database proxy server includes: a computing engine and an audit proxy module, wherein the audit proxy module can store audit rules and includes a designated cache space.

[0170] DB (database) 1-DBN in the distributed database are each storage node in the distributed database; DB1'-DBM in the audit database cluster are each storage server in the audit database cluster.

[0171] Since each database proxy server applies a database audit method provided by an embodiment of the present invention in the same manner, a database audit method provided by an embodiment of the present invention is described below using Proxy1 as an example. 1. SQL request: The tenant sends an SQL (Structured Query Language) request for a distributed database to Proxy1, where the SQL request is a database access request. In addition, the computing engine of Proxy1 receives the SQL request, parses the SQL request, obtains the parsing result, and generates an execution plan.

[0172] 2. SQL execution and return results: The computing engine of Proxy1 can continue to execute the above generated execution plan and access the distributed database to obtain the response result of the above SQL request.

[0173] 5. SQL request return: After obtaining the response result of the above SQL request, Proxy1 can directly feedback the response result of the SQL request to the tenant.

[0174] 3. Audit rules: The computing engine of Proxy1 obtains the audit rules from the audit proxy module, and determines whether to audit the received SQL request based on the parsing results of the SQL request and the audit rules.

[0175] 4. Audit content collection: If the judgment result in step 3 is yes, the computing engine of Proxy1 can obtain the data to be audited that matches the audit rules in the parsing result of the SQL request.

[0176] 6. SQL audit content synthesis and storage: The audit agent sends the received data to be audited to the management server in the audit database cluster. Then, the management server can generate audit results based on the received data to be audited, and determine the target storage server for storing the audit results from DB1'-DBM according to the preset storage rules, and send the audit results to the target storage server.

[0177] Based on this, by applying the solution provided by the embodiment of the present invention, since the management server for global audit can communicate with multiple database proxy servers configured for the distributed database, the management server can obtain the global audit data for the distributed database, thereby realizing the global audit of the distributed database. In this way, it is possible to realize the global audit of the access behavior of each tenant to the distributed database.

[0178] Corresponding to the database audit method provided by the above-mentioned embodiment of the present invention, the embodiment of the present invention also provides a database audit device.

[0179] The database auditing device is applied to any one of a plurality of database proxy servers configured for a distributed database, and the plurality of database proxy servers are communicatively connected with a preset management server for global auditing.

[0180] Figure 5 A schematic diagram of the structure of a database auditing device provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown, the device may include the following modules:

[0181] The request judgment module 510 is used to, after obtaining the database access request for the distributed database and the parsing result of the database access request, determine whether to audit the database access request based on the parsing result and the preset auditing rules; if the judgment result is yes, trigger the data acquisition module 520;

[0182] The data acquisition module 520 is used to acquire the data to be audited that matches the audit rule in the analysis result;

[0183] The data sending module 530 is used to send the acquired data to be audited to the management server, so that the management server generates an audit result for the audit rule based on the data to be audited sent by the multiple database proxy servers.

[0184] As can be seen from the above, by applying the solution provided by the embodiment of the present invention, in order to implement global auditing of each tenant's access behavior to a distributed database, a management server that is connected to multiple database proxy servers configured for the distributed database and used for global auditing can be set.

[0185] In this way, after obtaining the database access request for the distributed database and the parsing result of the database access request, any database proxy server configured for the distributed database can determine whether to audit the database access request based on the parsing result and the preset audit rules, and when the judgment result is yes, obtain the data to be audited in the parsing result that matches the audit rules. Then, the database proxy server can send the acquired data to be audited to the set management server. Therefore, after receiving the data to be audited sent by each database proxy server, the management server can generate the audit results for the above audit rules based on the data to be audited sent by each database proxy server.

[0186] Based on this, by applying the solution provided by the embodiment of the present invention, since the management server for global audit can communicate with multiple database proxy servers configured for the distributed database, the management server can obtain the global audit data for the distributed database, thereby realizing the global audit of the distributed database. In this way, it is possible to realize the global audit of the access behavior of each tenant to the distributed database.

[0187] Optionally, in a specific implementation, the audit rule includes: an audit condition and an audit field corresponding to the audit condition; wherein the audit condition is a condition set for a specified field and used to indicate that an access request can be audited, and the audit field is a field in a parsed result of an access request for which data audit is to be performed when any access request satisfies the audit condition;

[0188] The request determination module 510 is specifically used to: determine whether the field value of the specified field in the parsing result meets the audit condition;

[0189] The data acquisition module 520 is specifically used to obtain the field value of the audit field in the analysis result as the data to be audited.

[0190] Optionally, in a specific implementation, the designated field includes at least one of the following fields: tenant, access time, library table, access operation, and database node.

[0191] Optionally, in a specific implementation, the device further includes:

[0192] A data cache module, used for caching the acquired data to be audited in a designated cache space before sending the data to be audited to the management server;

[0193] The data sending module 530 is specifically used to: when the data to be audited cached in the designated cache space meets the preset sending condition, send the cached data to be audited to the management server;

[0194] The sending condition includes at least one of the following conditions:

[0195] The amount of cached data to be audited reaches the preset amount of data;

[0196] The time length since the last sending of the cached audit data to the management server reaches a preset time length.

[0197] Optionally, in a specific implementation, the device further includes:

[0198] Interface output module, used to output the audit rule setting interface;

[0199] An instruction acquisition module, used to acquire an audit rule update instruction issued by a user based on the audit rule setting interface;

[0200] A rule changing module is used to update the audit rules based on the audit rule update instruction.

[0201] Corresponding to a database audit method provided by an embodiment of the present invention, an embodiment of the present invention also provides a database audit system.

[0202] Figure 6 A schematic diagram of the structure of a database audit system provided by an embodiment of the present invention. Figure 6 As shown, the system includes: a plurality of database proxy servers 610 configured for a distributed database and a management server 620 for global auditing, wherein the plurality of database proxy servers 610 are in communication connection with the management server 620;

[0203] Each database proxy server 610 is used to determine whether to audit the database access request based on the parsing result and the preset auditing rule after obtaining the database access request for the distributed database and the parsing result of the database access request; if the judgment result is yes, obtain the data to be audited in the parsing result that matches the auditing rule; and send the obtained data to be audited to the management server 620;

[0204] The management server 620 is used to generate audit results for audit rules based on the audit data sent by the multiple database proxy servers 610.

[0205] As can be seen from the above, by applying the solution provided by the embodiment of the present invention, in order to implement global auditing of each tenant's access behavior to a distributed database, a management server that is connected to multiple database proxy servers configured for the distributed database and used for global auditing can be set.

[0206] In this way, after obtaining the database access request for the distributed database and the parsing result of the database access request, any database proxy server configured for the distributed database can determine whether to audit the database access request based on the parsing result and the preset audit rules, and when the judgment result is yes, obtain the data to be audited in the parsing result that matches the audit rules. Then, the database proxy server can send the acquired data to be audited to the set management server. Therefore, after receiving the data to be audited sent by each database proxy server, the management server can generate the audit results for the above audit rules based on the data to be audited sent by each database proxy server.

[0207] Based on this, by applying the solution provided by the embodiment of the present invention, since the management server for global audit can communicate with multiple database proxy servers configured for the distributed database, the management server can obtain the global audit data for the distributed database, thereby realizing the global audit of the distributed database. In this way, it is possible to realize the global audit of the access behavior of each tenant to the distributed database.

[0208] Optionally, in a specific implementation, the management server 620 is a server in a preset audit database cluster, and the audit database cluster further includes: a storage server;

[0209] The management server 620 is also used to send the audit results to the storage server;

[0210] The storage server is used to store the audit results sent by the management server 620.

[0211] In this specific implementation, after generating the audit result for the audit rule, the management server 620 may further send the audit result to the storage server, so that the storage server can store the received audit result.

[0212] In this way, the audit results can be saved, so that when the audit results need to be applied again, the audit results can be directly obtained from the storage server to ensure the normal progress of subsequent applications.

[0213] Optionally, in a specific implementation, the number of the above-mentioned storage servers is multiple;

[0214] The management server 620 is specifically used to determine a target storage server for storing the audit results from a plurality of storage servers according to a preset storage rule, and send the audit results to the target storage server.

[0215] In this specific implementation, the preset audit database cluster may include multiple storage servers, and storage rules may be preset, where the storage rules are used to indicate the types of audit results stored in each storage server.

[0216] For example, the preset audit database cluster includes three storage servers 1-3; storage server 1 is used to store the audit results of the audit rules with audit conditions for tenant A; storage server 2 is used to store the audit results of the audit rules with audit conditions for tenant B; storage server 3 is used to store the audit results of the audit rules with audit conditions for tenant C, etc.

[0217] Thus, after generating the audit result for the audit rule, the management server 620 can determine the target storage server for storing the audit result from multiple storage servers according to the preset storage rule, and then the management server 620 can send the generated audit result to the target storage server. In this way, the target storage server can store the received audit result.

[0218] Optionally, in a specific implementation, the audit rule includes: an audit condition and an audit field corresponding to the audit condition; wherein the audit condition is a condition set for a specified field and used to indicate that an access request can be audited, and the audit field is a field in a parsed result of an access request for which data audit is to be performed when any access request satisfies the audit condition;

[0219] Each database proxy server 610 is specifically used to: determine whether the field value of the specified field in the analysis result meets the audit condition; if the determination result is yes, obtain the field value of the audit field in the analysis result as the data to be audited.

[0220] Optionally, in a specific implementation, the designated field includes at least one of the following fields: tenant, access time, library table, access operation, and database node.

[0221] Optionally, in a specific implementation, each database proxy server 610 is further configured to cache the acquired data to be audited in a designated cache space;

[0222] Each database proxy server 610 is specifically used for: when the data to be audited cached in the designated cache space meets the preset sending condition, sending the cached data to be audited to the management server;

[0223] The sending condition includes at least one of the following conditions:

[0224] The amount of cached data to be audited reaches the preset amount of data;

[0225] The time length since the last sending of the cached audit data to the management server reaches a preset time length.

[0226] Optionally, in a specific implementation, each database proxy server 610 is further used to output an audit rule setting interface; obtain an audit rule update instruction issued by a user based on the audit rule setting interface; and update the audit rules based on the audit rule update instruction.

[0227] Corresponding to the database audit method provided by the above embodiment of the present invention, the embodiment of the present invention further provides a database proxy server, which is a proxy server configured for a distributed database and is connected to a preset management server for global auditing. Figure 7 As shown, it includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704.

[0228] Memory 703, used for storing computer programs;

[0229] The processor 701 is used to implement the steps of any database audit method provided by the above-mentioned embodiment of the present invention when executing the program stored in the memory 703.

[0230] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0231] The communication interface is used for communication between the above electronic device and other devices.

[0232] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0233] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0234] In another embodiment provided by the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any database audit method provided by the above-mentioned embodiment of the present invention are implemented.

[0235] In another embodiment provided by the present invention, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the steps of any database audit method provided by the above-mentioned embodiments of the present invention.

[0236] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0237] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0238] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, system embodiment, database proxy server embodiment, computer-readable storage medium embodiment, and computer program product embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0239] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A database audit method, characterized in that: Applied to any proxy server among a plurality of database proxy servers configured for a distributed database, the plurality of database proxy servers being communicatively connected with a preset management server for global auditing; the method comprising: After obtaining a database access request for the distributed database and a parsing result of the database access request, determining whether a field value of a specified field in the parsing result meets an audit condition; wherein the parsing result is obtained by a computing engine in a database proxy server parsing the database access request; If the judgment result is yes, then the field value of the audit field in the analysis result is obtained as the data to be audited; The acquired data to be audited is sent to the management server, so that the management server generates an audit result for the audit rule based on the data to be audited sent by the multiple database proxy servers; wherein the audit rule includes: the audit condition and the audit field corresponding to the audit condition, the audit condition is a condition set for a specified field for characterizing that an access request can be audited, and the audit field is a field in the parsing result of the access request for data audit when any access request satisfies the audit condition.

2. The method according to claim 1, characterized in that The specified field includes at least one of the following fields: Tenants, access time, library tables, access operations, and database nodes.

3. The method according to claim 1, characterized in that Before the step of sending the data to be audited to the management server, the method further includes: Cache the acquired data to be audited in the specified cache space; The step of sending the acquired data to be audited to the management server comprises: When the data to be audited cached in the designated cache space meets a preset sending condition, the cached data to be audited is sent to the management server; The sending condition includes at least one of the following conditions: The amount of cached data to be audited reaches the preset amount of data; The time length since the last sending of the cached audit data to the management server reaches a preset time length.

4. The method according to claim 1, characterized in that: The method further comprises: Output audit rule setting interface; Obtaining an audit rule update instruction issued by a user based on the audit rule setting interface; Based on the audit rule update instruction, the audit rule is updated.

5. A database auditing device, characterized in that: Applied to any one of a plurality of database proxy servers configured for a distributed database, wherein the plurality of database proxy servers are communicatively connected with a preset management server for global auditing; the device comprises: A request judgment module is used to judge whether the field value of a specified field in the parsing result meets the audit condition after obtaining the database access request for the distributed database and the parsing result of the database access request; if the judgment result is yes, trigger the data acquisition module; wherein the parsing result is obtained by the computing engine in the database proxy server parsing the database access request; The data acquisition module is used to obtain the field value of the audit field in the analysis result as the data to be audited; A data sending module, used for sending the acquired data to be audited to the management server, so that the management server generates an audit result for the audit rule based on the data to be audited sent by the multiple database proxy servers; wherein the audit rule includes: the audit condition and the audit field corresponding to the audit condition, the audit condition is a condition set for a specified field and used to characterize that an access request can be audited, and the audit field is a field to be audited in the parsing result of any access request when the audit condition is met.

6. A database audit system, characterized in that: The system comprises: a plurality of database proxy servers configured for a distributed database and a management server for global auditing, wherein the plurality of database proxy servers are communicatively connected with the management server; Each database proxy server is used to determine whether the field value of a specified field in the parsing result meets the audit condition after obtaining the database access request for the distributed database and the parsing result of the database access request; if the judgment result is yes, obtain the field value of the audit field in the parsing result as the data to be audited; and send the obtained data to be audited to the management server; wherein the parsing result is obtained by the computing engine in the database proxy server parsing the database access request; The management server is used to generate audit results for audit rules based on the data to be audited sent by the multiple database proxy servers; wherein the audit rules include: the audit conditions and audit fields corresponding to the audit conditions, the audit conditions are conditions set for specified fields and used to characterize that access requests can be audited, and the audit fields are fields in the parsing results of any access request that are subject to data audit when the audit conditions are met.

7. The system according to claim 6, characterized in that The management server is a server in a preset audit database cluster, and the audit database cluster further includes: a storage server; The management server is further used to send the audit result to the storage server; The storage server is used to store the audit results sent by the management server.

8. The system according to claim 7, characterized in that The number of the storage servers is multiple; The management server is specifically configured to determine a target storage server for storing the audit result from a plurality of storage servers according to a preset storage rule, and send the audit result to the target storage server.

9. A database proxy server, characterized in that: The database proxy server is a proxy server configured for a distributed database and is in communication connection with a preset management server for global auditing. The database proxy server includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-4 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Audit and early warning method and apparatus for application system usage and terminal device

    CN109359251A

  • Database auditing method and device

    CN112506954A