Database management method, apparatus, device, storage medium, and program product

By using predictive models to monitor the processing of database access requests in real time and halting abnormal processes, the timely detection and handling of database performance issues are achieved, improving the efficiency of database management and performance maintenance.

CN117056307BActive Publication Date: 2025-11-18INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311007799.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-10
Publication Date
2025-11-18
Estimated Expiration
2043-08-10

AI Technical Summary

Technical Problem

In existing technologies, database performance problems cannot be detected and handled in a timely manner, resulting in slow or unusable application systems. Traditional methods rely on manual troubleshooting, which is inherently delayed.

Method used

The trained prediction model predicts the normal processing time and resource usage of access requests, monitors the processing status in real time, and stops abnormal processing under preset conditions to avoid performance issues.

Benefits of technology

It enables timely prediction and handling of database performance issues, reduces manual intervention, and improves the efficiency of database management and the effectiveness of performance maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117056307B_ABST
    Figure CN117056307B_ABST
Patent Text Reader

Abstract

The application relates to a database management method and device, computer equipment, a storage medium and a computer program product. It relates to the technical field of artificial intelligence. The method comprises the following steps: processing an access request, and obtaining a first time length required for normal processing of the access request and a second resource proportion required for the normal processing according to a trained prediction model; detecting the processing condition of the access request in the process of processing the access request, and updating the current detection frequency; in the case that the processing condition of the access request is not completed, determining whether the current detection frequency is greater than a first threshold value; in the case that the current detection frequency is not greater than the first threshold value, obtaining a time difference; and in the case that the time difference is less than the first time length and a first resource difference value is less than a preset resource difference value, performing an abortion operation on the processing process corresponding to the access request. The method can avoid performance problems in the database as much as possible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a database management method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] When a production application system becomes temporarily or for an extended period of time unavailable, a large part of the reason is related to database performance. Due to a large number of concurrent users accessing the system and the uncertainty of access, the database may experience performance problems at a certain moment, resulting in slow response or unavailability of the entire application system.

[0003] Therefore, database performance management is particularly important. In traditional technologies, the monitoring system only alerts when a database performance problem occurs. After receiving the alert, the operations and maintenance personnel will handle the database. At this time, they may find that a large number of SQL statements are running, requiring the database administrator to check each SQL statement and then eliminate the problematic SQL statements.

[0004] However, this approach has a delay, making it impossible to detect problems in the database in a timely manner and to reduce performance issues in the database. Summary of the Invention

[0005] Therefore, it is necessary to provide a database management method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can reduce performance problems in databases, in order to address the aforementioned technical issues.

[0006] Firstly, this application provides a database management method. The method includes:

[0007] Upon receiving an access request, record the initial resource percentage at the time the access request is received;

[0008] The access request is processed, and based on the trained prediction model, a first time required for normal processing of the access request and a second resource percentage required for normal processing are obtained.

[0009] During the processing of the access request, the processing status of the access request is checked at a first time interval, and the current number of checks is updated.

[0010] If the processing status of the access request is not completed, it is determined whether the current number of detections is greater than a first threshold. If the current number of detections is not greater than the first threshold, the time difference is obtained. The time difference is the time difference between the start of the execution of the access request and the current time.

[0011] If the time difference is less than the first duration and the first resource difference is less than the preset resource difference, then the processing procedure corresponding to the access request is terminated. The first resource difference is obtained based on the first resource ratio, the second resource ratio, and the current resource ratio.

[0012] In one embodiment, the method further includes: if the current number of detections is greater than a first threshold, then performing a stop operation on the processing procedure corresponding to the access request.

[0013] In one embodiment, the method further includes:

[0014] If the time difference is not less than the first duration, or if the time difference is less than the first duration and the first resource difference is not less than the preset resource difference, return to the step of detecting the processing status of the access request according to the first time interval and continue execution.

[0015] In one embodiment, obtaining the first time required for normal processing of the access request and the second resource percentage required for normal processing based on the trained prediction model includes:

[0016] Obtain the data information of the access request, the data information including metadata information and the SQL statement corresponding to the access request;

