Database parameter optimization method and device, computer equipment and readable storage medium

By determining the database type and setting parameter priority, and optimizing high-priority parameters with reinforcement learning training, the problems of low efficiency and poor stability of existing database parameters are solved, and efficient and stable database performance improvement is achieved.

CN120277053APending Publication Date: 2025-07-08CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510380506.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

The existing database parameter optimization methods, especially manual tuning and automatic tuning algorithms, cannot effectively meet the efficient, universal and stable parameter optimization needs, resulting in low efficiency and poor stability in database performance improvement.

Method used

By determining the target database type of the database to be optimized, setting parameter priority based on the type, and optimizing high-priority parameters using reinforcement learning training, gradually optimizing database parameters, including CPU, IO, memory and log parameters, etc.

Benefits of technology

It improves the efficiency and stability of database optimization, can quickly improve system response speed and transaction processing throughput, reduce resource waste, and reduce the risk of system instability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120277053A_ABST
    Figure CN120277053A_ABST
Patent Text Reader

Abstract

The invention relates to a database parameter optimization method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: determining a target database type to which a to-be-optimized database belongs; determining the priority of each to-be-optimized parameter based on the target database type; and according to the priority of each to-be-optimized parameter, executing optimization processing of each to-be-optimized parameter to obtain a parameter optimization result of the to-be-optimized database. By adopting the method, the database optimization effect and the database optimization efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database technology, and in particular, to a database parameter optimization method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Art

[0002] In today's digital age, databases are widely used in all walks of life, such as financial transactions, e-commerce operations, medical record management, scientific research data storage, etc. With the increasing diversification and complexity of business requirements, the number of adjustable parameters involved in database systems is constantly increasing.

[0003] Reasonably setting these parameters plays a crucial role in improving the operating efficiency of database systems and meeting the performance requirements of different business scenarios. Summary of the Invention

[0004] Based on this, it is necessary to provide a database parameter optimization method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the parameter optimization efficiency and the performance stability of the database for the above technical problems.

[0005] In a first aspect, this application provides a database parameter optimization method, and the method includes:

[0006] Determine the target database type to which the database to be optimized belongs;

[0007] Based on the target database type, determine the priority of each parameter to be optimized;

[0008] According to the priority of each parameter to be optimized, perform the optimization process of each parameter to be optimized to obtain the parameter optimization result of the database to be optimized.

[0009] In one embodiment, the determining the target database type to which the database to be optimized belongs includes:

[0010] Obtain the historical operation data of the database to be optimized;

[0011] Based on the historical operation data and the standard vectors corresponding to each database type, determine the distance of the database to be optimized relative to each database type;

[0012] According to the distance of the database to be optimized relative to each database type, determine the target database type to which the database to be optimized belongs from each database type.

[0013] In one embodiment, the performing the optimization process of each parameter to be optimized according to the priority of each parameter to be optimized to obtain the parameter optimization result of the database to be optimized includes:

[0014] Use the parameter corresponding to the target priority as the target parameter, and perform reinforcement learning training on the target parameter to obtain an optimized parameter value. The target priority is the highest priority among the priorities without optimization processing;

[0015] After completing the optimization processing of the target parameter, re-determine the target priority, and repeat the step of using the parameter corresponding to the target priority as the target parameter and performing reinforcement learning training on the target parameter until all the parameters to be optimized have completed the optimization processing.

[0016] In one embodiment, the performing reinforcement learning training on the target parameter to obtain an optimized parameter value includes:

[0017] For the i-th round of reinforcement learning training for the target parameter, when the i-th round does not reach the training upper limit threshold, perform performance verification on the parameter value output in the i-th round. When the performance verification passes, use the parameter value output in the i-th round as the optimized parameter value, where i is an integer greater than 0;

[0018] Or, when the i-th round reaches the training upper limit threshold, determine the optimized parameter value of the target parameter from the parameter values output in all rounds.

[0019] In one embodiment, the performing the optimization processing of each parameter to be optimized according to the priority of each parameter to be optimized to obtain the parameter optimization result of the database to be optimized includes:

[0020] Obtain a preset priority condition;

[0021] Determine the target priority based on the preset priority condition;

[0022] Call the parameter optimization model corresponding to the target priority, and perform optimization processing on the parameter to be optimized corresponding to the target priority to obtain the parameter optimization result of the database to be optimized.

[0023] In one embodiment, the determining the distance of the database to be optimized relative to each database type based on the historical operation data and the standard vector corresponding to each database type includes:

[0024] Determine the historical operation data in each time interval;

[0025] For any time interval, obtain the vectorized representation of the historical operation data in the time interval, and determine the sub-distance corresponding to the time interval based on the vectorized representation and the standard vector corresponding to each database type;

[0026] Determine the distance of the database to be optimized relative to each of the database types according to the sub - distances and weights corresponding to each time interval.

[0027] In a second aspect, the present application also provides a database parameter optimization device, and the device includes:

[0028] A first determination module, configured to determine the target database type to which the database to be optimized belongs;

[0029] A second determination module, configured to determine the priority of each parameter to be optimized based on the target database type;

[0030] An optimization module, configured to perform optimization processing on each parameter to be optimized according to the priority of each parameter to be optimized, and obtain a parameter optimization result of the database to be optimized.

[0031] In one embodiment, the first determination module is specifically configured to:

[0032] Obtain historical operation data of the database to be optimized;

[0033] Based on the historical operation data and the standard vectors corresponding to each database type, determine the distance of the database to be optimized relative to each of the database types;

[0034] According to the distance of the database to be optimized relative to each of the database types, determine the target database type to which the database to be optimized belongs from each of the database types.

[0035] In one embodiment, the optimization module is specifically configured to:

[0036] Use the parameter corresponding to the target priority as the target parameter, and perform reinforcement learning training on the target parameter to obtain an optimized parameter value, where the target priority is the highest priority among the priorities for which optimization processing has not been performed;

[0037] After completing the optimization processing of the target parameter, re - determine the target priority, and repeat the step of using the parameter corresponding to the target priority as the target parameter and performing reinforcement learning training on the target parameter until all the parameters to be optimized have completed the optimization processing.

[0038] In one embodiment, the performing reinforcement learning training on the target parameter to obtain an optimized parameter value includes:

[0039] In the i-th round of reinforcement learning training for the target parameter, when the training upper limit threshold is not reached in the i-th round, the performance of the parameter value output in the i-th round is verified. When the performance verification passes, the parameter value output in the i-th round is used as the optimized parameter value, where i is an integer greater than 0;

[0040] Alternatively, when the training upper limit threshold is reached in the i-th round, the optimized parameter value of the target parameter is determined from the parameter values output in all rounds.

[0041] In one embodiment, the optimization module is specifically configured to:

[0042] Obtain a preset priority condition;

[0043] Determine a target priority based on the preset priority condition;

[0044] Call the parameter optimization model corresponding to the target priority to perform optimization processing on the parameter to be optimized corresponding to the target priority, and obtain the parameter optimization result of the database to be optimized.

[0045] In one embodiment, the determining the distance of the database to be optimized relative to each database type based on the historical operation data and the standard vectors corresponding to each database type includes:

[0046] Determine the historical operation data in each time interval;

[0047] For any time interval, obtain the vectorized representation of the historical operation data in the time interval, and determine the sub-distance corresponding to the time interval based on the vectorized representation and the standard vectors corresponding to each database type;

[0048] Determine the distance of the database to be optimized relative to each database type according to the sub-distances corresponding to each time interval and the weights.

[0049] In a third aspect, the present application further provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, it implements the database parameter optimization method according to any one of the above.

[0050] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the database parameter optimization method according to any one of the above.

[0051] In a fifth aspect, the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the database parameter optimization method according to any one of the above.

[0052] The above database parameter optimization method, device, computer device, computer-readable storage medium, and computer program product can determine the target database type to which the database to be optimized belongs, and determine the priority of each parameter to be optimized based on the target database type. Furthermore, the optimization process of each parameter to be optimized can be executed according to the priority of each parameter to be optimized, and the parameter optimization result of the database to be optimized can be obtained. By using the database parameter optimization method provided in the embodiments of the present application, parameter optimization can be performed on different types of databases specifically, including determining the priority of each parameter to be optimized based on the type of the database, and then performing parameter optimization according to the priority of the parameter to be optimized, which not only improves the parameter optimization efficiency but also reduces the resource occupation during optimization. The following remarkable effects can be achieved:

[0053] (1) It can first ensure that the parameters with the greatest impact on system performance are optimized, significantly improving the overall performance, directly solving the bottleneck problem of transaction waiting for connection resources under high concurrency, and quickly improving the system response speed and transaction processing throughput. (2) By processing high-priority parameters first, it is possible to avoid wasting too much time and computing resources on optimizing non-critical parameters, which can significantly improve resource utilization. For example, if the transaction log write frequency is adjusted first, it has little effect on immediate performance improvement, while optimizing the connection pool size first can utilize resources more effectively and improve the optimization efficiency. (3) Optimizing according to the priority can be carried out step by step. After each high-priority parameter optimization is completed, the impact on the system can be evaluated in a timely manner. If the optimization effect of the high-priority parameter is not good, the strategy can be adjusted in a timely manner, rather than being difficult to determine the root cause of the problem after multiple parameters are optimized simultaneously, reducing the risk of system instability caused by improper parameter adjustment. Description of the Drawings

[0054] To more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for the description in the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0055] Figure 1 It is a schematic flowchart of the database parameter optimization method in an embodiment;

[0056] Figure 2 It is a schematic flowchart of step 102 in an embodiment;

[0057] Figure 3 It is a schematic flowchart of step 204 in an embodiment;

[0058] Figure 4 It is a schematic flowchart of step 106 in an embodiment;

[0059] Figure 5 It is a schematic flowchart of step 106 in another embodiment;

[0060] Figure 6 It is a schematic diagram of a database parameter optimization method in one embodiment;

[0061] Figure 7 It is a schematic diagram of a database parameter optimization method in one embodiment;

[0062] Figure 8 It is a structural block diagram of a database parameter optimization device in one embodiment;

[0063] Figure 9 It is an internal structure diagram of a computer device in one embodiment. Detailed implementation manners

[0064] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0065] In the related art, the tuning of database parameters mainly depends on database administrators to complete it with their rich experience. However, this manual tuning method has significant limitations. On the one hand, the manual tuning efficiency is extremely low. Database administrators need to conduct detailed parameter analysis and adjustment for each database instance, which is a time-consuming and energy-consuming process. On the other hand, due to the uneven experience levels of different database administrators and the significant differences in the optimal parameter configurations of databases under different business scenarios, the manual tuning method is not universal and it is difficult to ensure the optimal configuration of database performance in all cases.

[0066] To solve the dilemma of manual tuning, some automatic parameter optimization algorithms have emerged, among which there are tuning algorithms based on deep learning. Although these algorithms attempt to achieve the automation of parameter optimization to a certain extent, they also expose many problems. The tuning process of these algorithms is extremely complex and requires a large amount of computing resources and time costs. At the same time, due to the large number of database parameters, when tuning and learning such a large number of parameters simultaneously, the stability of the results obtained by the deep learning algorithm cannot be effectively guaranteed, and it is difficult to provide a reliable and stable database parameter optimization solution in practical applications.

