A database intelligent parameter tuning system based on large language model enhancement

By using a large language model to assist in generating prompt words and recommended parameter configurations, combined with the Bayesian optimization algorithm and the multi-armed bandit algorithm, the problems of the database tuning system's difficulty in rapid convergence and high resource overhead in existing technologies are solved, achieving efficient and accurate database parameter tuning.

CN118467496BActive Publication Date: 2025-09-23SOUTH CHINA UNIV OF TECH

Patent Information

Application Number
CN202410470862.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-18
Publication Date
2025-09-23
Estimated Expiration
2044-04-18

AI Technical Summary

Technical Problem

Existing database tuning technologies are difficult to converge quickly when facing various workloads and have high resource overhead. They also find it difficult to utilize the rich knowledge in the database field for optimization.

Method used

A database intelligent parameter tuning system enhanced by a large language model is adopted. The large language model is used to assist in generating prompt words and recommended parameter configurations. Combined with the Bayesian optimization algorithm and the multi-armed bandit algorithm, the agent model is dynamically selected to balance the tuning effect and cost.

Benefits of technology

It improves the accuracy and convergence speed of the tuning system, enables more efficient discovery of optimal database parameter configurations, and enhances the applicability and efficiency of the tuning system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118467496B_ABST
    Figure CN118467496B_ABST
Patent Text Reader

Abstract

The present invention discloses a database intelligent parameter tuning system based on large language model enhancement, comprising: a large language model auxiliary module, which utilizes the rich prior knowledge of the large language model in the database field and the powerful reasoning and generation capabilities of the large language model to assist and enhance the capabilities of the tuning system; a parameter configuration recommendation module, which is used to automatically recommend the most promising database parameter configuration in an intelligent and efficient manner based on the current tuning scenario based on the assistance of the large language model; and a parameter configuration evaluation module, which is used to perform performance evaluation on the recommended parameter configuration during the database tuning process to obtain its specific performance value. The present invention combines artificial intelligence large language model technology with database optimization, breaking through the limitations of traditional database parameter tuning systems that are difficult to cope with multiple workloads and have high resource overhead required for tuning, fully capturing the heterogeneous characteristics between database parameters, and enhancing the tuning effect of the database system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of artificial intelligence large language models and database performance optimization, and in particular to a database intelligent parameter tuning system based on large language model enhancement. Background Art

[0002] With the explosive growth of digital information, individuals, organizations, and even enterprises are faced with the need to process and analyze vast amounts of data. In this context, database management systems must be able to effectively handle increasingly complex queries and transaction loads. To maximize resource utilization, more and more databases are moving to the cloud, and the widespread use of cloud databases has become a major trend. This makes cloud database performance optimization particularly critical. Cloud database performance directly determines the success of business operations. The complexity of database operations primarily stems from the need to process, store, and retrieve large amounts of data. Complex database operations often require optimization to improve performance, reduce costs, and ensure data consistency. In this era of rapid growth in digital information, cloud database performance optimization is not just about improving response speed and reducing costs; it is also key to adapting to new application scenarios and technological trends.

[0003] Current automated cloud database tuning techniques fall into four main categories: 1) Heuristics: These methods rely on empirical rules or search strategies, but are often affected by workload variability and lack the ability to leverage historical tuning knowledge. 2) Deep Learning: Deep learning methods use neural networks to predict tuning performance, alleviating the need for repeated workload evaluations. However, these methods face challenges when sample data is limited. 3) Reinforcement Learning: Reinforcement Learning leverages agent-environment interaction to learn strategies and adapt to large configuration spaces, but training convergence and computational costs are relatively high. Finally, 4) Bayesian Optimization: Bayesian optimization uses probabilistic surrogate models to explore the configuration space, balancing exploration and exploitation based on stochastic process techniques such as Gaussian processes. However, initial sampling may rely on migration techniques to obtain high-quality initial samples. The above cloud database knob tuning techniques have demonstrated advanced tuning performance in production environments. However, despite this significant progress, these methods still face a number of key challenges that need to be addressed to further optimize system performance.