[0017] The data and the first resource percentage are input into the trained prediction model to obtain the first time and the second resource percentage required to normally process the access request.

[0018] In one embodiment, the method further includes:

[0019] Obtain feedback information, which includes access requests received within a preset time period and processing information of the access requests; the processing information includes processing results, processing time, and the percentage of resources consumed in processing; the processing results include normal processing results and abnormal processing results.

[0020] The prediction model is updated based on the feedback information.

[0021] In one embodiment, the method further includes:

[0022] Obtain access log information; the access log information includes execution-related information of normally executed access requests and execution-related information of abnormally executed access requests; the execution-related information includes the data information of the access request, the processing time of the request, and the percentage of resources spent processing the access request;

[0023] Based on the access log information, determine the access processing data sample;

[0024] Based on the access processing samples, adjust the parameters of the pre-training prediction model until the pre-training prediction model converges to obtain the post-training prediction model.

[0025] Secondly, this application also provides a database management apparatus. The apparatus includes:

[0026] The recording module is used to record the initial resource percentage when an access request is received.

[0027] The request processing and prediction module is used to process the access request and, based on the trained prediction model, obtain the first time required for normal processing of the access request and the second resource percentage required for normal processing.

[0028] The processing status detection module is used to detect the processing status of the access request at a first time interval during the processing of the access request and update the current detection count.

[0029] The time difference acquisition module is used to determine whether the current number of detections is greater than a first threshold when the processing status of the access request is not completed; if the current number of detections is not greater than the first threshold, the time difference is acquired; the time difference is the time difference between the start of the execution of the access request and the current time.

[0030] The first abort operation execution module is used to execute an abort operation on the processing of the access request when the time difference is less than the first duration and the first resource difference is less than a preset resource difference. The first resource difference is obtained based on the first resource ratio, the second resource ratio and the current resource ratio.

[0031] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0032] Upon receiving an access request, record the initial resource percentage at the time the access request is received;

[0033] The access request is processed, and based on the trained prediction model, a first time required for normal processing of the access request and a second resource percentage required for normal processing are obtained.

[0034] During the processing of the access request, the processing status of the access request is checked at a first time interval, and the current number of checks is updated.

[0035] If the processing status of the access request is not completed, it is determined whether the current number of detections is greater than a first threshold. If the current number of detections is not greater than the first threshold, the time difference is obtained. The time difference is the time difference between the start of the execution of the access request and the current time.

[0036] If the time difference is less than the first duration and the first resource difference is less than the preset resource difference, then the processing procedure corresponding to the access request is terminated. The first resource difference is obtained based on the first resource ratio, the second resource ratio, and the current resource ratio.

[0037] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0038] Upon receiving an access request, record the initial resource percentage at the time the access request is received;

[0039] The access request is processed, and based on the trained prediction model, a first time required for normal processing of the access request and a second resource percentage required for normal processing are obtained.

[0040] During the processing of the access request, the processing status of the access request is checked at a first time interval, and the current number of checks is updated.

[0041] If the processing status of the access request is not completed, it is determined whether the current number of detections is greater than a first threshold. If the current number of detections is not greater than the first threshold, the time difference is obtained. The time difference is the time difference between the start of the execution of the access request and the current time.

[0042] If the time difference is less than the first duration and the first resource difference is less than the preset resource difference, then the processing procedure corresponding to the access request is terminated. The first resource difference is obtained based on the first resource ratio, the second resource ratio, and the current resource ratio.

[0043] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0044] Upon receiving an access request, record the initial resource percentage at the time the access request is received;

[0045] The access request is processed, and based on the trained prediction model, a first time required for normal processing of the access request and a second resource percentage required for normal processing are obtained.

[0046] During the processing of the access request, the processing status of the access request is checked at a first time interval, and the current number of checks is updated.

[0047] If the processing status of the access request is not completed, it is determined whether the current number of detections is greater than a first threshold. If the current number of detections is not greater than the first threshold, the time difference is obtained. The time difference is the time difference between the start of the execution of the access request and the current time.

