Search

CN-122019503-A - Database optimization method, database optimization device, electronic equipment, storage medium and computer program product

CN122019503ACN 122019503 ACN122019503 ACN 122019503ACN-122019503-A

Abstract

The application provides a database optimization method, a device, electronic equipment, a storage medium and a computer program product, wherein the method comprises the steps of collecting a plurality of first configurations corresponding to a first database and first performance data corresponding to the plurality of first configurations, constructing a first probability model based on the plurality of first configurations and the first performance data corresponding to the plurality of first configurations, determining one or more first parameter values corresponding to a first parameter set based on the first probability model, using the one or more first parameter values for maximizing first condition probability, solving the first optimization problem based on a set optimization algorithm by taking the one or more first parameter values as an initial solution of the first optimization problem, obtaining one or more second parameter values, and configuring the first database based on the one or more second parameter values.

Inventors

  • PENG HAO

Assignees

  • 中移(苏州)软件技术有限公司
  • 中国移动通信集团有限公司

Dates

Publication Date
20260512
Application Date
20260127

Claims (11)

  1. 1. A method of database optimization, the method comprising: Collecting a plurality of first configurations corresponding to a first database and first performance data corresponding to the plurality of first configurations; the first performance data is used for describing the performance of the first database under the condition of adopting a corresponding first configuration; Constructing a first probability model based on the first configurations and first performance data corresponding to the first configurations, and determining one or more first parameter values corresponding to a first parameter set based on the first probability model; the first probability model is used for describing a conditional probability relation between a first parameter set and a set target performance index, wherein the first parameter set is constructed based on one or more database parameters indicated by the plurality of first configuration, each of the one or more first parameter values represents the value of one database parameter in the first parameter set, and the one or more first parameter values are used for maximizing a first conditional probability; Taking the one or more first parameter values as an initial solution of a first optimization problem, and solving the first optimization problem based on a set optimization algorithm to obtain one or more second parameter values; The first database is configured based on the one or more second parameter values.
  2. 2. The method of claim 1, wherein the first objective function corresponding to the first optimization problem is constructed based on one or more performance index functions, each of the one or more performance index functions being configured to measure an impact of a parameter value corresponding to the first parameter set on a performance index.
  3. 3. The method of claim 2, wherein the first objective function is characterized as a weighted sum function of one or more performance index functions, the weights of the performance index functions in the first objective function being determined based on a sensitivity analysis.
  4. 4. The method of claim 2, wherein the optimization objective corresponding to the first optimization problem is characterized as minimizing the function value corresponding to the first objective function, and The function value corresponding to the first objective function is inversely related to the first performance corresponding to the performance index function, and the first performance represents the performance represented by the function value corresponding to the performance index function.
  5. 5. The method of claim 2, wherein the first objective function is constructed based on a first performance index function for measuring an effect of a parameter value corresponding to the first parameter set on throughput of the first database and a second performance index function for measuring an effect of a parameter value corresponding to the first parameter set on query delay of the first database.
  6. 6. The method of claim 1, wherein solving the first optimization problem based on the set-up optimization algorithm comprises: performing multiple iterations on the parameter value corresponding to the first parameter set based on the set optimizing algorithm until a set convergence condition is reached; The method comprises the steps of setting a first receiving probability corresponding to an optimizing algorithm, wherein the first receiving probability is inversely related to a first ratio, the first receiving probability represents the probability of receiving a first algorithm solution in a first iteration when the first algorithm solution in the first iteration is inferior to a second algorithm solution in a second iteration, the first iteration represents the subsequent iteration of the second iteration, the first ratio represents the ratio of a first difference value to a first factor, the first difference value is used for comparing the goodness degree of the first algorithm solution and the goodness degree of the second algorithm solution, and the first factor is in a descending trend along with the increase of iteration times.
  7. 7. The method of claim 1, wherein after configuring the first database based on the one or more second parameter values, the method further comprises: Acquiring second performance data of the first database; the first probabilistic model is updated based on the second performance data.
  8. 8. A database optimizing apparatus, comprising: the acquisition unit is used for acquiring a plurality of first configurations corresponding to the first database and first performance data corresponding to the plurality of first configurations; the first performance data is used for describing the performance of the first database under the condition of adopting a corresponding first configuration; A determining unit, configured to construct a first probability model based on the plurality of first configurations and first performance data corresponding to the plurality of first configurations, and determine one or more first parameter values corresponding to a first parameter set based on the first probability model; the first probability model is used for describing a conditional probability relation between a first parameter set and a set target performance index, wherein the first parameter set is constructed based on one or more database parameters indicated by the plurality of first configuration, each of the one or more first parameter values represents the value of one database parameter in the first parameter set, and the one or more first parameter values are used for maximizing a first conditional probability; The solving unit is used for taking the one or more first parameter values as an initial solution of a first optimization problem, and solving the first optimization problem based on a set optimizing algorithm to obtain one or more second parameter values; And a configuration unit, configured to configure the first database based on the one or more second parameter values.
  9. 9. An electronic device comprising a processor and a memory for storing a computer program capable of running on the processor, wherein the processor is adapted to perform the steps of the method of any of claims 1 to 7 when the computer program is run.
  10. 10. A storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1 to 7.
  11. 11. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method according to any one of claims 1 to 7.

