Database resource queue adjustment method and device, equipment and storage medium

By establishing an ARIMA model and parsing SQL statements in the MPP database, the resource queue is automatically adjusted, solving the problems of low efficiency and prediction bias in the existing technology, and realizing efficient resource utilization and stable operation of business applications.

CN122332091APending Publication Date: 2026-07-03XINYANG BRANCH HENAN CO LTD OF CHINA MOBILE COMM CORP +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610287271.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-10
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies for adjusting MPP database resource queues suffer from inefficiency, high skill requirements, susceptibility to biased prediction models, inability to promptly assess new business resource needs, and severe load imbalance, leading to business application resource waiting or timeouts.

Method used

By collecting historical memory usage information of resource queues, an ARIMA model is established to predict memory usage and make automatic adjustments. Combined with the syntax parsing of SQL statements, the resource queue is dynamically adjusted to meet memory requirements, thereby achieving automated resource management.

Benefits of technology

It effectively avoids the phenomenon of business application resource waiting or timeout, improves resource utilization, reduces operation and maintenance complexity and technical threshold, and improves system operating efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122332091A_ABST
    Figure CN122332091A_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, device, and storage medium for adjusting database resource queues. The adjustment method involves predicting the memory usage of resource queues in advance and analyzing business statements. First, historical memory usage information of resource queues over a time period is collected to determine the parameters of the ARIMA model based on the collected information, resulting in the final ARIMA model. This model is then used to predict the memory usage of resource queues over a time period, generating a memory usage prediction table. The memory load value of resource queues over a time period is then updated periodically. Next, the SQL statements in the business logic are parsed to predict the memory capacity required for execution. This, combined with the memory load value, enables automatic adjustment of the resource queues executing SQL statements in the database. This helps avoid resource waiting or timeouts in business applications and effectively improves data resource utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of resource queue adjustment technology, and in particular to a method, apparatus, device and storage medium for adjusting the resource queue of a database. Background Technology

[0002] Currently, the main method for adjusting resource queues in MPP databases is to manually collect the status information of the database's resource queues periodically, and then manually adjust the concurrency and memory size of each resource queue in the MPP database based on the host load and the running status of the resource queues (RQs) to ensure that subsequent tasks have sufficient resources to run. However, this method of manually adjusting MPP data warehouse resource queues has the following drawbacks: 1. MPP databases have a large cluster size, typically consisting of dozens or hundreds of hosts. Manually collecting load information is inefficient and requires professionals to analyze the relevant load information of the database and then adjust the memory of the resource queue based on the analysis results. This places skill requirements on operators, and the timeliness of information collection and analysis is poor, making it impossible to predict the memory usage of the resource queue in advance.

[0003] 2. If a predictive model is used to predict the memory usage of the resource queue, since the predictive model is based on existing training data, it is prone to prediction bias when there are sudden business fluctuations, which may lead to resource waiting or timeouts in business applications.

[0004] 3. As the business scale continues to expand, it is often impossible to assess the resources required for newly launched businesses in a timely manner, resulting in the business being in a waiting state in the resource queue for a long time after startup or exiting abnormally due to timeout.

[0005] 4. As business expands, the pre-allocated database resource queue memory ratio cannot meet the needs of newly launched businesses. The load imbalance between different resource queues is severe, and the corresponding resource queue load cannot be automatically updated before business operation, ultimately leading to resource waste. Summary of the Invention

[0006] The purpose of this invention is to provide a method, apparatus, device, and storage medium for adjusting the resource queue of a database. Based on the advance prediction of the memory ratio of the resource queue and the analysis of business statements, the resource queue is automatically adjusted, which helps to avoid resource waiting or timeout in business applications and effectively improves the resource utilization rate of data.

[0007] To achieve the above objectives, this invention discloses a resource queue adjustment method for a database, comprising: Collect historical memory usage information for at least one resource queue over at least one time period; The historical memory usage information is used to determine the d-parameters, p-parameters, and q-parameters of the ARIMA model in order to obtain at least one final ARIMA model. The memory usage of the resource queue for the specified time period is predicted using the final ARIMA model to obtain a memory usage prediction table. The memory load value of the resource queue for the specified time period is updated periodically based on the memory usage prediction table. The SQL statements that need to be executed in the business are parsed to predict the memory capacity required to execute the SQL statements; Adjust the resource queue in the database for executing the SQL statement based on the required memory capacity value and the memory load value.

