Parameter configuration method and apparatus

By acquiring a set of database operation statements and building a machine learning model that matches it with a set of training statements, and by using random forests and genetic algorithms to optimize parameter configuration, the problem of unreasonable parameter configuration in the database management system was solved, and the system performance was improved.

CN114756607BActive Publication Date: 2026-06-02HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
Filing Date
2020-12-25
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In existing technologies, unreasonable parameter configurations in database management systems lead to poor performance, especially when the actual business scenario does not match the business scenario covered by the training dataset, making it impossible for machine learning models to determine reasonable parameter configurations.

Method used

By acquiring a set of database operation statements, multiple sets of database training statements that match it are identified, and machine learning models are built based on these training statement sets. Techniques such as random forests and genetic algorithms are used to optimize parameter configurations to ensure that the model is configured according to the actual business scenario.

Benefits of technology

It improved the performance of the database management system, ensured that parameter configurations better met actual business needs, and enhanced the system's operating efficiency and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756607B_ABST
    Figure CN114756607B_ABST
Patent Text Reader

Abstract

The application provides a parameter configuration method and device, which can solve the problem of unreasonable database management system parameter configuration, improve the performance of the database management system, and can be applied to a parameter configuration system. The method comprises the following steps: obtaining a database operation statement set of a database management system, and determining a plurality of database training statement sets matched with the database operation statement set. A machine learning model is established based on database parameter training sets and database performance training data corresponding to the plurality of database training statement sets. Based on the machine learning model, a database parameter candidate set in a plurality of database parameter candidate sets, whose database performance prediction result satisfies a first preset condition, is determined as a target database parameter set. Since the sample data set corresponds to the actual business scenario, the machine learning model established based on the actual business scenario can solve the problem of unreasonable database operation parameters of the database management system configuration, and improve the performance of the database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database management, and in particular to a parameter configuration method and apparatus. Background Technology

[0002] Database management systems (DBMS) typically involve hundreds of parameters, and proper parameter configuration can improve DBMS performance.

[0003] Currently, the common practice is to first build a machine learning model based on a pre-set training dataset, and then use this model to determine the parameter configuration of the DBMS. The accuracy of the machine learning model is highly dependent on the quantity and quality of the training dataset, such as the number of samples in the training dataset and whether the training dataset covers a complete range of business scenarios.

[0004] However, the number of samples in the training dataset and the business scenarios it covers are limited. When the actual business scenarios in which the DBMS operates are different from those covered by the training dataset, the machine learning model built on the training dataset often cannot determine reasonable parameter configurations for the actual business scenarios, resulting in unreasonable DBMS parameter configurations and poor DBMS performance. Summary of the Invention

[0005] This application provides a parameter configuration method and apparatus that can solve the problem of unreasonable parameter configuration in current database management systems, thereby improving the performance of database management systems.

[0006] To achieve the above objectives, this application adopts the following technical solution:

[0007] Firstly, a parameter configuration method is provided. This method includes: acquiring a set of database operation statements from a database management system, and determining multiple sets of database training statements that match the set of database operation statements. Each set of database training statements corresponds to a database parameter training set and a set of database performance training data. Based on the database parameter training sets and database performance training data corresponding to the multiple sets of database training statements, a machine learning model is established. The machine learning model is used to determine the database performance prediction results corresponding to each of the multiple database parameter candidate sets. Based on the machine learning model, the database parameter candidate sets whose database performance prediction results satisfy a first preset condition are determined as the target database parameter set.

[0008] Based on the parameter configuration method described in the first aspect, a machine learning model can be established based on sample datasets (including database parameter training sets and database performance training data) corresponding to multiple database training statement sets. Since these multiple database training statement sets match the database operation statement sets of the database management system, and the database operation statement sets are related to the actual business scenarios of the database management system, that is, the sample datasets correspond to the actual business scenarios, it can be ensured that the machine learning model established based on the actual business scenarios makes the parameters of the database management system determined by the machine learning model more reasonable, thereby improving the performance of the database.

[0009] In one possible design, determining multiple database training statement sets that match the database operation statement set may include: acquiring multiple candidate database operation statement sets, calculating a first similarity between each candidate statement set and the database operation statement set, and identifying the candidate statement sets whose first similarity is greater than a similarity threshold as the database training statement sets. This ensures that the similarity between the identified multiple database training statement sets and the database operation statement set meets the requirements, thereby improving the matching degree between the multiple database training statement sets and the database operation statement set. This allows the training dataset upon which the established machine learning model is based to correspond to the actual business scenario of the database management system.

[0010] Optionally, calculating the first similarity between each of the multiple candidate database operation statement sets and the database operation statement set may include: determining a first feature vector corresponding to the database operation statement set. The first feature vector may include multiple first elements, each corresponding to a type of database operation statement, and the value of each first element is the proportion of the database operation statement corresponding to the first element in the database operation statement set. Determining a second feature vector corresponding to the database operation statement target set. The database operation statement target set is any set of database candidate operation statements from the multiple candidate database operation statement sets. The second feature vector may include multiple second elements, each corresponding to a type of database operation statement, and the value of each second element is the proportion of the database operation statement corresponding to the second element in the database operation statement target set. Calculating a second similarity between the first feature vector and each second feature vector. The second similarity is used to represent the first similarity. Since the value of each first element is the proportion of the database operation statement corresponding to the first element in the database operation statement set, similar to how the first feature vector can characterize the proportion of various types of database operation statements in the database operation statement set, the second feature vector can also characterize the proportion of various types of database operation statements in the database operation statement target set. In this way, by calculating the second similarity between the first feature vector and the second feature vector, the degree of matching between the database training statement set and the database operation statement set can be determined more accurately.

[0011] Alternatively, the calculation of the first similarity between the multiple candidate database operation statement sets and the database operation statement set can include: determining a first key vector corresponding to the database operation statement set; the first key vector may include multiple third elements, each corresponding to a key, and the value of each third element is the proportion of the key corresponding to the third element in the database operation statement set; determining a second key vector corresponding to the database operation statement target set; wherein, the database operation statement target set is any one of the multiple candidate database operation statement sets; the second key vector may include multiple fourth elements, each corresponding to a key, and the value of each fourth element is the proportion of the key corresponding to the fourth element in the database operation statement target set; calculating a third similarity between the first key vector and each second key vector, whereby the third similarity represents the first similarity. Since the value of each third element can be the proportion of the key corresponding to the third element in the database operation statement set, similar to how the first key vector can characterize the quantitative characteristics of various types of keys in the database operation statement set, the second key vector can also characterize the quantitative characteristics of various types of keys in the database operation statement target set. Therefore, by calculating the third similarity between the first key vector and each second key vector, it is helpful to more accurately determine the matching degree between the database training statement set and the database operation statement set.

[0012] In one possible design, the aforementioned establishment of a machine learning model based on database parameter training sets and database performance training data corresponding to multiple database training statement sets can include: determining the feature importance metric values ​​corresponding to each of the multiple parameter items in the database parameter training set based on the database parameter training sets and database performance training data corresponding to multiple database training statement sets. Parameter items whose feature importance metric values ​​satisfy a second preset condition are identified as important parameter items. A random forest (RF) model is then established based on the important parameter items, the database parameter training sets corresponding to multiple database training statement sets, and the database performance training data. Since feature importance metrics can represent the importance of parameter items, and the importance of a parameter item is positively correlated with its selectivity—for example, the higher the importance of a parameter item, the more the output of the random forest model depends on the value of that parameter item—it is possible to more precisely determine important parameter items when determining the database performance prediction results corresponding to the database parameter candidate set based on the random forest model, thereby improving the accuracy of the random forest model's determination results. Furthermore, since it is not necessary to build a random forest model based on all the parameters of the database parameter training set, the computational cost of building a random forest model can be reduced, thereby improving the efficiency of building a random forest model.

[0013] In one possible design scheme, the aforementioned method, based on a machine learning model, determines the target database parameter set by selecting the database parameter candidate set whose database performance prediction results satisfy a first preset condition from multiple database parameter candidate sets. This can include: using a genetic algorithm (GA) to determine the target database parameter set based on the database parameter candidate set whose database performance prediction results satisfy the first preset condition from multiple database parameter candidate sets. The fitness function of the genetic algorithm is determined by the machine learning model. Because the genetic algorithm can continuously eliminate database parameter candidate sets (i.e., samples) whose fitness does not meet the requirements within multiple database parameter candidate sets (i.e., sample space), and after each elimination, perform crossover and mutation (i.e., discretize the remaining samples) on the remaining samples, resulting in a smaller sample space. This continuous elimination process increases the fitness of samples in the sample space until the fitness of samples in the sample space meets the first preset condition, thereby obtaining the globally optimal samples (i.e., the target database parameter set), reducing or avoiding the risk of getting trapped in local optima during the search for the target database parameter set.

[0014] Optionally, the above-mentioned method of determining the target database parameter set based on a genetic algorithm, where the database performance prediction results from multiple database parameter candidate sets meet the first preset condition, may include: obtaining sampling results from multiple database parameter candidate sets based on sampling rules. The sampling results include multiple first database parameter selection sets. Based on the genetic algorithm and multiple first database parameter selection sets, the database parameter candidate set where the database performance prediction results meet the first preset condition from multiple database parameter candidate sets is determined as the target database parameter set. Since multiple discrete first database parameter selection sets (i.e., sampling results) can be determined from multiple database parameter candidate sets through sampling, and these sampling results can represent multiple database parameter candidate sets, and the number of these sampling results is less than the number of multiple database parameter candidate sets, obtaining sampling results from multiple database parameter candidate sets first during the process of determining the target database parameter set based on the genetic algorithm can reduce the search volume of the genetic algorithm and improve search efficiency.