[0048] If the time difference is less than the first duration and the first resource difference is less than the preset resource difference, then the processing procedure corresponding to the access request is terminated. The first resource difference is obtained based on the first resource ratio, the second resource ratio, and the current resource ratio.

[0049] The aforementioned database management method, apparatus, computer equipment, storage medium, and computer program product, upon receiving an access request, record a first resource percentage at the time of receiving the access request; process the access request and, based on a trained prediction model, obtain a first time duration and a second resource percentage required for normal processing of the access request; during the processing of the access request, check the processing status of the access request at a first time interval and update the current check count; if the processing status of the access request is incomplete, determine whether the current check count is greater than a first threshold; if the current check count is not greater than the first threshold, then obtain the time... If the time difference is less than a first duration and the first resource difference is less than a preset resource difference, then the processing procedure corresponding to the access request is suspended. Compared with traditional technology, which requires manual investigation of database problems after an alarm occurs, this method uses a predictive model to predict the time and resource ratio required for normal processing of access requests. By comparing the prediction results with the actual processing status of access requests, the processing procedure corresponding to potentially abnormal access requests is suspended, thereby minimizing performance issues in the database, maintaining database performance, and improving database management. Attached Figure Description

[0050] Figure 1 This is a diagram illustrating the application environment of a database management method in one embodiment.

[0051] Figure 2 This is a flowchart illustrating a database management method in one embodiment;

[0052] Figure 3 This is a schematic diagram of the training process of a prediction model in one embodiment;

[0053] Figure 4 This is a flowchart illustrating the database management method in another embodiment;

[0054] Figure 5 This is a structural block diagram of a database management device in one embodiment;

[0055] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0057] The database management method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another network server.

[0058] When server 104 receives an access request from terminal 102, it records the first resource percentage at the time of receiving the access request; processes the access request, and based on the trained prediction model, obtains the first time duration and the second resource percentage required for normal processing of the access request; during the processing of the access request, it checks the processing status of the access request at a first time interval and updates the current number of checks; if the processing status of the access request is incomplete, it determines whether the current number of checks is greater than a first threshold; if the current number of checks is not greater than the first threshold, it obtains the time difference; if the time difference is less than the first time duration and the first resource difference is less than a preset resource difference, it executes a stop operation on the processing of the access request.

[0059] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0060] In one embodiment, such as Figure 2 As shown, a database management method is provided, which can be applied to... Figure 1 Taking server 104 as an example, the following steps are included:

[0061] Step 202: Upon receiving an access request, record the first resource percentage at the time the access request is received.

[0062] The first resource percentage represents the system performance when an access request is received.

[0063] For example, the server can record the first resource percentage when receiving an access request upon receiving access information.

[0064] Step 204: Process the access request and, based on the trained prediction model, obtain the first time required for normal processing of the access request and the second resource percentage required for normal processing.

[0065] The process involves establishing a connection between the server and the database to retrieve data stored in the database. Access requests can include SQL statements, primarily categorized as CRUD (Create, Read, Update, Delete) statements.

[0066] The prediction model can be trained using deep learning and is used to predict received access requests. The first duration is the time required to normally execute the access request under the current server system performance. The second resource allocation is the system resources required to normally execute the access request under the current server system performance.

[0067] In some embodiments, the trained prediction model can be deployed to a server. The server preprocesses the access request data to obtain data to be processed, and uses the trained prediction model to predict the data to be processed, obtaining a first time required for normal processing of the access request and a second resource percentage required for normal processing. Specifically, preprocessing the access request data may involve cleaning the data to remove abnormal and null values, thus obtaining the data to be processed.

[0068] For example, the server can process access requests and, while processing the access requests, obtain, based on the trained prediction model, a first time required for normal processing of the access request and a second percentage of resources required for normal processing.

[0069] Step 206: During the processing of the access request, the processing status of the access request is detected according to the first time interval, and the current detection count is updated.

[0070] The processing status of the access request can be either completed or incomplete. The current detection count is the number recorded for the current access request.

[0071] Specifically, the first time interval can be set based on the actual situation, and the present invention does not impose any restrictions on it.

