Parameter configuration method and apparatus for database, device and storage medium

By acquiring the database operation flow and matching the configuration parameters, the problem of database parameter configuration not being able to adapt to dynamic changes is solved, and continuous optimization of database performance and efficient utilization of resources are achieved.

WO2025246567A1PCT designated stage Publication Date: 2025-12-04HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/083890
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-05-27
Filing Date
2025-03-20
Publication Date
2025-12-04

AI Technical Summary

Technical Problem

In existing technologies, database parameter configurations are fixed and cannot adapt to dynamically changing operational characteristics, leading to performance degradation, especially under high load or during specific periods, manifested as high CPU resource utilization or slow disk read/write speeds.

Method used

By acquiring the database operation flow, determining the operation characteristics, and matching and adjusting the configuration parameters in the correspondence between the operation characteristics and configuration parameters, the database performance can be continuously improved to adapt to changes in operation characteristics.

Benefits of technology

It achieves performance optimization of the database under dynamic changes in operation characteristics, reduces processing resources, and improves CPU resource utilization and disk read/write speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025083890_04122025_PF_FP_ABST
    Figure CN2025083890_04122025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to the technical field of databases, and provide a parameter configuration method and apparatus for a database, a device and a storage medium. In the present disclosure, for a database, parameters of the database can be configured on the basis of operational characteristics corresponding to an operation flow of the database. When the operational characteristics of the database change, the parameters of the database are also correspondingly adjusted, so that the database can continuously exhibit good performance.
Need to check novelty before this filing date? Find Prior Art

Description

Methods, apparatus, devices, and storage media for configuring database parameters

[0001] This disclosure claims priority to Chinese Patent Application No. 202410673969.9, filed on May 27, 2024, entitled "Method, Apparatus, Device and Storage Medium for Parameter Configuration of Database", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This disclosure relates to the field of database technology, and in particular to a method, apparatus, device, and storage medium for configuring parameters of a database. Background Technology

[0003] With the development of computer technology, the amount of data has exploded, and massive amounts of data can be stored and maintained by databases. Database operation involves configuring numerous parameters that technical personnel need to configure, such as transaction log configuration parameters and memory configuration parameters.

[0004] In related technologies, technicians can determine the optimal parameters for database operation based on the characteristics of different databases (generally manifested in the operational characteristics of the database), configure these parameters for the database, and continuously use these parameters during database use. Optimal parameter configuration can improve database performance, such as lower central processing unit (CPU) utilization and higher disk read / write speeds.

[0005] For some databases, user operations may change dynamically. In such cases, using fixed parameter configurations may affect database performance. Summary of the Invention

[0006] This disclosure provides a method, apparatus, device, and storage medium for configuring parameters of a database. When the operational characteristics of the database change, the database parameters are adjusted accordingly, so that the database can continuously maintain good performance.

[0007] Firstly, a method for configuring parameters of a database is provided. The method includes: firstly, obtaining a first operation flow of the target database, wherein the first operation flow includes multiple operation instructions, and determining a first operation feature corresponding to the first operation flow; in the correspondence between operation features and configuration parameters, determining a second operation feature that meets the matching conditions of the first operation feature, and determining the configuration parameters corresponding to the second operation feature; and finally, determining the configuration parameters to be used for the target database based on the configuration parameters corresponding to the second operation feature.

[0008] The database can configure its parameters based on the operational characteristics corresponding to its own operational flow. When the operational characteristics of the database change, the database parameters will also be adjusted accordingly, enabling the database to consistently exhibit good performance.

[0009] In one possible implementation, when the CPU resource utilization of the target database exceeds the utilization threshold or the disk read / write speed is lower than the speed threshold, the first operation flow of the target database is obtained.

[0010] The system detects the CPU resource utilization or disk read / write speed of the database based on time periods. When the CPU resource utilization of the database is too high or the disk read / write speed is too slow, it can be detected relatively quickly.

[0011] In this way, the database configuration parameters can be adjusted in a timely manner based on the database performance to ensure good subsequent database performance.

[0012] In one possible implementation, when the average duration of the target database's execution of operation instructions is detected to exceed a first threshold, the first operation flow of the target database is obtained.

[0013] The system detects the average duration of database operation commands based on time periods, and can detect excessively long average durations relatively quickly.

[0014] In this way, the database configuration parameters can be adjusted in a timely manner based on the database performance to ensure good subsequent database performance.

[0015] In this way, the database configuration parameters can be adjusted in a timely manner based on the database performance to ensure good subsequent database performance.

[0016] In one possible implementation, when the configuration cycle is reached, the first operation flow of the target database is obtained.

[0017] In one possible implementation, the third operation feature corresponding to the second operation flow determined in the previous configuration cycle is obtained, and then the matching degree between the first operation feature and the third operation feature is determined. If the matching degree is less than the matching degree threshold, in the correspondence between operation features and configuration parameters, the second operation feature that meets the matching condition of the first operation feature is determined, and the configuration parameters corresponding to the second operation feature are determined.

[0018] When the matching degree is greater than the matching degree threshold, the configuration parameters do not change.

[0019] In this way, when the time period is reached, it can be determined whether the parameter configuration has changed based on the matching degree of the operation characteristics of the two configuration periods, which can reduce some processing resources and at the same time the database performance is also relatively good.

[0020] In one possible implementation, the duration of the current configuration cycle is determined by looking up the corresponding relationship between the duration of the configuration cycle and the time period, based on the current time period.

[0021] Databases can be configured with different periods for different time periods, with shorter periods set for time periods where operational characteristics may change more frequently.

[0022] By setting different time periods, processing resources can be reduced when the operating characteristics are relatively stable.

[0023] In one possible implementation, the third operation feature corresponding to the second operation flow determined in the previous configuration cycle is obtained, and the matching degree between the first operation feature and the third operation feature is determined. If the matching degree is less than the matching degree threshold, the configuration cycle is reduced; if the matching degree is greater than the matching degree threshold, the configuration cycle is increased.

[0024] In this way, the database automatically processes the configuration cycle based on the matching degree of the two operation features corresponding to the two configuration cycle operation flows, taking into account both processing resources and database performance.

[0025] In one possible implementation, the operation features include at least one of operation type features, operation object features, and operation result features.