[0008] Furthermore, the step of "determining the d-parameters, p-parameters, and q-parameters of the ARIMA model using the historical memory usage information" includes: The historical memory usage information is differentially calculated, and the calculated data is visually compared with the historical memory usage information to determine the d parameter of the ARIMA model; The autocorrelation function and partial autocorrelation function of the ARIMA model with d parameter were calculated and determined to determine the value range of p parameter and q parameter; Multiple Bayesian information criterion values ​​are calculated based on the determined range of values ​​for the p and q parameters; The p-parameters and q-parameters corresponding to the minimum Bayesian information criterion values ​​are selected as the p-parameters and q-parameters of the ARIMA model.

[0009] Furthermore, after "obtaining at least one final ARIMA model", it also includes: The final ARIMA model is used to predict the peak memory usage of the resource queue within a preset time window to obtain a sequence of predicted values. The prediction performance of the final ARIMA model is evaluated by calculating the mean absolute error using the historical memory usage information of the resource queue and the predicted value sequence.

[0010] Furthermore, the phrase "parse the SQL statements that need to be executed in the business to predict the memory capacity required to execute the SQL statements" includes: Generate a syntax analysis tree using the SQL statements that need to be executed in the business process; The depth-first search algorithm is used to traverse all nodes in the parsing tree to extract node information; Obtain the storage path based on the extracted node information; The storage capacity under the obtained storage path is calculated to obtain the required memory capacity value for executing the SQL statement.

[0011] Furthermore, the adjustment method includes: Collect historical memory usage information for all resource queues at each time period; The historical memory usage information is used to determine the d-parameters, p-parameters, and q-parameters of multiple ARIMA models to obtain multiple final ARIMA models; The memory usage of all resource queues for each time period is predicted using multiple final ARIMA models to obtain multiple memory usage prediction tables. The memory load value of all resource queues for each time period is updated periodically based on multiple memory usage prediction tables.

[0012] Furthermore, the step of "adjusting the resource queue for executing the SQL statement in the database based on the required memory capacity value and the memory load value" includes: Determine whether the required memory capacity value is less than or equal to the free memory load value of the resource queue where the SQL statement is currently located. If the determination is yes, then execute the SQL statement directly. Determine whether the required memory capacity value is greater than the free memory load value of the resource queue in which the SQL statement is currently located and whether the required memory capacity value is less than the free memory load value of all the resource queues. If the determination is yes, then the SQL statement is adjusted to another resource queue and then executed. Determine whether the required memory capacity value is greater than the free memory load value of all the resource queues, and whether the required memory capacity value is less than the memory load value of all the resource queues. If the determination is yes, wait for the resource queues to release resources before executing the SQL statement. Determine whether the required memory capacity value is greater than the memory load value of all the resource queues. If the determination is yes, then interrupt the submission of the SQL statement to the database.

[0013] Furthermore, after "adjusting the resource queue for executing the SQL statement in the database based on the required memory capacity value and the memory load value", it also includes: The historical memory usage information of the resource queue within a preset time window is used as training data, and the final ARIMA model is retrained using the training data to obtain a new ARIMA model. The memory usage of the resource queue for a given time period is re-predicted using the new ARIMA model to obtain a new memory usage prediction table.

[0014] To achieve the above objectives, the present invention discloses a resource queue adjustment device for a database, comprising: The collection module is used to collect historical memory usage information of at least one resource queue over at least one time period. The determination module is used to determine the d-parameters, p-parameters, and q-parameters of the ARIMA model using the historical memory usage information, so as to obtain at least one final ARIMA model; The prediction module is used to predict the memory usage of the resource queue for the time period using the final ARIMA model, so as to obtain a memory usage prediction table. The update module is used to periodically update the memory load value of the resource queue for the time period based on the memory usage prediction table; The parsing and prediction module is used to perform syntax parsing on the SQL statements that need to be executed in the business, so as to predict the memory capacity required to execute the SQL statements; The adjustment module is used to adjust the resource queue in the database for executing the SQL statement based on the required memory capacity value and the memory load value.