[0067] In summary, neither the existing database parameter optimization methods, whether manual tuning or the existing automatic tuning algorithms, can well meet the requirements for efficient, universal and stable parameter optimization in the current database application scenarios. There is an urgent need for a new database parameter optimization method to solve these problems.

[0068] An embodiment of the present application provides a database parameter optimization method, which can set the priority of parameters to be optimized according to the type of the database, so as to optimize the parameters to be optimized according to the priority. This can not only improve the efficiency of database optimization, but also gradually optimize the parameters of the database, effectively improving the stability of optimization, that is, improving the stability of database performance.

[0069] In one embodiment, as Figure 1 shown, a database parameter optimization method is provided. In this embodiment, taking the application of this method to a terminal as an example, it can be understood that this method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0070] Step 102, determine the target database type to which the database to be optimized belongs.

[0071] In the embodiment of the present application, the databases can be classified in advance. Exemplarily, the databases can be classified into web application types, OLTP (On-Line Transaction Processing) types, data warehouse types, and OLTP hybrid data warehouse types. Before optimizing the parameters of the database to be optimized, the target database type to which the database to be optimized belongs can be determined in advance.

[0072] Exemplarily, assume that there is an enterprise-level application system, which contains databases relied on by multiple different functional modules. For example, there is a database for storing online transaction records, a database for user information management, and a database for commodity inventory management. For these databases to be optimized, it is first necessary to determine the target database type to which they belong.

[0073] In one example, classification can be performed by analyzing factors such as the functional characteristics of the database, the data types stored, and the application scenarios. For example, for the database for storing online transaction records, since it needs to process high-concurrency transaction data writing and frequent query operations, and has high requirements for data real-time and consistency, it can be classified as a transaction processing database (OLTP). For the user information management database, although there are also certain read and write operations, the data update frequency is relatively low, and it focuses more on data query and management, so it can be classified as a data management database. The commodity inventory management database may involve some complex inventory calculation logics in addition to regular inventory data reading and writing, and can be classified as a database with complex business logics.

[0074] Step 104, determine the priority of each parameter to be optimized based on the target database type.

[0075] In the embodiments of the present application, the parameters to be optimized may include CPU (Central Processing Unit) parameters, IO (Input / Output) parameters, memory parameters, log parameters, etc. Different priorities can be set for the parameters to be optimized according to different database types.

[0076] For example: For OLTP databases, the key to the performance of this type of database lies in being able to quickly process a large number of concurrent transactions. Therefore, both IO and CPU efficiency need to be focused on. Therefore, the priorities of some key CPU parameters and key IO parameters can be set relatively high, and the priorities of the remaining non-critical CPU parameters, IO parameters, and memory parameters, log parameters can be set relatively low. For web application databases, this type of database mainly focuses on simple queries and pays more attention to CPU efficiency. Therefore, a relatively high priority can be set for CPU parameters, and relatively low priorities can be set for IO parameters, memory parameters, log parameters, etc. For data warehouse databases, this type of database has the characteristics of complex queries, large amounts of data, and easy generation of slow SQL. Therefore, relatively high priorities can be set for log parameters, key IO parameters, and key memory parameters, and relatively low priorities can be set for non-critical IO parameters, non-critical memory parameters, and CPU parameters.

[0077] In one example, taking the parameters to be optimized for an OLTP database including the database connection pool size, cache hit rate, and transaction log write frequency as an example. Based on the characteristics of this database type, parameter priorities can be set, including: The database connection pool size is crucial for high-concurrency transaction processing. If the connection pool is too small, it will cause a large number of transactions to wait for connection resources, seriously affecting the system response speed. Therefore, the database connection pool size parameter is set to a high priority. The cache hit rate directly affects the data reading speed. A higher cache hit rate can reduce disk I / O operations and improve system performance. Therefore, it is set to a medium priority. Although the transaction log write frequency also affects system performance, relatively speaking, its immediate impact on high-concurrency transaction processing is relatively small and can be set to a low priority.

[0078] After determining the priority of the target database, the priority of the parameters to be optimized can be determined based on the target database type. For example: If the target database type is OLTP, the database connection pool size parameter can be determined to be of high priority, the cache hit rate parameter to be of medium priority, and the transaction log write frequency to be of low priority.

[0079] Step 106: Execute the optimization process of each parameter to be optimized according to the priority of each parameter to be optimized, and obtain the parameter optimization result of the database to be optimized.

[0080] In the embodiments of the present application, after determining the priorities of the parameters to be optimized, the parameter optimization process can be sequentially performed on each parameter to be optimized in descending order of priority, or only the parameters to be optimized with high priorities can be processed for parameter optimization, so as to obtain the parameter optimization result of the database to be optimized.

[0081] By using the database parameter optimization method provided by the embodiments of the present application, parameter optimization can be specifically performed on different types of databases, including determining the priorities of the parameters to be optimized based on the type of the database, and then performing parameter optimization according to the priorities of the parameters to be optimized, which not only improves the parameter optimization efficiency but also reduces the resource occupation during optimization. The following remarkable effects can be achieved:

[0082] (1) It can first ensure that the parameters with the greatest impact on system performance are optimized, significantly improving the overall performance, directly solving the bottleneck problem of transaction waiting for connection resources under high concurrency, and quickly increasing the system response speed and transaction processing throughput. (2) By first processing the parameters with high priorities, it is possible to avoid wasting too much time and computing resources on optimizing non-critical parameters, which can significantly improve the resource utilization rate. For example, if the transaction log write frequency is adjusted first, it has little effect on the immediate performance improvement, while optimizing the connection pool size first can make more effective use of resources and improve the optimization efficiency. (3) Optimizing according to the priorities can be carried out step by step. After each high-priority parameter optimization is completed, the impact on the system can be evaluated in a timely manner. If the optimization effect of the high-priority parameter is not good, the strategy can be adjusted in a timely manner, rather than being difficult to determine the root cause of the problem after multiple parameters are optimized simultaneously, reducing the risk of system instability caused by improper parameter adjustment.