[0015] Secondly, a parameter configuration device is provided. This device includes: a transceiver module for acquiring a set of database operation statements from a database management system; and a processing module for determining multiple sets of database training statements that match the set of database operation statements. Each set of database training statements corresponds to a database parameter training set and a set of database performance training data. The processing module is further configured to establish a machine learning model based on the database parameter training sets and database performance training data corresponding to the multiple sets of database training statements. The machine learning model is used to determine the database performance prediction results corresponding to each of the multiple database parameter candidate sets. The processing module is also configured to, based on the machine learning model, determine the database parameter candidate sets whose database performance prediction results satisfy a first preset condition as the target database parameter set.

[0016] In one possible design, the aforementioned processing module is further configured to acquire multiple sets of candidate database operation statements. The processing module is also configured to calculate the first similarity between each of the multiple candidate database operation statement sets and the first set of database operation statements. Furthermore, the processing module is configured to identify the sets of candidate database operation statements whose first similarity is greater than a similarity threshold as the database training statement set.

[0017] Optionally, the above processing module is further configured to determine a first feature vector corresponding to a set of database operation statements. The first feature vector includes multiple first elements, each corresponding to a database operation statement, and the value of each first element is the proportion of the database operation statement corresponding to that first element in the set of database operation statements. The processing module is further configured to determine a second feature vector corresponding to a target set of database operation statements. The target set of database operation statements is any set of database candidate operation statements from a set of multiple database candidate operation statements. The second feature vector includes multiple second elements, each corresponding to a database operation statement, and the value of each second element is the proportion of the database operation statement corresponding to that second element in the target set of database operation statements. The processing module is further configured to calculate a second similarity between the first feature vector and each second feature vector. The second similarity is used to represent the first similarity.

[0018] Alternatively, the processing module may further be used to determine a first key vector corresponding to a set of database operation statements. The first key vector includes multiple third elements, each corresponding to a key, and the value of each third element is the proportion of the key corresponding to that third element in the set of database operation statements. The processing module is also used to determine a second key vector corresponding to a target set of database operation statements. The target set of database operation statements is any set of candidate database operation statements from a set of multiple candidate database operation statements. The second key vector includes multiple fourth elements, each corresponding to a key, and the value of each fourth element is the proportion of the key corresponding to that fourth element in the target set of database operation statements. The processing module is also used to calculate a third similarity between the first key vector and each second key vector. The third similarity is used to represent the first similarity.

[0019] In one possible design, the aforementioned processing module is further configured to determine the feature importance metric values ​​corresponding to each of the multiple parameter items in the database parameter training set based on the database parameter training set corresponding to multiple database training statement sets and the database performance training data. The processing module is also configured to identify the parameter items whose feature importance metric values ​​satisfy a second preset condition as important parameter items. Furthermore, the processing module is configured to establish a random forest model based on the important parameter items, the database parameter training set corresponding to multiple database training statement sets, and the database performance training data.

[0020] In one possible design, the aforementioned processing module is further configured to, based on a genetic algorithm, determine the target database parameter set from multiple database parameter candidate sets whose database performance prediction results satisfy a first preset condition. The fitness function of the genetic algorithm is determined by a machine learning model.

[0021] Optionally, the processing module is further configured to obtain sampling results from multiple database parameter candidate sets based on sampling rules. The sampling results include multiple first database parameter selection sets. The processing module is also configured to, based on a genetic algorithm and the multiple first database parameter selection sets, determine the database parameter candidate sets whose database performance prediction results satisfy a first preset condition from the multiple database parameter candidate sets as the target database parameter set.

[0022] Thirdly, a parameter configuration apparatus is provided. This parameter configuration apparatus is used to execute the parameter configuration method described in any implementation of the first aspect.

[0023] In this application, the parameter configuration device described in the third aspect may be an electronic device with computing function for performing the method described in the first aspect, or a chip (system) or other component or assembly disposed in the electronic device, or a device containing the electronic device.

[0024] It should be understood that the parameter configuration apparatus described in the third aspect includes modules, units, or means that implement the parameter configuration method described in the first aspect. These modules, units, or means can be implemented in hardware, software, or by hardware executing corresponding software. The hardware or software includes one or more modules or units for performing the functions involved in the parameter configuration method described above.

[0025] Furthermore, the technical effects of the parameter configuration device described in the third aspect can be referred to the technical effects of the parameter configuration method described in the first aspect, and will not be repeated here.

[0026] Fourthly, a parameter configuration apparatus is provided. The parameter configuration apparatus includes a processor configured to execute the parameter configuration method described in any possible implementation of the first aspect.

[0027] In one possible design, the parameter configuration device described in the fourth aspect may further include a transceiver. This transceiver may be a transceiver circuit or an interface circuit. The transceiver can be used for communication between the parameter configuration device described in the fourth aspect and other parameter configuration devices.

[0028] In one possible design, the parameter configuration device described in the fourth aspect may further include a memory. This memory may be integrated with the processor or disposed separately. The memory may be used to store computer programs and / or data related to the parameter configuration method described in any of the first aspects.

[0029] In this application, the parameter configuration device described in the fourth aspect may be an electronic device with computing function for performing the method described in the first aspect, or a chip (system) or other component or assembly disposed in the electronic device, or a device containing the electronic device.

[0030] Furthermore, the technical effects of the parameter configuration device described in the fourth aspect can be referenced from the technical effects of the parameter configuration method described in any implementation of the first aspect, and will not be repeated here.

[0031] Fifthly, a parameter configuration apparatus is provided. The parameter configuration apparatus includes a processor coupled to a memory, the processor executing a computer program stored in the memory, such that the parameter configuration apparatus performs the parameter configuration method described in any possible implementation of the first aspect.

[0032] In one possible design, the parameter configuration device described in the fifth aspect may further include a transceiver. This transceiver may be a transceiver circuit or an interface circuit. The transceiver can be used for communication between the parameter configuration device described in the fifth aspect and other parameter configuration devices.

[0033] In this application, the parameter configuration device described in the fifth aspect may be an electronic device with computing function for performing the method described in the first aspect, or a chip (system) or other component or assembly disposed in the electronic device, or a device containing the electronic device.

[0034] Furthermore, the technical effects of the parameter configuration device described in the fifth aspect can be referenced from the technical effects of the parameter configuration method described in any implementation of the first aspect, and will not be repeated here.

[0035] In a sixth aspect, a parameter configuration apparatus is provided, comprising: a processor and a memory; the memory is used to store a computer program, which, when executed by the processor, causes the parameter configuration apparatus to perform the parameter configuration method described in any implementation of the first aspect.

[0036] In one possible design, the parameter configuration device described in the sixth aspect may further include a transceiver. This transceiver may be a transceiver circuit or an interface circuit. The transceiver can be used for communication between the parameter configuration device described in the sixth aspect and other parameter configuration devices.

[0037] In this application, the parameter configuration device described in the sixth aspect may be an electronic device with computing function for performing the method described in the first aspect, or a chip (system) or other component or assembly disposed in the electronic device, or a device containing the electronic device.

[0038] Furthermore, the technical effects of the parameter configuration device described in the sixth aspect can be referred to the technical effects of the parameter configuration method described in any implementation of the first aspect, and will not be repeated here.

[0039] In a seventh aspect, a parameter configuration apparatus is provided, comprising: a processor; the processor being coupled to a memory and, after reading a computer program from the memory, executing a parameter configuration method as described in any implementation of the first aspect according to the computer program.

[0040] In one possible design, the parameter configuration device described in the seventh aspect may further include a transceiver. This transceiver may be a transceiver circuit or an interface circuit. The transceiver can be used for communication between the parameter configuration device described in the seventh aspect and other parameter configuration devices.

[0041] In this application, the parameter configuration device described in the seventh aspect may be an electronic device with computing function for performing the method described in the first aspect, or a chip (system) or other component or assembly disposed in the electronic device, or a device containing the electronic device.

[0042] Furthermore, the technical effects of the parameter configuration device described in the seventh aspect can be referred to the technical effects of the parameter configuration method described in any implementation of the first aspect, and will not be repeated here.

[0043] Eighthly, a processor is provided. The processor is used to execute the parameter configuration method described in any possible implementation of the first aspect.

[0044] Ninthly, a parameter configuration system is provided. This parameter configuration system includes the aforementioned parameter configuration device and database operation device.

[0045] A tenth aspect provides a computer-readable storage medium comprising: a computer program or instructions; which, when executed on a computer, causes the computer to perform the parameter configuration method described in any possible implementation of the first aspect.

[0046] Eleventhly, a computer program product is provided, including a computer program or instructions that, when run on a computer, cause the computer to perform the parameter configuration method described in any possible implementation of the first aspect. Attached Figure Description

[0047] Figure 1 This is a schematic diagram of the architecture of the parameter configuration system provided in the embodiments of this application;

[0048] Figure 2 A flowchart illustrating the parameter configuration method provided in the embodiments of this application. Figure 1 ;

[0049] Figure 3 A flowchart illustrating the parameter configuration method provided in the embodiments of this application. Figure 2 ;

[0050] Figure 4 Schematic diagram of the parameter configuration device provided in the embodiments of this application Figure 1 ;