[0072] For example, during the processing of an access request, the server may detect the processing request of the access request at a first time interval and update the current detection count.

[0073] Step 208: If the processing status of the access request is not completed, determine whether the current number of detections is greater than a first threshold. If the current number of detections is not greater than the first threshold, obtain the time difference. The time difference is the time difference between the start of the execution of the access request and the current time.

[0074] The time difference is the time difference between the start of executing the access request and the current check to see if the access request has been processed.

[0075] Specifically, the size of the first threshold can be set based on empirical values, and this invention does not limit it here.

[0076] For example, if the processing request for the access request has not been completed, the server can determine whether the current number of checks is greater than a first threshold. If the current number of checks is not greater than the first threshold, the server can obtain the time difference.

[0077] Step 210: If the time difference is less than the first duration and the first resource difference is less than the preset resource difference, then the processing procedure corresponding to the access request is terminated. The first resource difference is obtained based on the first resource ratio, the second resource ratio and the current resource ratio.

[0078] The first resource difference can be obtained based on the first resource percentage, the second resource percentage, and the current resource percentage. Specifically, the first resource difference can be obtained by subtracting the current resource percentage from the sum of the first resource percentage and the second resource percentage.

[0079] For example, if the time difference is less than a first duration and the first resource difference is less than a preset resource difference, the server may terminate the processing of the access request. Specifically, the size of the first duration and the size of the preset resource difference can be empirical values ​​and can be set based on actual conditions; this invention does not impose any limitations on these values.

[0080] In the aforementioned database management method, upon receiving an access request, the first resource percentage at the time of receiving the access request is recorded; the access request is processed, and based on the trained prediction model, the first time duration and the second resource percentage required for normal processing of the access request are obtained; during the processing of the access request, the processing status of the access request is checked at a first time interval, and the current number of checks is updated; if the processing status of the access request is incomplete, it is determined whether the current number of checks is greater than a first threshold; if the current number of checks is not greater than the first threshold, the time difference is obtained; if the time difference is less than the first time duration and the first resource difference is less than a preset resource difference, the processing procedure corresponding to the access request is stopped. Compared to traditional technologies that require manual investigation of database problems after an alarm occurs, this method uses a prediction model to predict the time duration and resource percentage required for normal processing of access requests. By comparing the prediction results with the actual processing status of the access requests, the processing procedure corresponding to potentially abnormal access requests is stopped, thereby minimizing performance issues in the database, maintaining database performance, and improving database management effectiveness.

[0081] In one embodiment, the method further includes:

[0082] If the current number of detections exceeds the first threshold, then the processing procedure corresponding to the access request will be terminated.

[0083] For example, if the processing status of an access request is detected as incomplete, the current detection count is updated, and if the current detection count is greater than a first threshold, the server may perform a stop operation on the processing of the access request.

[0084] In the above embodiments, by setting a first threshold, the processing of access requests that may be abnormal is stopped, so as to avoid performance problems in the database as much as possible, maintain the performance of the database, and improve the management effect of the database.

[0085] In one embodiment, the method further includes:

[0086] If the time difference is not less than the first duration, or if the time difference is less than the first duration and the first resource difference is not less than the preset resource difference, return to the step of detecting the processing status of the access request according to the first time interval and continue execution.

[0087] The time difference can be the time from when the access request is started to when the current access check is completed. The first resource difference can be obtained based on the first resource percentage, the second resource percentage, and the current resource percentage. Specifically, the first resource difference can be obtained by subtracting the current resource percentage from the sum of the first resource percentage and the second resource percentage.

[0088] For example, if the time difference is less than a first duration, and the time difference is not less than the first duration, the process returns to the step of checking the processing status of the access request according to the first time interval and continues execution. Alternatively, if the time difference is less than the first duration, if the first resource difference is less than a preset resource difference, and the first resource difference is not less than the preset resource difference, the process returns to the step of checking the processing status of the access request according to the first time interval and continues execution.