[0083] In an exemplary embodiment, referring to Figure 2 as shown, in step 102, determining the target database type to which the database to be optimized belongs may include the following steps 202 to 206, where:

[0084] Step 202, obtaining the historical operation data of the database to be optimized;

[0085] Step 204, based on the historical operation data and the standard vectors corresponding to each database type, determining the distances of the database to be optimized relative to each database type;

[0086] Step 206, according to the distances of the database to be optimized relative to each database type, determining the target database type to which the database to be optimized belongs from each database type.

[0087] In the embodiments of the present application, the historical operation data may include database TPS (Transactions Per Second, the number of transaction processes transmitted per second), QPS (Queries-per-second, the query rate per second), connection resource occupancy rate, CPU usage rate, memory usage rate, disk I / O, data throughput, DQL (Data Query Language) / DML (Data Manipulation Language) ratio, number of connections, average idle time of idle connections, etc. The database to be optimized may record various historical operation data during use.

[0088] For each database type, a corresponding standard vector for each database type may be preset, including setting corresponding standard vectors for each historical operation data. Among them, for any database type, the standard vector corresponding to this database type may be obtained through statistical analysis of a large amount of operation data of this database type.

[0089] The historical operation data of the database to be optimized can be obtained, and based on the historical operation data and the standard vectors of each database type, the distance of the database to be optimized relative to each database type can be determined.

[0090] In an exemplary embodiment, referring to Figure 3 As shown, in step 204, based on the historical operation data and the standard vectors corresponding to each database type, determining the distance of the database to be optimized relative to each database type may include the following steps 302 to 306, where:

[0091] Step 302, determining the historical operation data within each time interval;

[0092] Step 304, for any time interval, obtaining the vectorized representation of the historical operation data within the time interval, and based on the vectorized representation and the standard vectors corresponding to each database type, determining the sub-distance corresponding to the time interval;

[0093] Step 306, according to the sub-distances corresponding to each time interval and the weights, determining the distance of the database to be optimized relative to each database type.

[0094] In the embodiments of the present application, at least one time interval may be preset, for example: within one week, within two weeks, within one month, etc. In the embodiments of the present application, the number and manner of setting the time interval are not specifically limited. For each time interval, the weight of each time interval may be preset, for example: the weight of the time interval closer to the current time may be set relatively larger.

[0095] For any time interval, the historical operation data corresponding to the time interval can be obtained from the historical operation data of the database to be optimized (hereinafter referred to as the interval historical operation data for clear description). After obtaining the interval historical operation data, the vectorized representation of each data item in the interval historical operation data can be obtained, and the sub-distance corresponding to the time interval can be calculated based on the vectorized representation of each data item and the standard vector corresponding to each database type.

[0096] Exemplarily, the vectorized representations of each data item can be unified into a parameter vector, for example, unified into an N×1 matrix vector, where N is the number of data items included in the historical operation data. For example, when the historical operation data includes database TPS, QPS, connection resource occupancy rate, CPU usage rate, memory usage rate, disk I / O, data throughput, DQL / DML ratio, number of connections, and average idle time of idle connections, N is 10. Similarly, after unifying the standard vectors corresponding to the database types into a parameter vector in the same order, the Euclidean distance between the two parameter vectors can be calculated as the sub-distance corresponding to the time interval. Alternatively, the Euclidean distance between the vectorized representation of each data item and the standard vector of the item parameter can be calculated respectively, and then the sub-distance corresponding to the time interval can be determined based on the Euclidean distances calculated for each item. For example, weights corresponding to each data parameter are set in advance based on the database type, and then the sub-distances corresponding to each data item are weighted and summed to obtain the sub-distance corresponding to the time interval.

[0097] After obtaining the sub-distances corresponding to each time interval, the sub-distances corresponding to each time interval can be weighted and summed based on the weights of each time interval, and then the distance of the database to be optimized relative to the current database type can be obtained. By analogy, the distances of the database to be optimized relative to each database type can be obtained.

[0098] Exemplarily, the historical operation data can be quantified into standard parameters, and then these standard parameters can be unified into an operation parameter vector as eigenvalue. Then, the Euclidean distances between the vector values statistically calculated for three time spans of within one week (weight 0.5), within two weeks (weight 0.3), and within one month (weight 0.2) and the standard vector of the database type are calculated. Assuming the Euclidean distances calculated for a single time interval are D1, D2, and D3 respectively, the final distance = 0.5*D1 + 0.3*D2 + 0.2*D3 can be determined.

[0099] After calculating the distances of the database to be optimized relative to each database type, the database type with the minimum distance can be used as the target database type of the database to be optimized.

[0100] In an exemplary embodiment, refer to Figure 4As shown, in step 106, according to the priorities of the parameters to be optimized, the optimization processing of each parameter to be optimized is performed to obtain the parameter optimization result of the database to be optimized, which may include steps 402 to 404, where:

[0101] Step 402: Take the parameter corresponding to the target priority as the target parameter, and perform reinforcement learning training on the target parameter to obtain the optimized parameter value. The target priority is the highest priority among the priorities for which the optimization processing has not been performed.

[0102] Step 404: After completing the optimization processing of the target parameter, re-determine the target priority, and repeat the step of taking the parameter corresponding to the target priority as the target parameter and performing reinforcement learning training on the target parameter until all the parameters to be optimized have completed the optimization processing.