[0026] In one possible implementation, the operation type characteristics include at least one of the following: the proportion of each type of operation instruction within a specified duration or a specified number of operation instructions, the average number of logical predicates in the conditions involved per operation instruction, the average number of aggregate functions involved per operation instruction, and the average number of grouping functions involved per operation instruction; the operation object characteristics include at least one of the following: the average number of tables involved per operation instruction within a specified duration or a specified number of operation instructions, the average number of column attributes of the returned data involved per operation instruction, the distribution of tables involved in the operation flow, the distribution of column attributes involved in the operation flow, the distribution of value range intervals of column attributes involved in the operation flow, the distribution of comparison constraint types involved in the operation flow, and the proportion of ascending and descending order of results involved in the operation flow; the operation result characteristics include the average number of data returned per operation instruction within a specified duration or a specified number of operation instructions.

[0027] In this way, all aspects of the operational characteristics are taken into account more comprehensively, resulting in more accurate determination of the operational characteristics.

[0028] In one possible implementation, in the correspondence between operation features and configuration parameters, the matching degree between the first operation feature and each operation feature in the correspondence is calculated, and then the second operation feature with the highest matching degree is determined.

[0029] In this way, by using the configuration parameters corresponding to the second operational feature with the highest matching degree as the configuration parameters of the first operational feature, we can make full use of prior experience and reduce processing resources.

[0030] In one possible implementation, the configuration parameters corresponding to the second operation feature are adjusted in different ways to obtain multiple adjusted configuration parameters. In multiple different time periods, the different adjusted configuration parameters are configured to the target database, and the performance value of the target database in each time period is detected. Then, the adjusted configuration parameter corresponding to the time period with the highest performance value is determined as the configuration parameter to be used by the target database.

[0031] In this way, the configuration parameters corresponding to the second operation feature are adjusted again so that the determined configuration parameters to be used are more in line with the first operation feature, thereby improving the performance of the database.

[0032] In one possible implementation, the first operational feature and the configuration parameters to be used are added to the correspondence.

[0033] The first operational feature is added to the mapping relationship with the adjusted configuration parameters. This mapping relationship is used to provide the initial configuration parameters for the operational feature.

[0034] This can further enrich the correspondence between operational features and configuration parameters, thereby providing richer prior experience for subsequent operational features.

[0035] Secondly, an apparatus for configuring parameters of a database is provided, the apparatus comprising at least one module for implementing the method provided in the first aspect and its possible implementations.

[0036] Thirdly, a computing device cluster is provided, including at least one computing device, each computing device including a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, such that the computing device cluster performs the methods provided by the first aspect and its possible implementations described above.

[0037] Fourthly, a computer device is provided, comprising a memory and a processor, the memory for storing computer instructions. The processor executes the computer instructions stored in the memory to cause the computer device to perform the methods provided in the first aspect and its possible implementations.

[0038] Fifthly, a computer-readable storage medium is provided, comprising computer program instructions that, when executed by a cluster of computing devices, perform the methods provided in the first aspect and its possible implementations.

[0039] In a sixth aspect, a computer program product containing instructions is provided, which, when run by a cluster of computing devices, causes the cluster of computing devices to perform the method provided in the first aspect and its possible implementations. Attached Figure Description

[0040] Figure 1 is a flowchart of a method for configuring parameters of a database according to an embodiment of this disclosure;

[0041] Figure 2 is a flowchart of a method for configuring parameters of a database according to an embodiment of this disclosure;

[0042] Figure 3 is a flowchart of a method for configuring parameters of a database according to an embodiment of this disclosure;

[0043] Figure 4 is a schematic diagram of a device for configuring parameters of a database according to an embodiment of this disclosure;

[0044] Figure 5 is a schematic diagram of a computing device provided in an embodiment of this disclosure;

[0045] Figure 6 is a schematic diagram of a computing device cluster provided in an embodiment of this disclosure;

[0046] Figure 7 is a schematic diagram of a computing device cluster provided in an embodiment of this disclosure. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this disclosure clearer, the embodiments of this disclosure will be described in further detail below with reference to the accompanying drawings.

[0048] The following is an explanation of the concepts involved in this disclosure:

[0049] Operation flow

[0050] An operation flow is a collection of operations performed sequentially by various users on a database over a period of time. Users typically use operation commands to manipulate the data stored in the database. These operation commands are generally in Structured Query Language (SQL), often simply referred to as SQL statements. SQL statements can be roughly divided into four categories, corresponding to the four operations of "add," "delete," "modify," and "query." For ease of understanding, examples of these four operations are provided below. The SQL statements described below are for easier understanding of different types of SQL statements; in actual operation, the form of SQL statements is diverse, and this disclosure does not limit the form of SQL statements.

[0051] The SQL statement for the "add" operation can take the following form:

[0052] INSERT INTO table_name(column_1, column_2)VALUES(value_1, value_2)

[0053] In this SQL statement, "INSERT", "INTO", and "VALUES" are fixed fields, and "table_name", "column_1, column_2", and "value_1, value_2" are parameter fields. "table_name" is the table name, "column_1" and "column_2" are the column attribute names, and "value_1" and "value_2" are the corresponding values ​​for the column attributes, where "column_1" corresponds to "value_1" and "column_2" corresponds to "value_2". This SQL statement inserts rows of data into the table named "table_name" where "column_1" is "value_1" and "column_2" is "value_2".

[0054] The SQL statement for the "delete" operation can take the following form:

[0055] DELETE FROM table_name WHERE condition

[0056] In this SQL statement, "DELETE", "FROM", and "WHERE" are fixed fields, while "table_name" and "condition" are parameter fields. "table_name" is the table name, and "condition" can be a range of values ​​for a column attribute, or a value equal to or not equal to a certain value. This SQL statement means that if the value of a column attribute in a row of data in the table named "table_name" meets the "condition", that row of data will be deleted.

[0057] The SQL statement for the "modify" operation can take the following form:

[0058] UPDATE table_name SET column_1=newvalue_1, column_2=newvalue_2WHERE condition

[0059] In this SQL statement, "UPDATE", "SET", and "WHERE" are fixed fields, while "table_name", "column_1 = newvalue_1, column_2 = newvalue_2", and "condition" are parameter fields. "table_name" is the table name, "column_1" and "column_2" are column attribute names in the table, "newvalue_1" and "newvalue_2" are the values ​​to be modified to match the specified values, and "condition" can be a range of values ​​for a column attribute, or a value equal to or not equal to a certain value. This SQL statement means that when the value of a column attribute in a row of data in the table named "table_name" meets the specified condition, the value of column attribute "column_1" in that row will be modified to "newvalue_1", and the value of column attribute "column_2" will be modified to "newvalue_2".

[0060] The SQL statement for a "query" operation can take the following form:

[0061] SELECT column_1, column_2FROM table_name WHERE condition