[0015] To achieve the above objectives, the present invention discloses an electronic device comprising: One or more processors; One or more memories are used to store one or more programs, which, when executed by the processor, cause the processor to implement the database resource queue adjustment method as described above.

[0016] To achieve the above objectives, the present invention discloses a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the aforementioned database resource queue adjustment method.

[0017] Compared with existing technologies, this invention performs advance prediction of resource queue memory usage and analysis of business statements. First, it collects historical memory usage information of the resource queue over a time period to determine the parameters of the ARIMA model based on the collected information, thus obtaining the final ARIMA model. This model is then used to predict the memory usage of the resource queue over a time period, resulting in a memory usage prediction table. The memory load value of the resource queue over a time period is then updated periodically. Next, the SQL statements in the business process are parsed to predict the memory capacity required for execution. This, combined with the memory load value, enables automatic adjustment of the resource queue executing SQL statements in the database. This helps avoid resource waiting or timeouts in business applications and effectively improves data resource utilization. Attached Figure Description

[0018] Figure 1 This is a flowchart of a database resource queue adjustment method according to an embodiment of the present invention.

[0019] Figure 2 This is a visual comparison chart showing the results of differential calculations performed in the resource queue adjustment method of the database in this embodiment of the invention.

[0020] Figure 3 This is a graph of the autocorrelation function and partial autocorrelation function calculated in the resource queue adjustment method of the database in this embodiment of the invention.

[0021] Figure 4 This is a code diagram illustrating the prediction using a model in the database resource queue adjustment method of this embodiment of the invention.

[0022] Figure 5 This is a schematic diagram of the parsing tree in the database resource queue adjustment method of this embodiment of the invention.

[0023] Figure 6 This is a schematic diagram illustrating the traversal of the parsing tree in the resource queue adjustment method of the database according to an embodiment of the present invention.

[0024] Figure 7 This is a schematic diagram illustrating the calculation of storage capacity for a storage path in the resource queue adjustment method of the database according to an embodiment of the present invention.

[0025] Figure 8 This is a block diagram of the resource queue adjustment device for the database in an embodiment of the present invention.

[0026] Figure 9 This is a system diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0027] To illustrate the technical content, structural features, objectives, and effects of the present invention in detail, the following description is provided in conjunction with the embodiments and accompanying drawings.

[0028] Example 1 Please see Figures 1 to 7 This invention discloses a method for adjusting the resource queue of a database, comprising: 101. Collect historical memory usage information for at least one resource queue over at least one time period; It is understood that in this embodiment, as described in step 11, the actual historical memory usage information of all resource queues in each time period is continuously collected to ensure the accuracy of the prediction results. For example, the collected historical memory usage information is shown in the table below:

[0029] 102. Use historical memory usage information to determine the d-parameters, p-parameters, and q-parameters of the ARIMA model in order to obtain at least one final ARIMA model; Furthermore, "determining the d-parameters, p-parameters, and q-parameters of the ARIMA model using historical memory usage information" includes: 1021. Perform differential calculations on historical memory usage information and visualize and compare the calculated data with historical memory usage information to determine the d-parameter of the ARIMA model; 1022. The autocorrelation function and partial autocorrelation function of the ARIMA model with d parameters were calculated and determined to determine the range of values ​​for p and q parameters. 1023. Based on the determined range of values ​​for the p and q parameters, multiple Bayesian information criterion values ​​are calculated. 1024. Select the p-parameters and q-parameters corresponding to the minimum Bayesian information criterion values ​​as the p-parameters and q-parameters of the ARIMA model.

[0030] Based on historical data from long-running resource queues and the ARIMA model, predictions can be made to accurately forecast the estimated load of MPP databases at different times, effectively reducing the complexity and technical barriers to the operation and maintenance of existing MPP data warehouses.