[0103] In the embodiments of the present application, after the priorities of the parameters to be optimized are determined, the parameter optimization of the parameters to be optimized corresponding to each priority can be performed in order from high to low. For example: if the parameters to be optimized are divided into high priority, medium priority, and low priority, the parameter optimization of the parameters to be optimized corresponding to the high priority is preferentially performed; after completing the parameter optimization of the parameters to be optimized with high priority, the parameter optimization of the parameters to be optimized corresponding to the medium priority is performed; after completing the parameter optimization of the parameters to be optimized with medium priority, the parameter optimization of the parameters to be optimized corresponding to the low priority is performed.

[0104] In an example, the target priority is the highest priority among the priorities for which the optimization processing has not been performed. Taking the parameter to be optimized corresponding to the highest priority as the size of the database connection pool as an example, that is, the target parameter is the size of the database connection pool. First, a reinforcement learning environment can be constructed. The environmental state can be defined as the current running state of the database to be optimized, including indicators such as the current concurrent connection number, average response time, throughput, etc. The action space is the adjustable range of the size of the database connection pool, for example, from 100 to 500, with an adjustment amplitude of 50 each time. The reward function is designed such that when the connection pool size is adjusted, if the system average response time is shortened and the throughput is increased, a positive reward is given, otherwise a negative reward is given.

[0105] Use a reinforcement learning algorithm (such as the Q-Learning algorithm) for training. Initially, the agent randomly selects an action in the environment (that is, tries a value of the connection pool size), observes the change in the environmental state, and obtains the corresponding reward. By continuously interacting with the environment, the agent gradually learns which action to choose in different states to obtain the maximum reward. After multiple rounds of training, the agent determines a value of the database connection pool size that can optimize the system performance, and completes the optimization processing of the target parameter of the database connection pool size.

[0106] After completing the optimization of the database connection pool size, the medium priority is re-determined as the target priority. At this time, the parameters related to the cache hit rate corresponding to the medium priority (such as cache replacement policy, cache capacity allocation, etc.) become the new target parameters.

[0107] Reconstruct the reinforcement learning environment again. The environmental state is updated to the database running state after optimizing the database connection pool size, including the new average response time, throughput, etc. The action space is the adjustable range of the parameters related to the cache hit rate. For example, the cache replacement policy can be selected from common policies such as FIFO (First In First Out), LRU (Least Recently Used), etc., and the cache capacity allocation can be adjusted within a certain proportion range. Redesign the reward function. For example, when adjusting the cache-related parameters, if the cache hit rate increases and has a positive impact on the overall system performance (such as further shortening of the average response time or further increase in throughput), a positive reward is given.

[0108] Repeat the reinforcement learning training process. The agent learns the optimal parameter configuration by continuously trying different actions (adjusting the cache-related parameters) to complete the optimization of the parameters related to the cache hit rate.

[0109] In this way, after each completion of the optimization of the target parameters corresponding to a priority, re-determine the target priority, select new target parameters for reinforcement learning training until all the parameters to be optimized, such as the transaction log writing frequency, query cache size, etc., are all optimized. Finally, a set of comprehensively optimized database parameter values are obtained, significantly improving the overall performance of the database.

[0110] In an exemplary embodiment, in step 402, performing reinforcement learning training on the target parameters to obtain the optimized parameter values may include the following steps:

[0111] For the i-th round of reinforcement learning training for the target parameters, when the i-th round does not reach the training upper limit threshold, perform performance verification on the parameter values output in the i-th round. When the performance verification passes, use the parameter values output in the i-th round as the optimized parameter values, where i is an integer greater than 0;

[0112] Alternatively, when the i-th round reaches the training upper limit threshold, determine the optimized parameter values of the target parameters from the parameter values output in all rounds.

[0113] In the embodiments of the present application, during the process of reinforcement learning training for target parameters, after obtaining the output parameter value in any round, if the training upper limit threshold has not been reached yet, the performance of this parameter value can be verified. If the performance verification passes, the parameter value is determined as the optimized parameter value of the target parameter, and a new target priority and target parameter are re-determined, and parameter optimization is performed on the new target parameter.

[0114] Continuing with the above example, the database connection pool size is selected as the target parameter to carry out reinforcement learning training. A training upper limit threshold is preset, for example, set to 100 rounds. A reinforcement learning environment is constructed, and the environmental state includes database operation metrics such as the current number of concurrent connections, average response time, throughput, etc.; the action space is set such that the database connection pool size ranges from 100 to 500, with an adjustment amplitude of 50 each time; the reward function is that when the connection pool size is adjusted, if the system average response time is shortened and the throughput is increased, a positive reward is given, otherwise a negative reward is given.

[0115] Suppose the current is the 10th round of training. The agent selects an action in the environment according to the reinforcement learning algorithm (such as the Q-Learning algorithm), that is, tries a value of the database connection pool size, assumed to be 250. The environment makes a feedback according to this action, the state changes, and the agent obtains the corresponding reward. At this time, the performance of the connection pool size value 250 output in the 10th round is verified.

[0116] Exemplarily, during the performance verification process, a database performance testing tool can be used to simulate concurrent requests in an actual business scenario and monitor performance metrics such as the average response time and throughput of the database when the connection pool size is 250. If compared with the original parameters of the database to be optimized before parameter optimization, the average response time is shortened and the throughput is increased, and both the reduction amplitude of the average response time and the increase amplitude of the throughput reach the preset requirements, it can be determined that the performance verification passes. Then, the parameter value 250 output in the 10th round is used as the optimized database connection pool size value, and at the same time, the parameter optimization process for the target parameter of the database connection pool size is ended. If the performance verification passes, for example, the average response time becomes longer or the throughput decreases, the 11th round of training is started. The agent tries a new value of the database connection pool size according to the reinforcement learning algorithm and the feedback of the previous round, and continues to explore a better parameter configuration.