[0089] In the above embodiments, the first duration and the preset resource difference are used to determine whether it is necessary to continue to detect the processing status of access requests according to the first time interval. This realizes the re-detection of the processing status of access requests, so as to stop the processing of access requests that may have abnormalities, avoid performance problems in the database as much as possible, and improve the management effect of the database.

[0090] In one embodiment, step 204 includes:

[0091] Step 2042: Obtain the data information of the access request, which includes metadata information and the SQL statement corresponding to the access request.

[0092] Step 2044: Input the data information and the first resource ratio into the trained prediction model to obtain the first time and the second resource ratio required to normally process the access request.

[0093] The data information in the access request can include metadata information and the SQL statement corresponding to the access request. The SQL statement is mainly divided into the following types: CRUD (Create, Read, Update, Delete).

[0094] The first resource allocation percentage can be seen as the system performance when an access request is received. Specifically, it can be seen as the percentage of processor resources used by the server when an access request is received.

[0095] For example, the trained prediction model is obtained through deep learning training. The data information corresponding to the access request and the first resource ratio are input into the trained prediction model to obtain the first time and the second resource ratio required to normally process the access request.

[0096] In the above embodiments, the trained prediction model is used to predict the first time and second resource ratio required for normal processing of access requests. The prediction results are compared with the actual processing of access requests, and the processing of access requests that may be abnormal is stopped. This achieves the goal of avoiding performance problems in the database as much as possible, maintaining the performance of the database, and improving the management effect of the database.

[0097] In one embodiment, the method further includes:

[0098] Obtain feedback information, which includes access requests received within a preset time period and processing information of the access requests; the processing information includes processing results, processing time, and the percentage of resources consumed in processing; the processing results include normal processing results and abnormal processing results.

[0099] The prediction model is updated based on the feedback information.

[0100] The feedback information may include access requests received within a preset time period and processing information for those requests. Processing information includes, but is not limited to, processing results, processing time, and the percentage of resources consumed. Processing results include normal processing results and abnormal processing results. Specifically, the size of the preset time period can be selected based on actual circumstances, and this invention does not impose any limitations on it.

[0101] For example, a preset period can be set, and feedback information can be obtained from the log information of the database according to the preset period, so as to update the trained prediction model based on the feedback information.

[0102] In the above embodiments, the trained prediction model is updated by feedback information, which realizes the update of the prediction model based on the actual execution of access requests, thereby improving the accuracy of the first time and second resource ratio required for normal processing of access requests using the prediction model.

[0103] In one embodiment, reference Figure 3 The diagram illustrates a flowchart of the training process for a prediction model in one embodiment, including:

[0104] Step 302: Obtain access log information; the access log information includes execution-related information of normally executed access requests and execution-related information of abnormally executed access requests; the execution-related information includes the data information of the access request, the processing time of the request, and the percentage of resources spent processing the access request.

[0105] The access log information is historical information and can include execution information for access requests. Specifically, the access log information can include execution-related information for normally executed access requests and execution-related information for abnormally executed access requests. Execution-related information can include the data information of the corresponding access request, the processing time of the request, and the percentage of resources consumed in processing the request.

[0106] Step 304: Determine the access processing data sample based on the access log information.

[0107] For example, access log information can be preprocessed to obtain data to be processed, and access processing data samples can be obtained based on the data to be processed. Specifically, access log information can be cleaned to remove abnormal data and null data, thereby obtaining access processing data samples.

[0108] Step 306: Based on the access processing samples, adjust the parameters of the pre-training prediction model until the pre-training prediction model converges to obtain the post-training prediction model.

[0109] In some embodiments, the server may use a portion of the access processing samples as a training set and the remainder as a test set. The training set is used to train the prediction model before training, and the test set is used to test the fault prediction model before training.

[0110] In practical applications, the prediction model before training can be a decision tree model, a support vector machine model, or a Bayesian model.

[0111] In the above embodiments, the historical data of access log information is used to train the prediction model, which improves the accuracy of the prediction model in predicting the first time required for normal processing of access requests and the second resource ratio required for normal processing.