Description

Database optimization method, database optimization device, electronic equipment, storage medium and computer program product Technical Field The present application relates to the field of computer technologies, and in particular, to a database optimization method, apparatus, electronic device, storage medium, and computer program product. Background In the related art, configuration parameters of a database are optimized based on a manual adjustment or preset fixed strategy mode, and the problem of poor performance of the database exists under the condition that a service scene corresponding to the database is complex. Disclosure of Invention To solve the related technical problems, embodiments of the present application provide a database optimization method, apparatus, electronic device, storage medium, and computer program product. The technical scheme of the embodiment of the application is realized as follows: the embodiment of the application provides a database optimization method, which comprises the following steps: Collecting a plurality of first configurations corresponding to a first database and first performance data corresponding to the plurality of first configurations; the first performance data is used for describing the performance of the first database under the condition of adopting a corresponding first configuration; Constructing a first probability model based on the first configurations and first performance data corresponding to the first configurations, and determining one or more first parameter values corresponding to a first parameter set based on the first probability model; the first probability model is used for describing a conditional probability relation between a first parameter set and a set target performance index, wherein the first parameter set is constructed based on one or more database parameters indicated by the plurality of first configuration, each of the one or more first parameter values represents the value of one database parameter in the first parameter set, and the one or more first parameter values are used for maximizing a first conditional probability; Taking the one or more first parameter values as an initial solution of a first optimization problem, and solving the first optimization problem based on a set optimization algorithm to obtain one or more second parameter values; The first database is configured based on the one or more second parameter values. In the scheme, the first objective function corresponding to the first optimization problem is constructed based on one or more performance index functions, and each performance index function in the one or more performance index functions is used for measuring the influence of the parameter value corresponding to the first parameter set on one performance index. In the above scheme, the first objective function is characterized as a weighted sum function of one or more performance index functions, and the weight of the performance index function in the first objective function is determined based on sensitivity analysis. In the above scheme, the optimization objective corresponding to the first optimization problem is characterized as minimizing the function value corresponding to the first objective function, and The function value corresponding to the first objective function is inversely related to the first performance corresponding to the performance index function, and the first performance represents the performance represented by the function value corresponding to the performance index function. In the scheme, the first objective function is constructed based on a first performance index function and a second performance index function, wherein the first performance index function is used for measuring the influence of a parameter value corresponding to the first parameter set on the throughput of the first database, and the second performance index function is used for measuring the influence of the parameter value corresponding to the first parameter set on the query delay of the first database. In the above solution, the setting-based optimization algorithm solves the first optimization problem, including: performing multiple iterations on the parameter value corresponding to the first parameter set based on the set optimizing algorithm until a set convergence condition is reached; The method comprises the steps of setting a first receiving probability corresponding to an optimizing algorithm, wherein the first receiving probability is inversely related to a first ratio, the first receiving probability represents the probability of receiving a first algorithm solution in a first iteration when the first algorithm solution in the first iteration is inferior to a second algorithm solution in a second iteration, the first iteration represents the subsequent iteration of the second iteration, the first ratio represents the ratio of a first difference value to a first factor, the first