[0117] If the training continues, the training limit threshold is reached at the 100th round, and the parameter values output in each round do not pass the performance verification. During these 100 rounds of training, the agent tried different values for the database connection pool size, and in each round, the output parameter values and the corresponding environmental state changes and rewards were recorded. Determine the optimized parameter values of the target parameter from the parameter values output in all 100 rounds. A common method is to select the parameter values output in the round with the highest cumulative reward as the optimized parameter values. For example, after statistics, it is found that in the 75th round, when the connection pool size is 350, the agent obtains the highest cumulative reward, and at this time, the performance indicators such as the average response time and throughput of the database perform best overall. Then, 350 is used as the optimized parameter value of the target parameter, which is the database connection pool size.

[0118] After completing the optimization determination of the target parameter, which is the database connection pool size, select the next target parameter according to the established priority order, such as the parameters related to the cache hit rate, and repeat the above process of reinforcement learning training, performance verification, and determining the final optimized value until all the parameters to be optimized are completed, so as to achieve the comprehensive optimization of the parameters of the entire database system and improve the overall performance of the database.

[0119] In an exemplary embodiment, refer to Figure 5 As shown, in step 106, according to the priority of each parameter to be optimized, perform the optimization process of each parameter to be optimized to obtain the parameter optimization result of the database to be optimized, including the following steps 502 to step 506, where:

[0120] Step 502, obtain the preset priority condition;

[0121] Step 504, determine the target priority based on the preset priority condition;

[0122] Step 506, call the parameter optimization model corresponding to the target priority to perform the optimization process on the parameter to be optimized corresponding to the target priority to obtain the parameter optimization result of the database to be optimized.

[0123] In the embodiment of the present application, the preset priority condition can be a condition preset for determining the target priority. For example, the preset priority condition can be set to optimize the parameters with high priority. Then, the high priority can be used as the target priority, and the parameters corresponding to the target priority are optimized to obtain the parameter optimization result of the database to be optimized.

[0124] In the process of optimizing the parameters corresponding to each target priority, a parameter optimization model corresponding to each target priority can be called to perform parameter optimization. The parameter optimization model is a model that is pre-trained for the parameters to be optimized corresponding to the target priority of the target database type and is used to optimize the database parameters of this part of the parameters to be optimized.

[0125] Exemplarily, still taking the database to be optimized of the OLTP type as an example, the size of the database connection pool of the database to be optimized corresponds to a high priority. If only the parameters with high priority are optimized, the parameter optimization model corresponding to the size of the database connection pool can be directly called to perform parameter optimization.

[0126] By using the database parameter optimization method provided by the embodiments of the present application, lightweight parameter optimization models can be pre-trained for each optimization level of each database type. In the process of database parameter optimization, the embodiments of the present application first set priorities for the parameters based on the database type, and only optimize the parameters with the specified priority. For example, only optimizing the parameters with high priority can have the following beneficial effects:

[0127] (1) The parameter optimization model only needs to focus on the optimization logic of the key parameter, without considering many other non-key parameters, greatly reducing the variables and relationships that the algorithm needs to process and reducing the algorithm complexity.

[0128] (2) The embodiments of the present application can only optimize some parameters with relatively high priorities, and can concentrate resources to quickly solve key performance problems. For example, in a financial trading platform, when the number of concurrent trading requests and response time trigger the priority conditions, quickly optimize the size of the database connection pool, avoiding wasting time on non-key parameters, making the optimization process more targeted and efficient, and significantly improving the system performance in a short time.

[0129] (3) The embodiments of the present application only optimize a few parameters with relatively high priorities, reducing the interference between parameters. For example, when optimizing the size of the database connection pool of a financial trading platform, the model only needs to consider the running data and performance indicators related to the connection pool, reducing uncertainty and making the optimization result more stable and reliable, effectively guaranteeing the stable operation of scenarios with extremely high requirements for stability such as high-frequency trading services.

[0130] To enable those skilled in the art to better understand the embodiments of the present application, the following uses examples to illustrate the embodiments of the present application. The database parameter optimization method provided by the embodiments of the present application is generally divided into two steps:

[0131] 1. When the monitoring and acquisition program detects that the database performance encounters a bottleneck (such as triggering a performance warning) or the user puts forward a performance optimization requirement, it triggers the optimization device to perform optimization. Then, the optimization device classifies the database according to historical monitoring data and outputs parameter optimization tasks with high and low priorities.

[0132] 2. The reinforcement learning module performs reinforcement learning training according to the results of step 1 in the order of high and low priorities. The learning and training tasks under each priority will be set according to the parameter values and performance performance of the current database. After completing the training of the current priority, the result verification module verifies the results. If the preset optimization goal is not reached, the training will continue until the goal is reached or the maximum number of training times is reached. Finally, the best optimization parameters in the learning process are output, as shown in Figure 6 shown.

[0133] In this application, by first analyzing the historical data of the database to be tuned, classifying it, defining different parameter levels for different types of databases, and performing reinforcement learning training on each level, the optimized parameters are finally obtained. Compared with the deep learning optimization algorithm for all parameters, the embodiments of this application specifically optimize the parameters of different types of databases, which not only improves the parameter optimization efficiency but also reduces the resource occupation during optimization.

[0134] In the specific implementation process, the embodiments of this application can pre-divide the database into simple types, namely web application type, OLTP type, data warehouse type, and OLTP hybrid data warehouse type. Before parameter optimization, the classification algorithm is used to assign the instance to the corresponding type based on historical operation data and then the parameters are optimized. Different types of databases will sort the parameters with different priorities and optimize different parameters at different levels. On the one hand, it reduces the impact on the database caused by each optimization operation, and on the other hand, it can also improve the efficiency of parameter optimization. Then, the reinforcement learning training is carried out step by step according to the priority. After each level completes a round of learning, it is tested whether the performance improvement of the database reaches the expectation or whether the number of training times has reached the upper limit. If the expectation is reached or the number of times reaches the upper limit, the optimization parameters of this level are output and optimized in the order from high to low, and finally the overall optimization parameters are obtained.