[0062] In this SQL statement, "SELECT", "FROM", and "WHERE" are fixed fields, "column_1", "column_2", "table_name", and "condition" are parameter fields. "column_1" and "column_2" are column attribute names in the table, "table_name" is the table name, and "condition" can be a range of values ​​for a column attribute, or a value equal to or not equal to a certain value, etc. This SQL statement retrieves rows from the table "table_name" that satisfy the "condition" and displays the rows labeled "column_1" and "column_2".

[0063] The above-described "query" operation corresponds to a relatively simple statement format. In practice, the SQL statement corresponding to the "query" operation can also perform statistical analysis on the retrieved data. For example, it can calculate the sum, maximum, minimum, and average values ​​of a specific column attribute in the query results, or count the number of query results. Correspondingly, the SQL statements for these operations include fixed fields such as "SUM", "MAX", "MIN", "AVG", or "COUNT". Furthermore, SQL statements can perform grouping queries, grouping data according to the values ​​of a specific column attribute, with the fixed field being "GROUP BY". SQL statements can also sort the query results according to the values ​​of a specific column attribute, with the fixed fields being "ORDER BY", "ASE", and "DESE", where "ASE" indicates ascending order and "DESE" indicates descending order. Besides the processing involved in the above-described query operation, there are many other forms of SQL statements corresponding to query operations, which will not be detailed here.

[0064] Configuration parameters

[0065] Configuration parameters are various hardware or software parameters of a database. By adjusting these parameters, various database configurations can be adjusted, resulting in better performance and meeting current business needs. Configuration parameters include many types, some of which are briefly illustrated below: memory configuration parameters (including shared memory parameters (shared_buffers), working memory parameters (work_mem), maintenance memory parameters (maintenance_work_mem), etc.), concurrency control parameters (including maximum connections parameters (max_connections), maximum prepared transactions parameters (max_prepared_transactions), etc.), query optimization parameters (including effective cache size parameters (effective_cache_size), random page cost parameters (random_page_cost), sequential page cost parameters (seq_page_cost), etc.), and transaction log configuration parameters (including write-ahead logging (WAL) buffer parameters (wal_buffers), commit delay parameters (commit_delay), commit sibling parameters (commit_siblings), etc.). These configuration parameters are merely illustrative and are not intended to limit this disclosure.

[0066] In related technologies, after a database is built, its parameters are configured. This configuration can be based on the Heteroscedastic Evolutionary Bayesian Optimization (HEBO) algorithm. This algorithm can quickly determine the target values ​​for parameter adjustments based on the impact of each configuration parameter's value on database performance, thereby optimizing the configuration parameters. Generally, once the database parameters are configured, they remain unchanged. However, during actual database use, the characteristics of the operation streams received by the database may vary significantly. These operation characteristics can manifest as a distribution of different types of operation behaviors, which can be roughly categorized into four types: "add," "delete," "modify," and "query." For example, if a database stores e-commerce data, during major sales events like "Double 11" or "618," a large amount of order data will be generated, significantly increasing the number of "add" operations. In this case, if the database still uses pre-configured parameters to handle operation streams with significantly different behavior distributions, the database performance may be poor. Poor database performance manifests in several ways, such as excessively high CPU resource utilization or slow disk I / O read / write speeds.

[0067] This disclosure provides a method for configuring parameters of a database. This method can be implemented by a computer device, which can be any device running a database.

[0068] This disclosure provides a method for configuring parameters of a database. Based on the operation characteristics corresponding to the database's operation flow, configuration parameters adapted to those characteristics are determined. This results in better overall performance when the database executes the operation flow using these configuration parameters. The processing flow of this method is shown in Figure 1 and includes the following steps:

[0069] Step 101: Obtain the first operation flow of the target database.

[0070] An operation flow can be a set of a certain number of operation instructions preceding the currently acquired operation instruction. The more operation instructions an operation flow includes, the higher the reliability of the operation characteristics determined based on this operation flow; however, correspondingly, more processing resources will be required. Those skilled in the art can set this number based on actual needs, and this disclosure does not limit this; for example, the number can be set to 1000. For different databases, this number can be the same or different.

[0071] An operation flow can also be a set of operation instructions acquired within a certain time range prior to the current time. The time range can be determined based on the frequency of database operations. If users operate on the database frequently, meaning the database receives many operation instructions in a short period, the time range can be set smaller; conversely, if users operate on the database infrequently, the time range can be set larger. In practice, technical personnel can set the time range according to the actual situation; for example, it can be set to one hour.

[0072] Step 102: Determine the first operation feature corresponding to the operation flow.

[0073] Operational characteristics include at least one of the following: operation type characteristics, operation object characteristics, and operation result characteristics. The three types of operational characteristics are explained below. Table 1 shows a detailed classification of each operational characteristic.

[0074] Table 1

[0075] The operational features of each item in Table 1 will be described below.

[0076] First, we introduce the operation type characteristics, which indicate the proportion of various types of operation instructions and the quantity of each type of operation in the operation flow. The characteristics of each operation type are described below.

[0077] The proportion of each type of operation instruction is the ratio of the number of each type of operation instruction. Generally, there are four operation types: "Add," "Delete," "Update," and "Query." Therefore, the operation characteristic is the ratio of the number of "Add," "Delete," "Update," and "Query" instructions, which corresponds to the proportion of the number of these four operations. This operation characteristic can be represented by the ratio of the number of "INSERT," "DELETE," "UPDATE," and "SELECT" instructions in the operation flow. For example, in an operation flow containing 100 "INSERT" fields, 200 "DELETE" fields, 300 "UPDATE" fields, and 300 "SELECT" fields, the operation characteristic is 1:2:3:3.

[0078] The average number of logical predicates in the "conditions" of each operation instruction is calculated by dividing the number of logical predicates appearing in the "conditions" in the operation flow by the number of operation instructions. The "condition" refers to the query conditions in the operation instruction, and is generally introduced by the fixed field "WHERE". Logical predicates can be broadly categorized into four types: "AND", "OR", "NOT", and "IN". For example, if the operation flow includes 5 SQL statements, and the number of logical predicates contained in these 5 SQL statements are 2, 3, 1, 2, and 3 respectively, then the operation characteristic is 2.2, calculated as: (2+3+1+2+3) / 5 = 2.2.

[0079] The average number of aggregate functions involved per operation instruction is calculated by dividing the number of times an aggregate function appears in the operation flow by the number of operation instructions. Aggregate functions typically appear in the operation instructions corresponding to query operations. These aggregate functions include "SUM", "MAX", "MIN", "AVG", or "COUNT", etc., indicating further statistical analysis of the data. For example, if an operation flow includes 5 SQL statements, and the number of aggregate functions contained in these 5 SQL statements are 2, 3, 1, 2, and 3 respectively, then the operation characteristic is 2.2, calculated as: (2+3+1+2+3) / 5 = 2.2.