[0004] Existing database systems have a large number of configuration parameters that affect their behavior in many areas, including memory allocation, I / O optimization, query plan cost estimation, parallel processing, logging, recovery, and more (Tuning Database Configuration Parameters with iTuned, Songyun Duan, Vamsidhar Thummala, and Shivnath Babu Duke University). Even expert database administrators struggle to tune these parameters for optimal performance. Existing database management research has largely ignored this problem, which is in fact quite difficult to address. iTuned is an automated tool for identifying good settings for database configuration parameters. It has three innovative features: Adaptive Sampling: Proactively introduces appropriate data through planned experiments to discover high-impact parameters and high-performance parameter settings. Executor: Supports online experimentation in production database environments, using a cycle-stealing paradigm with virtually no overhead for production workloads. Cross-database portability: Enables parameter tuning across different database systems. However, there are many adjustable parameters in the database, and iTuned has difficulty identifying important parameters. iTuned uses a Bayesian optimization algorithm, and its warm start data is generated through random sampling, which makes it difficult for the algorithm to converge quickly. The computational overhead is too high, and it is difficult to utilize the rich domain knowledge in the database field to assist in database optimization, including database tuning manuals and database Internet forums. Summary of the Invention

[0005] The purpose of the present invention is to overcome the shortcomings and deficiencies of the existing technology and propose a database intelligent parameter tuning system based on large language model enhancement. It breaks through the limitations of traditional database parameter tuning systems that are difficult to cope with various workloads and the high resource overhead required for tuning, fully captures the heterogeneous characteristics between database parameters, thereby enhancing the tuning effect of the database system. At the same time, the tuning system can be easily applied to various database systems, enhancing the applicability of the tuning system.

[0006] The present invention is achieved through at least one of the following technical solutions.

[0007] A database intelligent parameter tuning system based on large language model enhancement, including:

[0008] The large language model auxiliary module uses the large language model's prior knowledge and reasoning generation capabilities in the database to optimize the database;

[0009] The large language model auxiliary module includes a prompt word construction module and a prompt word execution module, wherein:

[0010] The prompt word construction module generates prompt words for different tasks based on the tuning task information and the large language model prompt word templates in different scenarios;

[0011] The prompt word execution module is used to use the large language model to execute the prompt words generated by the prompt word construction module, and parse and extract specific data returned by the large language model in different scenarios through the large language model output parsing advance program in different scenarios;

[0012] The parameter configuration recommendation module is used to automatically recommend the most promising database parameter configuration based on the current tuning scenario and with the assistance of a large language model.

[0013] The parameter configuration evaluation module is used to perform performance evaluation on the recommended parameter configuration during database tuning to obtain its specific performance values.

[0014] Furthermore, the scenarios of the prompt word construction module include parameter space clipping scenario, warm start configuration generation scenario, hybrid candidate configuration sampling scenario, and adaptive proxy model scenario. The prompt words in each scenario are composed of multiple parts, including database information, hardware configuration, workload, specific requirements, and return format, including the following steps:

[0015] 1) Tune the task information according to the target, including the relevant information of the database db , Hardware environment information I hw , Workload Information I wl ;

[0016] 2) Based on the information of the target tuning task in step 1) and the prompt word templates in various task scenarios, the prompt words in each scenario are obtained, including the parameter space clipping scenario prompt word P pruning , warm start configuration generates scene prompt word P warm , mixed candidate configuration sampling scene prompt word P sampling , Adaptive proxy model scene prompt word P surrogate .

[0017] Furthermore, I db Including database name, database version, I hw Including the number of CPU cores, memory size, external storage size, I wl Includes workload name, workload size, workload read / write ratio

[0018] Furthermore, the prompt word execution module is used to use the large language model to execute the prompt words generated by the prompt word construction module, and parse and extract specific data returned by the large language model in different scenarios through the large language model output parsing advance program in different scenarios.

[0019] Furthermore, it includes important parameter data, warm start configuration data, mixed sampling candidate point data, and prediction data of the Bayesian optimization proxy model based on the large language model.

[0020] Furthermore, the parameter configuration recommendation module is used to recommend the most promising database parameter configuration based on existing information, including a parameter space clipping module, a warm start data generation module, a hybrid candidate point sampling module, and an adaptive proxy model module, wherein:

[0021] The parameter space trimming module is used to select the most important parameters in the current tuning scenario from the adjustable parameters in the database and construct a trimmed search space based on the selected parameters, including the following steps:

[0022] (1) Initialize the tuning task and collect comprehensive information about the target tuning task, including relevant information about the database. db , Hardware environment information I hw , Workload Information I wl Based on the information of the above target tuning task, the parameter space clipping prompt word P is obtained by combining the prompt word construction module pruning ;

[0023] (2) Crop the prompt word P based on the generated parameter space pruning Combined with the prompt word execution module, sampling is performed to construct the pruned parameter search space Θ. The sampling process is as follows:

[0024] Θ~p(Θ|P pruning ;LLM)

[0025] Where, P pruning represents the parameter space pruning prompt word, LLM represents the large language model, and Θ represents the pruned parameter search space;