[0135] Among them, the operation data includes database TPS, QPS, connection resource occupancy rate, CPU usage rate, memory usage rate, disk I / O, data throughput, DQL / DML ratio, number of connections, average idle time of idle connections, etc.

[0136] The classification method is as follows: Quantify the running data into standard parameters, then unify these parameters as a running parameter vector with the eigenvalues, and then calculate the Euclidean distances between the vector values statistically calculated over three time spans of within one week (weight 0.5), within two weeks (weight 0.3), and within one month (weight 0.2) and the classification criteria, assumed to be D1, D2, and D3. The final distance = 0.5 * D1 + 0.3 * D2 + 0.2 * D3. The classification with the minimum final distance is the classification where the database is located.

[0137] The grading method is as follows: For web application databases, simple queries are the main focus, and more attention is paid to CPU efficiency. Therefore, the high priority is CPU parameter optimization, and the low priority is the optimization of IO parameters, memory parameters, and log parameters. OLTP databases have the characteristics of multiple reads and writes and high concurrency, and both IO and CPU efficiency need to be focused on. Therefore, the high priority is some key CPU parameters and key IO parameters, and the low priority is non-critical CPU and IO parameters, memory parameters, and log parameters. Data warehouse databases have the characteristics of complex queries and large amounts of data that are prone to generating slow SQLs. Therefore, the high priority is log parameters, key IO parameters, and memory parameters, and the low priority is non-critical IO memory parameters and CPU parameters.

[0138] Exemplarily, with reference to Figure 7 shown, the implementation process of the embodiments of the present application mainly includes the following several modules: a classification and grading module, a reinforcement training module, and a result verification module, where:

[0139] Classification and grading module: Record the running data of the database to be optimized, calculate the distances from various types of standard values based on the running data, select the type closest to it as the database type, and then generate the grading parameters that need to be optimized.

[0140] Reinforcement learning module: Optimize according to the grading parameters output by the classification and grading module in the order of high priority and low priority. After the optimization of each level is completed, the generated optimized parameters are passed into the result verification module for verification to determine whether the optimization of this level is completed.

[0141] Result verification module: Verify the parameters generated by the reinforcement learning module. It includes three main pieces of data: stress test data / settings, original parameter performance, and optimized parameter performance. First, asynchronously obtain the performance of the original parameters under the stress test data / settings as a comparison benchmark, then apply the generated parameters to the database to be optimized, perform stress testing using the same stress test data / settings, obtain the optimized parameter performance, and finally calculate the performance improvement of this parameter optimization relative to the original parameters.

[0142] Using the database parameter optimization method provided by the embodiments of the present application, classify the database according to the historical usage of the target database, such as operating data including CPU usage rate, memory usage rate, disk I / O, data throughput, DQL / DML ratio, number of connections, average idle time of idle connections, etc. Then, classify the parameters according to the classification, and finally use the reinforcement learning module to optimize them in sequence according to the classification level. After reaching the optimization goal, the optimization process is completed. Through classification and grading, the feature dimension of each training is reduced, and the efficiency and result stability are improved.

[0143] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps do not necessarily need to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps is not strictly restricted by order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily need to be executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0144] Based on the same inventive concept, the embodiments of the present application also provide a database parameter optimization device for implementing the above-mentioned database parameter optimization method. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the following database parameter optimization device can refer to the limitations on the database parameter optimization method in the above text, and will not be repeated here.

[0145] In an exemplary embodiment, as Figure 8 shown, a database parameter optimization device is provided, including: a first determination module 802, a second determination module 804, and an optimization module 806, where:

[0146] The first determination module 802 is configured to determine the target database type to which the database to be optimized belongs;

[0147] The second determination module 804 is configured to determine the priority of each parameter to be optimized based on the target database type;

[0148] The optimization module 806 is configured to perform optimization processing on each parameter to be optimized according to the priority of each parameter to be optimized, and obtain a parameter optimization result of the database to be optimized.

[0149] By using the database parameter optimization device provided in the embodiments of the present application, parameter optimization can be carried out for different types of databases in a targeted manner, including determining the priority of each parameter to be optimized based on the type of the database, and then performing parameter optimization according to the priority of the parameter to be optimized, which not only improves the parameter optimization efficiency but also reduces the resource occupation during optimization. The following remarkable effects can be achieved:

[0150] (1) It can first ensure that the parameters with the greatest impact on system performance are optimized, significantly improving the overall performance, directly solving the bottleneck problem of transaction waiting for connection resources under high concurrency, and quickly improving the system response speed and transaction processing throughput. (2) Processing high-priority parameters first can avoid wasting too much time and computing resources on non-critical parameter optimization, and can significantly improve resource utilization. For example, if the transaction log writing frequency is adjusted first, it has little effect on immediate performance improvement, while optimizing the connection pool size first can more effectively utilize resources and improve the optimization efficiency. (3) Optimizing according to the priority can be carried out step by step. After each high-priority parameter optimization is completed, the impact on the system can be evaluated in a timely manner. If the optimization effect of the high-priority parameter is not good, the strategy can be adjusted in a timely manner, rather than being difficult to determine the root cause of the problem after multiple parameters are optimized simultaneously, reducing the risk of system instability caused by improper parameter adjustment.

[0151] In one embodiment, the first determination module 802 is specifically configured to:

[0152] Obtain the historical operation data of the database to be optimized;

[0153] Based on the historical operation data and the standard vectors corresponding to each database type, determine the distances of the database to be optimized relative to each of the database types;