[0080] The average number of "grouping functions" involved per operation instruction is calculated by dividing the number of times a "grouping function" appears in the operation flow by the number of operation instructions. The fixed field corresponding to the grouping function is generally "GROUP BY". For example, if the operation flow includes 5 SQL statements, and the number of grouping functions contained in these 5 SQL statements are 1, 0, 1, 0, and 0 respectively, then the operation characteristic is 0.4, calculated as: (1+0+1+0+0) / 5=0.4.

[0081] The following section introduces the characteristics of operation objects. These characteristics primarily involve the quantity and "distribution" of operation objects, specifically the frequency of each operation object mentioned in the operation flow and its proportion within the total operation queue. When the frequency of mentions of different operation objects in the operation flow is relatively small, the distribution can be considered relatively even. Conversely, when the frequency of mentions of certain operation objects is significantly higher than that of others, the distribution is considered uneven. When distribution is involved in operation object characteristics, various forms of representation are possible, such as density functions. The characteristics of each operation object are described below.

[0082] The average number of tables involved per operation instruction is calculated by dividing the number of times a table name appears in the operation flow by the number of operation instructions. For example, if an operation flow includes 5 SQL statements, and the number of tables involved in these 5 SQL statements are 2, 3, 1, 2, and 3 respectively, then the operation characteristic is 2.2, calculated as: (2+3+1+2+3) / 5=2.2.

[0083] The average number of column attributes returned by each operation instruction is the number of column attributes in the result data corresponding to that operation instruction. In SQL statements, the column attributes to be retrieved in the result data can be specified. Generally, the column attribute names are listed sequentially after the fixed field "SELECT". For example, if an operation flow includes 5 SQL statements, and the number of column attributes in the returned data from these 5 SQL statements are 2, 3, 1, 2, and 3 respectively, then the operation characteristic is 2.2, calculated as: (2+3+1+2+3) / 5 = 2.2.

[0084] The distribution of "tables" involved in the operation flow involves counting the "table names" and the frequency of each "table name" in the operation flow to obtain the distribution of the "tables". For example, if the operation flow mentions 5 tables: table_A, table_B, table_C, table_D, and table_E, with table_A appearing 2 times, table_B appearing 3 times, table_C appearing 100 times, table_D appearing 200 times, and table_E appearing 4 times, we can sort these 5 tables from least to most frequent and determine the proportion of each table, expressed as 2:3:4:100:200. Then, we convert this proportion into a probability. After simplification, it becomes In practice, the operation flow may involve many tables. In this case, a distribution function can be used to represent the distribution of the tables, which will not be elaborated on here.

[0085] The distribution of "column attributes" involved in the operation flow is obtained by counting the "column attributes" in the operation flow and the number of times each "column attribute" appears. The specific operation is similar to the calculation of the operation feature "distribution of "tables" involved in the operation flow", as explained above.

[0086] The distribution of the "value range intervals" of the "column attributes" involved in the operation flow is obtained by statistically analyzing the "value range intervals" in the operation flow and the frequency of each "value range interval." For example, if a "column attribute" is a person's "age," the operation flow will access ages 20-40 more frequently, ages 40-50 less frequently, and ages 0-20 and 50-100 least frequently. Based on this, the distribution of the value range intervals for the column attribute "age" can be obtained. The specific operation is similar to the calculation of the operation feature "distribution of tables involved in the operation flow," as explained above.

[0087] The distribution of "comparison constraint types" involved in the operation flow involves statistically analyzing the types of comparison constraints in the operation flow and the frequency of each type. This yields the distribution of the "comparison constraint types," which can be broadly categorized as "equal to," "not equal to," "less than," "greater than," "between two specified values," and "null," corresponding to the fields "=", "!=", "<", ">", "BETWEEN," and "IS NULL," respectively. The specific calculation of the operation characteristic "distribution of tables involved in the operation flow" is similar to the above explanation.

[0088] The ratio of "ascending order" and "descending order" in an operation flow is calculated by counting the number of times ascending and descending orders appear when the operation instruction includes sorting, and then calculating the ratio between the two. Ascending and descending orders correspond to the fields "ASE" and "DESE" respectively. For example, in an operation flow containing 100 "ASE" fields and 200 "DESE" fields, the operation characteristic is 1:2.

[0089] Finally, we introduce the characteristics of operation results. These characteristics include the average number of data returned per operation instruction. For each operation instruction, the database can estimate the number of data returned based on its stored data and the characteristics of the instruction. For example, if an operation instruction is to find data in a table whose attribute value falls within a certain range, the database can retrieve the number of data within that range from the table and use this number as the estimated number of data returned by the instruction. Then, the number of data returned by all operation instructions in the operation flow is summed and divided by the number of operation instructions. For example, if the operation flow includes 5 SQL statements, and the estimated number of data returned by these 5 SQL statements are 100, 200, 100, 300, and 100 respectively, then the operation characteristic is 160, calculated as: (100+200+100+300+100) / 5 = 0.4.

[0090] The method for statistically analyzing the above-mentioned operational features can be as follows: First, perform simple word segmentation on all operational instructions in the operational flow. For statistics on fixed fields, you can directly count them. For statistics on parameter fields, you can use an operational instruction semantic recognition model. Based on the fixed fields before and after each parameter field, you can determine which type of parameter field it belongs to. The types of parameter fields include "table name", "column attribute name" or "column attribute value range", etc.

[0091] Step 103: In the correspondence between operation features and configuration parameters, determine the second operation feature that meets the matching condition of the first operation feature, and determine the configuration parameters corresponding to the second operation feature.

[0092] Technical personnel can pre-establish the correspondence between operation features and configuration parameters. This involves experimentally determining and recording the configuration parameters corresponding to several operation features. Specifically, this involves acquiring the database's operation features, recording these features, and then adjusting the configuration parameters to achieve higher performance when the database executes the operation flow using the adjusted parameters. Performance values ​​can be measured using performance parameters, such as CPU resource utilization or disk I / O read / write speeds, which will not be elaborated upon here. Performance values ​​can comprehensively consider the aforementioned performance parameters, assigning weights to each parameter. More important performance parameters can be assigned higher weights to ensure greater accuracy. By performing the above operations on several operation features, several sets of correspondences between operation features and configuration parameters are obtained. These correspondences can be stored in key-value pair format, with "operation feature" as the key and "configuration parameter" as the value. Alternatively, they can be stored in a two-dimensional table format, which is not limited in this embodiment.