[0026] The warm start data generation module is used to perform initialization sampling from the parameter search space Θ, thereby sampling high-quality initialization parameter configuration to accelerate convergence, including the following steps:

[0027] S1) Information I based on target tuning task db , I hw , I wl Combine the prompt word construction module to generate warm start configuration to generate prompt word P warm ;

[0028] S2) Generate prompt word P based on the generated warm start configuration warm Combine the prompt word execution module to sample high-quality warm start parameter configuration X C :

[0029]

[0030] Where x represents the sampled configuration, L represents the number of samples, Θ is the parameter search space, and LLM represents the large language model;

[0031] S3) Based on the parameter configuration evaluation module, warm start parameter configuration X C Perform performance evaluation and build context dataset C:

[0032]

[0033] y=eval(x),x∈X C

[0034] In the formula, x represents the sampled configuration, y represents the actual performance corresponding to x, and eval represents the performance evaluation of the database configuration;

[0035] The hybrid candidate point sampling module is used to sample a batch of parameter configurations that balance the relationship between exploration and utilization from the parameter space, thereby accelerating the efficiency of finding the optimal configuration, and includes the following steps:

[0036] a1) Construct a surrogate model M based on Gaussian process regression based on dataset C GP Based on M GP Construct the expected improvement acquisition function acq EI :

[0037]

[0038] In the formula, μ represents the performance value of the proxy model for the configuration x, σ represents the uncertainty in the prediction, and y * represents the optimal performance value of the observed database, Φ represents the Gaussian cumulative distribution function, and ψ represents the Gaussian density distribution function;

[0039] a2) Based on the Latin hypercube sampling method, a batch of uniformly distributed parameter configurations X0 are sampled in the parameter search space Θ and the parameter configurations sampled based on the L-BFGS optimization algorithm are used as starting points to improve the expected acquisition function acq in step a1) EI Optimize and get a batch of optimized parameter configurations B GP :

[0040]

[0041] B GP =LBFGS(x,acq EI ),x∈X0

[0042] Where N represents the number of sampling configurations, LHS represents the Latin hypercube sampling method, and LBFGS represents the L-BFGS optimization algorithm;

[0043] a3) Information I based on target tuning tasks db , I hw , I wl The combined prompt word construction module generates a mixed candidate configuration sampling prompt word P sampling ;

[0044] a4) Based on the candidate point sampling prompt words generated in step a3), a batch of high-potential parameter configurations X1 are sampled from the search space in combination with the large language model. Based on the L-BFGS optimization algorithm, the sampled parameter configurations are used as the starting point to optimize the expected improvement acquisition function in step a1) to obtain a batch of optimized parameter configurations B. LLM ;

[0045]

[0046] B LLM =LBFGS(x,acq EI ),x∈X1

[0047] Where N is the number of sampling configurations, LLM is the large language model, and LBFGS is the L-BFGS optimization algorithm.

[0048] a5) merging the two batches of parameter configurations obtained in step a4) and step a2) to obtain a hybrid candidate point B;

[0049] B=B GP ∪B LLM

[0050] The adaptive proxy model module is used to dynamically select different Bayesian optimization proxy models according to the tuning environment, thereby balancing the relationship between the tuning effect and the tuning cost, and includes the following steps:

[0051] h1) Based on the information of the tuning scenario and the context dataset information, the large language model auxiliary module is combined to generate the prompt word P based on the large language model proxy model surrogate ;

[0052] h2) Prompt word P based on the proxy model generated in step h1) surrogate Constructing a Bayesian optimization proxy model M based on a large language model LLM ;

[0053] h3) Use the multi-armed bandit algorithm based on Thompson sampling to control the surrogate model M of Gaussian process regression in the hybrid candidate point sampling module GP and the proxy model M based on the large language model in step h2) LLM As two arms of a multi-armed bandit, forming an adaptive agent model M;

[0054] M=MAB(M GP,M LLM )

[0055] Where, MAB represents the multi-armed bandit algorithm;

[0056] h4) Based on the adaptive proxy model M, the next parameter configuration to be evaluated is selected from the numerous candidate points sampled by the hybrid candidate point module, and the configuration-performance data pair obtained by the performance evaluation of the parameter configuration is added to the context set C;

[0057] x * =argmax acq EI (B,M)

[0058] y * =eval(x * )

[0059] C=C∪{x * ,y *}

[0060] Where x * represents the optimal configuration obtained by evaluating the acquisition function, y * Represents x * Corresponding database performance.