[0051] Figure 5 Schematic diagram of the parameter configuration device provided in the embodiments of this application Figure 2 . Detailed Implementation

[0052] The following is a brief explanation of some of the technical terms involved in the embodiments of this application.

[0053] 1. Random Forest Model

[0054] In machine learning, a random forest model is a classifier that consists of multiple decision trees. The output class is determined by the classes output by each decision tree, for example, by the class with the most occurrences among all the decision tree outputs. A trained random forest model can predict the class of a given data point. For instance, assuming each training data point in a training sample includes feature data and class data, where feature data includes personal information (such as age, address, height, weight, etc.) and class data includes gender (such as male, female), then using this training sample to train a random forest model will allow the model to predict a person's gender. The specific generation process of a random forest can be found in existing implementations and will not be elaborated upon here.

[0055] 2. Genetic Algorithm

[0056] A genetic algorithm is a computational model that simulates the natural evolutionary process. This model can search for the global optimum in a sample space. The specific implementation process of a genetic algorithm can be found in existing implementations and will not be elaborated upon here.

[0057] 3. Database Management System

[0058] A Database Management System (DBMS) is a large software application used to manage, create, use, and maintain databases. It provides unified management and control over the database to ensure its security and integrity. Users can access data within the database through the DBMS, and database administrators also use it for database maintenance.

[0059] 4. Workload

[0060] In the field of database management, a workload can refer to multiple statements executed by a database management system. Each statement can access data in the database to achieve database management and maintenance. These statements can be database administration languages ​​(DBMS), such as Structured Query Language (SQL), i.e., SQL statements. For example, a workload may include 1000 SQL statements, each of which can access data in the database, such as performing operations like adding, deleting, modifying, and querying. The statements performing these operations can be respectively called: insert SQL statements, delete SQL statements, modify SQL statements, and query SQL statements.

[0061] The workload can include both actual running workload and benchmark workload. Actual running workload can be a collection of multiple SQL statements actually executed within the database management system. It's understandable that the business scenario of the database management system is directly related to its actual running workload.

[0062] Benchmarking workloads can include a set of pre-configured (or predefined, or pre-specified) SQL statements that can be used for database benchmarking. Benchmarking workloads can include one or more of the following: TPC-C benchmark (TPCC), Telecommunication Application Transaction Processing Benchmark (TATP), Smallbank benchmark (Smallbank), or wiki benchmark (wiki), etc.

[0063] For example, if 1,000 SQL statements are executed in a database management system over a period of time (e.g., 5 minutes), these 1,000 SQL statements can be considered as an actual running workload.

[0064] For example, 2000 SQL statements are pre-set. These 2000 SQL statements can include 500 insert operations, 500 delete operations, 500 update operations, and 500 query operations. These 2000 SQL statements can be used as a benchmark test workload.

[0065] When benchmark workloads are used to benchmark a database management system (DBMS), the DBMS can execute each SQL statement in the benchmark workload and then output a set of performance data, such as throughput per second (TPS), queries per second (QPS), concurrency (the number of requests / transactions processed simultaneously by the system), and response time. These multiple parameters of the DBMS can be considered as a set of configuration parameters.

[0066] It should be noted that the above "actual running workload" can sometimes be replaced with "running data"; the above "benchmark workload" can sometimes be replaced with "test data".

[0067] It's understandable that when using benchmark workloads to benchmark databases, to make the testing process more realistic, the benchmark workload can be set up with reference to the actual running workload. For example, in actual operation, when a database management system executes SQL statements, the proportions of insert, delete, update, and query operations are 50%, 30%, 10%, and 10%, respectively. Therefore, in a benchmark workload containing 2000 SQL statements, insert operations could be set to 1000 (50%), delete operations to 600 (30%), update operations to 200 (10%), and query operations to 200 (10%). This allows for setting a benchmark workload that matches the actual running workload, ensuring that the tested database performance more closely reflects real-world performance and improving test accuracy.

[0068] It should be noted that the database management language in this application embodiment is not limited to SQL statements. With the evolution of technology, the database management language in this application embodiment can also be other languages. Therefore, it can be understood that this application uses SQL statements as an example when referring to the database management language.

[0069] Furthermore, the above description of workloads is merely illustrative; for specific workloads, please refer to the relevant existing technical specifications.

[0070] In implementing the embodiments of this application, the inventors discovered that the parameters of a DBMS are typically configured in the following ways. These are described in detail below.

[0071] Method 1 involves a professional database administrator (DBA) continuously adjusting the DBMS parameter configurations and observing the DBMS performance until the DBMS performance meets the requirements. Clearly, this method is very inefficient.

[0072] Method 2 uses a recursive approach to search for the optimal parameter in the DBMS's parameter sample space. In each recursive step, the parameter sample space is narrowed down by sampling, and the optimal parameter in the narrowed sample space is selected; if this parameter does not meet the requirements, the recursion continues. Method 2 is time-consuming and, because it searches within a gradually shrinking parameter sample space, it ignores the sample spaces of other parameters, thus easily leading to local optima problems.

[0073] Method 3 involves first building a machine learning model based on a pre-set training dataset (such as the benchmark workload mentioned above), and then using this model to determine the DBMS parameter configuration. However, the number of samples in the training dataset and the business scenarios it covers are usually limited. When the actual business scenario in which the DBMS operates differs from the business scenarios covered by the training dataset, the parameter configuration determined by the machine learning model built based on that training dataset may not be applicable to the actual business scenario, resulting in unreasonable DBMS parameter configuration and poor DBMS performance.

[0074] Furthermore, method 3 can also be an artificial intelligence approach, typically including machine learning (ML) and reinforcement learning (RL). Both of these methods are highly dependent on the quality of the training data, such as whether the number of training samples is large enough and whether the training data covers all business scenarios comprehensively. Additionally, reinforcement learning methods require manual tuning of the hyperparameters of the reinforcement learning model, and even slight changes in hyperparameters can affect the effectiveness of reinforcement learning, or even cause the entire learning process to fail, requiring significant manual tuning time. Therefore, method 3 also suffers from difficulties in collecting training data samples and low training efficiency. It should be noted that configuring DBMS parameters based on machine learning and reinforcement learning methods can refer to existing technologies, which will not be elaborated upon here.

[0075] Furthermore, when configuring cloud platform database parameters using Method 3, it becomes difficult to use a single training dataset to address parameter configuration for different databases. Specifically, different tenants on the cloud platform may have different business needs, and the hardware configurations they use may also differ (e.g., memory, processor, disk type, etc.). Therefore, it is difficult to use the same training data samples to build machine learning models applicable to various business needs and / or various hardware configurations.

[0076] To address the problem of unreasonable parameter configuration in current database management systems, this application provides a parameter configuration method and apparatus to improve the performance of database management systems. It should be noted that the various shortcomings of the existing implementations described above are the result of careful practical research by the inventors. Therefore, the discovery process of the above problems and the solutions proposed in the embodiments of this application below should be considered as contributions made by the inventors to this application during its implementation.

[0077] The technical solutions in this application will now be described with reference to the accompanying drawings.

[0078] This application will present various aspects, embodiments, or features relating to systems that may include multiple devices, components, modules, etc. It should be understood and appreciated that individual systems may include additional devices, components, modules, etc., and / or may not include all the devices, components, modules, etc. discussed in conjunction with the accompanying drawings. Furthermore, combinations of these approaches are also possible.

[0079] Furthermore, in the embodiments of this application, words such as "exemplarily" and "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as an "example" in this application should not be construed as being better or more advantageous than other embodiments or designs. Rather, the use of the word "example" is intended to present the concept in a specific manner.

[0080] In the embodiments of this application, sometimes the subscript such as W1 may be mistakenly written as a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.

[0081] To facilitate understanding of the embodiments of this application, let's first take... Figure 1 The parameter configuration system shown in the figure is used as an example to describe in detail the parameter configuration system applicable to the embodiments of this application. For example, Figure 1 This is a schematic diagram of the architecture of a parameter configuration system to which the parameter configuration method provided in the embodiments of this application is applicable.

[0082] like Figure 1 As shown, the parameter configuration system may include a parameter configuration device and a database operation device.

[0083] The database running device can be used to run the database management system. The parameter configuration device can be used to obtain the database operation statement set of the database management system and configure the parameters of the database management system based on the database operation statement set, thereby implementing the parameter configuration method provided in this application embodiment. This solves the problem of unreasonable parameter configuration in current database management systems, thereby improving the performance of the database management system. It is understood that the related terminology and analysis of beneficial effects in this solution can be referred to the following method embodiment, and will not be repeated here.

[0084] The aforementioned parameter configuration device and database operation device may include one or more processors, and memory coupled to the one or more processors. The memory may include, but is not limited to, random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or any other media that can be used to access program code.

[0085] The parameter configuration device and the database operation device mentioned above may be contained in the same device or in different devices. The device may be an electronic device with computing capabilities, including but not limited to: servers (such as database servers), desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, handsets such as so-called "smart" phones, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers or the like.

[0086] It should be noted that the parameter configuration device and database operation device mentioned above can be virtual modules, such as software programs, or hardware modules, such as one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware or any combination thereof, or a combination of hardware and software, etc.

[0087] Optionally, the parameter configuration device described above may include a monitoring module and an optimization module.

[0088] The monitoring module can be used to acquire the database operation statement set of the database management system, and the tuning module can be used to configure the parameters of the database management system based on the database operation statement set, thereby implementing the parameter configuration method provided in this embodiment. It is understood that the relevant terminology and analysis of beneficial effects in this solution can be referred to below.