[0093] In the correspondence between operational features and configuration parameters, the matching degree between the first operational feature and each operational feature in the correspondence is calculated, and the second operational feature with the highest matching degree is determined. There are many methods for calculating the matching degree. For example, the similarity of vector cosine can be used to represent the matching degree. In addition, there are other ways to calculate the matching degree, which are not limited in this embodiment.

[0094] Step 104: Based on the configuration parameters corresponding to the second operation feature, determine the configuration parameters to be used in the target database.

[0095] By searching for the configuration parameter corresponding to the second operation feature in the correspondence, this configuration parameter can be identified as the configuration parameter to be used in the target database.

[0096] Furthermore, the configuration parameters corresponding to the determined second operational feature can be fine-tuned, and the fine-tuned configuration parameters are determined as the configuration parameters to be used by the target database. This operation is explained in detail below. Different adjustments are made to the configuration parameters corresponding to the second operational feature to obtain multiple adjusted configuration parameters. A fine-tuning range can be set for each configuration parameter based on its attributes. Then, the database randomly adjusts each configuration parameter based on this range. This step is repeated several times to obtain several sets of configuration parameters. At multiple different time periods, different adjusted configuration parameters are configured to the target database, and the performance value of the target database in each time period is detected. Then, the adjusted configuration parameters corresponding to the time period with the highest performance value are determined as the configuration parameters to be used by the target database.

[0097] For the adjusted configuration parameters, the first operation feature and the configuration parameters to be used can be added to the correspondence between operation features and configuration parameters.

[0098] The configuration parameters to be used, determined by the operation feature, are fed back to the user, who can then decide whether to use them.

[0099] In this embodiment of the disclosure, the database parameters can be configured based on the operation characteristics corresponding to the database operation flow. When the database operation characteristics change, the database parameters will also be adjusted accordingly, so that the database can continuously exhibit good performance.

[0100] For steps 101-104 above, the execution condition can be that the above operations are performed when poor database performance is detected. This will be explained in detail below:

[0101] A pre-set time period can be used to monitor database performance upon reaching the set time. Performance metrics can include CPU resource utilization and disk I / O read / write speeds. Thresholds can be set for each performance metric; for example, the threshold for CPU resource utilization is called the utilization threshold, and the threshold for disk I / O read / write speed is called the speed threshold. When CPU resource utilization exceeds the utilization threshold or the threshold for disk I / O read / write speed is below the speed threshold, the performance is considered very poor, and steps 101-104 are executed. Additionally, performance values ​​and weight values ​​can be set for each performance metric. A higher performance value indicates better performance; for example, the performance value for CPU resource utilization is "1 - resource utilization," and the performance value for disk I / O read / write speed is the specified speed. A second threshold is set; when the product of each performance parameter and its weight value is lower than the second threshold, steps 101-104 are triggered. The second threshold can be determined by those skilled in the art based on actual conditions, and this embodiment does not impose any limitations on this.

[0102] Additionally, a first threshold can be set, which is a time duration, such as 50ms, etc. This threshold can be determined by relevant technical personnel based on actual conditions, and this embodiment does not limit it. When the time period is reached, the average duration of the operation instructions executed by the target database is detected. When the duration exceeds the first threshold, the operations in steps 101-104 above are triggered. The average duration of the operation instructions executed by the target database can be the average duration of the execution of operation instructions within a certain time period before the current time, or it can be the average duration of the execution of a certain number of operation instructions before the current time. This embodiment does not limit it.

[0103] For steps 101-104 above, the execution condition can be that the configuration cycle is reached. Accordingly, the operation flow is shown in Figure 2, including the following steps:

[0104] Step 201: When the configuration period is reached, obtain the first operation flow of the target database.

[0105] The configuration cycle can be preset by relevant technical personnel, for example, it can be one day. The configuration cycle can be determined by relevant technical personnel based on the actual situation, and this disclosure does not limit it.

[0106] Step 202: Determine the first operation feature corresponding to the operation flow of the current configuration period, and obtain the third operation feature corresponding to the second operation flow determined in the previous configuration period.

[0107] Step 203: Determine the matching degree between the first operational feature and the third operational feature.

[0108] There are many methods for calculating the matching degree. For example, the similarity of vector cosine can be used to represent the matching degree. In addition, there are other ways to calculate the matching degree, which are not limited in the embodiments of this disclosure.

[0109] Step 204: If the matching degree is less than the matching degree threshold, determine the second operation feature that meets the matching condition of the first operation feature in the correspondence between operation features and configuration parameters, and determine the configuration parameters corresponding to the second operation feature.

[0110] A matching threshold can be preset. When the matching degree is less than the matching threshold, that is, when the similarity between the first operation feature and the third operation feature is low, the process of "determining the second operation feature that meets the matching condition with the first operation feature in the correspondence between operation features and configuration parameters, and determining the configuration parameter corresponding to the second operation feature" is executed. The process of "determining the second operation feature that meets the matching condition with the first operation feature in the correspondence between operation features and configuration parameters, and determining the configuration parameter corresponding to the second operation feature" is similar to step 103 above. For a description of the relevant content, please refer to step 103. It will not be explained in detail here.

[0111] When the matching degree is greater than or equal to the matching degree threshold, the configuration parameters to be used in the target database determined in the previous matching cycle are used as the current configuration parameters to be used in the target database. The database continues to use the configuration parameters from the previous cycle to process subsequent operation commands.

[0112] Step 205: Based on the configuration parameters corresponding to the second operation feature, determine the configuration parameters to be used in the target database.

[0113] The processing flow for this operation is similar to step 104 above. For details on the relevant content, please refer to step 104. It will not be explained in detail here.

[0114] In the processing flow of steps 201-205 above, the configuration period is fixed, but it can also be variable, allowing for different configuration periods to be set for different time periods. The duration of the currently used configuration period is determined by looking up the correspondence between the current time period and the time period. When the configuration period is reached, the processing of steps 101-104 above is executed. For example, if a database is used to record data from an e-commerce platform, configuration periods for normal and special time periods can be set for this database. The configuration period for normal time periods can be set to one day, and the configuration period for special time periods can be set to one hour. Special time periods can be periods of major product promotions such as "Double Eleven" or "618".

[0115] In addition to the aforementioned preset settings, the configuration cycle can also be changed based on the matching degree between the operation characteristics corresponding to the current configuration cycle and the operation characteristics corresponding to the previous configuration cycle. Accordingly, the operation process is shown in Figure 3, including the following steps:

[0116] Step 301: When the configuration period is reached, obtain the first operation flow of the target database.