[0061] Furthermore, the parameter configuration evaluation module is used to evaluate the performance of the most promising database parameter configuration recommended by the parameter configuration recommendation module, and includes a target workload generation module, a target workload playback module, and a feature data collection module, wherein: the target workload generation module is used to generate a workload representative of the user; the feature data collection module is used to replay the representative workload generated by the target workload generation module; the target workload playback module is used to analyze the feature data generated after replaying the target workload and return the performance value.

[0062] Furthermore, the target workload generation module generates a workload representative of the user, including the following steps:

[0063] 11) Based on the validity period of the workload, sample representative user query statements from the private cloud, including read-only queries, write-only queries, and read-write queries;

[0064] 12) Combine the query statements in step 11) in chronological order to generate a representative workload, and detect conflicts between the query statements.

[0065] Furthermore, the characteristic data collection module replays the representative workload generated by the target workload generation module, including the following steps:

[0066] 21) Clone a new instance with the same environment as the user instance to avoid the parameter optimization process affecting the user's normal use;

[0067] 22) Execute the workload generated by the target workload generation module on the new instance cloned in step 21) and save relevant execution information, including throughput, latency, execution time, and CPU usage.

[0068] Furthermore, the target workload playback module analyzes characteristic data generated after replaying the target workload and returns a performance value, including the following steps:

[0069] 31) Count the specific characteristic values ​​of the target workload during playback at a granularity of minutes, including throughput and latency;

[0070] 32) Based on the eigenvalues ​​counted in step 31), return specific performance values, including mean, variance, and quantiles

[0071] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0072] 1. The large language model is used to assist in parameter selection, which enhances the accuracy of the tuning direction of the tuning system.

[0073] 2. Using a large language model to assist in warm start data generation helps accelerate the convergence of optimization algorithms in the tuning system and also helps to more efficiently discover the optimal database parameter configuration.

[0074] 3. Using a large language model to assist in candidate point selection is conducive to further discovering high-potential parameter configurations.

[0075] 4. Using a multi-armed bandit machine to control the selection of large language model proxy models and Gaussian process regression proxy models is conducive to balancing the relationship between tuning costs and tuning effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] Figure 1 This is a flow chart of tuning a database intelligent parameter tuning system based on large language model enhancement according to an embodiment of the present invention;

[0077] Figure 2 This is a schematic diagram of the flow of each module of the system according to an embodiment of the present invention;

[0078] Figure 3 This is a flowchart of the interaction between modules in an embodiment of the present invention. DETAILED DESCRIPTION

[0079] The present invention will be further described below with reference to specific embodiments.

[0080] like Figures 1 to 3As shown, the database intelligent parameter tuning system based on large language model enhancement provided in this embodiment is a parameter tuning system developed in Python and can be run on different database systems, including:

[0081] The large language model auxiliary module uses the large language model's rich prior knowledge in the database field and its powerful reasoning and generation capabilities in small or even zero-sample situations to assist and enhance the system's tuning capabilities.

[0082] The parameter configuration recommendation module is used to automatically recommend the most promising database parameter configurations for improving database runtime performance based on the specific information of the current tuning task and the assistance of a large language model in an intelligent and efficient manner.

[0083] The parameter configuration evaluation module is used to efficiently and accurately evaluate the performance of the database parameter configuration recommended by the parameter configuration recommendation module during the database tuning process to obtain the specific performance values ​​of the recommended parameter configuration;

[0084] The large language model auxiliary module includes a prompt word construction module and a prompt word execution module, wherein:

[0085] The prompt word construction module generates prompt words for different tasks based on the tuning task information and the large language model prompt word templates in different scenarios, including parameter space tailoring scenarios, warm start configuration generation scenarios, hybrid candidate configuration sampling scenarios, and adaptive proxy model scenarios. The prompt words in each scenario are composed of multiple parts, including database information, hardware configuration, workload, specific requirements, and return format. The following steps are included:

[0086] 1) Tune the task information according to the target, including the relevant information of the database db , Hardware environment information I hw , Workload Information I wl Among them, I db Including database name, database version, I hw Including the number of CPU cores, memory size, external storage size, I wl Includes workload name, workload size, and workload read / write ratio.

[0087] 2) Based on the information of the target tuning task in step 1) and the prompt word templates in various task scenarios, the prompt words in each scenario, including the parameter space clipping scenario prompt word P pruning , warm start configuration generates scene prompt word P warm , mixed candidate configuration sampling scene prompt word P sampling , adaptive proxy model scene prompt word P surrogate ;

