Configuration control method and equipment for database
By using the database configuration recommendation model and performance evaluation model to automatically obtain and evaluate database configuration, the complex and time-consuming problem of database performance configuration in the existing technology is solved, and configuration efficiency and quality are improved.
Patent Information
- Application Number
- CN202510168976.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-06-03
AI Technical Summary
In the prior art, the manual configuration process of database performance is complex and time-consuming, and the configuration effect is poor, making it difficult to meet the needs of different workloads.
By obtaining the workload information and types of the database, using the database to configure the recommendation model and performance evaluation model, repeatedly call the recommendation model, evaluate performance indicators, select target configuration information, and automatically configure database parameters.
It improves the efficiency and quality of database performance configuration, reduces time consumption, and improves the ability of database configuration to support business.
Smart Images

Figure CN120086203A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the technical field of database management, and in particular, to a method and device for configuring and controlling a database. Background Art
[0002] Currently, since the default database configuration usually cannot meet the requirements of all workloads, at this time, it is necessary to optimize the performance of the database by adjusting various parameters to meet the requirements of each workload. Therefore, the configuration control of the database is a crucial task in database management.
[0003] In the prior art, database administrators rely on experience to manually configure the database performance. However, the number of adjustable parameters in the database is huge and their configuration ranges are large, and the configuration process is extremely complex, resulting in extremely time-consuming manual configuration of the database performance and poor configuration effects. Summary of the Invention
[0004] Embodiments of the present disclosure provide a method and device for configuring and controlling a database, which can improve the efficiency of configuring and controlling the database performance and the quality of database configuration, and enhance the support ability of database configuration for services.
[0005] In a first aspect, embodiments of the present disclosure provide a method for configuring and controlling a database, including:
[0006] Responding to receiving a configuration request for the database, obtaining the workload information and workload type of the database;
[0007] Repeatedly calling a database configuration recommendation model according to the workload information a preset number of times to obtain multiple candidate configuration information corresponding to the workload information, where the database configuration recommendation model is used to estimate candidate configuration information of the database that matches the workload information based on the workload information of the database;
[0008] For each candidate configuration information, calling a performance evaluation model according to the workload type, the candidate configuration information, and the workload information to obtain performance index parameters output by the performance evaluation model, where the performance index parameters are used to evaluate the performance of the database;
[0009] Selecting target configuration information from the multiple candidate configuration information according to the performance index parameters corresponding to the multiple candidate configuration information, and configuring the parameters of the database according to the target configuration information.
[0010] In a second aspect, embodiments of the present disclosure provide a device for configuring and controlling a database, including:
[0011] An acquisition unit, configured to acquire the workload information and workload type of a database in response to receiving a configuration request for the database;
[0012] A model invocation unit, configured to repeatedly invoke a database configuration recommendation model a preset number of times according to the workload information to obtain a plurality of candidate configuration information corresponding to the workload information, where the database configuration recommendation model is used to estimate candidate configuration information of a database that matches the workload information based on the workload information of the database;
[0013] A performance evaluation unit, configured to, for each candidate configuration information, invoke a performance evaluation model according to the workload type, the candidate configuration information, and the workload information to obtain performance metric parameters output by the performance evaluation model, where the performance metric parameters are used to evaluate the performance of the database;
[0014] A parameter configuration unit, configured to select target configuration information from the plurality of candidate configuration information according to the performance metric parameters corresponding to the plurality of candidate configuration information, and configure the parameters of the database according to the target configuration information.
[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
[0016] The memory stores computer-executable instructions;
[0017] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the configuration control method for the database as described in the first aspect and various possible designs of the first aspect above.
[0018] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the processor executes the computer-executable instructions, the configuration control method for the database as described in the first aspect and various possible designs of the first aspect above is implemented.
[0019] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, and when the computer program is executed by a processor, the configuration control method for the database as described in the first aspect and various possible designs of the first aspect above is implemented.
[0020] The configuration control method and device for a database provided in this embodiment, the method includes: in response to receiving a configuration request for the database, obtaining the workload information and workload type of the database; repeatedly calling the database configuration recommendation model according to the preset number of times according to the workload information to obtain multiple candidate configuration information corresponding to the workload information, where the database configuration recommendation model is used to estimate the candidate configuration information of the database that matches the workload information based on the workload information of the database; for each candidate configuration information, calling the performance evaluation model according to the workload type, candidate configuration information and workload information to obtain the performance index parameters output by the performance evaluation model, where the performance index parameters are used to evaluate the performance of the database; according to the performance index parameters corresponding to each of the multiple candidate configuration information, selecting the target configuration information from the multiple candidate configuration information, and configuring the parameters of the database according to the target configuration information. In this technical solution, for the workload information of the database, multiple candidate configuration information corresponding to the workload information can be directly obtained through the database configuration recommendation model, without long-term online iterative tuning, thereby reducing the time consumption, and thus improving the efficiency of configuring and controlling the performance of the database; and, according to the performance index parameters corresponding to each of the multiple candidate configuration information, selecting the target configuration information from the multiple candidate configuration information, through the inference method of "sampling first and then sorting", the configuration quality of the database can be effectively improved, and the support ability of the database configuration for the business can be enhanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0022] Figure 1 FIG. is a schematic diagram of an application scenario of a configuration control method for a database provided in an embodiment of the present disclosure;
[0023] Figure 2 FIG. is a flowchart of a configuration control method for a database provided in an embodiment of the present disclosure Figure 1 ;
[0024] Figure 3 FIG. is a schematic diagram of a configuration control method for a database provided in an embodiment of the present disclosure Figure 1 ;
[0025] Figure 4 FIG. is a training process flowchart of a database configuration recommendation model and a performance evaluation model provided in an embodiment of the present disclosure Figure 1 ;
[0026] Figure 5 Schematic diagram of the prompt word template provided by the embodiments of the present disclosure Figure 1 ;
[0027] Figure 6 Training schematic diagram of the database configuration recommendation model and performance evaluation model provided by the embodiments of the present disclosure Figure 1 ;
[0028] Figure 7 Schematic diagram of the input and output of the database configuration recommendation model provided by the embodiments of the present disclosure Figure 1 ;
[0029] Figure 8 Schematic diagram of the structure of the configuration control device of the database provided by the embodiments of the present disclosure;
[0030] Figure 9 Schematic diagram of the structure of the electronic device provided by the embodiments of the present disclosure. Detailed implementation manners
[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some but not all of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
[0032] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. The collection, use, and processing of the relevant data need to comply with relevant laws, regulations, and standards, and corresponding operation entrances are provided for the user to select authorization or rejection.
[0033] Currently, since the default database configuration usually cannot meet the needs of all workloads, at this time, it is necessary to optimize the performance of the database by adjusting various parameters to meet the needs of each workload. Therefore, database performance tuning is a crucial task in database management.
[0034] In the prior art, database administrators rely on experience to manually tune the performance of the database. However, the number of adjustable parameters in the database is huge and their configuration ranges are large, and the tuning process is extremely complex, resulting in extremely time-consuming manual tuning of the database performance and poor configuration effects.
[0035] In recent years, with the development of machine learning technology, automated tuning methods have begun to be applied. For example, tuning algorithms based on Bayesian optimization and reinforcement learning. However, the above tuning algorithms usually require online fitting of models to achieve tuning, so it is necessary to iteratively test configurations and correct models. This process requires repeatedly executing workloads in the database to test the performance of parameter configurations, resulting in low tuning efficiency.
[0036] To address the technical problems in the prior art, the inventors' technical concept is as follows: This application proposes an innovative end-to-end tuning method. Its core idea is to directly recommend the optimal configuration based on the workload to eliminate the extremely time-consuming iterative process in the previous methods. Compared with the prior art, the main advantage of this application is that through the end-to-end modeling method, it greatly reduces the repeated and long-term workload tests required in the traditional method, and significantly improves the tuning efficiency. To achieve this goal, two major technical challenges need to be solved: how to model the complex distribution mapping relationship between the workload and the optimal configuration (i.e., the end-to-end modeling method) and how to effectively utilize the modeling results to recommend excellent parameter configurations.
[0037] To effectively utilize the modeling results to recommend excellent parameter configurations, this application proposes an end-to-end database parameter tuning method. First, sample through the database configuration recommendation model to obtain multiple candidate configuration information, and then use the performance evaluation model to sort the multiple candidate configuration information and select the target configuration information from it. This inference method can obtain the parameter configuration information for improving the database performance without long-term online iterative tuning.
[0038] Correspondingly, the specific steps include: in response to receiving a configuration request for the database, obtain the workload information and workload type of the database; repeatedly call the database configuration recommendation model a preset number of times according to the workload information to obtain multiple candidate configuration information corresponding to the workload information, where the database configuration recommendation model is used to estimate the candidate configuration information of the database that matches the workload information based on the workload information of the database; for each candidate configuration information, call the performance evaluation model according to the workload type, candidate configuration information, and workload information to obtain the performance metric parameters output by the performance evaluation model, where the performance metric parameters are used to evaluate the performance of the database; according to the performance metric parameters corresponding to each of the multiple candidate configuration information, select the target configuration information from the multiple candidate configuration information, and configure the parameters of the database according to the target configuration information.
[0039] In this technical solution, for the workload information of the database, multiple candidate configuration information corresponding to the workload information can be directly obtained through the database configuration recommendation model, without the need for long-term online iterative tuning, thereby reducing time consumption and improving the efficiency of configuring and controlling the database performance. Moreover, according to the performance index parameters corresponding to each of the multiple candidate configuration information, the target configuration information is selected from the multiple candidate configuration information. Through the inference method of "sampling first and then sorting", the configuration quality of the database can be effectively improved, and the support ability of the database configuration for the business can be enhanced.
[0040] The application scenarios of the embodiments of the present disclosure are explained below:
[0041] The method for configuring and controlling a database provided by the embodiments of the present disclosure can be applied to scenarios where the performance of various types of databases is optimized. Figure 1 It is a schematic diagram of the application scenario of a method for configuring and controlling a database provided by the embodiments of the present disclosure. As Figure 1 shown, the user can send a request for configuring and controlling the database to the server 102 through the terminal 101. The server 102 receives the request for configuring and controlling the database, determines the target configuration information through the method for configuring and controlling the database provided by the embodiments of the present disclosure, and configures the parameters of the database through the target configuration information.
[0042] The following is the specific implementation process of the method and device for configuring and controlling a database involved in the embodiments of the present disclosure. Some examples are only for illustration and are not limited. The execution subject of the method for configuring and controlling a database involved in the embodiments of the present disclosure is an electronic device, which can be a terminal, a server, etc.
[0043] Figure 2 It is the flow of the method for configuring and controlling a database provided by the embodiments of the present disclosure Figure 1 As Figure 2 shown, the method for configuring and controlling the database may include:
[0044] S201. In response to receiving a database configuration request, obtain the workload information and workload type of the database.
[0045] In the embodiments of the present disclosure, the workload of the database may include Structured Query Language (SQL) workload.
[0046] Optionally, the workload type includes Online Analytical Processing (OLAP) type and Online Transaction Processing (OLTP) type. Among them, the Online Analytical Processing type can be represented as the OLAP (Online Analytical Processing) type, and the Online Transaction Processing type can be represented as the OLTP (Online Transaction Processing) type.
[0047] Among them, the workload information at least includes database execution information. Optionally, the database execution information includes one or more of the following: the number of transaction commits, the number of transaction rollbacks, the number of blocks read, the number of blocks hitting the cache, the number of tuples returned, the number of tuples read, the number of tuples inserted, the number of conflicts, the number of tuples updated, the number of tuples deleted, the number of disk reads, the number of disk writes, the number of bytes read from the disk, and the number of bytes written to the disk.
[0048] Among them, the workload information corresponding to different types of workloads is different. For example, for workloads with frequent reads, the value of the number of tuples read is relatively high. For workloads with frequent writes, the value of the number of tuples inserted is relatively high. Among them, the read frequency and write frequency of different types of workloads are different, and the corresponding values of the number of tuples read and the number of tuples inserted are also different.
[0049] Optionally, the workload information may further include: query workload information of Structured Query Language and query plan information of Structured Query Language.
[0050] S202. Repeatedly call the database configuration recommendation model according to the workload information for a preset number of times to obtain multiple candidate configuration information corresponding to the workload information, where the database configuration recommendation model is used to estimate the candidate configuration information of the database that matches the workload information based on the workload information of the database.
[0051] In some embodiments, the candidate configuration information output by the database configuration recommendation model includes the configuration values corresponding to multiple database parameters respectively.
[0052] In other embodiments, the candidate configuration information output by the database configuration recommendation model includes the configuration value ranges corresponding to multiple database parameters respectively; among them, the configuration value range of each database parameter is obtained by first normalizing the parameter value range of the database parameter and then discretizing each parameter value.
[0053] In the embodiments of the present disclosure, each candidate configuration information may include multiple database parameters, and the value ranges of each database parameter vary greatly. To improve the prediction stability of the database configuration recommendation model, the value ranges of multiple database parameters can be normalized, and then each parameter value is discretized into multiple intervals. For example, 0% to 10%, 10% to 20%, etc.
[0054] Optionally, the multiple database parameters include the number of active sessions, the maximum number of concurrent connections, the maximum number of automatic cleaning processes, the shared memory size, etc. Exemplarily, the value range of the maximum number of concurrent connections can be from 0 to 100. And the value range of the maximum number of automatic cleaning processes can be from 0 to 10. At this time, the value ranges of the database parameters vary greatly.
[0055] For example, the database parameter is: the maximum number of concurrent connections, and the value range of the maximum number of concurrent connections is from 0 to 40. At this time, the value range of the maximum number of concurrent connections can be normalized, and then each parameter value can be discretized into 4 intervals, which are: 0% to 25%, 25% to 50%, 50% to 75%, 75% to 100%. In this embodiment, the interval corresponding to the maximum number of concurrent connections from 0 to 10 is 0% to 25%, the interval corresponding to the maximum number of concurrent connections from 10 to 20 is 25% to 50%, the interval corresponding to the maximum number of concurrent connections from 20 to 30 is 50% to 75%, and the interval corresponding to the maximum number of concurrent connections from 30 to 40 is 75% to 100%.
[0056] Again, for example, the database parameter is: the maximum number of automatic cleaning processes, and the value range of the maximum number of automatic cleaning processes can be from 0 to 10. At this time, the value range of the maximum number of automatic cleaning processes can be normalized, and then each parameter value can be discretized into 5 intervals, which are: 0% to 20%, 20% to 40%, 40% to 60%, 60% to 80%, 80% to 100%. In this embodiment, the interval corresponding to the maximum number of automatic cleaning processes from 0 to 2 is 0% to 20%, the interval corresponding to the maximum number of automatic cleaning processes from 2 to 4 is 20% to 40%, the interval corresponding to the maximum number of automatic cleaning processes from 4 to 6 is 40% to 60%, the interval corresponding to the maximum number of automatic cleaning processes from 6 to 8 is 60% to 80%, and the interval corresponding to the maximum number of automatic cleaning processes from 8 to 10 is 80% to 100%.
[0057] In some embodiments, the database configuration recommendation model is used to output candidate configuration information based on the conditional probability between the workload information and each configuration information. Optionally, the candidate configuration information output by the database configuration recommendation model includes the discretized intervals corresponding to the multiple database parameters respectively, where the parameter values located within the discretized intervals are the normalized parameter values.
[0058] Optionally, the workload information is: the number of transaction submissions: 100. The multiple database parameters included in the configuration information are: the maximum number of automatic cleaning processes, the maximum number of concurrent connections.
[0059] The following takes the maximum number of concurrent connections as an example for illustration. For example, the workload information is as follows: the number of transaction submissions is 100, and the conditional probabilities for the maximum number of concurrent connections in the output ranges of 0% to 25%, 25% to 50%, 50% to 75%, and 75% to 100% are 0.5, 0.2, 0.2, and 0.1 respectively. In this embodiment, each time the database configuration recommendation model is called, candidate configuration information will be output based on the conditional probabilities between the workload information and each configuration information.
[0060] In the embodiments of the present disclosure, the specific value of the preset number of times is not specifically limited and can be set and modified as needed. Exemplarily, as Figure 3 shown, the preset number of times is 3 times, and 3 samplings are performed. At this time, the 3 candidate configuration information corresponding to the workload information obtained are respectively: the maximum number of concurrent connections: 25% to 50%, the maximum number of automatic cleaning processes: 20% to 40%. The maximum number of concurrent connections: 25% to 50%, the maximum number of automatic cleaning processes: 40% to 60%. The maximum number of concurrent connections: 50% to 75%, the maximum number of automatic cleaning processes: 20% to 40%.
[0061] S203. For each candidate configuration information, call the performance evaluation model according to the workload type, candidate configuration information, and workload information to obtain the performance metric parameters output by the performance evaluation model, where the performance metric parameters are used to evaluate the performance of the database.
[0062] In the embodiments of the present disclosure, for different types of workloads, the performance metric parameters output by calling the performance evaluation model are different.
[0063] In some embodiments, the workload type includes the online analytical processing type and the online transaction processing type, and the workload information at least includes database execution information; correspondingly, calling the performance evaluation model according to the workload type, candidate configuration information, and workload information to obtain the performance metric parameters output by the performance evaluation model includes:
[0064] If the workload type includes the online analytical processing type, then call the performance evaluation model according to the workload type, candidate configuration information, and the database execution information in the workload information to obtain the online analytical performance parameters output by the performance evaluation model, where the online analytical performance parameters include one or more of the following: latency duration, data analysis accuracy rate; or,
[0065] If the workload type includes the online transaction processing type, the performance evaluation model is called according to the database execution information in the workload type, candidate configuration information, and workload information to obtain the online processing performance parameters output by the performance evaluation model. The online processing performance parameters include one or more of the following: the number of transactions processed per second, the number of transaction queries per second, the database failure rate, and the database availability parameter.
[0066] Exemplarily, the workload type includes the online analytical processing type, and the output performance metric parameter is the latency duration. The latency duration represents the total duration of data analysis based on historical data and can characterize the data analysis performance of the database. Exemplarily, the workload type includes the online transaction processing type, and the output performance metric parameter is the number of transactions processed per second. The number of transactions processed per second can characterize the online processing performance of the database.
[0067] S204. Select the target configuration information from multiple candidate configuration information according to the performance metric parameters corresponding to each of the multiple candidate configuration information, and configure the parameters of the database according to the target configuration information.
[0068] In the embodiments of the present disclosure, as Figure 3 shown, the target configuration information is the best configuration information among the multiple candidate configuration information. Optionally, selecting the target configuration information from multiple candidate configuration information according to the performance metric parameters corresponding to each of the multiple candidate configuration information includes: if the performance metric parameter includes the latency duration, selecting the target configuration information with the minimum latency duration from the multiple candidate configuration information according to the latency durations corresponding to each of the multiple candidate configuration information; if the performance metric parameter includes the number of transactions processed per second, selecting the target configuration information with the maximum number of transactions processed per second from the multiple candidate configuration information according to the number of transactions processed per second corresponding to each of the multiple candidate configuration information.
[0069] Embodiments of the present disclosure provide a method for configuring and controlling a database: in response to receiving a configuration request for the database, obtain the workload information and workload type of the database; repeatedly call the database configuration recommendation model a preset number of times according to the workload information to obtain multiple candidate configuration information corresponding to the workload information, where the database configuration recommendation model is used to estimate candidate configuration information of the database that matches the workload information based on the workload information of the database; for each candidate configuration information, call a performance evaluation model according to the workload type, candidate configuration information, and workload information to obtain performance metric parameters output by the performance evaluation model, where the performance metric parameters are used to evaluate the performance of the database; select target configuration information from the multiple candidate configuration information according to the performance metric parameters corresponding to each of the multiple candidate configuration information, and configure the parameters of the database according to the target configuration information. In this technical solution, for the workload information of the database, multiple candidate configuration information corresponding to the workload information can be directly obtained through the database configuration recommendation model, without long-term online iterative tuning, thereby reducing time consumption and improving the efficiency of configuring and controlling the database performance; moreover, according to the performance metric parameters corresponding to each of the multiple candidate configuration information, select target configuration information from the multiple candidate configuration information, and through the inference method of "sampling first and then sorting", the configuration quality of the database can be effectively improved, and the support ability of the database configuration for the business can be enhanced.
[0070] In the embodiments of the present disclosure, through the database configuration recommendation model, the distribution mapping relationship between the workload and the database configuration control information can be modeled, and through the performance evaluation model, the database performance corresponding to the database configuration control information can be evaluated. This application can automatically synthesize high-quality workloads and obtain the optimal configuration information for these workloads; after obtaining sufficient data, it is used for the training of the database configuration recommendation model and the performance evaluation model. The training methods of the database configuration recommendation model and the performance evaluation model are described in detail below. Optionally, as Figure 4 shown, the training methods for the database configuration recommendation model and the performance evaluation model include:
[0071] S401. Obtain the load information of multiple first workloads and the load information of multiple second workloads, where the first workload is a workload of the online analytical processing type, and the second workload is a workload of the online transaction processing type.
[0072] In an embodiment of the present disclosure, obtaining the load information of multiple first workloads and the load information of multiple second workloads includes: generating multiple Structured Query Languages corresponding to a first database instance as first workloads through a large language model and the first database instance, and obtaining the load information of each first workload; collecting online transactions of various types from a second database instance as second workloads according to randomly generated proportion weights of each type, and obtaining the load information of each second workload.
[0073] Exemplarily, the first workload is mainly for complex data analysis tasks. In this embodiment, a large language model and a prompt template as shown in Figure 5 can be used to generate multiple Structured Query Languages for querying historical data for data analysis for different database instances, so as to obtain the load information of the first workload.
[0074] Among them, <Database DDL> needs to be replaced with the table creation DDL of the first database instance, "<column name1>: <value1> , <value2> , <value3>……” needs to be replaced with the column names in the database schema and the column values sampled from the database. <query1>The part needs to be replaced with the query in the benchmark as an example. It should be noted that, as Figure 6 shown, after the query is generated, the syntax correctness of the generated query is verified through the EXPLAIN command, and only the query without syntax errors is retained.
[0075] Exemplarily, the second workload mainly includes a predefined transaction sequence. In this embodiment, as Figure 6 shown, according to the randomly generated proportion weights of each type, online transactions of each type are collected from the second database instance, and multiple second workload information can be generated.
[0076] It should be noted that the first database instance is a database instance based on OLAP. Among them, a database instance based on OLAP is a database system optimized for complex query and analysis operations. It supports fast and flexible data analysis, helping users view data from multiple perspectives to make more informed business decisions. Exemplarily, database instances based on OLAP include: database instances based on TPC-H, database instances based on JOB, database instances based on TPC-DS, database instances based on SSB, and database instances based on SSB-flat.
[0077] The second database instance is a database instance based on the OLTP benchmark. Among them, a database instance based on OLTP is a database system designed to efficiently process a large number of short transactional operations. The main feature of a database based on OLTP is to quickly and reliably process data insertion, update, and deletion operations, which are usually closely related to daily business activities. Exemplarily, database instances based on the OLTP benchmark include: database instances based on TPC-C, database instances based on Wikipedia, database instances based on Twitter, database instances based on Smallbank, and database instances based on YCSB.
[0078] S402. Determine the database configuration control information corresponding to the load information of each first workload, and determine the database configuration control information corresponding to the load information of each second workload.
[0079] Optionally, determine the database configuration control information corresponding to the load information of each first workload, including: for the load information of each first workload, tune and iterate the configuration parameters of the first database instance through a hyperparameter optimization algorithm, record the first configuration parameters of each iteration and the performance parameters corresponding to the first configuration parameters of each iteration, and determine the second configuration parameters corresponding to the highest performance parameter from the first configuration parameters according to the performance parameters corresponding to the first configuration parameters of each iteration; determine the first configuration parameters of each iteration, the performance parameters corresponding to the first configuration parameters of each iteration, and the second configuration parameters as the database configuration control information corresponding to the load information of the first workload.
[0080] Optionally, determine the database configuration control information corresponding to the load information of each second workload, including: for the load information of each second workload, tune and iterate the configuration parameters of the second database instance through a hyperparameter optimization algorithm, record the first configuration parameters of each iteration and the performance parameters corresponding to the first configuration parameters of each iteration, and determine the second configuration parameters corresponding to the highest performance parameter from the first configuration parameters according to the performance parameters corresponding to the first configuration parameters of each iteration; determine the first configuration parameters of each iteration, the performance parameters corresponding to the first configuration parameters of each iteration, and the second configuration parameters as the database configuration control information corresponding to the load information of the second workload.
[0081] In the embodiments of the present disclosure, the hyperparameter optimization algorithm may be an iterative Bayesian optimization algorithm.
[0082] S403. Through the load information of each first workload and its corresponding database configuration control information and the load information of each second workload and its corresponding database configuration control information, perform end-to-end linkage training on the initial database configuration recommendation model and the initial performance evaluation model to obtain a database configuration recommendation model and a performance evaluation model.
[0083] In the embodiments of the present disclosure, during the training process, the model optimizes its internal parameters by maximizing the conditional probability between the input sequence and the output configuration sequence.
[0084] Optionally, as Figure 6 As shown, this step may include: training an initial database configuration recommendation model with the load information of multiple first workloads, the second configuration parameters corresponding to the load information of each first workload, the load information of multiple second workloads, and the second configuration parameters corresponding to the load information of each second workload to obtain a database configuration recommendation model; and training an initial performance evaluation model with the load information of multiple first workloads, the multiple first configuration parameters corresponding to the load information of each first workload and the performance parameters corresponding to each first configuration parameter, the load information of multiple second workloads, the multiple first configuration parameters corresponding to the load information of each second workload and each first configuration parameter to obtain a performance evaluation model.
[0085] Among them, the database configuration recommendation model is used to recommend candidate configuration information end-to-end. To reduce the learning difficulty of the database configuration recommendation model, this application designs a set of input-output standardization solutions. During the training process, the input of the database configuration recommendation model is the multi-dimensional feature information of the workload. Optionally, as Figure 7 shown, these features include the statistical information of the workload, the query plan, and the internal execution metrics of the database.
[0086] Optionally, the workload statistical information includes the access frequency of each table, the total number of SQL statements, the read-write ratio, the average number of predicates per SQL query, and the ratio of key operators. Optionally, the query plan of the SQL statement is obtained through the EXPLAIN command. Optionally, the internal execution metrics include: the number of transaction commits, the number of transaction rollbacks, the number of blocks read, the number of blocks cached, the number of tuples returned, the number of tuples read, the number of tuples inserted, the number of conflicts, the number of tuples updated, the number of tuples deleted, the number of disk reads, the number of disk writes, the number of bytes read from disk, and the number of bytes written to disk. To facilitate the database configuration recommendation model to understand large values, the internal metrics are represented in the form of orders of magnitude.
[0087] Optionally, as Figure 6 shown, training the initial performance evaluation model to obtain a performance evaluation model includes: training the initial performance evaluation model with the load information of multiple first workloads, the multiple first configuration parameters corresponding to the load information of each first workload and the performance parameters corresponding to each first configuration parameter, the load information of multiple second workloads, the multiple first configuration parameters corresponding to the load information of each second workload and each first configuration parameter, combining the gradient boosting regression algorithm and the random forest regression algorithm to obtain a performance evaluation model.
[0088] Among them, the performance evaluation model is used to predict the performance metrics of the workload under a given configuration. This model adopts an ensemble learning method and is trained by combining the Gradient Boosting Regression (GBR) and Random Forest Regression (RFR) models. The input of the performance evaluation model is a vector, including the features of the workload and the configuration values of the current parameters. Optionally, the workload features include: the number of transaction commits, the number of transaction rollbacks, the number of blocks read, the number of blocks hitting the cache, the number of tuples returned, the number of tuples read, the number of tuples inserted, the number of conflicts, the number of tuples updated, the number of tuples deleted, the number of disk reads, the number of disk writes, the number of bytes read from the disk, and the number of bytes written to the disk.
[0089] Figure 8 The structural schematic diagram of the configuration control device for the database provided by the embodiment of the present disclosure is as Figure 8 shown. The configuration control device includes:
[0090] An acquisition unit 801, configured to acquire the workload information and workload type of the database in response to receiving a configuration request for the database.
[0091] A model calling unit 802, configured to repeatedly call the database configuration recommendation model a preset number of times according to the workload information, and obtain multiple candidate configuration information corresponding to the workload information, where the database configuration recommendation model is used to estimate the candidate configuration information of the database that matches the workload information based on the workload information of the database.
[0092] A performance evaluation unit 803, configured to, for each candidate configuration information, call the performance evaluation model according to the workload type, the candidate configuration information, and the workload information, and obtain the performance metric parameters output by the performance evaluation model, where the performance metric parameters are used to evaluate the performance of the database.
[0093] A parameter configuration unit 804, configured to select target configuration information from the multiple candidate configuration information according to the performance metric parameters corresponding to each of the multiple candidate configuration information, and configure the parameters of the database according to the target configuration information.
[0094] According to one or more embodiments of the present disclosure, the workload type includes an online analytical processing type and an online transaction processing type, and the workload information at least includes database execution information; correspondingly, the obtaining unit 801 calls a performance evaluation model according to the workload type, the candidate configuration information, and the workload information, and obtains performance metric parameters output by the performance evaluation model, including: if the workload type includes the online analytical processing type, the performance evaluation model is called according to the workload type, the candidate configuration information, and the database execution information in the workload information, and the online analytical performance parameters output by the performance evaluation model are obtained, where the online analytical performance parameters include one or more of the following: latency duration, data analysis accuracy rate; or, if the workload type includes the online transaction processing type, the performance evaluation model is called according to the workload type, the candidate configuration information, and the database execution information in the workload information, and the online processing performance parameters output by the performance evaluation model are obtained, where the online processing performance parameters include one or more of the following: transactions processed per second, transaction queries per second, database failure rate, database availability parameter.
[0095] According to one or more embodiments of the present disclosure, the parameter configuration unit 804 selects target configuration information from the multiple candidate configuration information according to the performance metric parameters corresponding to each of the multiple candidate configuration information, including: if the performance metric parameter includes the latency duration, the target configuration information with the minimum latency duration is selected from the multiple candidate configuration information according to the latency duration corresponding to each of the multiple candidate configuration information; if the performance metric parameter includes the transactions processed per second, the target configuration information with the maximum transactions processed per second is selected from the multiple candidate configuration information according to the transactions processed per second corresponding to each of the multiple candidate configuration information.
[0096] According to one or more embodiments of the present disclosure, the candidate configuration information output by the database configuration recommendation model includes a configuration value range corresponding to each of multiple database parameters; wherein, the configuration value range of each database parameter is obtained by first normalizing the parameter value range of the database parameter, and then discretizing each parameter value.
[0097] According to one or more embodiments of the present disclosure, the device further includes: a model training unit, configured to obtain the load information of a plurality of first workloads and the load information of a plurality of second workloads, where the first workloads are workloads of the online analytical processing type, and the second workloads are workloads of the online transaction processing type; determine the database configuration control information corresponding to the load information of each first workload, and determine the database configuration control information corresponding to the load information of each second workload; and perform end-to-end linkage training on the initial database configuration recommendation model and the initial performance evaluation model through the load information of each first workload and its corresponding database configuration control information and the load information of each second workload and its corresponding database configuration control information to obtain the database configuration recommendation model and the performance evaluation model.
[0098] According to one or more embodiments of the present disclosure, the model training unit obtaining the load information of a plurality of first workloads and the load information of a plurality of second workloads includes: generating, through a large language model and a first database instance, a plurality of structured query languages corresponding to the first database instance as the first workloads, and obtaining the load information of each first workload; collecting online transactions of various types from a second database instance as the second workloads according to randomly generated proportion weights of each type, and obtaining the load information of each second workload.
[0099] According to one or more embodiments of the present disclosure, the model training unit determining the database configuration control information corresponding to the load information of each first workload includes: for the load information of each first workload, tuning and iterating the configuration parameters of the first database instance through a hyperparameter optimization algorithm, recording the first configuration parameter of each iteration and the performance parameter corresponding to the first configuration parameter of each iteration, and determining, according to the performance parameter corresponding to the first configuration parameter of each iteration, the second configuration parameter corresponding to the highest performance parameter from the first configuration parameters; and determining the first configuration parameter of each iteration, the performance parameter corresponding to the first configuration parameter of each iteration, and the second configuration parameter as the database configuration control information corresponding to the load information of the first workload.
[0100] According to one or more embodiments of the present disclosure, the model training unit performs end-to-end linkage training on the initial database configuration recommendation model and the initial performance evaluation model through the load information of each first workload and its corresponding database configuration control information, and the load information of each second workload and its corresponding database configuration control information, to obtain a database configuration recommendation model and a performance evaluation model, including: training the initial database configuration recommendation model through the load information of multiple first workloads, the second configuration parameters corresponding to the load information of each first workload, the load information of multiple second workloads, and the second configuration parameters corresponding to the load information of each second workload, to obtain the database configuration recommendation model; and training the initial performance evaluation model through the load information of multiple first workloads, the multiple first configuration parameters corresponding to the load information of each first workload and the performance parameters corresponding to each first configuration parameter, the load information of multiple second workloads, the multiple first configuration parameters corresponding to the load information of each second workload and the performance parameters corresponding to each first configuration parameter, to obtain the performance evaluation model.
[0101] Reference Figure 9 , which shows a schematic structural diagram of an electronic device 900 suitable for implementing the embodiments of the present disclosure. The electronic device 900 may be a terminal device or a server. Among them, the terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs for short), tablet computers, portable media players (PMPs for short), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 9 The electronic device shown is only an example and should not impose any limitations on the functions and usage scopes of the embodiments of the present disclosure.
[0102] As Figure 9 shown, the electronic device 900 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 901, which may perform various appropriate actions and processes according to the programs stored in the read-only memory (ROM) 902 or the programs loaded from the storage device 908 into the random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. The input / output (I / O) interface 905 is also connected to the bus 904.
[0103] Typically, the following devices can be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 can allow the electronic device 900 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 9 the electronic device 900 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices can be implemented or had.
[0104] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above functions defined in the method of the embodiment of the present disclosure are performed.
[0105] It should be noted that the above computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0106] The above computer-readable medium can be included in the above electronic device; it can also exist separately and not be assembled into the electronic device.
[0107] The above computer-readable medium carries one or more programs. When the above one or more programs are executed by the electronic device, the electronic device is caused to execute the method shown in the above embodiments.
[0108] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0109] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a portion of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0110] The units involved in the embodiments described in the present disclosure may be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation on the unit itself in some cases. For example, the first acquisition unit may also be described as "the unit for acquiring at least two Internet protocol addresses".
[0111] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system on a chip (SOC), complex programmable logic devices (CPLD), and so on.
[0112] In a first aspect, according to one or more embodiments of the present disclosure, there is provided a method for configuring and controlling a database, including:
[0113] In response to receiving a configuration request for the database, obtaining the workload information and workload type of the database;
[0114] Repeatedly calling a database configuration recommendation model a preset number of times according to the workload information to obtain a plurality of candidate configuration information corresponding to the workload information, wherein the database configuration recommendation model is used to estimate candidate configuration information of the database that matches the workload information based on the workload information of the database;
[0115] For each candidate configuration information, calling a performance evaluation model according to the workload type, the candidate configuration information, and the workload information to obtain performance metric parameters output by the performance evaluation model, wherein the performance metric parameters are used to evaluate the performance of the database;
[0116] Selecting target configuration information from the plurality of candidate configuration information according to the performance metric parameters corresponding to each of the plurality of candidate configuration information, and configuring the parameters of the database according to the target configuration information.
[0117] According to one or more embodiments of the present disclosure, the workload type includes an online analytical processing type and an online transaction processing type, and the workload information includes at least database execution information; correspondingly, the calling a performance evaluation model according to the workload type, the candidate configuration information, and the workload information to obtain the performance metric parameters output by the performance evaluation model includes: if the workload type includes the online analytical processing type, calling the performance evaluation model according to the database execution information in the workload type, the candidate configuration information, and the workload information to obtain the online analytical performance parameters output by the performance evaluation model, where the online analytical performance parameters include one or more of the following: latency duration, data analysis accuracy rate; or, if the workload type includes the online transaction processing type, calling the performance evaluation model according to the database execution information in the workload type, the candidate configuration information, and the workload information to obtain the online processing performance parameters output by the performance evaluation model, where the online processing performance parameters include one or more of the following: transactions processed per second, transaction queries per second, database failure rate, database availability parameter.
[0118] According to one or more embodiments of the present disclosure, selecting a target configuration information from the multiple candidate configuration information according to the performance metric parameters corresponding to each of the multiple candidate configuration information includes: if the performance metric parameter includes a latency duration, selecting the target configuration information with the minimum latency duration from the multiple candidate configuration information according to the latency durations corresponding to each of the multiple candidate configuration information; if the performance metric parameter includes the number of transactions processed per second, selecting the target configuration information with the maximum number of transactions processed per second from the multiple candidate configuration information according to the number of transactions processed per second corresponding to each of the multiple candidate configuration information.
[0119] According to one or more embodiments of the present disclosure, the candidate configuration information output by the database configuration recommendation model includes a configuration value range corresponding to each of multiple database parameters; wherein, the configuration value range of each database parameter is obtained by first normalizing the parameter value range of the database parameter and then discretizing each parameter value.
[0120] According to one or more embodiments of the present disclosure, the method further includes:
[0121] Obtaining the load information of multiple first workloads and the load information of multiple second workloads, where the first workloads are workloads of the online analytical processing type, and the second workloads are workloads of the online transaction processing type;
[0122] Determining the database configuration control information corresponding to the load information of each first workload, and determining the database configuration control information corresponding to the load information of each second workload;
[0123] Performing end-to-end linkage training on the initial database configuration recommendation model and the initial performance evaluation model through the load information of each first workload and its corresponding database configuration control information and the load information of each second workload and its corresponding database configuration control information to obtain the database configuration recommendation model and the performance evaluation model.
[0124] According to one or more embodiments of the present disclosure, the obtaining the load information of multiple first workloads and the load information of multiple second workloads includes: generating multiple structured query languages corresponding to the first database instance as the first workloads through a large language model and the first database instance, and obtaining the load information of each first workload; collecting various types of online transactions as the second workloads from the second database instance according to randomly generated proportion weights of each type and obtaining the load information of each second workload.
[0125] According to one or more embodiments of the present disclosure, determining the database configuration control information corresponding to the load information of each first workload includes: for the load information of each first workload, tuning and iterating the configuration parameters of the first database instance through a hyperparameter optimization algorithm, recording the first configuration parameters of each iteration and the performance parameters corresponding to the first configuration parameters of each iteration, and determining the second configuration parameters corresponding to the highest performance parameter from the first configuration parameters according to the performance parameters corresponding to the first configuration parameters of each iteration; determining the first configuration parameters of each iteration, the performance parameters corresponding to the first configuration parameters of each iteration, and the second configuration parameters as the database configuration control information corresponding to the load information of the first workload.
[0126] According to one or more embodiments of the present disclosure, end-to-end joint training of the initial database configuration recommendation model and the initial performance evaluation model by using the load information of each first workload and its corresponding database configuration control information and the load information of each second workload and its corresponding database configuration control information to obtain the database configuration recommendation model and the performance evaluation model includes: training the initial database configuration recommendation model by using the load information of multiple first workloads, the second configuration parameters corresponding to the load information of each first workload, the load information of multiple second workloads, and the second configuration parameters corresponding to the load information of each second workload to obtain the database configuration recommendation model; and training the initial performance evaluation model by using the load information of multiple first workloads, the multiple first configuration parameters corresponding to the load information of each first workload and the performance parameters corresponding to each first configuration parameter, the load information of multiple second workloads, the multiple first configuration parameters corresponding to the load information of each second workload and the performance parameters corresponding to each first configuration parameter to obtain the performance evaluation model.
[0127] In a second aspect, according to one or more embodiments of the present disclosure, there is provided a database configuration control device, including:
[0128] An acquisition unit, configured to acquire the workload information and workload type of the database in response to receiving a configuration request for the database;
[0129] A model calling unit, configured to repeatedly call the database configuration recommendation model a preset number of times according to the workload information to obtain multiple candidate configuration information corresponding to the workload information, where the database configuration recommendation model is used to estimate candidate configuration information of the database that matches the workload information;
[0130] A performance evaluation unit, configured to, for each candidate configuration information, call a performance evaluation model according to the workload type, the candidate configuration information, and the workload information, and obtain performance metric parameters output by the performance evaluation model, where the performance metric parameters are used to evaluate the performance of the database;
[0131] A parameter configuration unit, configured to select target configuration information from the multiple candidate configuration information according to the performance metric parameters corresponding to the multiple candidate configuration information, and configure the parameters of the database according to the target configuration information.
[0132] According to one or more embodiments of the present disclosure, the workload type includes an online analytical processing type and an online transaction processing type, and the workload information at least includes database execution information; correspondingly, the obtaining unit calls a performance evaluation model according to the workload type, the candidate configuration information, and the workload information, and obtains performance metric parameters output by the performance evaluation model, including: if the workload type includes the online analytical processing type, calling a performance evaluation model according to the database execution information in the workload type, the candidate configuration information, and the workload information, and obtaining online analytical performance parameters output by the performance evaluation model, where the online analytical performance parameters include one or more of the following: latency duration, data analysis accuracy rate; or, if the workload type includes the online transaction processing type, calling a performance evaluation model according to the database execution information in the workload type, the candidate configuration information, and the workload information, and obtaining online processing performance parameters output by the performance evaluation model, where the online processing performance parameters include one or more of the following: transactions processed per second, transaction queries per second, database failure rate, database availability parameter.
[0133] According to one or more embodiments of the present disclosure, the parameter configuration unit selects target configuration information from the multiple candidate configuration information according to the performance metric parameters corresponding to the multiple candidate configuration information, including: if the performance metric parameters include latency duration, selecting, from the multiple candidate configuration information, the target configuration information with the minimum latency duration according to the latency durations corresponding to the multiple candidate configuration information; if the performance metric parameters include transactions processed per second, selecting, from the multiple candidate configuration information, the target configuration information with the maximum transactions processed per second according to the transactions processed per second corresponding to the multiple candidate configuration information.
[0134] According to one or more embodiments of the present disclosure, the candidate configuration information output by the database configuration recommendation model includes a configuration value range corresponding to each of a plurality of database parameters; wherein, the configuration value range of each database parameter is obtained by first normalizing the parameter value range of the database parameter and then discretizing each parameter value.
[0135] According to one or more embodiments of the present disclosure, the device further includes: a model training unit, configured to obtain the load information of a plurality of first workloads and the load information of a plurality of second workloads, wherein the first workloads are workloads of the online analytical processing type, and the second workloads are workloads of the online transaction processing type; determine the database configuration control information corresponding to the load information of each first workload, and determine the database configuration control information corresponding to the load information of each second workload; perform end-to-end joint training on the initial database configuration recommendation model and the initial performance evaluation model through the load information of each first workload and its corresponding database configuration control information and the load information of each second workload and its corresponding database configuration control information to obtain the database configuration recommendation model and the performance evaluation model.
[0136] According to one or more embodiments of the present disclosure, the model training unit obtaining the load information of a plurality of first workloads and the load information of a plurality of second workloads includes: generating, through a large language model and a first database instance, a plurality of structured query languages corresponding to the first database instance as the first workloads, and obtaining the load information of each first workload; collecting online transactions of various types from a second database instance as the second workloads according to randomly generated proportion weights of various types, and obtaining the load information of each second workload.
[0137] According to one or more embodiments of the present disclosure, the model training unit determining the database configuration control information corresponding to the load information of each first workload includes: for the load information of each first workload, tuning and iterating the configuration parameters of the first database instance through a hyperparameter optimization algorithm, recording the first configuration parameter of each iteration and the performance parameter corresponding to the first configuration parameter of each iteration, and determining, according to the performance parameter corresponding to the first configuration parameter of each iteration, the second configuration parameter corresponding to the highest performance parameter from the first configuration parameters; determining the first configuration parameter of each iteration, the performance parameter corresponding to the first configuration parameter of each iteration, and the second configuration parameter as the database configuration control information corresponding to the load information of the first workload.
[0138] According to one or more embodiments of the present disclosure, the model training unit performs end-to-end linkage training on the initial database configuration recommendation model and the initial performance evaluation model through the load information of each first workload and its corresponding database configuration control information, and the load information of each second workload and its corresponding database configuration control information, to obtain a database configuration recommendation model and a performance evaluation model, including: training the initial database configuration recommendation model through the load information of multiple first workloads, the second configuration parameters corresponding to the load information of each first workload, the load information of multiple second workloads, and the second configuration parameters corresponding to the load information of each second workload, to obtain the database configuration recommendation model; and training the initial performance evaluation model through the load information of multiple first workloads, the multiple first configuration parameters corresponding to the load information of each first workload and the performance parameters corresponding to each first configuration parameter, the load information of multiple second workloads, the multiple first configuration parameters corresponding to the load information of each second workload and the performance parameters corresponding to each first configuration parameter, to obtain the performance evaluation model.
[0139] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, including: at least one processor and a memory;
[0140] The memory stores computer-executable instructions;
[0141] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the database configuration control method as described in the first aspect and various possible designs of the first aspect above.
[0142] In a fourth aspect, according to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium, in which computer-executable instructions are stored, and when the processor executes the computer-executable instructions, the database configuration control method as described in the first aspect and various possible designs of the first aspect above is implemented.
[0143] In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided a computer program product, including a computer program, and when the computer program is executed by a processor, the database configuration control method as described in the first aspect and various possible designs of the first aspect above is implemented.
[0144] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
[0145] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although a number of specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0146] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims. < / value2> < / value1>
Claims
1. A database configuration control method, characterized in that: The method comprises: In response to receiving a configuration request for a database, obtaining workload information and a workload type of the database; Repeating calling the database configuration recommendation model according to the workload information for a preset number of times to obtain a plurality of candidate configuration information corresponding to the workload information, wherein the database configuration recommendation model is used to estimate candidate configuration information of the database matching the workload information based on the workload information of the database; For each candidate configuration information, calling a performance evaluation model according to the workload type, the candidate configuration information and the workload information, and obtaining performance indicator parameters output by the performance evaluation model, wherein the performance indicator parameters are used to evaluate the performance of the database; According to the performance indicator parameters corresponding to each of the plurality of candidate configuration information, target configuration information is selected from the plurality of candidate configuration information, and parameters of the database are configured according to the target configuration information.
2. The configuration control method according to claim 1, characterized in that: The workload type includes an online analytical processing type and an online transaction processing type, and the workload information includes at least database execution information; Accordingly, calling a performance evaluation model according to the workload type, the candidate configuration information, and the workload information to obtain performance indicator parameters output by the performance evaluation model includes: If the workload type includes an online analytical processing type, a performance evaluation model is called according to the workload type, the candidate configuration information, and the database execution information in the workload information to obtain online analysis performance parameters output by the performance evaluation model, wherein the online analysis performance parameters include one or more of the following: delay duration, data analysis accuracy; or, If the workload type includes an online transaction processing type, a performance evaluation model is called according to the workload type, the candidate configuration information, and the database execution information in the workload information to obtain online processing performance parameters output by the performance evaluation model, wherein the online processing performance parameters include one or more of the following: transaction processing volume per second, transaction query volume per second, database failure rate, and database availability parameters.
3. The configuration control method according to claim 2, characterized in that: The selecting target configuration information from the plurality of candidate configuration information according to the performance indicator parameters respectively corresponding to the plurality of candidate configuration information comprises: If the performance indicator parameter includes delay duration, selecting target configuration information with the shortest delay duration from the multiple candidate configuration information according to the delay durations corresponding to the multiple candidate configuration information; If the performance indicator parameter includes the transaction volume per second, then according to the transaction volumes per second corresponding to each of the multiple candidate configuration information, target configuration information with the largest transaction volume per second is selected from the multiple candidate configuration information.
4. The configuration control method according to claim 1, characterized in that: The candidate configuration information output by the database configuration recommendation model includes configuration value intervals corresponding to multiple database parameters; The configuration value interval of each database parameter is obtained by first normalizing the parameter value range of the database parameter and then discretizing each parameter value.
5. The configuration control method according to claim 1, characterized in that: The method further comprises: Obtain load information of a plurality of first workloads and load information of a plurality of second workloads, wherein the first workloads are workloads of an online analytical processing type, and the second workloads are workloads of an online transaction processing type; Determine database configuration control information corresponding to the load information of each first workload, and determine database configuration control information corresponding to the load information of each second workload; Through the load information of each first workload and its corresponding database configuration control information and the load information of each second workload and its corresponding database configuration control information, the initial database configuration recommendation model and the initial performance evaluation model are trained end-to-end in linkage to obtain the database configuration recommendation model and the performance evaluation model.
6. The configuration control method according to claim 5, characterized in that: The acquiring load information of the plurality of first workloads and load information of the plurality of second workloads includes: Generate multiple structured query languages corresponding to the first database instance as first workloads through the large language model and the first database instance, and obtain load information of each first workload; Online transactions of various types are collected from the second database instance as second workloads according to randomly generated weights of each type, and load information of each second workload is obtained.
7. The configuration control method according to claim 5, characterized in that: The step of determining the database configuration control information corresponding to the load information of each first workload includes: For each first workload, the configuration parameters of the first database instance are tuned and iterated by a hyperparameter optimization algorithm, the first configuration parameters of each iteration and the performance parameters corresponding to the first configuration parameters of each iteration are recorded, and according to the performance parameters corresponding to the first configuration parameters of each iteration, the second configuration parameters corresponding to the highest performance parameters are determined from the first configuration parameters; The first configuration parameter of each iteration, the performance parameter corresponding to the first configuration parameter of each iteration, and the second configuration parameter are determined as database configuration control information corresponding to the load information of the first workload.
8. The configuration control method according to claim 7, characterized in that: The method of performing end-to-end linkage training on the initial database configuration recommendation model and the initial performance evaluation model through the load information of each first workload and the corresponding database configuration control information and the load information of each second workload and the corresponding database configuration control information to obtain the database configuration recommendation model and the performance evaluation model includes: The initial database configuration recommendation model is trained by using load information of multiple first workloads, a second configuration parameter corresponding to the load information of each first workload, load information of multiple second workloads, and a second configuration parameter corresponding to the load information of each second workload to obtain the database configuration recommendation model; Furthermore, the initial performance evaluation model is trained using load information of multiple first workloads, multiple first configuration parameters corresponding to the load information of each first workload and performance parameters corresponding to each first configuration parameter, load information of multiple second workloads, multiple first configuration parameters corresponding to the load information of each second workload and performance parameters corresponding to each first configuration parameter to obtain the performance evaluation model.
9. A database configuration control device, characterized in that: The device comprises: An acquisition unit, configured to acquire workload information and workload type of the database in response to receiving a configuration request of the database; A model calling unit, configured to repeatedly call a database configuration recommendation model according to the workload information for a preset number of times to obtain a plurality of candidate configuration information corresponding to the workload information, wherein the database configuration recommendation model is used to estimate candidate configuration information of a database matching the workload information based on the workload information of the database; A performance evaluation unit, configured to call a performance evaluation model for each candidate configuration information according to the workload type, the candidate configuration information, and the workload information, and obtain performance indicator parameters output by the performance evaluation model, wherein the performance indicator parameters are used to evaluate the performance of the database; A parameter configuration unit is used to select target configuration information from the multiple candidate configuration information according to the performance indicator parameters corresponding to each of the multiple candidate configuration information, and configure the parameters of the database according to the target configuration information.
10. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the database configuration control method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the database configuration control method according to any one of claims 1 to 8 is implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the configuration control method of the database according to any one of claims 1 to 8 is implemented.