[0031] It is understood that, in this embodiment, as described in step 12, the Autoregressive Integrated Moving Average (ARIMA) model is selected to develop a sub-model for the peak memory usage of all resource queues in each time period, so as to more accurately predict the peak memory usage sequence of the MPP database resource queue load in each time period.

[0032] First, it is necessary to determine the multiple parameters of the ARIMA model, including the d-value (difference), p-value, and q-value. For example, using the time series vector (TSV9) of the daily 9:00-10:00 time period in resource queue RQ1, first-order and second-order difference calculations are performed respectively. The results are then visualized and compared with the original data. Figure 2 As can be seen, the first-order difference calculation is sufficient to convert the TSV9 time series vector into a stationary sequence, so the d value (difference) of the corresponding sub-model can be set to 1; Next, by calculating the autocorrelation function and partial autocorrelation function of the TSV9_D1 time series vector, the following can be obtained: Figure 3 The ACF and PACF distribution plots shown are presented. It can be observed that both plots show obvious tailing. Therefore, multiple parameter groups for p and q values ​​can be formed using positive integers within [1,5], and model training can be attempted for each group. Finally, the model evaluation quality index for each model is calculated: the Bayesian Information Criterion (BIC) is used to determine the p-value and q-value of the ARIMA model in order to select the optimal model. The BIC values ​​of each model are shown in the table below:

[0033] The parameters of the ARIMA model are determined to be 3 and 1 based on the combination of p and q values ​​corresponding to the minimum BIC value, so as to obtain the trained (P=3, D=1, Q=1) final ARIMA application model.

[0034] Furthermore, after "obtaining at least one final ARIMA model", it also includes: 1025. Use the final ARIMA model to predict the peak memory usage of the resource queue within a preset time window to obtain a sequence of predicted values; 1026. The mean absolute error is calculated using the historical memory usage information of the resource queue and the predicted value sequence to evaluate the prediction performance of the final ARIMA model.

[0035] Understandably, historical data from a selected resource queue, such as... Figure 4 As shown, the memory usage of the resource queue is predicted using the corresponding final ARIMA model, and the two are compared. In this embodiment, the preset time window is 7 days (a custom week). For example, the predicted memory usage of TSV9 after 7 days is shown in the table below:

[0036] The performance metric of the final ARIMA model, Mean Absolute Error (MAE), is used to evaluate the error between the model's predicted values ​​and the actual values. In this embodiment, The mean absolute error (MAE) of the final ARIMA model is 0.7G, which is much smaller than the expected mean absolute error (MAE) of 5G. Therefore, the performance of the final ARIMA model meets expectations.

[0037] 103. Use the final ARIMA model to predict the memory usage of the resource queue over a period of time to obtain a memory usage prediction table; Understandably, for example, the memory usage prediction table is shown below:

[0038] 104. Update the memory load value of the resource queue for a specific time period based on the memory usage prediction table. It is understandable that a scheduled task is created in the automated scheduling tool, and a resource queue, time period, and memory usage prediction table are used as input parameters to automatically update the memory load settings of the resource queue in the first N minutes of each time period, so that the subsequent execution of step 106 can automatically adjust the resource queue.

[0039] 105. Perform syntax parsing on the SQL statements that need to be executed in the business to predict the memory capacity required to execute the SQL statements; Furthermore, "parse the SQL statements that need to be executed in the business to predict the memory capacity required to execute the SQL statements" includes: 1051. Generate a syntax tree (AST) from the SQL statements that need to be executed in the business; 1052. Use the depth-first search algorithm to traverse all nodes in the parsing tree to extract node information; 1053. Obtain the storage path based on the extracted node information; 1054. Calculate the storage capacity under the obtained storage path to obtain the memory capacity value required to execute the SQL statement.