[0088] The prompt word execution module is used to execute the prompt words generated by the prompt word construction module using the large language model, and parse and extract the specific data returned by the large language model in different scenarios through the large language model output parsing advance program in different scenarios; the construction method is to fill in the hard template method, as shown in the following example:

[0089] Warm start prompt word P warm : You will help me tune the {*} database knobs. The database knobs are {*}. The hardware environment is {*} CPU cores, {*} memory size, and {*} external storage size. The workload is {*} loads of {*} size. The database optimization goal is {*}. Please recommend {*} diverse and effective knob configurations to initialize the Bayesian optimization algorithm for the tuning process.

[0090] Parsing is to parse the output of the large model through regular expressions to obtain the desired data.

[0091] This includes important parameter data that has a significant impact on performance, warm start configuration data, mixed sampling candidate point data, and prediction data of the Bayesian optimization proxy model based on a large language model.

[0092] As an embodiment, the large language model used in this example is OpenAI's GPT 3.5 and GPT4.0.

[0093] The parameter configuration recommendation module includes a parameter space clipping module, a warm start data generation module, a hybrid candidate point sampling module, and an adaptive proxy model module, wherein:

[0094] The parameter space trimming module is used to select the most important parameters in the current tuning scenario from a large number of adjustable parameters in the database and construct a trimmed search space based on the selected parameters. It includes the following steps:

[0095] 1) Initialize the tuning task and collect comprehensive information about the target tuning task, including database related information. db , Hardware environment information I hw , Workload Information I wl Based on the information of the above target tuning task, the parameter space clipping prompt word P is obtained by combining the prompt word construction module. pruning The combination process involves filling the above database-related information, hardware environment information, and workload information into the hard template.

[0096] 2) Based on the generated parameter space, the prompt words are clipped and sampled in combination with the prompt word execution module to construct the clipped parameter search space Θ. The sampling process is as follows:

[0097] Θ~p(Θ|P pruning ;LLM)

[0098] Where, P pruning represents the parameter space pruning hint word, LLM represents the large language model, and Θ represents the pruned parameter search space.

[0099] As an embodiment, a large number of database tunable parameters refers to a large number of parameters in the database, such as several database tunable parameter examples in Table 1.

[0100] Table 1 Heterogeneous knobs in Cloud Database MySQL

[0101] Knob Name Value range type tmp_table_size <![CDATA[[2 10 ,2 30 ]]]> Integer innodb_thread_concurrency_size [0,1000] Integer innodb_random_read_ahead ON / OFF enumerate log_output TABLE / FILE / NONE enumerate

[0102] The warm start data generation module is used to perform initialization sampling from the parameter search space Θ, thereby sampling a high-quality initialization parameter configuration to accelerate the convergence of the algorithm, and includes the following steps:

[0103] 1) Information based on target tuning tasks I db , I hw , I wl Combine the prompt word construction module to generate warm start configuration to generate prompt word P warm ;

[0104] 2) Generate prompt word P based on the generated warm start configuration warm Combine the prompt word execution module to sample high-quality warm start parameter configuration X C :

[0105]

[0106] Where x represents the sampled configuration, L represents the number of samples, Θ is the parameter search space, and LLM represents the large language model;

[0107] 3) Warm start parameter configuration X based on parameter configuration evaluation module C Perform performance evaluation and build context dataset C:

[0108]

[0109] y=eval(x),x∈X C

[0110] In the formula, x represents the sampled configuration, y represents the actual performance corresponding to x, and eval represents the performance evaluation of the database configuration. Evaluation refers to submitting the database configuration to the parameter configuration evaluation module for performance evaluation.

[0111] The hybrid candidate point sampling module is used to sample a batch of parameter configurations that balance the relationship between exploration and utilization from the parameter space, thereby accelerating the efficiency of the optimization algorithm in finding the optimal configuration, and includes the following steps:

[0112] 1) Construct a Gaussian process regression-based proxy model M based on the constructed context dataset C GP Based on M GP Construct the expected improvement acquisition function acq EI :

[0113]

[0114] In the formula, μ represents the performance value of the proxy model for the configuration x, σ represents the uncertainty in the prediction, and y * represents the optimal performance value of the observed database, Φ represents the Gaussian cumulative distribution function, and ψ represents the Gaussian density distribution function;

[0115] 2) Based on the Latin hypercube sampling method, a batch of uniformly distributed parameter configurations X0 are sampled in the parameter search space Θ and the parameter configurations sampled based on the L-BFGS optimization algorithm are used as starting points to improve the expected acquisition function acq in step 1) EI Optimize and get a batch of optimized parameter configurations B GP :