[0112] To better understand the complete database management process in this embodiment of the invention, a complete example is provided. (Refer to...) Figure 4 The diagram illustrates a flow chart of a database management method in another embodiment, including the following steps:

[0113] Step 402: Obtain access log information, perform data cleaning on the access log information, and obtain access processing data samples.

[0114] The access log information includes execution-related information for normally executed access requests and execution-related information for abnormally executed access requests. The execution-related information includes the data information of the access request, the processing time of the request, and the percentage of resources spent processing the access request.

[0115] Step 404: Based on the access processing samples, adjust the parameters of the pre-training prediction model until the pre-training prediction model converges, and obtain the post-training prediction model.

[0116] Step 406: Upon receiving an access request, record the first resource percentage at the time the access request is received.

[0117] Step 408: Process the access request and obtain the data information of the access request. Input the data information and the first resource ratio into the trained prediction model to obtain the first time and the second resource ratio required to process the access request normally.

[0118] The data information includes metadata information and the SQL statement corresponding to the access request.

[0119] Step 410: During the process of processing access requests, the processing status of access requests is checked according to the first time interval, and the current number of checks is updated.

[0120] Step 412: If the processing status of the access request is not completed, determine whether the current number of detections is greater than the first threshold. If the current number of detections is not greater than the first threshold, obtain the time difference. If the time difference is less than the first duration and the first resource difference is less than the preset resource difference, then execute the stop operation for the processing of the access request.

[0121] Specifically, the time difference is the time difference between the start of executing the access request and the current time; specifically, the first resource difference is obtained based on the first resource percentage, the second resource percentage, and the current resource percentage.

[0122] Step 414: If the current number of detections exceeds the first threshold, then the processing procedure corresponding to the access request is suspended.

[0123] Step 416: If the time difference is not less than the first duration, or if the time difference is less than the first duration and the first resource difference is not less than the preset resource difference, return to the step of detecting the processing status of the access request according to the first time interval and continue execution.

[0124] Step 418: Obtain feedback information and update the prediction model based on the feedback information.

[0125] The feedback information includes access requests received within a preset time period and the processing information of the access requests; the processing information includes the processing result, processing time, and the percentage of resources consumed in the processing; the processing result includes normal processing result and abnormal processing result.

[0126] In this embodiment, upon receiving an access request, the first resource percentage at the time of receiving the access request is recorded; the access request is processed, and based on the trained prediction model, the first time duration and the second resource percentage required for normal processing of the access request are obtained; during the processing of the access request, the processing status of the access request is detected at a first time interval, and the current detection count is updated; if the processing status of the access request is incomplete, it is determined whether the current detection count is greater than a first threshold; if the current detection count is not greater than the first threshold, the time difference is obtained; if the time difference is less than the first time duration and the first resource difference is less than a preset resource difference, the processing procedure corresponding to the access request is terminated. Compared with traditional technology, which requires manual investigation of database problems after an alarm occurs, this method uses a prediction model to predict the time duration and resource percentage required for normal processing of access requests. By comparing the prediction results with the actual processing status of the access request, the processing procedure corresponding to potentially abnormal access requests is terminated, thereby minimizing performance issues in the database, maintaining database performance, and improving database management. Furthermore, compared to the traditional method that requires manual inspection, this method reduces labor costs.

[0127] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0128] Based on the same inventive concept, this application also provides a database management apparatus for implementing the database management method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more database management apparatus embodiments provided below can be found in the limitations of the database management method described above, and will not be repeated here.

[0129] In one embodiment, such as Figure 5As shown, a database management device is provided, including: a recording module 502, a request processing and prediction module 504, a processing status detection module 506, a time difference acquisition module 508, and a first abort operation execution module 510, wherein:

[0130] The recording module 502 is used to record the first resource percentage when an access request is received;

[0131] The request processing and prediction module 504 is used to process the access request and, based on the trained prediction model, obtain the first time required for normal processing of the access request and the second resource percentage required for normal processing.

[0132] The processing status detection module 506 is used to detect the processing status of the access request at a first time interval during the processing of the access request and update the current detection count.