[0040] Understandably, before executing business SQL statements, an SQL pre-parsing engine is used to pre-parse the statements to automatically analyze and determine the memory resources required. First, the SQL statement undergoes lexical analysis to break it down into a series of keywords and generate an Abstract Syntax Tree (AST). For example, if the SQL statement is: `insert t1 select t2.c1 from t2 where t2.c2 = <condition>`, parsing it will generate an AST like... Figure 5 The parsing tree shown; Next, a depth-first traversal algorithm is used to traverse the generated parsing tree, starting from the root node of `select`. Figure 6 The node traversal shown first traverses the left leaf nodes, then traverses the right leaf nodes, and after traversing all nodes, extracts all child node information under the FROM and WHERE nodes to obtain the table name T2 and the WHERE condition c2="condition" of the SQL statement. Then, based on the table name, query the metadata information in the database to obtain the HDFS storage path of the storage table T2; and determine whether the storage table T2 is a partition column according to the WHERE condition. If it is a partition column, determine the HDFS storage path of the storage table T2 as the corresponding subdirectory according to the partition key value of the WHERE condition; otherwise, determine the corresponding entire directory. Finally, the storage capacity under the determined HDFS storage path of storage table T2 is calculated, such as... Figure 7 As shown in this embodiment, the memory required to execute the SQL statement is 10GB.

[0041] 106. Adjust the resource queue for executing SQL statements in the database based on the required memory capacity and memory load values.

[0042] Furthermore, the adjustment methods include: 11. Collect historical memory usage information for all resource queues at each time period; 12. Use historical memory usage information to determine the d-parameters, p-parameters, and q-parameters of multiple ARIMA models to obtain multiple final ARIMA models; 13. Use multiple final ARIMA models to predict the memory usage of all resource queues for each time period to obtain multiple memory usage prediction tables; 14. Update the memory load value of all resource queues for each time period based on multiple memory usage prediction tables.

[0043] Furthermore, "adjusting the resource queue for executing SQL statements in the database based on the required memory capacity and memory load values" includes: 1061. Determine whether the required memory capacity is less than or equal to the free memory load value of the resource queue in which the SQL statement is currently located. If the determination is yes, then execute the SQL statement directly. 1062. Determine whether the required memory capacity is greater than the free memory load of the resource queue where the SQL statement is currently located and whether the required memory capacity is less than the free memory load of all resource queues. If the determination is yes, then adjust the SQL statement to another resource queue and execute the SQL statement. 1063. Determine whether the required memory capacity is greater than the free memory load of all resource queues and whether the required memory capacity is less than the memory load of all resource queues. If the determination is yes, wait for the resource queues to release resources before executing the SQL statement. 1064. Determine if the required memory capacity is greater than the memory load of all resource queues. If so, interrupt the submission of the SQL statement to the database.

[0044] Understandably, if the ARIMA model's predictions deviate, it can automatically adjust the memory load of the resource queue in a timely manner based on the memory size parsed from the SQL, the current database resource queue load, and the preset adjustment rules. This effectively avoids resource waiting or timeouts in business applications, thereby ensuring the normal operation of business applications, reducing system failure rates, improving system operating efficiency, and automatically adjusting the resource queue before business operations begin, which is beneficial for adapting to business operations running at different times.

[0045] Furthermore, following "adjusting the resource queue for executing SQL statements in the database based on the required memory capacity and memory load values," it also includes: 107. Use the historical memory usage information of the resource queue within a preset time window as training data, and use the training data to retrain the final ARIMA model to obtain a new ARIMA model. 108. Use the new ARIMA model to re-predict the memory usage of the resource queue over a time period to obtain a new memory usage prediction table.

[0046] Understandably, before executing business SQL statements, SQL pre-parsing technology is used to automatically analyze and obtain the memory capacity resources required by each business SQL statement in real time. This allows for real-time comparison with the predictions of the ARIMA model, enabling timely detection of deviations in the ARIMA model's predictions. Furthermore, by reapplying the ARIMA model, the predictions can be automatically updated and corrected, ensuring the smooth operation of business applications.

[0047] It should be noted that the specific process of retraining and regenerating predictions for the ARIMA model is as follows: The ARIMA model automatically selects production data from a specified time period of a specified resource queue, representing the week most recent to the point where business fluctuations occurred, as training data, while keeping the model parameters P, D, and Q values ​​unchanged for retraining. Then, the ARIMA model predict method is used for... Figure 4 The re-prediction shown in this embodiment, where the ARIMA model's prediction function regenerates the latest output prediction values, is illustrated in the table below:

[0048] Finally, update the predicted parameters in the database scheduling task. Specifically, the input parameters are shown in the following table (new memory usage prediction table):

[0049] By utilizing the optimized Autoregressive Differential Moving Average (ARIMA) time-series model, the load of MPP data warehouse resource queues at different times can be predicted relatively accurately. Furthermore, when the ARIMA model's predictions deviate, the actual load of the corresponding resource queue is calculated by parsing the SQL syntax into an Abstract Syntax Tree (AST) and using a depth-first traversal algorithm. This enables automatic adjustment of the resource queue's memory load, proactively avoiding resource waiting or timeouts during business application runtime, and automatically correcting ARIMA model deviations. This helps to minimize the manpower costs and workload of operations and maintenance, and effectively improve business operation efficiency.

[0050] Compared with existing technologies, this invention performs advance prediction of resource queue memory usage and analysis of business statements. First, it collects historical memory usage information of the resource queue over a time period to determine the parameters of the ARIMA model based on the collected information, thus obtaining the final ARIMA model. This model is then used to predict the memory usage of the resource queue over a time period, resulting in a memory usage prediction table. The memory load value of the resource queue over a time period is then updated periodically. Next, the SQL statements in the business process are parsed to predict the memory capacity required for execution. This, combined with the memory load value, enables automatic adjustment of the resource queue executing SQL statements in the database. This helps avoid resource waiting or timeouts in business applications and effectively improves data resource utilization.

[0051] Example 2 Please see Figure 1 and Figure 8 This invention discloses a resource queue adjustment device for a database, comprising: Collection module 201 is used to collect historical memory usage information of at least one resource queue over at least one time period; The determination module 202 is used to determine the d-parameters, p-parameters, and q-parameters of the ARIMA model using historical memory usage information, so as to obtain at least one final ARIMA model; The prediction module 203 is used to predict the memory usage of the resource queue over a period of time using the final ARIMA model, so as to obtain a memory usage prediction table. Update module 204 is used to periodically update the memory load value of the resource queue for a given time period based on the memory usage prediction table; The parsing and prediction module 205 is used to perform syntax parsing on the SQL statements that need to be executed in the business, so as to predict the memory capacity required to execute the SQL statements. Adjustment module 206 is used to adjust the resource queue for executing SQL statements in the database based on the required memory capacity value and memory load value.

[0052] Example 3 Please see Figure 1 and Figure 9 This invention discloses an electronic device comprising: One or more processors 301; One or more memories 302 are used to store one or more programs, which, when executed by a processor, cause the processor to implement the resource queue adjustment method for the database as described above.

[0053] Example 4 This application discloses a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements the aforementioned database resource queue adjustment method.

[0054] Example 5 This application discloses a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the aforementioned database resource queue adjustment method.

[0055] It should be understood that, in the embodiments of this application, the processor may be a central processing unit (CPU), but it may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0056] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by hardware related to computer program instructions. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0057] The above-disclosed embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, any equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.

Claims

1. A method for adjusting a resource queue of a database, characterized by, The adjustment method includes: Collect historical memory usage information for at least one resource queue over at least one time period; The historical memory usage information is used to determine the d-parameters, p-parameters, and q-parameters of the ARIMA model in order to obtain at least one final ARIMA model. The memory usage of the resource queue for the specified time period is predicted using the final ARIMA model to obtain a memory usage prediction table. The memory load value of the resource queue for the specified time period is updated periodically based on the memory usage prediction table. The SQL statements that need to be executed in the business are parsed to predict the memory capacity required to execute the SQL statements; Adjust the resource queue in the database for executing the SQL statement based on the required memory capacity value and the memory load value.

2. The database resource queue adjustment method according to claim 1, characterized in that, The phrase "determining the d-parameters, p-parameters, and q-parameters of the ARIMA model using the historical memory usage information" includes: The historical memory usage information is differentially calculated, and the calculated data is visually compared with the historical memory usage information to determine the d parameter of the ARIMA model; The autocorrelation function and partial autocorrelation function of the ARIMA model with d parameter were calculated and determined to determine the value range of p parameter and q parameter; Multiple Bayesian information criterion values ​​are calculated based on the determined range of values ​​for the p and q parameters; The p-parameters and q-parameters corresponding to the minimum Bayesian information criterion values ​​are selected as the p-parameters and q-parameters of the ARIMA model.