[0116]

[0117] B GP =LBFGS(x,acq EI ),x∈X0

[0118] Where N represents the number of sampling configurations, LHS represents the Latin hypercube sampling method, and LBFGS represents the L-BFGS optimization algorithm;

[0119] 3) Information based on target tuning tasks I db , I hw , I wl Combined with the prompt word building module to generate a mixed candidate configuration sampling prompt word P sampling ;

[0120] 4) Based on the candidate point sampled prompt words generated in step 3) and combined (the prompt words are handed over to the large language model for execution and output), the large language model samples a batch of high-potential parameter configurations X1 from the search space and optimizes the expected improvement acquisition function in step 1) based on the L-BFGS optimization algorithm using the sampled parameter configurations as the starting point to obtain a batch of optimized parameter configurations B LLM ;

[0121]

[0122] B LLM =LBFGS(x,acq EI ),x∈X1

[0123] Where N is the number of sampling configurations, LLM is the large language model, and LBFGS is the L-BFGS optimization algorithm.

[0124] 5) Merge the two batches of parameter configurations obtained in step 4) and step 7) to obtain a hybrid candidate point B;

[0125] B=B GP ∪B LLM

[0126] The adaptive proxy model module is used to dynamically select different Bayesian optimization proxy models according to the tuning environment, thereby balancing the relationship between the tuning effect and the tuning cost, and includes the following steps:

[0127] 1) Based on the information of the tuning scenario and the context dataset information (filling the hard template, as shown in the above example), the large language model auxiliary module generates the prompt word P based on the large language model proxy model surrogate ;

[0128] 2) Based on the proxy model prompt word P generated in step 1) surrogate Constructing a Bayesian optimization proxy model M based on a large language model LLM ;

[0129] 3) Use the multi-armed bandit algorithm based on Thompson sampling to control the Gaussian regression-based surrogate model M in step 1) of the hybrid candidate point sampling module GP and the proxy model M based on the large language model in step 2) LLM As two arms of a multi-armed bandit, forming an adaptive agent model M;

[0130] M=MAB(M GP ,M LLM )

[0131] Where, MAB represents the multi-armed bandit algorithm;

[0132] 4) Based on the adaptive proxy model M, the next parameter configuration to be evaluated is selected from the numerous candidate points sampled by the hybrid candidate point module, and the configuration-performance data pair obtained by the performance evaluation of the parameter configuration is added to the context set C;

[0133] x * =argmax acq EI (B,M)

[0134] y * =eval(x* )

[0135] C=C∪{x * ,y *}

[0136] Where x * represents the optimal configuration obtained by evaluating the acquisition function, y * Represents x * Corresponding database performance.

[0137] The parameter configuration evaluation module is used to evaluate the performance of the most promising database parameter configuration recommended by the parameter configuration recommendation module, and includes a target workload generation module, a target workload playback module, and a feature data collection module, wherein:

[0138] The target workload generation module is used to generate a representative workload of a user within a period of time, including the following steps:

[0139] 1) Based on the validity period of the workload, representative user query statements are sampled from the private cloud over a period of time, including read-only queries, write-only queries, and read-write queries;

[0140] 2) Combine the query statements in step 1) in chronological order to generate a representative workload, and detect conflicts between the query statements; the detection method is to construct a graph of the query statements and perform topological sorting.

[0141] The characteristic data collection module is used to replay the representative workload generated by the target workload generation module, including the following steps:

[0142] 1) Clone a new instance with the same environment as the user instance to prevent the parameter optimization process from affecting the user's normal use;

[0143] 2) Execute the workload generated by the target workload generation module on the new instance cloned in step 1) and save relevant execution information, including throughput, latency, execution time, and CPU usage;

[0144] The target workload playback module is used to analyze the characteristic data generated after the target workload is played back and return the performance value, including the following steps:

[0145] 1) Count the specific characteristic values ​​of the target workload during playback at a granularity of minutes, including throughput and latency;

[0146] 2) Based on the eigenvalues ​​counted in step 1), return specific performance values, including mean, variance, and quantiles.

[0147] The preferred embodiments of the present invention disclosed above are intended only to help illustrate the present invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the present invention to the specific embodiments described. Obviously, numerous modifications and variations are possible based on the contents of this specification. These embodiments are selected and described in detail in this specification to better explain the principles and practical applications of the present invention, so that those skilled in the art can better understand and utilize the present invention.

Claims