[0133] The time difference acquisition module 508 is used to determine whether the current number of detections is greater than a first threshold when the processing status of the access request is not completed; if the current number of detections is not greater than the first threshold, then the time difference is acquired; the time difference is the time difference value from the start of the execution of the access request to the current time.

[0134] The first abort operation execution module 510 is used to execute an abort operation on the processing of the access request when the time difference is less than the first duration and the first resource difference is less than a preset resource difference. The first resource difference is obtained based on the first resource ratio, the second resource ratio and the current resource ratio.

[0135] In some embodiments, the database management apparatus further includes:

[0136] The second abort operation module is used to execute a stop operation on the processing of the access request if the current number of detections is greater than the first threshold.

[0137] In some embodiments, the database management apparatus further includes:

[0138] The request detection module is configured to, when the time difference is not less than the first duration, or when the time difference is less than the first duration and the first resource difference is not less than the preset resource difference, return to the step of detecting the processing status of the access request according to the first time interval and continue execution.

[0139] In some embodiments, the request processing and prediction module 504 includes:

[0140] A data information acquisition unit is used to acquire data information of the access request, the data information including metadata information and the SQL statement corresponding to the access request;

[0141] The model prediction unit is used to input the data information and the first resource ratio into the trained prediction model to obtain the first time and the second resource ratio required to normally process the access request.

[0142] In some embodiments, the database management apparatus further includes:

[0143] The feedback information acquisition module is used to acquire feedback information, which includes access requests received within a preset time period and processing information of the access requests; the processing information includes processing results, processing time, and the percentage of resources consumed in processing; the processing results include normal processing results and abnormal processing results.

[0144] The prediction model update module is used to update the prediction model based on the feedback information.

[0145] In some embodiments, the database management apparatus further includes:

[0146] The log information acquisition module is used to acquire access log information; the access log information includes execution-related information of normally executed access requests and execution-related information of abnormally executed access requests; the execution-related information includes the data information of the access request, the processing time of the request, and the percentage of resources spent processing the access request;

[0147] The data sample determination module is used to determine the access processing data sample based on the access log information.

[0148] The prediction model acquisition module is used to adjust the parameters of the pre-training prediction model based on the access processing samples until the pre-training prediction model converges, thereby obtaining the trained prediction model.

[0149] Each module in the aforementioned database management device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0150] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores access log information. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a database management method. The display unit of the computer device forms a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0151] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0152] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0153] Upon receiving an access request, record the initial resource percentage at the time the access request is received;

[0154] The access request is processed, and based on the trained prediction model, a first time required for normal processing of the access request and a second resource percentage required for normal processing are obtained.

[0155] During the processing of the access request, the processing status of the access request is checked at a first time interval, and the current number of checks is updated.

[0156] If the processing status of the access request is not completed, it is determined whether the current number of detections is greater than a first threshold. If the current number of detections is not greater than the first threshold, the time difference is obtained. The time difference is the time difference between the start of the execution of the access request and the current time.

[0157] If the time difference is less than the first duration and the first resource difference is less than the preset resource difference, then the processing procedure corresponding to the access request is terminated. The first resource difference is obtained based on the first resource ratio, the second resource ratio, and the current resource ratio.

[0158] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0159] Upon receiving an access request, record the initial resource percentage at the time the access request is received;

[0160] The access request is processed, and based on the trained prediction model, a first time required for normal processing of the access request and a second resource percentage required for normal processing are obtained.

[0161] During the processing of the access request, the processing status of the access request is checked at a first time interval, and the current number of checks is updated.

[0162] If the processing status of the access request is not completed, it is determined whether the current number of detections is greater than a first threshold. If the current number of detections is not greater than the first threshold, the time difference is obtained. The time difference is the time difference between the start of the execution of the access request and the current time.

[0163] If the time difference is less than the first duration and the first resource difference is less than the preset resource difference, then the processing procedure corresponding to the access request is terminated. The first resource difference is obtained based on the first resource ratio, the second resource ratio, and the current resource ratio.

[0164] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0165] Upon receiving an access request, record the initial resource percentage at the time the access request is received;