[0089] For example, Table 1 is Figure 1The table below shows the hardware and software configurations of each device or module. Please refer to Table 1. The database operation device, monitoring module, and tuning module mentioned above can each be housed in a single device. The hardware configuration of the monitoring module may include: a 4-core processor, 16 gigabytes (GB) of memory, and a 40GB disk with ultra-high input / output (I / O) capacity. The software configuration of the monitoring module may include: CentOS 7 operating system, Python 3.6, oltpbench, Java 1.8, and Ant 1.9. The term "ultra-high I / O" refers to the data read / write speed level, which can be divided into three levels: ultra-high I / O, medium-speed I / O, and low-speed I / O. Ultra-high I / O is defined as a data read / write speed > 500 megabytes per second (MB / s), medium-speed I / O is defined as a data read / write speed ≤ 500 MB / s and ≥ 300 MB / s, and low-speed I / O is defined as a data read / write speed < 300 MB / s. Similarly, the hardware and software configurations of the database operating device and tuning module will not be elaborated further.

[0090] Table 1

[0091]

[0092] It should be noted that the solutions in the embodiments of this application can also be applied to other parameter configuration systems, and the corresponding names can be replaced by the names of the corresponding functions in other parameter configuration systems.

[0093] It should be understood that Figure 1 This is a simplified illustration for ease of understanding only. The parameter configuration system may also include other network devices and / or other terminal devices. Figure 1 It was not drawn in the middle.

[0094] The following will combine Figure 2 , Figure 3 The parameter configuration method provided in the embodiments of this application will be described in detail.

[0095] For example, Figure 2 A flowchart illustrating the parameter configuration method provided in the embodiments of this application. Figure 1 This parameter configuration method can be applied to Figure 1 The parameter configuration system is shown.

[0096] like Figure 2 As shown, the parameter configuration method may include the following steps:

[0097] S201, Obtain the set of database operation statements from the database management system.

[0098] The aforementioned database management system may include relational database management systems (RDBMS), such as MySQL, DB2, Oracle, and MS SQL Server (Microsoft SQL Server). It is understood that this application does not limit the type of database management system.

[0099] The aforementioned set of database operation statements can include multiple statements executed by the database management system over a period of time. In other words, the aforementioned set of database operation statements can represent the actual runtime workload (refer to the explanation in the technical terminology section above). For example, if 2000 SQL statements are executed in the database management system over a period of time (e.g., 10 minutes), then these 2000 SQL statements can be considered as a set of database operation statements.

[0100] In some possible embodiments, obtaining the database operation statement set of the database management system may include: the database management system sending all executed SQL statements within a certain period of time (e.g., 10 minutes) to the parameter configuration device, and the parameter configuration device receiving the SQL statements from the database management system.

[0101] S202, determine multiple sets of database training statements that match the set of database operation statements.

[0102] The matching of the database operation statement set and the database training statement set mentioned above can include: the similarity between the database training statement set and the database operation statement set being greater than or equal to a similarity threshold. The method for determining the similarity between the database training statement set and the database operation statement set can be referred to steps 1-3 below, and will not be repeated here.

[0103] Optionally, S202, determining multiple sets of database training statements that match the set of database operation statements may include: determining multiple sets of database training statements that match the set of database operation statements from multiple sets of candidate database operation statements.

[0104] The aforementioned set of candidate database operation statements can include benchmark workloads. In other words, the set of candidate database operation statements can be used for benchmarking database management systems.

[0105] In a benchmark test of a database management system (DBMS), the executed benchmark workload, the DBMS's configuration parameter set, and a set of performance data correspond to each other. The DBMS's configuration parameter set can serve as a database parameter training set, and the DBMS's performance data can serve as a set of database performance training data. Furthermore, for the multiple database training statement sets mentioned above, each database training statement set can correspond to a database parameter training set and a set of database performance training data.

[0106] For example, suppose a benchmark workload is used to benchmark MySQL, obtaining a set of performance data for that MySQL instance. The set of configuration parameters for that MySQL instance can serve as a database parameter training set, and the set of performance data can serve as a set of database performance training data. Here, the set of MySQL performance data and the set of MySQL configuration parameters can be used as a single training data point. Furthermore, a set of multiple such training data points can be used as a training dataset to train the machine learning model described in S303 below.

[0107] In some possible embodiments, to ensure that the matching degree between the database operation statement set and multiple database training statement sets meets the requirements, the above-mentioned determination of multiple database training statement sets that match the database operation statement set may include steps 1-3:

[0108] Step 1: Obtain multiple sets of candidate database operation statements.

[0109] Step 2: Calculate the first similarity between each of the multiple candidate database operation statement sets and the database operation statement set.

[0110] Optionally, "calculating the first similarity between each of the multiple candidate database operation statement sets and the database operation statement set" can be achieved through either method 4 or method 5:

[0111] Method 4: First, determine the first feature vector corresponding to the set of database operation statements. The first feature vector may include multiple first elements, each corresponding to a database operation statement. The value of each first element can be the proportion of the corresponding database operation statement in the set of database operation statements.

[0112] The database operation statements mentioned above can be categorized based on their operation types. These operation types can include: add, delete, modify, and query. Taking SQL statements as an example, based on the operation types, SQL statements can be divided into four types: add, delete, modify, and query.

[0113] Furthermore, the categories of the aforementioned database operation statements can also be based on the keyword characteristics they contain. Taking the set of database operation statements as SQL statements as an example, an SQL statement includes one or more of the following keywords: select, delete, update, insert, from, set, into, values, where, count, sum, avg, max, min, and, or, all, any, between, exists, limit, asc, desc, <, >, <=, >=, !=, ==, or =. Assuming an SQL statement is "select * from students where id>3", then the keywords in this SQL statement are "select", "from", "where", and ">", thus the keyword characteristic of this SQL statement is "select from where>". Therefore, database operation statements containing the same keywords can be identified as the same type of database operation statement. In other words, for multiple database operation statements, if they contain the same keywords, then these multiple database operation statements contain the same keyword characteristic and can be considered as the same type of database operation statement.

[0114] Specifically, taking the set of database operation statements as the SQL statement set as an example, determining the first feature vector corresponding to the SQL statement set may include: statistically analyzing the proportion of various SQL statements in the SQL statement set, that is, the ratio of the number of various SQL statements to the total number of SQL statements, in order to determine the first element corresponding to each SQL statement, and then determine the first feature vector corresponding to the SQL statement set.

[0115] When the category of database operation statements is based on the operation type of the database operation statements, the process of determining the first feature vector corresponding to the SQL statement set can be referred to Table 2 below. Table 2 shows the proportion of various SQL statements in the SQL statement set. Assuming that there are 2000 SQL statements in the SQL statement set, the proportions of insert, delete, update, and query SQL statements are 60% (1200 / 2000), 20% (400 / 2000), 10% (200 / 2000), and 10% (200 / 2000) respectively. Then, the first element corresponding to each SQL statement can be determined to be 0.6, 0.2, 0.1, and 0.1 respectively, and thus the first feature vector corresponding to this SQL statement set can be determined as [0.6 0.2 0.1 0.1]. It can be understood that since the operation types of SQL statements include insert, delete, update, and query, when the category of database operation statements is based on the operation type of the database operation statements, the implementation process of method 4 can be called: insert, delete, update, and query matching method.

[0116] Table 2

[0117]

[0118] When database operation statements are categorized based on the keyword features they contain, the process of determining the first feature vector corresponding to the SQL statement set can be referenced in Table 3. Table 3 shows the proportion of various SQL statements in the SQL statement set. Assuming the SQL statement set contains 2000 SQL statements, these 2000 SQL statements can be divided into 20 types of database operation statements based on the keyword features they contain, including: sql1, sql2, ..., sql 20 Among them, sql1, sql2, ..., sql 20 The percentages of the total SQL statements are 10% (200 / 2000), 20% (400 / 2000), ..., 10% (200 / 2000), respectively. Therefore, the first element corresponding to each SQL statement is 0.1, 0.2, ..., 0.1, respectively, and the first feature vector corresponding to this SQL statement set is [0.1 0.2 0.1 0.1]. It can be understood that since SQL statements are usually contained in the database management system's runtime logs, when the category of database operation statements is based on the keyword features contained in the database operation statements, the implementation process of method 4 can be called: the log matching method.

[0119] Table 3

[0120]

[0121] Then, the second feature vector corresponding to the database operation statement target set is determined. The database operation statement target set is any set of database candidate operation statements from multiple database candidate operation statement sets. The second feature vector may include multiple second elements, each corresponding to a database operation statement, and the value of each second element is the proportion of the corresponding database operation statement in the database operation statement target set.

[0122] Similarly, the specific method for determining the second eigenvector can refer to the specific method for determining the first eigenvector described above, and will not be repeated here.

[0123] It can be understood that the first feature vector can represent the quantity characteristics of various types of keywords in the database operation statement set, and the second feature vector can represent the quantity characteristics of various types of keywords in the database operation statement target set. Therefore, the first feature vector can represent the characteristics of the database operation statement set, and the second feature vector can represent the characteristics of the database operation statement target set. Thus, by determining the similarity between the first and second feature vectors, the similarity between the two statement sets can be determined.

[0124] Finally, the second similarity between the first feature vector and each second feature vector is calculated. Here, the second similarity is used to represent the first similarity.