[0154] According to the distances of the database to be optimized relative to each of the database types, determine the target database type to which the database to be optimized belongs from each of the database types.

[0155] In one embodiment, the optimization module 806 is specifically configured to:

[0156] Take the parameter corresponding to the target priority as the target parameter, perform reinforcement learning training on the target parameter to obtain the optimized parameter value, where the target priority is the highest priority among the priorities that have not been optimized;

[0157] After the optimization process of the target parameter is completed, re-determine the target priority, and repeat the step of taking the parameter corresponding to the target priority as the target parameter and performing reinforcement learning training on the target parameter until all the parameters to be optimized are completed with the optimization process.

[0158] In one embodiment, the step of performing reinforcement learning training on the target parameter to obtain an optimized parameter value includes:

[0159] For the i-th round of performing reinforcement learning training on the target parameter, when the i-th round does not reach the training upper limit threshold, perform performance verification on the parameter value output in the i-th round. When the performance verification passes, use the parameter value output in the i-th round as the optimized parameter value, where i is an integer greater than 0;

[0160] Alternatively, when the i-th round reaches the training upper limit threshold, determine the optimized parameter value of the target parameter from the parameter values output in all rounds.

[0161] In one embodiment, the optimization module 806 is specifically configured to:

[0162] Obtain a preset priority condition;

[0163] Determine a target priority based on the preset priority condition;

[0164] Call the parameter optimization model corresponding to the target priority, and perform an optimization process on the parameter to be optimized corresponding to the target priority to obtain a parameter optimization result of the database to be optimized.

[0165] In one embodiment, the step of determining the distance between the database to be optimized and each database type based on the historical operation data and the standard vectors corresponding to each database type includes:

[0166] Determine the historical operation data in each time interval;

[0167] For any time interval, obtain a vectorized representation of the historical operation data in the time interval, and determine a sub-distance corresponding to the time interval based on the vectorized representation and the standard vectors corresponding to each database type;

[0168] Determine the distance between the database to be optimized and each database type according to the sub-distances corresponding to each time interval and weights.

[0169] Each module in the above database parameter optimization device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.

[0170] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as Figure 9As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a method for optimizing database parameters. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0171] Those skilled in the art can understand that Figure 9 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.

[0172] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

[0173] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0174] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0175] 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 this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0176] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., and are not limited thereto. The processors involved in the embodiments provided in this application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., and are not limited thereto.

[0177] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this application.

[0178] The above-described embodiments merely represent several implementation manners of this application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of this application. It should be noted that for those of ordinary skill in the art, without departing from the concept of this application, several modifications and improvements can still be made, and these all belong to the protection scope of this application. Therefore, the protection scope of this application shall be subject to the appended claims.

Claims

1. A method for optimizing database parameters, characterized in that, The method includes: Determine the target database type to which the database to be optimized belongs; Determine the priority of each parameter to be optimized based on the target database type; Execute the optimization process of each parameter to be optimized according to the priority of each parameter to be optimized, and obtain the parameter optimization result of the database to be optimized.

2. The method according to claim 1, wherein The determination of the target database type to which the database to be optimized belongs includes: Obtain the historical operation data of the database to be optimized; Determine the distance between the database to be optimized and each database type based on the historical operation data and the standard vectors corresponding to each database type; Determine the target database type to which the database to be optimized belongs from each database type according to the distance between the database to be optimized and each database type.

3. The method according to claim 1 or 2, characterized in that The execution of the optimization process of each parameter to be optimized according to the priority of each parameter to be optimized, and obtaining the parameter optimization result of the database to be optimized includes: Use the parameter corresponding to the target priority as the target parameter, and perform reinforcement learning training on the target parameter to obtain the optimized parameter value, where the target priority is the highest priority among the priorities for which the optimization process has not been executed; After completing the optimization process of the target parameter, re-determine the target priority, and repeat the step of using the parameter corresponding to the target priority as the target parameter and performing reinforcement learning training on the target parameter until all the parameters to be optimized have completed the optimization process.

4. The method according to claim 3, wherein The performing of reinforcement learning training on the target parameter to obtain the optimized parameter value includes: For the i-th round of reinforcement learning training for the target parameter, when the i-th round does not reach the training upper limit threshold, perform performance verification on the parameter value output in the i-th round, and when the performance verification passes, use the parameter value output in the i-th round as the optimized parameter value, where i is an integer greater than 0; Or, when the i-th round reaches the training upper limit threshold, determine the optimized parameter value of the target parameter from the parameter values output in all rounds.

5. The method according to claim 1 or 2, characterized in that, The execution of the optimization process of each parameter to be optimized according to the priority of each parameter to be optimized, and obtaining the parameter optimization result of the database to be optimized includes: Obtain the preset priority condition; Determine the target priority based on the preset priority condition; Call the parameter optimization model corresponding to the target priority, and perform the optimization process on the parameter to be optimized corresponding to the target priority to obtain the parameter optimization result of the database to be optimized.

6. The method according to claim 2, characterized in that, The determination of the distance between the database to be optimized and each database type based on the historical operation data and the standard vectors corresponding to each database type includes: Determine the historical operation data within each time interval; For any time interval, obtain the vectorized representation of the historical operation data within the time interval, and determine the sub-distance corresponding to the time interval based on the vectorized representation and the standard vectors corresponding to each database type; Determine the distance between the database to be optimized and each database type according to the sub-distances corresponding to each time interval and the weights.

7. A database parameter optimization device, characterized in that, The device includes: The first determination module is configured to determine the target database type to which the database to be optimized belongs; The second determination module is configured to determine the priority of each parameter to be optimized based on the target database type; The optimization module is configured to perform the optimization processing of each parameter to be optimized according to the priority of each parameter to be optimized, and obtain the parameter optimization result of the database to be optimized.

8. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

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

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