[0117] Step 302: Determine the first operation feature corresponding to the operation flow of the current configuration cycle, and obtain the third operation feature determined in the previous configuration cycle.

[0118] Step 303: Determine the matching degree between the first operational feature and the third operational feature.

[0119] Step 304: If the matching degree is less than the matching degree threshold, the configuration period is reduced; if the matching degree is greater than the matching degree threshold, the configuration period is increased.

[0120] Reducing the configuration period can be done by decreasing a fixed amount of time or by decreasing a percentage of the current period. The percentage can be a fixed value or based on similarity. Similarly, increasing the configuration period can be done by increasing a fixed amount of time or by increasing a percentage of the current period. The percentage can be a fixed value or based on similarity; this disclosure does not limit the scope of the embodiments.

[0121] The following example illustrates steps 301-304 above. A configuration period can be preset, for example, one day, with a matching threshold of 50%. On the first day, the third operation feature is acquired, and on the second day, the first operation feature is acquired. The matching degree between the first and third operation features is 20%, which is less than the matching threshold. Therefore, the configuration period is changed to 12 hours, and the next time the operation feature is acquired is 12 hours later. The above process is then repeated.

[0122] Based on the same technical concept, this disclosure provides an apparatus for configuring parameters of a database, which can be applied to the aforementioned computer device running a database. As shown in FIG4, the apparatus includes:

[0123] The acquisition module 410 is used to acquire the first operation flow of the target database, wherein the first operation flow includes multiple operation instructions. Specifically, it can implement the processing function of step 101 above, as well as other implicit steps.

[0124] The determination module 420 is used to determine the first operation feature corresponding to the first operation flow, determine the second operation feature that meets the matching condition with the first operation feature in the correspondence between operation features and configuration parameters, determine the configuration parameters corresponding to the second operation feature, and determine the configuration parameters to be used in the target database based on the configuration parameters corresponding to the second operation feature. Specifically, it can implement the processing functions of steps 102-104 above, as well as other implicit steps.

[0125] In one possible implementation, the device further includes a first detection module 430 for detecting that the CPU resource utilization rate of the target database exceeds a utilization rate threshold or the disk read / write speed is lower than a speed threshold.

[0126] In one possible implementation, the device further includes a second detection module 440 for detecting that the average duration of the target database executing operation instructions exceeds a first threshold.

[0127] In one possible implementation, module 410 is used to acquire the first operation flow of the target database when the configuration period is reached. Specifically, it can implement the processing functions of steps 201 and 301 above, as well as other implicit steps.

[0128] In one possible implementation, the acquisition module 410 is further configured to acquire the third operation feature corresponding to the second operation flow determined in the previous configuration cycle. The determination module 420 is further configured to: determine the matching degree between the first operation feature and the third operation feature; if the matching degree is less than a matching degree threshold, determine the second operation feature that satisfies the matching condition with the first operation feature in the correspondence between operation features and configuration parameters, and determine the configuration parameters corresponding to the second operation feature. Specifically, this can implement the processing functions of steps 202-204 above, as well as other implicit steps.

[0129] In one possible implementation, the duration of the current configuration cycle is determined by looking up the corresponding relationship between the duration of the configuration cycle and the time period, based on the current time period.

[0130] In one possible implementation, the acquisition module 410 is further configured to acquire the third operation feature corresponding to the second operation flow determined in the previous configuration cycle. The determination module 420 is further configured to determine the matching degree between the first operation feature and the third operation feature; if the matching degree is less than a matching degree threshold, the configuration cycle is reduced; if the matching degree is greater than the matching degree threshold, the configuration cycle is increased. Specifically, the processing functions of steps 301-304 above, as well as other implicit steps, can be implemented.

[0131] In one possible implementation, the operation features include at least one of operation type features, operation object features, and operation result features.

[0132] In one possible implementation, the operation type features include at least one of the following: the proportion of each type of operation instruction in a specified duration or a specified number of operation instructions, the average number of logical predicates in the conditions involved per operation instruction, the average number of aggregation functions involved per operation instruction, and the average number of grouping functions involved per operation instruction.

[0133] The characteristics of the operation object include at least one of the following: the average number of tables involved per operation instruction within a specified time period or a specified number of operation instructions, the average number of column attributes of the returned data involved per operation instruction, the distribution of tables involved in the operation flow, the distribution of column attributes involved in the operation flow, the distribution of value range intervals of column attributes involved in the operation flow, the distribution of comparison constraint types involved in the operation flow, and the ratio of ascending order and descending order of results involved in the operation flow.

[0134] Operation result characteristics include the average number of data returned per operation instruction within a specified time period or a specified number of operation instructions.

[0135] In one possible implementation, module 420 is used to calculate the matching degree between the first operation feature and each operation feature in the correspondence between operation features and configuration parameters; and to determine the second operation feature with the highest matching degree. Specifically, this can implement the processing function of step 103 above, as well as other implicit steps.

[0136] In one possible implementation, module 420 is used to adjust the configuration parameters corresponding to the second operational feature in different ways to obtain multiple adjusted configuration parameters. These adjusted configuration parameters are then configured to the target database at different time periods. The performance value of the target database in each time period is detected, and the adjusted configuration parameters corresponding to the time period with the highest performance value are determined as the configuration parameters to be used by the target database. Specifically, this can implement the processing function of step 104 above, as well as other implicit steps.

[0137] In one possible implementation, the device further includes an adding module 450, used to add the first operating feature and the configuration parameters to be used to a corresponding relationship. Specifically, this can implement the processing function of step 104 above, as well as other implicit steps.

[0138] In this embodiment of the disclosure, the database parameters can be configured based on the operation characteristics corresponding to the database operation flow. When the database operation characteristics change, the database parameters will also be adjusted accordingly, so that the database can continuously exhibit good performance.

[0139] The acquisition module 410, determination module 420, first detection module 430, second detection module 440, and addition module 450 can all be implemented in software or hardware. For example, the implementation of the acquisition module 410 will be described below. Similarly, the implementation of the determination module 420, first detection module 430, second detection module 440, and addition module 450 can refer to the implementation of the acquisition module 410.

[0140] As an example of a software functional unit, module 410 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, or a container. Further, the aforementioned computing instance may be one or more. For example, module 410 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed within the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed within the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.

[0141] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.

[0142] As an example of a hardware functional unit, the acquisition module 410 may include at least one computing device, such as a server. Alternatively, the acquisition module 410 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.