[0125] For example, methods such as Euclidean distance and cosine similarity can be used to calculate the second similarity between the first feature vector and each second feature vector, but this application does not limit this.

[0126] It can be understood that after calculating the second similarity between the first feature vector and each second feature vector, the first similarity between each of the multiple candidate database operation statement sets and the database operation statement set can be determined.

[0127] The effects of method 4 are explained below with reference to Tables 4 and 5.

[0128] Table 4 shows the success rate of identifying different types of workloads based on the CRUD matching method or log matching method described above. Referring to Table 4, the workloads include tpccorg, tpcc1-tpcc9, wikiorg, and wiki1-wiki9. tpccorg and tpcc1-tpcc9 both belong to the aforementioned TPC-C benchmark, differing only in the statements they contain. wikiorg and wiki1-wiki9 both belong to the aforementioned wiki benchmark, differing only in the statements they contain. In the data in Table 4, the CRUD matching method has a 57% success rate in correctly identifying tpccorg, while the log matching method has a 100% success rate; the CRUD matching method also has a 57% success rate in correctly identifying tpcc1, while the log matching method has a 100% success rate, and so on. It is evident that the log matching method, compared to the CRUD matching method, can more accurately determine whether two workloads match.

[0129] Table 4

[0130]

[0131]

[0132] Table 5 shows the similarity calculations for different types of workloads based on the log matching method described above. The different types of workloads include: wikiorg, wiki1, wiki2, wiki3, tpccorg, tpcc1, and tpcc2. Referring to the data in Table 5, except for the first row and second column, the data in different cells of different rows and columns represents the similarity between two workloads. For example, a value of 1 in the second row and second column indicates a similarity of 1 for the two wikiorg instances calculated using the log matching method; another example is a value of 0.918762 in the second row and third column, indicating a similarity of 0.918762 for wikiorg and wiki1 calculated using the same method. And so on, demonstrating that the log matching method can accurately distinguish between different types of workloads.

[0133] Table 5

[0134] wikiorg wiki1 wiki2 wiki3 tpccorg tpcc1 tpcc2 wikiorg 1 0.918762 0.692079 0.637795 0.047114 0.040276 0.046159 wiki1 1 0.612412 0.624325 0.025957 0.020212 0.025709 wiki2 1 0.55753 0.371266 0.317021 0.363183 wiki3 1 0.103981 0.088755 0.10206 tpccorg 1 0.876257 0.998915 tpcc1 1 0.883248 tpcc2 1

[0135] It should be understood that since the value of each first element represents the proportion of the corresponding database operation statement in the database operation statement set, similar to how the first feature vector can characterize the proportion of various types of database operation statements in the database operation statement set, the second feature vector can also characterize the proportion of various types of database operation statements in the database operation statement target set. Thus, by calculating the second similarity between the first and second feature vectors, the degree of matching between the database training statement set and the database operation statement set can be determined more accurately.

[0136] Method 5: First, determine the first key vector corresponding to the set of database operation statements. The first key vector may include multiple third elements, each corresponding to a key, and the value of each third element can be the proportion of the corresponding key in the set of database operation statements.

[0137] Taking the SQL statement set as an example, the SQL statement includes one or more of the following keywords: select, delete, update, insert, from, set, into, values, where, count, sum, avg, max, min, and, or, all, any, between, exists, limit, asc, desc, <, >, <=, >=, !=, ==, or =.

[0138] Determining the first key vector corresponding to a set of database operation statements may include: statistically analyzing the proportion of various keywords in the SQL statement set, i.e., the ratio of the number of various keywords to the total number of keywords in the SQL statement set, in order to determine the third element corresponding to each keyword, and thus determine the first key vector corresponding to the SQL statement set.

[0139] For example, Table 6 shows the percentage of various keywords in the SQL statement set. Referring to Table 6, assuming there are 2500 SQL statements in the SQL statement set, each SQL statement has an average of 4 keywords, for a total of 10000 keywords. Among them, select, delete, ..., ==, and = account for 5%, 4%, ..., 1%, and 2% of the total number of keywords in the SQL statement set, respectively. Then, we can determine that the third element corresponding to each keyword is 0.05, 0.04, ..., 0.01, and 0.02, respectively. Thus, we can determine that the first keyword vector corresponding to this SQL statement set is [0.05 0.04...0.01 0.02].

[0140] Table 6

[0141]

[0142] Then, the second key vector corresponding to the database operation statement target set is determined. The database operation statement target set is any set of database candidate operation statements from multiple database candidate operation statement sets. The second key vector includes multiple fourth elements, each corresponding to a key, and the value of each fourth element is the proportion of the key corresponding to that fourth element in the database operation statement target set.

[0143] Similarly, the method for determining the second key vector can refer to the method for determining the first key vector, and will not be repeated here.

[0144] It can be understood that the first key vector can represent the quantity characteristics of various types of keywords in the database operation statement set, and the second key vector can represent the quantity characteristics of various types of keywords in the database operation statement target set. Therefore, the first key vector can represent the characteristics of the database operation statement set, and the second key vector can represent the characteristics of the database operation statement target set. Thus, determining the similarity between the first and second key vectors determines the similarity between the two statement sets.

[0145] Finally, the third similarity between the first keyword vector and each of the second keyword vectors is calculated. The third similarity is used to represent the first similarity.

[0146] Similarly, Euclidean distance, cosine similarity, and other calculation methods can be used to calculate the third similarity between the first key vector and the second key vector. This application does not limit this.

[0147] Among them, the first feature vector, the second feature vector, the first keyword vector, and the second keyword vector can all be normalized. Vector normalization can refer to existing technologies, which will not be elaborated here.

[0148] It is understandable that after calculating the third similarity between the first key vector and each of the second key vectors, the first similarity between each of the multiple candidate database operation statement sets and the database operation statement set can be determined.

[0149] It should be understood that since the value of each third element can be the proportion of the keyword corresponding to the third element in the database operation statement set, similar to how the first keyword vector can represent the quantitative characteristics of various types of keywords in the database operation statement set, the second keyword vector can also represent the quantitative characteristics of various types of keywords in the database operation statement target set. Therefore, by calculating the third similarity between the first keyword vector and each second keyword vector, it is helpful to more accurately determine the degree of matching between the database training statement set and the database operation statement set.

[0150] Step 3: From the multiple database candidate operation statement sets, the set of database candidate operation statements with the first similarity greater than the similarity threshold is determined as the database training statement set.

[0151] For example, Table 7 shows the matching results between the database operation statement set and the database candidate operation statement set. Please refer to Table 7 below. Table 7 includes one database operation statement set (workload1) and ten database candidate operation statement sets (A1-A10). Table 7 also includes the first similarity score between each database candidate operation statement set (A1-A10) and workload1. Assuming a similarity threshold of 99%, then A7, A8, A9, and A10 match workload1, meaning A7, A8, A9, and A10 can be identified as the database training statement set.

[0152] Table 7

[0153]

[0154] It should be understood that by performing steps 1-3 above, the determined sets of multiple database training statements and sets of database operation statements can meet the similarity requirements, thereby improving the matching degree between the multiple sets of database training statements and sets of database operation statements. This allows the training dataset on which the established machine learning model is based to correspond to the actual business scenario of the database management system.

[0155] S203, a machine learning model is established based on the database parameter training set and database performance training data corresponding to multiple database training statement sets.

[0156] The aforementioned machine learning models include, but are not limited to, random forest models, deep learning models, reinforcement learning models, etc., and this application does not limit them.

[0157] For example, Table 8 shows multiple sets of database training statements and their corresponding data tables. Referring to Table 8, assuming that the sets of database training statements determined by executing S301 and S302 above include: B1, B2, ..., B1000, the database parameter training sets corresponding to B1-B1000 respectively include: C1, C2, ..., C1000, and the database performance training data corresponding to B1-B1000 respectively include: D1, D2, ..., D1000, then C1-C1000 and D1-D1000 can be used as training datasets to train a machine learning model, thereby establishing a machine learning model.

[0158] Table 8

[0159] Database training statement set Database parameter training set Database performance training data B1 C1 D1 B2 C2 D2 … … … B1000 C1000 D1000

[0160] Specifically, this machine learning model can be used to determine the database performance prediction results corresponding to multiple candidate sets of database parameters. These candidate sets of database parameters can include a set of configuration parameters for a database management system. In other words, this machine learning model can predict the performance of a database management system configured based on this set of configuration parameters.

[0161] In some possible embodiments, in order to reduce the computational cost of building a random forest model and improve its efficiency, the above-mentioned process of building a machine learning model based on the database parameter training set and database performance training data corresponding to multiple database training statement sets may include steps 4 and 5, which are explained below:

[0162] Step 4: Based on the database parameter training set and database performance training data corresponding to multiple database training statement sets, determine the feature importance metric value corresponding to each of the multiple parameter items in the database parameter training set.

[0163] The database parameter training set can include multiple parameter items, each with a corresponding value range. For example, Table 9 shows the values ​​of multiple parameter items in the database parameter training set. Referring to Table 9, assuming the database parameter training set includes E1-E1000, and the corresponding database performance training data includes F1-F1000, and the values ​​of each parameter item in E1-E1000 are shown in Table 9, then the feature importance metric for each parameter item can be determined based on the values ​​of each parameter item in E1-E1000 and F1-F1000. Optionally, multiple database parameter training sets and database performance training data can be used as training datasets, and a random forest model can be used to select the feature importance metric for each parameter item in the database parameter training set.

