Statement processing method and device, computer equipment and storage medium
The interceptor captures and parses query requests, generates a query threshold, and optimizes the query statement based on the optimization strategy, solves the problem of inefficiency and excessive load of the database query mechanism under massive data, and achieves more efficient and stable database operations .
Patent Information
- Application Number
- CN202411491059.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-18
AI Technical Summary
When facing massive data, the existing database query mechanism is inefficient in operation, which can easily lead to excessive database load, increase the risk of system downtime, and affect user experience and business efficiency.
The user's query request is captured through the interceptor, the query statement is parsed, the table query information is obtained, the query number threshold is generated, and the query statement is optimized based on the optimization strategy, the target query statement is generated, and finally submitted to the database.
It improves the optimization processing efficiency and intelligence of query statements, reduces database access and data reading, reduces database and system load, reduces system risks, and improves database operation efficiency and stability.
Smart Images

Figure CN119474137A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of data processing technology and financial technology, and in particular to statement processing methods, devices, computer equipment and storage media. Background Art
[0002] With the rapid development of informatization today, the business departments and institutional users of financial enterprises are highly dependent on data-driven decision-making mechanisms in their daily operations. In order to accurately formulate business strategies, evaluate policy effects and optimize business processes, these users need to frequently extract and analyze historical business data from the database. With the continuous operation of the business system and the passage of time, the amount of data accumulated in the database grows exponentially, which poses a severe challenge to the performance of the data management system.
[0003] Existing database query mechanisms often expose the problem of low operational efficiency when faced with massive amounts of data. When the amount of data involved in a query request is too large, the database needs to perform complex retrieval, sorting, and aggregation operations, which not only consume a lot of computing resources, but may also significantly extend the query response time, affecting user experience and business efficiency. More seriously, if the query statement is not designed properly, it may also cause excessive occupation of system resources. If the amount of query data involved in the query statement is too large, the database load will increase sharply, thereby increasing the risk of system downtime. System downtime will not only interrupt normal business operations, but may also cause data loss or damage due to uncertainties in the data recovery process, causing immeasurable losses to the enterprise. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose a statement processing method, apparatus, computer equipment and storage medium to solve the technical problems that the existing database query mechanism based on query statements has low operating efficiency and easily causes excessive database load.
[0005] In order to solve the above technical problems, the embodiment of the present application provides a statement processing method, which adopts the following technical solution:
[0006] Determine whether a query request for a target database submitted by a user is received;
[0007] If so, capturing the query statement corresponding to the query request based on a preset interceptor;
[0008] Parsing the query statement to obtain table query information corresponding to the query statement; wherein the table query information includes a single table query or a multi-table query;
[0009] Obtaining a target optimization strategy corresponding to the table query information;
[0010] Generate a corresponding query number threshold based on the user's historical query data;
[0011] Optimizing the query statement based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement;
[0012] Submit the target query statement to the target database.
[0013] Furthermore, the step of generating a corresponding query number threshold based on the user's historical query data specifically includes:
[0014] Acquiring historical query operation data of the user based on a preset server;
[0015] Call the preset data analysis tool;
[0016] Analyze and process the historical query operation data based on the data analysis tool to obtain analysis results corresponding to the query habits of the user;
[0017] The query number threshold is constructed based on the analysis result.
[0018] Furthermore, the step of optimizing the query statement based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement specifically includes:
[0019] If the table query information is a single table query, then a preset restriction clause template is obtained;
[0020] Generate a corresponding first restriction clause based on the query number threshold and the restriction clause template;
[0021] Adding the first restriction clause to the query statement to obtain a corresponding first query statement;
[0022] The first query statement is used as the target query statement.
[0023] Furthermore, the step of optimizing the query statement based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement specifically includes:
[0024] If the table query information is a multi-table query, then obtaining a target data table corresponding to the query statement;
[0025] Obtaining the table size of the target data table;
[0026] Performing corresponding table reordering processing on the query statement based on the table size to obtain a corresponding second query statement;
[0027] Get the preset restriction clause template;
[0028] Generate a corresponding second restriction clause based on the query number threshold and the restriction clause template;
[0029] Adding the second restriction clause to the second query statement to obtain a corresponding third query statement;
[0030] The third query statement is used as the target query statement.
[0031] Furthermore, the statement processing method further includes:
[0032] Determining whether a deletion request for the target database submitted by the user is received;
[0033] If so, capturing a delete statement corresponding to the delete request based on the interceptor;
[0034] Splitting and analyzing the delete statement to obtain the amount of deleted data corresponding to the specified data table in the target database;
[0035] generating a deletion ratio corresponding to the amount of deleted data based on the total amount of data in the designated data table;
[0036] Determine whether the deletion ratio is greater than a preset ratio threshold;
[0037] If yes, generate an approval report corresponding to the deletion statement, and send the approval report to a designated reviewer;
[0038] If the approval result corresponding to the approval report returned by the designated reviewer is approval passed, a corresponding deletion operation is performed on the target database based on the deletion statement.
[0039] Furthermore, the step of splitting and analyzing the delete statement to obtain the amount of deleted data corresponding to the specified data table in the target database specifically includes:
[0040] Splitting the delete statement to obtain corresponding split data;
[0041] Extracting a deletion condition and a deletion table name from the split data;
[0042] Call the preset calculation tool;
[0043] Based on the calculation tool, the deletion condition is subjected to a calculation process for the amount of deleted data to obtain corresponding calculation data;
[0044] The calculated data is used as the amount of deleted data of the designated data table corresponding to the deleted table name.
[0045] Furthermore, after the step of generating an approval report corresponding to the deletion statement and sending the approval report to a designated reviewer, the method further includes:
[0046] If the approval result corresponding to the approval report returned by the designated reviewer is that the approval is not passed, then suspending the response processing for the deletion statement;
[0047] generating an alarm message corresponding to the deletion statement;
[0048] The alarm information is sent to the user.
[0049] In order to solve the above technical problems, the embodiment of the present application further provides a statement processing device, which adopts the following technical solution:
[0050] A first determination module is used to determine whether a query request for a target database submitted by a user is received;
[0051] A first capturing module, configured to capture the query statement corresponding to the query request based on a preset interceptor;
[0052] A first acquisition module is used to parse the query statement and acquire table query information corresponding to the query statement; wherein the table query information includes a single table query or a multi-table query;
[0053] A second acquisition module, used to acquire a target optimization strategy corresponding to the table query information;
[0054] A first generating module, configured to generate a corresponding query number threshold based on the historical query data of the user;
[0055] An optimization module, used to optimize the query statement based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement;
[0056] A submission module is used to submit the target query statement to the target database.
[0057] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0058] Determine whether a query request for a target database submitted by a user is received;
[0059] If so, capturing the query statement corresponding to the query request based on a preset interceptor;
[0060] Parsing the query statement to obtain table query information corresponding to the query statement; wherein the table query information includes a single table query or a multi-table query;
[0061] Obtaining a target optimization strategy corresponding to the table query information;
[0062] Generate a corresponding query number threshold based on the user's historical query data;
[0063] Optimizing the query statement based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement;
[0064] Submit the target query statement to the target database.
[0065] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0066] Determine whether a query request for a target database submitted by a user is received;
[0067] If so, capturing the query statement corresponding to the query request based on a preset interceptor;
[0068] Parsing the query statement to obtain table query information corresponding to the query statement; wherein the table query information includes a single table query or a multi-table query;
[0069] Obtaining a target optimization strategy corresponding to the table query information;
[0070] Generate a corresponding query number threshold based on the user's historical query data;
[0071] Optimizing the query statement based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement;
[0072] Submit the target query statement to the target database.
[0073] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0074] The present application first determines whether a query request for a target database submitted by a user is received; if so, the query statement corresponding to the query request is captured based on a preset interceptor; the query statement is then parsed to obtain table query information corresponding to the query statement; wherein the table query information includes a single-table query or a multi-table query; then a target optimization strategy corresponding to the table query information is obtained; subsequently, a corresponding query number threshold is generated based on the user's historical query data; the query statement is further optimized based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement; and finally, the target query statement is submitted to the target database. After receiving a query request for a target database submitted by a user, the present application captures the query statement corresponding to the query request through the use of an interceptor, and parses the query statement to obtain table query information corresponding to the query statement, then generates a corresponding query number threshold based on the user's historical query data, and then optimizes the query statement based on the target optimization strategy corresponding to the table query information and the query number threshold. This can quickly and accurately complete the optimization processing of the query statement, improve the processing efficiency and processing intelligence of the optimization processing of the query statement, facilitate the subsequent submission of the optimized target query statement to the target database for database operation, and can effectively reduce the database access and data reading volume of the target database, thereby reducing the database load and system load, as well as reducing system risks, effectively improving database operation efficiency, and improving database stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0076] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0077] Figure 2 A flowchart of an embodiment of a sentence processing method according to the present application;
[0078] Figure 3 is a structural schematic diagram of an embodiment of a sentence processing device according to the present application;
[0079] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0080] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0081] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0082] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0083] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0084] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0085] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.
[0086] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .
[0087] It should be noted that the statement processing method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the statement processing device is generally arranged in the server / terminal device.
[0088] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0089] Continue to refer Figure 2 , shows a flowchart of an embodiment of the statement processing method according to the present application. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted. The statement processing method provided in the embodiment of the present application can be applied to any scenario where statement processing is required, and the statement processing method can be applied to products in these scenarios, for example, database statement processing in the financial insurance field. The statement processing method includes the following steps:
[0090] Step S201, determining whether a query request for a target database submitted by a user is received.
[0091] In this embodiment, the electronic device (eg, Figure 1The server / terminal device shown in the figure) can obtain the query request through a wired connection or a wireless connection. It should be noted that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future. The executor of the present application is specifically a statement processing system, or simply referred to as a system. The above-mentioned query request is a request submitted by a user for performing corresponding data query processing on the target database according to the input query statement. The query statement is a SELECT query statement involving a data query operation. Among them, the above-mentioned query request carries a query statement. Exemplarily, in the business data query scenario of the financial database of financial insurance, the data query operation corresponding to the above-mentioned query request includes querying transaction data, payment data, claims data, insurance data, and so on in the financial database.
[0092] Step S202: If yes, capture the query statement corresponding to the query request based on a preset interceptor.
[0093] In this embodiment, the interceptor is a pre-built middleware, which is used to intercept all database requests from the system. And the interceptor can parse SQL statements, extract SQL type (SELECT, DELETE, etc.), execution time, user ID and SQL statement original text. Among them, the query statement carried in the above query request can be intercepted by using the interceptor, and it can be fully recorded in the system database. The recorded information should include the original text of the query statement, and can also include execution time, user ID, etc.
[0094] Step S203, parsing the query statement to obtain table query information corresponding to the query statement; wherein the table query information includes a single table query or a multi-table query.
[0095] In this embodiment, the query statement is parsed to obtain table names, and the number of obtained table names is analyzed to determine table query information corresponding to the query statement. If the number of table names is 1, the table query information corresponding to the query statement is set to a single table query. If the number of table names is greater than 1, it indicates that the query statement is a joint query statement, and the table query information corresponding to the query statement is set to a multi-table query.
[0096] Step S204: Obtain a target optimization strategy corresponding to the table query information.
[0097] In this embodiment, a first optimization strategy for query statements corresponding to single-table queries is pre-set, and a second optimization strategy for query statements corresponding to multi-table queries is pre-set. The optimization steps corresponding to the strategy contents of the specific target optimization strategy will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.
[0098] Step S205: Generate a corresponding query number threshold based on the user's historical query data.
[0099] In this embodiment, the specific implementation process of generating the corresponding query number threshold based on the user's historical query data will be further described in detail in subsequent specific embodiments of the present application, and will not be elaborated on here.
[0100] Step S206: Optimize the query statement based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement.
[0101] In this embodiment, the query statement is optimized based on the target optimization strategy and the query number threshold to obtain the specific implementation process of the corresponding target query statement. This application will provide further detailed descriptions of this in subsequent specific embodiments and will not be elaborated on here.
[0102] Step S207: submitting the target query statement to the target database.
[0103] In this embodiment, the optimized target query statement can be sent to the target database for execution by using middleware or database proxy. Among them, the optimized query performance can be monitored, including indicators such as query response time, CPU and memory usage. At the same time, user feedback should also be paid attention to understand whether the optimization has truly improved the user experience. And according to the monitoring results and user feedback, the above optimization strategy is continuously adjusted to achieve the best query performance and user experience.
[0104] The present application first determines whether a query request for a target database submitted by a user is received; if so, the query statement corresponding to the query request is captured based on a preset interceptor; the query statement is then parsed to obtain table query information corresponding to the query statement; wherein the table query information includes a single-table query or a multi-table query; then a target optimization strategy corresponding to the table query information is obtained; subsequently, a corresponding query number threshold is generated based on the user's historical query data; the query statement is further optimized based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement; and finally, the target query statement is submitted to the target database. After receiving a query request for a target database submitted by a user, the present application captures the query statement corresponding to the query request through the use of an interceptor, and parses the query statement to obtain table query information corresponding to the query statement, then generates a corresponding query number threshold based on the user's historical query data, and then optimizes the query statement based on the target optimization strategy corresponding to the table query information and the query number threshold. This can quickly and accurately complete the optimization processing of the query statement, improve the processing efficiency and processing intelligence of the optimization processing of the query statement, facilitate the subsequent submission of the optimized target query statement to the target database for database operations, and effectively reduce the database access and data reading volume of the target database, thereby reducing the database load and system load, as well as reducing system risks, effectively improving database operation efficiency, and improving database stability.
[0105] In some optional implementations, step S205 includes the following steps:
[0106] The historical query operation data of the user is obtained based on a preset server.
[0107] In this embodiment, the historical query operation data refers to the historical query operation data of the user on the target database. The server can be a system-built-in log server with a log collection function for collecting the historical query operation data of the user on the target database. The historical query operation data can include data such as query frequency, query time, and paging parameters.
[0108] Call the preset data analysis tool.
[0109] In this embodiment, the data analysis tool may be a tool that has the function of processing and analyzing data, such as Excel.
[0110] The historical query operation data is analyzed and processed based on the data analysis tool to obtain analysis results corresponding to the query habits of the user.
[0111] In this embodiment, the collected historical query operation data may be processed and analyzed by using a data analysis tool to infer the user's query habits and needs, and output corresponding analysis results.
[0112] The query number threshold is constructed based on the analysis result.
[0113] In this embodiment, the user click rate data of the user can be obtained from the above analysis results, and a reasonable maximum amount of returned data can be set according to the distribution of the user click rate. For example, if the user habitually clicks only on the results of the first few pages, a lower maximum amount of returned data corresponding to the first few pages can be set as the above threshold of the number of query items to reduce the burden of the system on database query processing. Among them, the user click rate can be counted by adopting a calculation method (number of clicks / amount of returned data). In addition, the chart function of Excel (such as a line chart or a bar chart) can also be used to display the change trend of the click rate with time as the axis to identify seasonal or cyclical patterns.
[0114] The present application obtains the historical query operation data of the user based on a preset server; then calls a preset data analysis tool; then analyzes and processes the historical query operation data based on the data analysis tool to obtain an analysis result corresponding to the user's query habits; and subsequently constructs the query number threshold based on the analysis result. The present application obtains the historical query operation data of the user based on the use of a server; then analyzes and processes the historical query operation data based on the use of a data analysis tool to obtain an analysis result corresponding to the user's query habits, and then can quickly and accurately construct a corresponding query number threshold based on the analysis result, thereby ensuring the accuracy and reliability of the obtained query number threshold.
[0115] In some optional implementations of this embodiment, step S206 includes the following steps:
[0116] If the table query information is a single table query, a preset restriction clause template is obtained.
[0117] In this embodiment, the restriction clause template is specifically a LIMIT clause, and the amount of returned data can be limited by using the LIMIT clause. The LIMIT clause is: LIMITX. Where X is the data value to be filled corresponding to the amount of returned data, which means: only the first X records are returned.
[0118] A corresponding first restriction clause is generated based on the query number threshold and the restriction clause template.
[0119] In this embodiment, the restriction clause template may be populated with data values using the query number threshold to generate a corresponding first restriction clause. For example, if the query number threshold is 100, the corresponding first restriction clause is LIMIT 100.
[0120] The first restriction clause is added to the query statement to obtain a corresponding first query statement.
[0121] In this embodiment, the first restriction clause may be added to the end of the query statement to generate a corresponding first query statement.
[0122] The first query statement is used as the target query statement.
[0123] In this embodiment, the query statement can also be optimized by indexing, including checking whether the fields involved in the query statement have been indexed, and considering whether a new index needs to be added to speed up the query. In addition, the query statement can also be processed by materialized view and cache. Specifically, for high-frequency queries and large data volumes, consider creating a materialized view to store query results, or use cache technology to cache query results to reduce the number of database accesses.
[0124] If the table query information is a single-table query, the present application obtains a preset restriction clause template; then generates a corresponding first restriction clause based on the query number threshold and the restriction clause template; then adds the first restriction clause to the query statement to obtain the corresponding first query statement; and subsequently uses the first query statement as the target query statement. When the present application identifies that the table query information is a single-table query, it will intelligently obtain a preset restriction clause template, and generate a corresponding first restriction clause based on the query number threshold and the restriction clause template, and then add the first restriction clause to the query statement, thereby achieving fast and accurate optimization of the query statement, improving the processing efficiency and processing intelligence of the optimization processing of the query statement, and ensuring the accuracy of the target query statement obtained. It is beneficial to subsequently submit the optimized target query statement to the target database for database operations, which can effectively reduce the database access and data reading volume of the target database, thereby reducing the database load and system load, as well as reducing system risks and improving database operation efficiency.
[0125] In some optional implementations, step S206 includes the following steps:
[0126] If the table query information is a multi-table query, a target data table corresponding to the query statement is obtained.
[0127] In this embodiment, the query statement can be parsed by using a SQL parsing library to extract key information such as corresponding table names, JOIN operations, WHERE conditions, etc. The target data table refers to all data tables corresponding to the extracted statement.
[0128] Get the table size of the target data table.
[0129] In this embodiment, the table size of the target data table may be obtained by performing a size query on the target data table.
[0130] The query statement is subjected to corresponding table reordering processing based on the table size to obtain a corresponding second query statement.
[0131] In this embodiment, the data tables in the query can be reordered according to the table size of the target data table and the JOIN conditions using a query optimizer (which can be built-in or customized in the target database) to reduce unnecessary table scanning and data transmission, thereby obtaining a corresponding second query statement.
[0132] Gets a preset restriction clause template.
[0133] In this embodiment, the restriction clause template is specifically a LIMIT clause, and the LIMIT clause can be used to limit the amount of returned data.
[0134] A corresponding second restriction clause is generated based on the query number threshold and the restriction clause template.
[0135] In this embodiment, the implementation process of generating the corresponding second restriction clause based on the query number threshold and the restriction clause template can refer to the processing process of generating the corresponding first restriction clause based on the query number threshold and the restriction clause template, and will not be elaborated here.
[0136] The second restriction clause is added to the second query statement to obtain a corresponding third query statement.
[0137] In this embodiment, the second restriction clause may be added to the end of the second query statement to generate a corresponding third query statement.
[0138] The third query statement is used as the target query statement.
[0139] In this application, if the table query information is a multi-table query, the target data table corresponding to the query statement is obtained; then the table size of the target data table is obtained; and the query statement is subjected to corresponding table reordering processing based on the table size to obtain the corresponding second query statement; then a preset restriction clause template is obtained; and a corresponding second restriction clause is generated based on the query number threshold and the restriction clause template; the second restriction clause is subsequently added to the second query statement to obtain the corresponding third query statement; and finally the third query statement is used as the target query statement. When the table query information is identified as a multi-table query, the application first obtains the target data table corresponding to the query statement, and performs table reordering processing on the query statement based on the table size of the target data table to obtain the second query statement, and then intelligently obtains the preset restriction clause template, and generates the corresponding second restriction clause based on the query number threshold and the restriction clause template, and then adds the second restriction clause to the second query statement, thereby realizing fast and accurate optimization processing of the query statement, improving the processing efficiency and processing intelligence of the optimization processing of the query statement, and ensuring the accuracy of the obtained target query statement. This is conducive to subsequently submitting the optimized target query statement to the target database for database operation, which can effectively reduce the database access and data reading volume of the target database, thereby reducing the database load and system load, as well as reducing system risks and improving database operation efficiency.
[0140] In some optional implementations, the electronic device may further perform the following steps:
[0141] It is determined whether a deletion request for the target database submitted by the user is received.
[0142] In this embodiment, the above-mentioned deletion request is a request submitted by a user for performing corresponding data deletion processing on a specified data table in a target database according to an input deletion statement. The deletion statement is a DELETE statement involving a data deletion operation. The above-mentioned deletion request carries a deletion statement.
[0143] If so, a delete statement corresponding to the delete request is captured based on the interceptor.
[0144] In this embodiment, the delete statement corresponding to the above-mentioned delete request can be intercepted by using a preset interceptor. Specifically, the delete request is parsed to extract the delete statement (DELETE statement) corresponding to the delete request. The legality and format correctness of the DELETE statement can be verified to ensure that it is a valid operation on the target database.
[0145] The delete statement is split and analyzed to obtain the amount of deleted data corresponding to the specified data table in the target database.
[0146] In this embodiment, the above-mentioned deleting statement splitting and analyzing process is carried out to obtain the specific implementation process of the amount of deleted data corresponding to the specified data table in the target database. This application will provide further detailed descriptions of this in subsequent specific embodiments and will not be elaborated in detail here.
[0147] A deletion ratio corresponding to the amount of deleted data is generated based on the total amount of data in the designated data table.
[0148] In this embodiment, the ratio between the amount of deleted data and the total amount of data in the specified data table may be calculated, and the ratio may be used as the deletion ratio corresponding to the amount of deleted data.
[0149] It is determined whether the deletion ratio is greater than a preset ratio threshold.
[0150] In this embodiment, there is no specific limitation on the value of the ratio threshold, which can be set according to the actual risk assessment requirements. For example, it can be set to 10%. If the deletion ratio exceeds the preset ratio threshold (or security threshold), the data deletion operation corresponding to the deletion statement is marked as a high-risk operation.
[0151] If so, generate an approval report corresponding to the deletion statement, and send the approval report to a designated reviewer.
[0152] In this embodiment, if the deletion ratio is greater than the above ratio threshold, an approval report containing detailed information about the deletion statement is automatically generated. The approval report includes but is not limited to the executor, DELETE statement, deletion amount, deletion ratio, operation time, etc.
[0153] If the approval result corresponding to the approval report returned by the designated reviewer is approval passed, a corresponding deletion operation is performed on the target database based on the deletion statement.
[0154] In this embodiment, after the approval report is sent to the designated reviewer, the designated reviewer will evaluate the risk and necessity of the deletion operation based on the information in the approval report, and return the corresponding approval result. The approval result includes approval or failure. If the approval is passed, the corresponding deletion operation is performed on the target database based on the deletion statement. In addition, ensure that the deletion condition is verified again before the data is deleted from the target database to avoid misoperation.
[0155] When receiving a deletion request for a target database submitted by a user, the present application will capture the deletion statement corresponding to the deletion request based on the interceptor, split and analyze the deletion statement, obtain the amount of deleted data corresponding to the specified data table in the target database, and then generate a deletion ratio corresponding to the amount of deleted data based on the total table data volume of the specified data table, and when it is detected that the deletion ratio is greater than a preset ratio threshold, it will intelligently generate an approval report corresponding to the deletion statement, and send the approval report to the designated reviewer. Only when the approval result corresponding to the approval report returned by the designated reviewer is approved, will the corresponding deletion operation be performed on the target database based on the deletion statement, thereby effectively improving the review and analysis capabilities for the deletion statement, and determining whether to perform the corresponding deletion operation on the target database based on the analysis result of the deletion ratio and the approval result, thereby reducing the risk of data loss in the target database due to accidental deletion operations, and reducing the cost required to recover accidentally deleted data.
[0156] In some optional implementations of this embodiment, the deleting statement is split and analyzed to obtain the amount of deleted data corresponding to the specified data table in the target database, including the following steps:
[0157] The delete statement is split to obtain corresponding split data.
[0158] In this embodiment, the structure of the delete statement can be deeply parsed using an SQL parsing tool and key information can be extracted to complete the splitting process to obtain the corresponding split data. The splitting data at least includes the name of the deleted table, the deletion condition, such as the condition in the WHERE clause (if any), and any additional clauses (such as JOINs) that may affect the deletion scope.
[0159] A deletion condition and a deletion table name are extracted from the split data.
[0160] In this embodiment, specific information can be extracted from the split data to obtain corresponding deletion conditions and deletion table names, wherein the deletion conditions refer to the restriction conditions for deletion.
[0161] Call up a preset calculation tool.
[0162] In this embodiment, the calculation tool is a pre-built tool with the function of calculating the amount of deleted data.
[0163] The deletion condition is subjected to a deletion data amount calculation process based on the calculation tool to obtain corresponding calculation data.
[0164] In this embodiment, the calculation tool can actually calculate the amount of data to be deleted in the specified data table corresponding to the above-mentioned deletion table name by using a delete statement with the same WHERE condition.
[0165] The calculated data is used as the amount of deleted data of the designated data table corresponding to the deleted table name.
[0166] The present application obtains corresponding split data by splitting the deletion statement; then extracts the deletion conditions and the deletion table name from the split data; then calls a preset calculation tool; and based on the calculation tool, performs a deletion data volume calculation process on the deletion conditions to obtain corresponding calculation data; and subsequently uses the calculation data as the deletion data volume of the specified data table corresponding to the deletion table name. The present application obtains split data by splitting the deletion statement, and extracts the deletion conditions and the deletion table name from the split data; then, based on the use of the calculation tool, performs a deletion data volume calculation process on the deletion conditions to obtain calculation data, thereby achieving fast and accurate acquisition of the deletion data volume of the specified data table corresponding to the deletion table name, improving the efficiency of acquiring the deletion data volume, and ensuring the data accuracy of the obtained deletion data volume.
[0167] In some optional implementations of this embodiment, after the step of generating an approval report corresponding to the deletion statement and sending the approval report to a designated reviewer, the electronic device may further perform the following steps:
[0168] If the approval result corresponding to the approval report returned by the designated reviewer is that the approval is not passed, the response processing for the deletion statement is suspended.
[0169] In this embodiment, if it is parsed that the approval result corresponding to the approval report returned by the designated reviewer is approval failure, the response processing for the deletion statement will be automatically suspended.
[0170] Generate an alarm message corresponding to the delete statement.
[0171] In this embodiment, the corresponding alarm information can be obtained by obtaining the amount of deleted data, the deletion ratio and the potential risk corresponding to the above-mentioned deletion statement, and filling the amount of deleted data, the deletion ratio and the potential risk into the preset alarm information template. The template content of the above-mentioned alarm information template can be set according to the actual alarm notification requirements.
[0172] The alarm information is sent to the user.
[0173] In this embodiment, the alarm information may be sent to the user by means of a system interface or a system log.
[0174] In this application, if the approval result corresponding to the approval report returned by the designated reviewer is approval failure, the response processing for the deletion statement will be suspended; then an alarm message corresponding to the deletion statement will be generated; and the alarm message will be subsequently sent to the user. After obtaining the approval result corresponding to the approval report returned by the designated reviewer, if the approval result is parsed as approval failure, the response processing for the deletion statement will be automatically suspended, thereby effectively reducing the risk of data loss caused by misoperation of the target database. In addition, an alarm message corresponding to the deletion statement will be intelligently generated and sent to the user, so that the user can promptly know the risk issues of the currently submitted deletion request, thereby improving the user experience.
[0175] In some optional implementations, the user information obtained is subject to the user's consent and complies with relevant laws and policies.
[0176] In addition, the non-Company software tools or components that appear in the embodiments of the present application are merely examples and do not represent actual use.
[0177] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0178] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned target query statement, the above-mentioned target query statement can also be stored in a node of a blockchain.
[0179] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0180] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0181] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0182] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0183] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0184] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a sentence processing device, and the embodiment of the device is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0185] like Figure 3 As shown, the statement processing device 300 described in this embodiment includes: a first judgment module 301, a first capture module 302, a first acquisition module 303, a second acquisition module 304, a first generation module 305, an optimization module 306 and a submission module 307. Among them:
[0186] The first determination module 301 is used to determine whether a query request for a target database submitted by a user is received;
[0187] A first capturing module 302, configured to capture a query statement corresponding to the query request based on a preset interceptor;
[0188] A first acquisition module 303 is used to parse the query statement and acquire table query information corresponding to the query statement; wherein the table query information includes a single table query or a multi-table query;
[0189] A second acquisition module 304 is used to acquire a target optimization strategy corresponding to the table query information;
[0190] A first generating module 305, configured to generate a corresponding query number threshold based on the user's historical query data;
[0191] An optimization module 306 is used to optimize the query statement based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement;
[0192] The submission module 307 is used to submit the target query statement to the target database.
[0193] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the statement processing method in the aforementioned implementation mode, and are not described in detail here.
[0194] In some optional implementations of this embodiment, the first generating module 305 includes:
[0195] A first acquisition submodule, used for acquiring the historical query operation data of the user based on a preset server;
[0196] The first calling submodule is used to call a preset data analysis tool;
[0197] An analysis submodule, configured to analyze and process the historical query operation data based on the data analysis tool to obtain analysis results corresponding to the query habits of the user;
[0198] A construction submodule is used to construct the query number threshold based on the analysis result.
[0199] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the statement processing method in the aforementioned implementation mode, and are not described in detail here.
[0200] In some optional implementations of this embodiment, the optimization module 306 includes:
[0201] A second acquisition submodule is used to acquire a preset restriction clause template if the table query information is a single table query;
[0202] A first generating submodule, configured to generate a corresponding first restriction clause based on the query number threshold and the restriction clause template;
[0203] A first adding submodule, used for adding the first restriction clause to the query statement to obtain a corresponding first query statement;
[0204] The first determining submodule is configured to use the first query statement as the target query statement.
[0205] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the statement processing method in the aforementioned implementation mode, and are not described in detail here.
[0206] In some optional implementations of this embodiment, the optimization module 306 includes:
[0207] A third acquisition submodule is used to acquire a target data table corresponding to the query statement if the table query information is a multi-form query;
[0208] A fourth acquisition submodule, used to acquire the table size of the target data table;
[0209] A sorting submodule, configured to perform corresponding table re-sorting processing on the query statement based on the table size to obtain a corresponding second query statement;
[0210] A fifth acquisition submodule is used to acquire a preset restriction clause template;
[0211] A second generating submodule, configured to generate a corresponding second restriction clause based on the query number threshold and the restriction clause template;
[0212] A second adding submodule, used for adding the second restriction clause to the second query statement to obtain a corresponding third query statement;
[0213] The second determining submodule is configured to use the third query statement as the target query statement.
[0214] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the statement processing method in the aforementioned implementation mode, and are not described in detail here.
[0215] In some optional implementations of this embodiment, the statement processing device further includes:
[0216] A second judgment module is used to judge whether a deletion request for the target database submitted by the user is received;
[0217] A second capturing module, configured to capture a delete statement corresponding to the delete request based on the interceptor;
[0218] An analysis module, used for splitting and analyzing the deletion statement to obtain the amount of deleted data corresponding to the specified data table in the target database;
[0219] A second generating module, configured to generate a deletion ratio corresponding to the amount of deleted data based on the total amount of data in the specified data table;
[0220] A third judgment module is used to judge whether the deletion ratio is greater than a preset ratio threshold;
[0221] A first sending module, configured to generate an approval report corresponding to the deletion statement, and send the approval report to a designated reviewer;
[0222] An execution module is used to execute a corresponding deletion operation on the target database based on the deletion statement if the approval result corresponding to the approval report returned by the designated reviewer is approval passed.
[0223] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the statement processing method in the aforementioned implementation mode, and are not described in detail here.
[0224] In some optional implementations of this embodiment, the analysis module includes:
[0225] A splitting submodule is used to split the deletion statement to obtain corresponding split data;
[0226] An extraction submodule, used for extracting deletion conditions and deletion table names from the split data;
[0227] The second calling submodule is used to call a preset calculation tool;
[0228] A calculation submodule, used for calculating the amount of deleted data for the deletion condition based on the calculation tool to obtain corresponding calculation data;
[0229] The third determining submodule is used to use the calculated data as the amount of deleted data of the designated data table corresponding to the deletion table name.
[0230] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the statement processing method in the aforementioned implementation mode, and are not described in detail here.
[0231] In some optional implementations of this embodiment, the statement processing device further includes:
[0232] A suspension module, used for suspending the response processing of the deletion statement if the approval result corresponding to the approval report returned by the designated reviewer is approval failure;
[0233] A third generating module, used to generate alarm information corresponding to the deletion statement;
[0234] The second sending module is used to send the alarm information to the user.
[0235] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the statement processing method in the aforementioned implementation mode, and are not described in detail here.
[0236] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0237] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0238] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0239] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the statement processing method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0240] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run the computer-readable instructions stored in the memory 41 or process data, such as running the computer-readable instructions of the statement processing method.
[0241] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0242] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0243] In an embodiment of the present application, after receiving a query request for a target database submitted by a user, a query statement corresponding to the query request is captured by using an interceptor, and the query statement is parsed to obtain table query information corresponding to the query statement. Then, a corresponding query number threshold is generated based on the user's historical query data, and then the query statement is optimized based on the target optimization strategy corresponding to the table query information and the query number threshold. This can achieve fast and accurate optimization of the query statement, improve the processing efficiency and processing intelligence of the optimization processing of the query statement, facilitate the subsequent submission of the optimized target query statement to the target database for database operations, and effectively reduce the database access and data reading volume of the target database, thereby reducing the database load and system load, as well as reducing system risks, effectively improving database operation efficiency, and improving database stability.
[0244] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the statement processing method as described above.
[0245] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0246] In an embodiment of the present application, after receiving a query request for a target database submitted by a user, a query statement corresponding to the query request is captured by using an interceptor, and the query statement is parsed to obtain table query information corresponding to the query statement. Then, a corresponding query number threshold is generated based on the user's historical query data, and then the query statement is optimized based on the target optimization strategy corresponding to the table query information and the query number threshold. This can achieve fast and accurate optimization of the query statement, improve the processing efficiency and processing intelligence of the optimization processing of the query statement, facilitate the subsequent submission of the optimized target query statement to the target database for database operations, and effectively reduce the database access and data reading volume of the target database, thereby reducing the database load and system load, as well as reducing system risks, effectively improving database operation efficiency, and improving database stability.
[0247] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0248] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A statement processing method, characterized in that: The steps include: Determine whether a query request for a target database submitted by a user is received; If so, capturing the query statement corresponding to the query request based on a preset interceptor; Parsing the query statement to obtain table query information corresponding to the query statement; wherein the table query information includes a single table query or a multi-table query; Obtaining a target optimization strategy corresponding to the table query information; Generate a corresponding query number threshold based on the user's historical query data; Optimizing the query statement based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement; Submit the target query statement to the target database.
2. The sentence processing method according to claim 1, characterized in that: The step of generating a corresponding query number threshold based on the user's historical query data specifically includes: Acquiring historical query operation data of the user based on a preset server; Call the preset data analysis tool; Analyze and process the historical query operation data based on the data analysis tool to obtain analysis results corresponding to the query habits of the user; The query number threshold is constructed based on the analysis result.
3. The sentence processing method according to claim 1, characterized in that: The step of optimizing the query statement based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement specifically includes: If the table query information is a single table query, then a preset restriction clause template is obtained; Generate a corresponding first restriction clause based on the query number threshold and the restriction clause template; Adding the first restriction clause to the query statement to obtain a corresponding first query statement; The first query statement is used as the target query statement.
4. The sentence processing method according to claim 1, characterized in that: The step of optimizing the query statement based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement specifically includes: If the table query information is a multi-table query, then obtaining a target data table corresponding to the query statement; Obtaining the table size of the target data table; Performing corresponding table reordering processing on the query statement based on the table size to obtain a corresponding second query statement; Get the preset restriction clause template; Generate a corresponding second restriction clause based on the query number threshold and the restriction clause template; Adding the second restriction clause to the second query statement to obtain a corresponding third query statement; The third query statement is used as the target query statement.
5. The sentence processing method according to claim 1, characterized in that: The statement processing method further includes: Determining whether a deletion request for the target database submitted by the user is received; If so, capturing a delete statement corresponding to the delete request based on the interceptor; Splitting and analyzing the delete statement to obtain the amount of deleted data corresponding to the specified data table in the target database; generating a deletion ratio corresponding to the amount of deleted data based on the total amount of data in the designated data table; Determine whether the deletion ratio is greater than a preset ratio threshold; If yes, generate an approval report corresponding to the deletion statement, and send the approval report to a designated reviewer; If the approval result corresponding to the approval report returned by the designated reviewer is approval passed, a corresponding deletion operation is performed on the target database based on the deletion statement.
6. The sentence processing method according to claim 5, characterized in that: The step of splitting and analyzing the delete statement to obtain the amount of deleted data corresponding to the specified data table in the target database specifically includes: Splitting the delete statement to obtain corresponding split data; Extracting a deletion condition and a deletion table name from the split data; Call the preset calculation tool; Based on the calculation tool, the deletion condition is subjected to a calculation process for the amount of deleted data to obtain corresponding calculation data; The calculated data is used as the amount of deleted data of the designated data table corresponding to the deleted table name.
7. The sentence processing method according to claim 5, characterized in that: After the step of generating an approval report corresponding to the deletion statement and sending the approval report to a designated reviewer, the method further includes: If the approval result corresponding to the approval report returned by the designated reviewer is that the approval is not passed, then suspending the response processing for the deletion statement; generating an alarm message corresponding to the deletion statement; The alarm information is sent to the user.
8. A sentence processing device, characterized in that: include: A first determination module is used to determine whether a query request for a target database submitted by a user is received; A first capturing module, configured to capture the query statement corresponding to the query request based on a preset interceptor; A first acquisition module is used to parse the query statement and acquire table query information corresponding to the query statement; wherein the table query information includes a single table query or a multi-table query; A second acquisition module, used to acquire a target optimization strategy corresponding to the table query information; A first generating module, configured to generate a corresponding query number threshold based on the historical query data of the user; An optimization module, used to optimize the query statement based on the target optimization strategy and the query number threshold to obtain a corresponding target query statement; A submission module is used to submit the target query statement to the target database.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the statement processing method according to any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the statement processing method according to any one of claims 1 to 7 are implemented.