[0143] The multiple computing devices included in the acquisition module 410 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the acquisition module 410 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the acquisition module 410 can be distributed in the same VPC or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0144] It should be noted that, in other embodiments, the acquisition module 410, the determination module 420, the first detection module 430, the second detection module 440, and the addition module 450 can be used for any step in the method of configuring parameters for the database. The steps implemented by the acquisition module 410, the determination module 420, the first detection module 430, the second detection module 440, and the addition module 450 can be specified as needed. By implementing different steps in the method of configuring parameters for the database through the acquisition module 410, the determination module 420, the first detection module 430, the second detection module 440, and the addition module 450, all functions of the device for configuring parameters for the database can be realized.

[0145] This disclosure also provides a computing device 100. As shown in FIG5, the computing device 100 includes: a bus 102, a processor 104, a memory 106, and a communication interface 108. The processor 104, the memory 106, and the communication interface 108 communicate with each other via the bus 102. The computing device 100 may be a server or a terminal device. It should be understood that this disclosure does not limit the number of processors and memories in the computing device 100.

[0146] Bus 102 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, only one line is used in Figure 5, but this does not imply that there is only one bus or one type of bus. Bus 102 can include pathways for transmitting information between various components of computing device 100 (e.g., memory 106, processor 104, communication interface 108).

[0147] The processor 104 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0148] The memory 106 may include volatile memory, such as random access memory (RAM). The memory 106 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0149] The memory 106 stores executable program code, which the processor 104 executes to implement the functions of the aforementioned acquisition module 410, determination module 420, first detection module 430, second detection module 440, and addition module 450, thereby realizing the method for configuring parameters of the database. In other words, the memory 106 stores instructions for configuring parameters of the database.

[0150] Alternatively, the memory 106 stores executable code, which the processor 104 executes to implement the functions of the aforementioned acquisition module 410, determination module 420, first detection module 430, second detection module 440, and addition module 450, thereby realizing the method for configuring parameters of the database. That is, the memory 106 stores instructions for configuring parameters of the database.

[0151] The communication interface 108 uses transceiver modules such as, but not limited to, network interface cards and transceivers to enable communication between the computing device 100 and other devices or communication networks.

[0152] This disclosure also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.

[0153] As shown in Figure 6, the computing device cluster includes at least one computing device 100. The memory 106 in one or more computing devices 100 in the computing device cluster may store the same instructions for configuring parameters of the database.

[0154] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for a method of configuring parameters for the database. In other words, a combination of one or more computing devices 100 can jointly execute the instructions for a method of configuring parameters for the database.

[0155] It should be noted that the memory 106 in different computing devices 100 within the computing device cluster can store different instructions, each used for a portion of the functions of the device for configuring parameters in the database. That is, the instructions stored in the memory 106 of different computing devices 100 can implement the functions of one or more of the aforementioned acquisition module 410, determination module 420, first detection module 430, second detection module 440, and addition module 450.

[0156] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN), and can be a Transmission Control Protocol (TCP) network or a Remote Direct Memory Access (RDMA) network. Figure 7 illustrates one possible implementation. As shown in Figure 7, two computing devices 100A and 100B are connected via a network. Specifically, they are connected to the network through communication interfaces in each computing device. In this type of possible implementation, the memory 106 in computing device 100A stores instructions for executing the functions of the acquisition module 410, the first detection module 430, and the second detection module 440. Simultaneously, the memory 106 in computing device 100B stores instructions for executing the functions of the determination module 420 and the addition module 450.

[0157] The connection method between the computing device clusters shown in Figure 7 can be considered as follows: taking into account that the method for configuring parameters of the database provided in this disclosure requires a large amount of data storage, it is considered that the functions implemented by the determination module 420 and the addition module 450 are delegated to the computing device 100B for execution.

[0158] It should be understood that the functions of computing device 100A shown in Figure 7 can also be performed by multiple computing devices 100. Similarly, the functions of computing device 100B can also be performed by multiple computing devices 100.

[0159] This disclosure also provides another computing device cluster. The connection relationship between the computing devices in this computing device cluster can be similarly referred to the connection method of the computing device cluster described in Figures 6 and 7. The difference is that the memory 106 in one or more computing devices 100 in this computing device cluster can store the same instructions for configuring parameters of the database.

[0160] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store partial instructions for a method of configuring parameters for the database. In other words, a combination of one or more computing devices 100 can jointly execute the instructions for a method of configuring parameters for the database.

[0161] This disclosure also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions capable of running on a computing device or stored on any usable medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to configure parameters to a database.

[0162] This disclosure also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of being stored by a computing device, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disk (DVD)), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to perform a method for configuring parameters of a database, or instruct the computing device to perform a method for configuring parameters of a database.