1. A database intelligent parameter tuning system based on large language model enhancement, characterized in that: include: The large language model auxiliary module uses the large language model's prior knowledge and reasoning generation capabilities in the database to optimize the database; The large language model auxiliary module includes a prompt word construction module and a prompt word execution module, wherein: The prompt word construction module generates prompt words for different tasks based on the tuning task information and the large language model prompt word templates in different scenarios; The scenarios of the prompt word construction module include parameter space clipping scenario, warm start configuration generation scenario, hybrid candidate configuration sampling scenario, and adaptive proxy model scenario. The prompt words in each scenario are composed of multiple parts, including database information, hardware configuration, workload, specific requirements, and return format, including the following steps: 1) Tune the task information according to the target, including the relevant information of the database db , Hardware environment information I hw , Workload Information I wl ; 2) Based on the information of the target tuning task in step 1) and the prompt word templates in various task scenarios, the prompt words in each scenario are obtained, including the parameter space clipping scenario prompt word P pruning , warm start configuration generates scene prompt word P warm , mixed candidate configuration sampling scene prompt word P sampling , Adaptive proxy model scene prompt word P surrogate ; The prompt word execution module is used to use the large language model to execute the prompt words generated by the prompt word construction module, and parse and extract specific data returned by the large language model in different scenarios through the large language model output parsing advance program in different scenarios; A parameter configuration recommendation module, which is used to automatically recommend the most promising database parameter configuration based on the current tuning scenario and with the assistance of a large language model. The parameter configuration recommendation module, which is used to recommend the most promising database parameter configuration based on existing information, includes a parameter space clipping module, a warm start data generation module, a hybrid candidate point sampling module, and an adaptive proxy model module. A parameter configuration evaluation module is used to perform performance evaluation on the recommended parameter configuration during the database tuning process to obtain its specific performance value; the parameter configuration evaluation module is used to perform performance evaluation on the most promising database parameter configuration recommended by the parameter configuration recommendation module, and includes a target workload generation module, a target workload playback module, and a feature data collection module, wherein: the target workload generation module is used to generate a workload representative of the user; the feature data collection module is used to replay the representative workload generated by the target workload generation module; the target workload replay module is used to analyze the feature data generated after replaying the target workload and return the performance value.

2. The database intelligent parameter tuning system based on large language model enhancement according to claim 1, characterized in that: I db Including database name, database version, I hw Including the number of CPU cores, memory size, external storage size, I wl Includes workload name, workload size, and workload read / write ratio.

3. The database intelligent parameter tuning system based on large language model enhancement according to claim 1, characterized in that: The specific data returned by the large language model includes important parameter data, warm start configuration data, mixed sampling candidate point data, and prediction data of the Bayesian optimization proxy model based on the large language model.