[0166] The access request is processed, and based on the trained prediction model, a first time required for normal processing of the access request and a second resource percentage required for normal processing are obtained.

[0167] During the processing of the access request, the processing status of the access request is checked at a first time interval, and the current number of checks is updated.

[0168] If the processing status of the access request is not completed, it is determined whether the current number of detections is greater than a first threshold. If the current number of detections is not greater than the first threshold, the time difference is obtained. The time difference is the time difference between the start of the execution of the access request and the current time.

[0169] If the time difference is less than the first duration and the first resource difference is less than the preset resource difference, then the processing procedure corresponding to the access request is terminated. The first resource difference is obtained based on the first resource ratio, the second resource ratio, and the current resource ratio.

[0170] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0171] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0172] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0173] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A database management method, characterized in that, The method includes: Upon receiving an access request, record the initial resource percentage at the time the access request is received; The access request is processed, and based on the trained prediction model, a first time duration and a second resource percentage required for normal processing of the access request are obtained; during the processing of the access request, the processing status of the access request is detected at a first time interval, and the current detection count is updated. If the processing status of the access request is not completed, it is determined whether the current number of detections is greater than a first threshold. If the current number of detections is not greater than the first threshold, the time difference is obtained. The time difference is the time difference between the start of the execution of the access request and the current time. If the time difference is less than the first duration and the first resource difference is less than the preset resource difference, then the processing procedure corresponding to the access request is terminated. The first resource difference is obtained based on the first resource ratio, the second resource ratio, and the current resource ratio.

2. The method according to claim 1, characterized in that, The method further includes: If the current number of detections exceeds the first threshold, then the processing procedure corresponding to the access request will be terminated.

3. The method according to claim 1, characterized in that, The method further includes: If the time difference is not less than the first duration, or if the time difference is less than the first duration and the first resource difference is not less than the preset resource difference, return to the step of detecting the processing status of the access request according to the first time interval and continue execution.

4. The method according to claim 1, characterized in that, The step of obtaining the first time required for normal processing of the access request and the second resource percentage required for normal processing based on the trained prediction model includes: Obtain the data information of the access request, the data information including metadata information and the SQL statement corresponding to the access request; The data and the first resource percentage are input into the trained prediction model to obtain the first time and the second resource percentage required to normally process the access request.

5. The method according to claim 1, characterized in that, The method further includes: Obtain feedback information, which includes access requests received within a preset time period and processing information of the access requests; the processing information includes processing results, processing time, and the percentage of resources consumed in processing; the processing results include normal processing results and abnormal processing results. The prediction model is updated based on the feedback information.

6. The method according to claim 1, characterized in that, The method further includes: Obtain access log information; the access log information includes execution-related information of normally executed access requests and execution-related information of abnormally executed access requests; the execution-related information includes the data information of the access request, the processing time of the request, and the percentage of resources spent processing the access request; Based on the access log information, determine the access processing data sample; Based on the access processing data sample, adjust the parameters of the pre-training prediction model until the pre-training prediction model converges to obtain the post-training prediction model.

7. A database management device, characterized in that, The device includes: The recording module is used to record the first resource percentage when an access request is received; the request processing and prediction module is used to process the access request and, based on the trained prediction model, obtain the first time required for normal processing of the access request and the second resource percentage required for normal processing. The processing status detection module is used to detect the processing status of the access request at a first time interval during the processing of the access request and update the current detection count. The time difference acquisition module is used to determine whether the current number of detections is greater than a first threshold when the processing status of the access request is not completed; if the current number of detections is not greater than the first threshold, the time difference is acquired; the time difference is the time difference between the start of the execution of the access request and the current time. The first abort operation execution module is used to execute an abort operation on the processing of the access request when the time difference is less than the first duration and the first resource difference is less than a preset resource difference. The first resource difference is obtained based on the first resource ratio, the second resource ratio and the current resource ratio.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the database management method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the database management method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the database management method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Database performance analysis method and device, electronic equipment and storage medium

    CN114610588A

  • Predicting database system performance

    US20060074970A1