[0164] For example, multiple database parameter training sets and database performance training data can be used as samples to calculate the Gini index (GI) or information gain (IG) for each parameter item in the database parameter training set, thereby determining the feature importance measure of each parameter item. Alternatively, the feature importance measure of each parameter item can be calculated using the out-of-bag (OOB) error rate.

[0165] Table 9

[0166]

[0167] The parameters mentioned above can also be understood as features of the training dataset. The feature importance metric (importance) mentioned above can be considered as feature selectivity, that is, the feature importance metric represents the correlation between the value of a feature and the classification result.

[0168] It is understandable that the specific implementation of the feature importance measure values ​​of the above-mentioned parameter items can refer to the existing implementation methods, and will not be elaborated here.

[0169] Step 5: Among multiple parameter items, the parameter items whose feature importance metric values ​​meet the second preset condition are identified as important parameter items.

[0170] The second preset condition mentioned above may include: parameter items whose feature importance metric values ​​rank among the top n of multiple parameter items, where n is a positive integer. For example, parameter items whose feature importance metric values ​​rank among the top 5 of multiple parameter items may be identified as important parameter items.

[0171] Step 6: Based on important parameter items, database parameter training sets corresponding to multiple database training statement sets, and database performance training data, establish a random forest model.

[0172] For example, assuming there are N training data points and M important parameter terms, where each training data point includes one database parameter training set and one database performance training set, multiple decision trees can be generated from the N training data points to obtain the Random Forest (RF) model. The process of generating a decision tree can be as follows: based on sampling with replacement, select N samples from the N training data points as a training set; then, randomly select d important parameter terms from the M important parameter terms without repetition; finally, build a decision tree based on the selected training set and these d important parameter terms. It should be noted that the above process for building a random forest model is only an example; the specific process for building a random forest model can also refer to relevant existing technical regulations.

[0173] Optionally, when determining the database performance prediction result corresponding to a database parameter candidate set, the random forest model established in step 6 can: first determine the mean and / or variance of the values ​​output by all decision trees in the random forest model, and then determine the database performance prediction result corresponding to the database parameter candidate set based on the mean and / or variance, so as to improve the accuracy of the prediction result of the random forest model.

[0174] The effects of steps 4-6 are explained below with reference to Table 10.

[0175] Table 10 shows the prediction errors using the Lasso Path method or the random forest model established in steps 4-6 above. Specifically, the prediction error of the Lasso Path method or the random forest model is the error between the predicted database performance and the actual database performance, based on a set of configuration parameters determined using the Lasso Path method or the random forest model with different numbers of features. For example, assuming a set of configuration parameters has 179 parameters (features), five features are selected, and the random forest model is used to determine the database performance prediction for these five features. This prediction represents the predicted performance of the database management system with these five features configured. The error between this prediction and the actual performance of the database management system is determined to be 67 TPS. This error can be the mean absolute error (MAE). Similarly, the prediction error of the Lasso Path method or the random forest model can be determined. Referring to the data in Table 10, for different numbers of features, the prediction error of the above random forest model is less than or equal to the prediction error of Lasso Path. Therefore, the database performance prediction result corresponding to a set of configuration parameters determined by the random forest model established in steps 4-6 is more accurate.

[0176] Table 10

[0177]

[0178] It should be understood that feature importance metrics can represent the degree of importance of a parameter, and the importance of a parameter is positively correlated with its selectivity. For example, the higher the importance of a parameter, the more the output of the random forest model depends on the value of that parameter. Therefore, when determining the database performance prediction results corresponding to the candidate set of database parameters based on the random forest model, more refined determination can be made for important parameters to improve the accuracy of the random forest model's results. Furthermore, since it is not necessary to build a random forest model based on all parameters of the database parameter training set, the computational cost of building the random forest model can be reduced, thereby improving the efficiency of building the random forest model.

[0179] S204. Based on the machine learning model, the database parameter candidate set whose database performance prediction results meet the first preset condition from multiple database parameter candidate sets is determined as the target database parameter set.

[0180] The first preset condition can be: a set of database parameter candidates whose database performance prediction results rank among the top n in a set of multiple database parameter candidate sets, where n is a positive integer. For example, the set of database parameter candidates whose database performance prediction results rank among the top 3 in a set of multiple database parameter candidate sets can be determined as the target database parameter set.

[0181] In some possible embodiments, in order to reduce or avoid the risk of getting trapped in local optima during the search for the target database parameter set, S204 above, based on a machine learning model, determines the database parameter candidate set whose database performance prediction results meet the first preset condition from multiple database parameter candidate sets as the target database parameter set, which may include:

[0182] Based on a genetic algorithm, the set of database parameter candidates whose database performance prediction results meet a first preset condition from multiple database parameter candidate sets is determined as the target database parameter set. The fitness function of the genetic algorithm is determined by a machine learning model.

[0183] For example, after initializing multiple candidate sets of database parameters, individuals whose fitness does not meet the requirements are iteratively eliminated. Assuming the initialized multiple candidate sets of database parameters constitute a population, and each candidate set represents an individual, each iteration may include: determining the fitness of each individual based on a fitness function, such as using a machine learning model to determine the database performance prediction result for each individual; then, eliminating individuals with fitness less than or equal to a fitness threshold, and generating a new population based on the eliminated population, selection operators, crossover operators, and mutation operators. It should be noted that the selection operators, crossover operators, and mutation operators here can refer to relevant existing technologies.

[0184] It should be understood that, within multiple candidate sets of database parameters (i.e., the sample space), a genetic algorithm can continuously eliminate candidates (i.e., samples) whose fitness does not meet the requirements. After each elimination, the remaining samples undergo crossover and mutation (i.e., the remaining samples are discretized) to obtain a smaller sample space. This continuous elimination process increases the fitness of samples in the sample space until the fitness of samples in the sample space meets a first preset condition, thereby obtaining the globally optimal samples (i.e., the target database parameter set). This reduces or avoids the risk of getting trapped in local optima during the search for the target database parameter set.

[0185] Optionally, in order to reduce the search volume of the genetic algorithm and improve the search efficiency, the above-mentioned genetic algorithm-based method of determining the database parameter candidate set whose database performance prediction results meet the first preset condition from multiple database parameter candidate sets as the target database parameter set may include steps 7 and 8, which are explained as follows:

[0186] Step 7: Based on the sampling rules, obtain the sampling results of multiple database parameter candidate sets.

[0187] The sampling rules may include one or more of the following: systematic sampling, simple random sampling, stratified sampling, etc. The sampling results may include multiple sets of first database parameters.

[0188] For example, the stratified sampling mentioned above can be Latin hypercube sampling (LHS). By obtaining sampling results from multiple candidate sets of database parameters based on Latin hypercube sampling, the overlap of the sample space can be minimized, ensuring that the sampling results are structurally similar to the sample space. This allows the sampling results to represent the sample space, thereby reducing the search workload of the genetic algorithm.

[0189] Step 8: Based on the genetic algorithm and multiple first database parameter selection sets, determine the database parameter candidate set whose database performance prediction results meet the first preset conditions from the multiple database parameter candidate sets as the target database parameter set.

[0190] For example, after initializing multiple sets of first database parameter selections, individuals whose fitness does not meet the requirements are iteratively eliminated. Assuming that the initialized multiple sets of first database parameter selections constitute a population, and one set of first database parameter selections constitutes an individual, each iteration process may include: determining the fitness of each individual based on a fitness function; then, eliminating individuals whose fitness is less than or equal to a preset fitness threshold, and generating a new population based on the eliminated population, selection operators, crossover operators, and mutation operators.

[0191] It should be noted that, because genetic algorithms can discretize samples in the sample space during the iteration process using crossover and mutation operators, when searching for the target database parameter set based on a genetic algorithm within multiple selected sets of first database parameters, the determined target database parameter set may not necessarily be included in all selected sets of first database parameters, but it can be included in multiple candidate sets of database parameters.

[0192] It should be understood that, in a set of multiple database parameter candidates, sampling can determine a discrete set of multiple first database parameter selections (i.e., sampling results). These sampling results can represent multiple database parameter candidate sets, and the number of these sampling results is less than the number of multiple database parameter candidate sets. Therefore, in the process of determining the target database parameter set based on the genetic algorithm, obtaining the sampling results of multiple database parameter candidate sets through sampling can reduce the search volume of the genetic algorithm and improve the search efficiency.

[0193] Furthermore, after executing S204, the above method may also include: configuring the database management system according to the target database parameter set; running the database management system and determining the actual performance data of the database management system; if the actual performance data does not meet the requirements (e.g., the value of the actual performance data is less than or equal to the performance threshold), then returning to execute S201 again.

[0194] This enables iterative optimization, allowing for continuous improvement of machine learning models. This helps adapt to changes in the same user's business. For example, even if a tenant's business on the cloud platform changes continuously, the parameter configuration of the database used by the tenant will be continuously optimized through the aforementioned iterative optimization. The database can maintain a high-performance operating state, thereby maximizing the satisfaction of user needs.

[0195] The above describes a method for establishing a machine learning model based on a training dataset that matches a set of database operation statements, and for determining the parameter configuration of the target database parameter set based on the machine learning model. The following describes the specific implementation process of the parameter configuration method when the parameter configuration device includes a monitoring module and an optimization module.

[0196] For example, refer to Figure 3 , Figure 3 A flowchart illustrating the parameter configuration method provided in the embodiments of this application. Figure 2 This method can be applied to, for example... Figure 1 The parameter configuration system shown can include the following steps:

[0197] S301, the monitoring module sends the running database information to the database running device, and the database running device receives the running database information from the monitoring module.

[0198] Among them, the database operation information can instruct the database operation device to run the database management system.

[0199] S302, the database operation device runs the database management system and obtains the actual performance data and database operation statement set of the database management system.

[0200] S303, the database operating device sends actual performance data and a set of database operation statements to the monitoring module, and the monitoring module receives the actual performance data and the set of database operation statements from the database operating device.

[0201] It is understandable that S301-S303 can achieve the above-mentioned S201.

[0202] S304, the monitoring module determines whether the actual performance data meets the requirements.

[0203] For example, suppose the actual performance data of the database management system is 2200 TPS, and only when it is greater than or equal to 3000 TPS is it considered whether the actual performance data meets the requirements. Then the monitoring module can determine that the actual performance data does not meet the requirements.

[0204] It's understandable that if the actual performance data meets the requirements, then the database management system does not need further optimization. If the actual performance data does not meet the requirements, then S305 is executed.

[0205] S305, the monitoring module sends a set of database operation statements to the tuning module, and the tuning module receives the set of database operation statements from the monitoring module.

[0206] S306, tuning module to match workload.

[0207] In other words, the tuning module determines multiple sets of database training statements that match the set of database operation statements.

[0208] It is understandable that the execution process and effect of S306 can be referred to as S202 above, and will not be repeated here. In addition, before executing S306, the tuning module can also perform initialization, such as initializing data classes.

[0209] S307, the tuning module trains the model.

[0210] In other words, the tuning module builds a machine learning model based on the database parameter training set and database performance training data corresponding to multiple database training statement sets.

[0211] It is understandable that the execution process and effect of S307 can be referred to S203 above, and will not be repeated here.

[0212] S308, the optimization module searches the target database parameter set based on a genetic algorithm.

[0213] In other words, the tuning module, based on a machine learning model, determines the target database parameter set from multiple database parameter candidate sets whose database performance prediction results meet the first preset condition.

[0214] It is understandable that the execution process and effect of S308 can be referred to S204 above, and will not be repeated here.

[0215] S309, the tuning module sends the target database parameter set to the monitoring module, and the monitoring module receives the target database parameter set from the tuning module.

[0216] S310, the monitoring module sends the target database parameter set to the database operating device, and the database operating device receives the target database parameter set from the monitoring module.

[0217] S311, the database operation device configures parameters based on the target database parameter set.

[0218] It is understandable that after executing S311, it is possible to return to executing S302, thereby achieving the function of iterative optimization. In addition, the implementation methods and technical effects of the above-mentioned S301-S311 can be referred to the aforementioned S201-S204, and will not be repeated here.

[0219] To better illustrate the technical effects of this application, Table 11 below shows the technical effects that the embodiments of this application can achieve in practical applications. The data collection environment in Table 11 can be the parameter configuration system environment shown in Table 1 above.

[0220] Please refer to Table 11, which shows the performance of the database management system configured using two different parameter configuration methods. The workloads executed by the database management system include TPCC, TATP, and Smallbank, and the total data volume processed by the database management system is 103GB. As can be seen from the data in Table 11, for different workloads, the performance of method 1 is lower than that of the parameter configuration method provided in this application. Therefore, the method embodiments provided in this application help improve database performance.

[0221] Table 11

[0222] workload The amount of data processed Method 1 The method provided in this application TPCC 103GB 2100~2150TPS 2200TPS TATP 103GB 7600~7690TPS 8500TPS Smallbank 103GB 2700~2750TPS 2930 TPS

[0223] based on Figure 2 or Figure 3 The parameter configuration method shown allows the parameter configuration device to build a machine learning model based on sample datasets (including database parameter training sets and database performance training data) corresponding to multiple database training statement sets. Since these multiple database training statement sets match the database operation statement sets of the database management system, and the database operation statement sets are related to the actual business scenarios of the database management system, that is, the sample datasets correspond to the actual business scenarios, it can ensure that the machine learning model built based on the actual business scenarios makes the parameters of the database management system determined by the machine learning model more reasonable, thereby improving the performance of the database.

[0224] The above combination Figure 2 , Figure 3 The parameter configuration method provided in the embodiments of this application is described in detail below. Figure 4 , Figure 5 This document describes in detail the parameter configuration apparatus used to execute the parameter configuration method provided in the embodiments of this application.

[0225] For example, Figure 4 This is a schematic diagram of the parameter configuration device provided in the embodiments of this application. Figure 1 .like Figure 4 As shown, the parameter configuration device 400 includes a processing module 401 and a transceiver module 402. For ease of explanation, Figure 4 Only the main components of this parameter configuration device are shown.

[0226] In some embodiments, the parameter configuration device 400 may be adapted to Figure 1 The parameter configuration system shown is executed. Figure 2 , Figure 3 The parameter configuration method is shown.

[0227] Specifically, the transceiver module 402 is used to implement the transceiver function of the parameter configuration device, such as executing S201 and S301-S303 described above. The processing module 401 can be used to process data related to parameter configuration, such as executing S202, S203, S204 and S306-S308 described above. For the specific implementation of the processing module 401 and the transceiver module 402, please refer to the above. Figure 2 or Figure 3 The relevant content in the method embodiments shown will not be repeated here.

[0228] Optionally, the transceiver module 402 may include a receiving module and a transmitting module. Figure 4 (Not shown in the image). The transmitting module implements the transmitting function of the parameter configuration device 400, and the receiving module implements the receiving function of the parameter configuration device 400.

[0229] Optionally, the parameter configuration device 400 may further include a storage module. Figure 4 (Not shown in the image), this storage module stores programs or instructions. When the processing module 401 executes the program or instructions, the parameter configuration device 400 can perform operations. Figure 2 or Figure 3 The parameter configuration method is shown.

[0230] It should be understood that the processing module 401 involved in the parameter configuration device 400 can be implemented by a processor or processor-related circuit components, and can be a processor or processing unit; the transceiver module 402 can be implemented by a transceiver or transceiver-related circuit components, and can be a transceiver or transceiver unit.

[0231] It should be noted that the parameter configuration device 400 may be an electronic device with computing functions, or a chip (system) or other component or assembly that may be set in the electronic device, or a device containing the electronic device.

[0232] Furthermore, the technical effects of the parameter configuration device 400 can be referenced. Figure 2 or Figure 3 The technical effects of the parameter configuration method shown will not be elaborated here.

[0233] For example, Figure 5 Schematic diagram of the parameter configuration device provided in the embodiments of this application Figure 2 The parameter configuration device can be an electronic device with computing capabilities, or a chip (system) or other component or assembly that can be disposed in the electronic device, or a device containing the electronic device. For example... Figure 5 As shown, the parameter configuration device 500 may include a processor 501. Optionally, the parameter configuration device 500 may also include a memory 502 and / or a transceiver 503. The processor 501 is coupled to the memory 502 and the transceiver 503, for example, via a communication bus.

[0234] The following is combined with Figure 5 A detailed description of each component of the parameter configuration device 500 is provided below:

[0235] The processor 501 is the control center of the parameter configuration device 500. It can be a single processor or a collective term for multiple processing elements. For example, the processor 501 can be one or more central processing units (CPUs), application-specific integrated circuits (ASICs), or one or more integrated circuits configured to implement the embodiments of this application, such as one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs).

[0236] Optionally, the processor 501 can perform various functions of the parameter configuration device 500 by running or executing software programs stored in the memory 502 and calling data stored in the memory 502.

[0237] In a specific implementation, as one example, the processor 501 may include one or more CPUs, for example... Figure 5 CPU0 and CPU1 are shown in the diagram.

[0238] In a specific implementation, as one example, the parameter configuration device 500 may also include multiple processors, for example... Figure 5 The processors 501 and 504 are shown. Each of these processors can be a single-core processor or a multi-core processor. Here, "processor" can refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).

[0239] The memory 502 is used to store the software program that executes the solution of this application, and is controlled by the processor 501 to execute it. The specific implementation method can be referred to the above method embodiment, and will not be repeated here.

[0240] Optionally, the memory 502 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. The memory 502 may be integrated with the processor 501 or exist independently, and may be configured via the interface circuit of the parameter configuration device 500. Figure 5 (Not shown in the image) is coupled to processor 501, and this embodiment does not specifically limit this.

[0241] Transceiver 503 is used for communication with other parameter configuration devices. For example, if parameter configuration device 500 is an electronic device, transceiver 503 can be used to communicate with another electronic device.

[0242] Optionally, transceiver 503 may include a receiver and a transmitter. Figure 5 (Not shown separately). The receiver is used to implement the receiving function, and the transmitter is used to implement the sending function.

[0243] Optionally, the transceiver 503 can be integrated with the processor 501, or it can exist independently and be configured via the interface circuit of the parameter configuration device 500. Figure 5 (Not shown in the image) is coupled to processor 501, and this embodiment does not specifically limit this.

[0244] It should be noted that, Figure 5 The structure of the parameter configuration device 500 shown does not constitute a limitation on the parameter configuration device. The actual parameter configuration device may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0245] Furthermore, the technical effects of the parameter configuration device 500 can be referred to the technical effects of the parameter configuration method described in the above method embodiments, and will not be repeated here.

[0246] This application provides a parameter configuration system. The parameter configuration system may include the aforementioned parameter configuration device and database operation device.