4. The database intelligent parameter tuning system based on large language model enhancement according to claim 1, characterized in that: The parameter space trimming module is used to select the most important parameters in the current tuning scenario from the adjustable parameters in the database and construct a trimmed search space based on the selected parameters, including the following steps: (1) Initialize the tuning task and collect comprehensive information about the target tuning task, including relevant information about the database. db , Hardware environment information I hw , Workload Information I wl Based on the information of the above target tuning task, the parameter space clipping prompt word P is obtained by combining the prompt word construction module pruning ; (2) Crop the prompt word P based on the generated parameter space pruning Combined with the prompt word execution module, sampling is performed to construct the pruned parameter search space Θ. The sampling process is as follows: Θ~p(Θ|P pruning (LLM) Where, P pruning represents the parameter space pruning prompt word, LLM represents the large language model, and Θ represents the pruned parameter search space; The warm start data generation module is used to perform initialization sampling from the parameter search space Θ, thereby sampling high-quality initialization parameter configuration to accelerate convergence, including the following steps: S1) Information I based on target tuning task db , I hw , I wl Combine the prompt word construction module to generate warm start configuration to generate prompt word P warm ; S2) Generate prompt word P based on the generated warm start configuration warm Combine the prompt word execution module to sample high-quality warm start parameter configuration X c : Where x represents the sampled configuration, L represents the number of samples, Θ is the parameter search space, and LLM represents the large language model; S3) Based on the parameter configuration evaluation module, warm start parameter configuration X C Perform performance evaluation and build context dataset C: y=eval(x),x∈X C In the formula, x represents the sampled configuration, y represents the actual performance corresponding to x, and eval represents the performance evaluation of the database configuration; The hybrid candidate point sampling module is used to sample a batch of parameter configurations that balance the relationship between exploration and utilization from the parameter space, thereby accelerating the efficiency of finding the optimal configuration, and includes the following steps: a1) Construct a surrogate model M based on Gaussian process regression based on dataset C GP Based on M GP Construct the expected improvement acquisition function ecq EI : In the formula, μ represents the performance value of the proxy model for the configuration x, σ represents the uncertainty in the prediction, and y * represents the optimal performance value of the observed database, Φ represents the Gaussian cumulative distribution function, and ψ represents the Gaussian density distribution function; a2) Based on the Latin hypercube sampling method, a batch of uniformly distributed parameter configurations X0 are sampled in the parameter search space Θ and the parameter configurations sampled based on the L-BFGS optimization algorithm are used as starting points to improve the expected acquisition function acq in step a1) EI Optimize and get a batch of optimized parameter configurations B GP : B GP =LBFGS(x,acq EI ),x∈X0 Where N represents the number of sampling configurations, LHS represents the Latin hypercube sampling method, and LBFGS represents the L-BFGS optimization algorithm; a3) Information I based on target tuning tasks db , I hw , I wl Combined with the prompt word building module to generate a mixed candidate configuration sampling prompt word P sampling ; a4) Based on the candidate point sampling prompt words generated in step a3), a batch of high-potential parameter configurations X1 are sampled from the search space in combination with the large language model. Based on the L-BFGS optimization algorithm, the sampled parameter configurations are used as the starting point to optimize the expected improvement acquisition function in step a1) to obtain a batch of optimized parameter configurations B. LLM ; B LLM =LBFGS(x,acq EI ),x∈X1 Where N is the number of sampling configurations, LLM is the large language model, and LBFGS is the L-BFGS optimization algorithm. a5) merging the two batches of parameter configurations obtained in step a4) and step a2) to obtain a hybrid candidate point B; B=B GP ∪B LLM The adaptive proxy model module is used to dynamically select different Bayesian optimization proxy models according to the tuning environment, thereby balancing the relationship between the tuning effect and the tuning cost, and includes the following steps: h1) Based on the information of the tuning scenario and the context dataset information, the large language model auxiliary module is combined to generate the prompt word P based on the large language model proxy model surrogate ; h2) Prompt word P based on the proxy model generated in step h1) surrogate Constructing a Bayesian optimization proxy model M based on a large language model LLM ; h3) Use the multi-armed bandit algorithm based on Thompson sampling to control the surrogate model M of Gaussian process regression in the hybrid candidate point sampling module GP and the proxy model M based on the large language model in step h2) LLM As two arms of a multi-armed bandit, forming an adaptive agent model M; M=MAB(M GP ,M LLM ) Where, MAB represents the multi-armed bandit algorithm; h4) Based on the adaptive proxy model M, the next parameter configuration to be evaluated is selected from the numerous candidate points sampled by the hybrid candidate point module, and the configuration-performance data pair obtained by the performance evaluation of the parameter configuration is added to the context set C; x * =argmaxacq EI (B,M) and * =eval(x * ) C=C∪{x * ,y * } Where x * represents the optimal configuration obtained by evaluating the acquisition function, y * Represents x * Corresponding database performance.

5. The database intelligent parameter tuning system based on large language model enhancement according to claim 1 is characterized in that: The target workload generation module generates a workload representative of the user, including the following steps: 11) Based on the validity period of the workload, sample representative user query statements from the private cloud, including read-only queries, write-only queries, and read-write queries; 12) Combine the query statements in step 11) in chronological order to generate a representative workload, and detect conflicts between the query statements.

6. The database intelligent parameter tuning system based on large language model enhancement according to claim 1, characterized in that: The characteristic data collection module replays the representative workload generated by the target workload generation module, including the following steps: 21) Clone a new instance with the same environment as the user instance to avoid the parameter optimization process affecting the user's normal use; 22) Execute the workload generated by the target workload generation module on the new instance cloned in step 21) and save relevant execution information, including throughput, latency, execution time, and CPU usage.

7. The database intelligent parameter tuning system based on large language model enhancement according to claim 1, characterized in that: The target workload playback module analyzes the characteristic data generated after replaying the target workload and returns the performance value. It includes the following steps: 31) Count the specific characteristic values ​​of the target workload during playback at a granularity of minutes, including throughput and latency; 32) Based on the characteristic values ​​counted in step 31), specific performance values ​​are returned, including mean, variance, and quantile.

Citation Information

Patent Citations

  • Database configuration parameter tuning method and system based on large language model and deep reinforcement learning

    CN117762897A

  • Computerized systems and methods for using artificial intelligence to optimize database parameters

    US20220222231A1

Cited By

  • Cooperative tuning system for enhancing language model

    CN121599109A