[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit them. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of this disclosure.

Claims

1. A method for configuring parameters in a database, characterized in that, The method includes: Obtain the first operation flow of the target database, wherein the first operation flow includes multiple operation instructions; Determine the first operation feature corresponding to the first operation flow; In the correspondence between operation features and configuration parameters, a second operation feature that meets the matching condition of the first operation feature is determined, and the configuration parameters corresponding to the second operation feature are determined. Based on the configuration parameters corresponding to the second operational feature, the configuration parameters to be used for the target database are determined.

2. The method according to claim 1, characterized in that, Before obtaining the first operation flow of the target database, the method further includes: The target database's CPU resource utilization rate exceeds the utilization threshold or its disk read / write speed is lower than the speed threshold.

3. The method according to claim 1, characterized in that, Before the operation flow for obtaining the target database, the method further includes: The average duration of executing operation instructions in the target database exceeded the first threshold.

4. The method according to claim 1, characterized in that, The first operation flow for obtaining the target database includes: When the configuration cycle is reached, the first operation flow of the target database is obtained.

5. The method according to claim 4, characterized in that, The method further includes: Obtain the third operation feature corresponding to the second operation flow determined in the previous configuration cycle; Determine the matching degree between the first operational feature and the third operational feature; In the correspondence between operation features and configuration parameters, determining a second operation feature that matches the first operation feature, and determining the configuration parameters corresponding to the second operation feature, includes: If the matching degree is less than the matching degree threshold, in the correspondence between operation features and configuration parameters, a second operation feature that meets the matching condition of the first operation feature is determined, and the configuration parameter corresponding to the second operation feature is determined.

6. The method according to claim 4 or 5, characterized in that, The duration of the configuration period currently in use is determined by searching the correspondence between the duration of the configuration period and the time period, based on the current time period.

7. The method according to claim 4 or 5, characterized in that, The method further includes: Obtain the third operation feature corresponding to the second operation flow determined in the previous configuration cycle; Determine the matching degree between the first operational feature and the third operational feature; If the matching degree is less than the matching degree threshold, the configuration period is reduced; if the matching degree is greater than the matching degree threshold, the configuration period is increased.

8. The method according to any one of claims 1-7, characterized in that, The operational features include at least one of operational type features, operational object features, and operational result features.

9. The method according to claim 8, characterized in that, The operation type features include at least one of the following: the proportion of each type of operation instruction within a specified duration or a specified number of operation instructions, the average number of logical predicates in the conditions involved in each operation instruction, the average number of aggregation functions involved in each operation instruction, and the average number of grouping functions involved in each operation instruction. The characteristics of the operation object include at least one of the following: the average number of tables involved per operation instruction within a specified time period or a specified number of operation instructions, the average number of column attributes of the returned data involved per operation instruction, the distribution of tables involved in the operation flow, the distribution of column attributes involved in the operation flow, the distribution of value range intervals of column attributes involved in the operation flow, the distribution of comparison constraint types involved in the operation flow, and the ratio of ascending order and descending order of results involved in the operation flow. The operation result characteristics include the average number of data returned by each operation instruction within a specified time period or a specified number of operation instructions.

10. The method according to any one of claims 1-9, characterized in that, In the correspondence between operation features and configuration parameters, determining a second operation feature that matches the first operation feature includes: In the correspondence between operation features and configuration parameters, calculate the matching degree between the first operation feature and each operation feature in the correspondence; Identify the second operational feature with the highest matching degree.

11. The method according to any one of claims 1-10, characterized in that, The step of determining the configuration parameters to be used for the target database based on the configuration parameters corresponding to the second operational feature includes: By making different adjustments to the configuration parameters corresponding to the second operational feature, multiple adjusted configuration parameters are obtained; Different adjusted configuration parameters are configured to the target database at different time periods, and the performance value of the target database in each time period is detected. The adjusted configuration parameters corresponding to the time period with the highest performance value are determined as the configuration parameters to be used in the target database.

12. The method according to claim 11, characterized in that, After determining the adjusted configuration parameters corresponding to the time period with the highest performance value as the configuration parameters to be used in the target database, the method further includes: The first operational feature and the configuration parameters to be used are added to the corresponding relationship.

13. An apparatus for configuring parameters of a database, characterized in that, The device includes: The acquisition module is used to acquire the first operation flow of the target database, wherein the first operation flow includes multiple operation instructions; The determination module is used to determine a first operation feature corresponding to the first operation flow, determine a second operation feature that meets the matching condition of the first operation feature in the correspondence between operation features and configuration parameters, determine the configuration parameters corresponding to the second operation feature, and determine the configuration parameters to be used for the target database based on the configuration parameters corresponding to the second operation feature.

14. The apparatus according to claim 13, characterized in that, The device further includes a first detection module for: The system detected that the CPU resource utilization rate of the target database exceeded the utilization rate threshold or the disk read / write speed was lower than the speed threshold.

15. The apparatus according to claim 13, characterized in that, The device further includes a second detection module for: The average duration of executing operation instructions in the target database exceeded the first threshold.

16. The apparatus according to claim 13, characterized in that, The acquisition module is used for: When the configuration cycle is reached, the first operation flow of the target database is obtained.

17. The apparatus according to claim 16, characterized in that, The acquisition module is also used to acquire the third operation feature corresponding to the second operation flow determined in the previous configuration cycle; The determining module is further configured to: The matching degree between the first operation feature and the third operation feature is determined. If the matching degree is less than the matching degree threshold, a second operation feature that meets the matching condition with the first operation feature is determined in the correspondence between operation features and configuration parameters, and the configuration parameters corresponding to the second operation feature are determined.

18. The apparatus according to claim 16 or 17, characterized in that, The duration of the configuration period currently in use is determined by searching the correspondence between the duration of the configuration period and the time period, based on the current time period.

19. The apparatus according to claim 16 or 17, characterized in that, The acquisition module is also used to acquire the third operation feature corresponding to the second operation flow determined in the previous configuration cycle; The determining module is further configured to determine the matching degree between the first operation feature and the third operation feature, and to reduce the configuration period if the matching degree is less than the matching degree threshold, and to increase the configuration period if the matching degree is greater than the matching degree threshold.

20. The apparatus according to any one of claims 13-19, characterized in that, The operational features include at least one of operational type features, operational object features, and operational result features.

21. The apparatus according to claim 20, characterized in that, The operation type features include at least one of the following: the proportion of each type of operation instruction within a specified duration or a specified number of operation instructions, the average number of logical predicates in the conditions involved in each operation instruction, the average number of aggregation functions involved in each operation instruction, and the average number of grouping functions involved in each operation instruction. The characteristics of the operation object include at least one of the following: the average number of tables involved per operation instruction within a specified time period or a specified number of operation instructions, the average number of column attributes of the returned data involved per operation instruction, the distribution of tables involved in the operation flow, the distribution of column attributes involved in the operation flow, the distribution of value range intervals of column attributes involved in the operation flow, the distribution of comparison constraint types involved in the operation flow, and the ratio of ascending order and descending order of results involved in the operation flow. The operation result characteristics include the average number of data returned by each operation instruction within a specified time period or a specified number of operation instructions.

22. The apparatus according to any one of claims 13-21, characterized in that, The determining module is used for: In the correspondence between operation features and configuration parameters, calculate the matching degree between the first operation feature and each operation feature in the correspondence; Identify the second operational feature with the highest matching degree.

23. The apparatus according to any one of claims 13-22, characterized in that, The determining module is used for: By making different adjustments to the configuration parameters corresponding to the second operational feature, multiple adjusted configuration parameters are obtained; Different adjusted configuration parameters are configured to the target database at different time periods, and the performance value of the target database in each time period is detected. The adjusted configuration parameters corresponding to the time period with the highest performance value are determined as the configuration parameters to be used in the target database.

24. The apparatus according to claim 23, characterized in that, The device further includes an adding module for: The first operational feature and the configuration parameters to be used are added to the corresponding relationship.

25. A computing device cluster, characterized in that, It includes at least one computing device, each computing device including a processor and memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform the method as described in any one of claims 1-12.

26. A computer-readable storage medium, characterized in that, Includes computer program instructions, which, when executed by a cluster of computing devices, perform the method as described in any one of claims 1-12.

27. A computer program product containing instructions, characterized in that, When the instruction is executed by the computing device cluster, the computing device cluster causes the computing device cluster to perform the method as described in any one of claims 1-12.

Citation Information

Patent Citations

  • Method and device for determining configuration parameters of database

    CN111949631A

  • Parameter configuration method and device

    CN114756607A

  • User permission data processing method and device

    CN117436112A

  • Method and system for intelligently optimizing database performance

    WO2024066635A1