[0247] It should be understood that the processor in the embodiments of this application can be a central processing unit (CPU), or it can 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. The general-purpose processor can be a microprocessor or any conventional processor.

[0248] It should also be understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0249] The above embodiments can be implemented, in whole or in part, by software, hardware (such as circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive.

[0250] It should be understood that the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. A and B can be singular or plural. Additionally, the character " / " in this article generally indicates an "or" relationship between the preceding and following related objects, but it can also represent an "and / or" relationship. Please refer to the context for a more accurate understanding.

[0251] In this application, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0252] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0253] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0254] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0255] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0256] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0257] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0258] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0259] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A parameter configuration method, characterized in that, include: Obtain the set of database operation statements from the database management system; Retrieve multiple sets of candidate database operation statements; Calculate the first similarity between each of the multiple candidate database operation statement sets and the database operation statement set; From the multiple sets of database candidate operation statements, the set of database candidate operation statements whose first similarity is greater than the similarity threshold is determined as the database training statement set; Each set of database training statements corresponds to a set of database parameter training data and a set of database performance training data. The database training statement set matches the database operation statement set of the database management system, and the database operation statement set is related to the actual business scenario of the database management system. A machine learning model is established based on the database parameter training set and database performance training data corresponding to multiple database training statement sets; the machine learning model is used to determine the database performance prediction results corresponding to each of the multiple database parameter candidate sets. Based on the machine learning model, the database parameter candidate set whose database performance prediction results meet the first preset condition from the multiple database parameter candidate sets is determined as the target database parameter set.

2. The method according to claim 1, characterized in that, The calculation of the first similarity between each of the multiple candidate database operation statement sets and the database operation statement set includes: Determine a first feature vector corresponding to the set of database operation statements; the first feature vector includes multiple first elements, each first element corresponds to a database operation statement, and the value of each first element is the proportion of the database operation statement corresponding to the first element in the set of database operation statements; A second feature vector corresponding to the database operation statement target set is determined; wherein, the database operation statement target set is any database candidate operation statement set from a plurality of database candidate operation statement sets; the second feature vector includes a plurality of second elements, each second element corresponds to a database operation statement, and the value of each second element is the proportion of the database operation statement corresponding to the second element in the database operation statement target set; Calculate a second similarity between the first feature vector and each of the second feature vectors; the second similarity is used to represent the first similarity.

3. The method according to claim 1, characterized in that, The calculation of the first similarity between each of the multiple candidate database operation statement sets and the database operation statement set includes: Determine the first key vector corresponding to the database operation statement set; the first key vector includes multiple third elements, each third element corresponds to a key, and the value of each third element is the proportion of the key corresponding to the third element in the database operation statement set; Determine a second key vector corresponding to the database operation statement target set; wherein, the database operation statement target set is any database candidate operation statement set from a plurality of database candidate operation statement sets; the second key vector includes a plurality of fourth elements, each fourth element corresponding to a key, and the value of each fourth element is the proportion of the key corresponding to the fourth element in the database operation statement target set; Calculate a third similarity between the first keyword vector and each of the second keyword vectors, whereby the third similarity is used to represent the first similarity.

4. The method according to any one of claims 1-3, characterized in that, The step of establishing a machine learning model based on database parameter training sets corresponding to multiple database training statement sets and database performance training data includes: Based on the database parameter training set and database performance training data corresponding to the multiple database training statement sets, determine the feature importance metric value corresponding to each of the multiple parameter items in the database parameter training set; Among the multiple parameter items, the parameter items whose feature importance metric values ​​satisfy the second preset condition are determined as important parameter items; A random forest model is established based on the aforementioned important parameters, the database parameter training sets corresponding to multiple database training statement sets, and the database performance training data.

5. The method according to any one of claims 1-3, characterized in that, The step of determining the target database parameter set based on the machine learning model, from a plurality of database parameter candidate sets, the database performance prediction results of which satisfy a first preset condition, includes: Based on the genetic algorithm, the database parameter candidate set whose database performance prediction results satisfy the first preset condition is determined as the target database parameter set from the multiple database parameter candidate sets. The fitness function of the genetic algorithm is determined by the machine learning model.

6. The method according to claim 5, characterized in that, The genetic algorithm-based method determines the target database parameter set from multiple candidate database parameters whose database performance prediction results satisfy the first preset condition, including: Based on the sampling rules, the sampling results of the multiple database parameter candidate sets are obtained; the sampling results include multiple first database parameter selection sets. Based on the genetic algorithm and multiple first database parameter selection sets, the database parameter candidate set whose database performance prediction results satisfy the first preset conditions is determined as the target database parameter set.

7. A parameter configuration device, characterized in that, include: The transceiver module is used to obtain the database operation statement set of the database management system; The processing module is used to obtain multiple sets of candidate database operation statements; Calculate the first similarity between each of the multiple candidate database operation statement sets and the database operation statement set; From the multiple sets of database candidate operation statements, the set of database candidate operation statements whose first similarity is greater than the similarity threshold is determined as the database training statement set; Each set of database training statements corresponds to a set of database parameter training data and a set of database performance training data. The database training statement set matches the database operation statement set of the database management system, and the database operation statement set is related to the actual business scenario of the database management system. The processing module is further configured to establish a machine learning model based on the database parameter training set and database performance training data corresponding to the multiple database training statement sets; the machine learning model is used to determine the database performance prediction results corresponding to each of the multiple database parameter candidate sets. The processing module is further configured to, based on the machine learning model, determine the database parameter candidate set whose database performance prediction results satisfy a first preset condition from the multiple database parameter candidate sets as the target database parameter set.

8. The apparatus according to claim 7, characterized in that, The processing module is further configured to determine a first feature vector corresponding to the set of database operation statements; the first feature vector includes a plurality of first elements, each first element corresponds to a database operation statement, and the value of each first element is the proportion of the database operation statement corresponding to the first element in the set of database operation statements. The processing module is further configured to determine a second feature vector corresponding to the database operation statement target set; wherein the database operation statement target set is any database candidate operation statement set from a plurality of database candidate operation statement sets; the second feature vector includes a plurality of second elements, each second element corresponding to a database operation statement, and the value of each second element is the proportion of the database operation statement corresponding to the second element in the database operation statement target set; The processing module is further configured to calculate a second similarity between the first feature vector and each of the second feature vectors; the second similarity is used to represent the first similarity.

9. The apparatus according to claim 7, characterized in that, The processing module is further configured to determine a first key vector corresponding to the database operation statement set; the first key vector includes a plurality of third elements, each third element corresponding to a key, and the value of each third element is the proportion of the key corresponding to the third element in the database operation statement set; The processing module is further configured to determine a second key vector corresponding to the database operation statement target set; wherein the database operation statement target set is any database candidate operation statement set from a plurality of database candidate operation statement sets; the second key vector includes a plurality of fourth elements, each fourth element corresponding to a key, and the value of each fourth element is the proportion of the key corresponding to the fourth element in the database operation statement target set; The processing module is further configured to calculate a third similarity between the first keyword vector and each of the second keyword vectors, wherein the third similarity is used to represent the first similarity.

10. The apparatus according to any one of claims 7-9, characterized in that, The processing module is further configured to determine the feature importance metric value corresponding to each of the multiple parameter items in the database parameter training set based on the database parameter training set corresponding to the multiple database training statement sets and the database performance training data. The processing module is further configured to identify, among the multiple parameter items, the parameter items whose feature importance metric values ​​satisfy a second preset condition as important parameter items; The processing module is also used to establish a random forest model based on the important parameter items, the database parameter training set corresponding to multiple database training statement sets, and the database performance training data.

11. The apparatus according to any one of claims 7-9, characterized in that, The processing module is further configured to, based on a genetic algorithm, determine the database parameter candidate set whose database performance prediction results satisfy the first preset condition from the multiple database parameter candidate sets as the target database parameter set; The fitness function of the genetic algorithm is determined by the machine learning model.

12. The apparatus according to claim 11, characterized in that, The processing module is further configured to obtain sampling results of the plurality of database parameter candidate sets based on sampling rules; the sampling results include a plurality of first database parameter selection sets. The processing module is further configured to, based on the genetic algorithm and multiple first database parameter selection sets, determine the database parameter candidate set whose database performance prediction results satisfy the first preset conditions from the multiple database parameter candidate sets as the target database parameter set.

13. A parameter configuration device, characterized in that, The parameter configuration device is used to perform the parameter configuration method as described in any one of claims 1-6.

14. A parameter configuration device, characterized in that, The parameter configuration device includes: a processor; wherein... The processor is configured to execute the parameter configuration method as described in any one of claims 1-6.

15. A parameter configuration device, characterized in that, include: Processor, the processor being coupled to memory; The processor is configured to execute a computer program stored in the memory, so that the parameter configuration device performs the parameter configuration method as described in any one of claims 1-6.

16. A parameter configuration device, characterized in that, include: Processor and interface circuits; among which, The interface circuit is used to receive code instructions and transmit them to the processor; The processor is used to run the code instructions to perform the method as described in any one of claims 1 to 6.

17. A processor, characterized in that, include: The processor is used to execute the parameter configuration method as described in any one of claims 1-6.

18. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a computer program or instructions that, when executed on a computer, cause the computer to perform the parameter configuration method as described in any one of claims 1-6.

19. A computer program product, characterized in that, The computer program product includes: a computer program or instructions that, when run on a computer, cause the computer to perform the parameter configuration method as described in any one of claims 1-6.