3. The database resource queue adjustment method according to claim 1, characterized in that, After obtaining at least one final ARIMA model, the process also includes: The final ARIMA model is used to predict the peak memory usage of the resource queue within a preset time window to obtain a sequence of predicted values. The prediction performance of the final ARIMA model is evaluated by calculating the mean absolute error using the historical memory usage information of the resource queue and the predicted value sequence.

4. The database resource queue adjustment method according to claim 1, characterized in that, The phrase "parse the syntax of the SQL statements that need to be executed in the business to predict the memory capacity required to execute the SQL statements" includes: Generate a syntax analysis tree using the SQL statements that need to be executed in the business process; The depth-first search algorithm is used to traverse all nodes in the parsing tree to extract node information; Obtain the storage path based on the extracted node information; The storage capacity under the obtained storage path is calculated to obtain the required memory capacity value for executing the SQL statement.

5. The database resource queue adjustment method according to claim 1, characterized in that, The adjustment method includes: Collect historical memory usage information for all resource queues at each time period; The historical memory usage information is used to determine the d-parameters, p-parameters, and q-parameters of multiple ARIMA models to obtain multiple final ARIMA models; The memory usage of all resource queues for each time period is predicted using multiple final ARIMA models to obtain multiple memory usage prediction tables. The memory load value of all resource queues for each time period is updated periodically based on multiple memory usage prediction tables.

6. The database resource queue adjustment method according to claim 5, characterized in that, The phrase "adjusting the resource queue in the database for executing the SQL statement based on the required memory capacity value and the memory load value" includes: Determine whether the required memory capacity value is less than or equal to the free memory load value of the resource queue where the SQL statement is currently located. If the determination is yes, then execute the SQL statement directly. Determine whether the required memory capacity value is greater than the free memory load value of the resource queue in which the SQL statement is currently located and whether the required memory capacity value is less than the free memory load value of all the resource queues. If the determination is yes, then the SQL statement is adjusted to another resource queue and then executed. Determine whether the required memory capacity value is greater than the free memory load value of all the resource queues, and whether the required memory capacity value is less than the memory load value of all the resource queues. If the determination is yes, wait for the resource queues to release resources before executing the SQL statement. Determine whether the required memory capacity value is greater than the memory load value of all the resource queues. If the determination is yes, then interrupt the submission of the SQL statement to the database.

7. The database resource queue adjustment method according to claim 1, characterized in that, Following the phrase "adjusting the resource queue for executing the SQL statement in the database based on the required memory capacity value and the memory load value", the process also includes: The historical memory usage information of the resource queue within a preset time window is used as training data, and the final ARIMA model is retrained using the training data to obtain a new ARIMA model. The memory usage of the resource queue for a given time period is re-predicted using the new ARIMA model to obtain a new memory usage prediction table.

8. A resource queue adjustment device for a database, characterized in that, include: The collection module is used to collect historical memory usage information of at least one resource queue over at least one time period. The determination module is used to determine the d-parameters, p-parameters, and q-parameters of the ARIMA model using the historical memory usage information, so as to obtain at least one final ARIMA model; The prediction module is used to predict the memory usage of the resource queue for the time period using the final ARIMA model, so as to obtain a memory usage prediction table. The update module is used to periodically update the memory load value of the resource queue for the time period based on the memory usage prediction table; The parsing and prediction module is used to perform syntax parsing on the SQL statements that need to be executed in the business, so as to predict the memory capacity required to execute the SQL statements; The adjustment module is used to adjust the resource queue in the database for executing the SQL statement based on the required memory capacity value and the memory load value.

9. An electronic device, characterized in that, include: One or more processors; One or more memories for storing one or more programs, which, when executed by the processor, cause the processor to implement the resource queue adjustment method for a database as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements the database resource queue adjustment method as described in any one of claims 1 to 7.