# US 2021/0286786 A1 · Database performance tuning method, apparatus, and system, device, and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0286786 A1
- Document ID: US20210286786A1
- Status: Published application
- Kind: A1
- Application number: 17/332,948
- Filed: 2021-05-27
- Published: 2021-09-16
- Earliest claimed: 2019-04-11
- Assignees: Tencent Technology (Shenzhen) Company Limited
- Applicants: Tencent Technology (Shenzhen) Company Limited
- Inventors: Ji ZHANG
- Web page: https://patentgrep.com/patent/US20210286786A1

## CPC

- G06F 16/217: {Database tuning (G06F16/2282 takes precedence; database performance monitoring G06F11/3409)}
- G06N 3/04: Architecture, e.g. interconnection topology
- G06N 3/045: Combinations of networks
- G06N 3/08: Learning methods
- G06N 3/092: Reinforcement learning
- G06N 20/00: Machine learning
- G06N 3/006: based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
- G06N 7/01: Probabilistic graphical models, e.g. probabilistic networks
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A database performance tuning method is provided, including: receiving a performance tuning request of tuning a configuration parameter of a target database; obtaining a status indicator of the target database; and inputting the status indicator of the target database into a deep reinforcement learning model, and outputting a recommended configuration parameter of the target database. The deep reinforcement learning model includes a first deep reinforcement learning network and a second deep reinforcement learning network. The first deep reinforcement learning network is configured to provide a recommendation policy for outputting a recommended configuration parameter according to a status indicator, and the second deep reinforcement learning network is configured to evaluate the recommendation policy provided by the first deep reinforcement learning network.

## Claims

### Claim 1

A database performance tuning method, performed by a computer device, the method comprising:
receiving a performance tuning request of tuning a configuration parameter of a target database;
obtaining a status indicator of the target database; and
inputting the status indicator of the target database into a deep reinforcement learning model, to obtain a recommended configuration parameter of the target database, the deep reinforcement learning model comprising a first deep reinforcement learning network and a second deep reinforcement learning network, the first deep reinforcement learning network being configured to provide a recommendation policy for outputting a recommended configuration parameter according to a status indicator, the second deep reinforcement learning network being configured to evaluate the recommendation policy provided by the first deep reinforcement learning network.

### Claim 2 (depends on 1)

The method according to claim 1, wherein an input parameter of the first deep reinforcement learning network comprises the status indicator, and an output parameter of the first deep reinforcement learning network comprises the recommended configuration parameter; and an input parameter of the second deep reinforcement learning network comprises the input parameter and the output parameter of the first deep reinforcement learning network, an output parameter of the second deep reinforcement learning network comprises a score value, and the score value is used for evaluating the recommendation policy provided by the first deep reinforcement learning network and adjusting the first deep reinforcement learning network.

### Claim 3 (depends on 1)

The method according to claim 1, further comprising:
invoking a standard deep reinforcement learning model, the standard deep reinforcement learning model being trained with standard database instances; and
retraining the standard deep reinforcement learning model, to obtain a tuned deep reinforcement learning model, the tuned deep reinforcement learning model being used for providing the recommended configuration parameter of the target database.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the retraining the standard deep reinforcement learning model, to obtain a tuned deep reinforcement learning model comprises:
replaying an actual workload of the target database;
performing at least one round of retraining process on the standard deep reinforcement learning model in a process of running the target database according to the actual workload; and
stopping retraining the standard deep reinforcement learning model when a training stop condition is met, to obtain the tuned deep reinforcement learning model.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the performing at least one round of retraining process on the standard deep reinforcement learning model comprises:
obtaining an ith round of status indicator of the target database in an ith round of retraining process, i being a positive integer;
inputting the ith round of status indicator into the first deep reinforcement learning network, and outputting an ith round of recommended configuration parameter of the target database;
applying the ith round of recommended configuration parameter to the target database;
inputting the ith round of status indicator and the ith round of recommended configuration parameter into the second deep reinforcement learning network, and outputting the score value corresponding to the first deep reinforcement learning network; and
tuning a parameter of the first deep reinforcement learning network according to the score value, to increase a reward value corresponding to the first deep reinforcement learning network, the reward value indicating a difference between performance of the target database before the ith round of recommended configuration parameter is applied and performance of the target database after the ith round of recommended configuration parameter is applied.

### Claim 6 (depends on 4)

The method according to claim 4, wherein replaying the actual workload of the target database comprises:
obtaining an operation execution record of the target database;
returning the target database to a state at a previous timestamp; and
re-executing a plurality of operations logged in the operation execution record starting from the previous timestamp according to a same execution sequence logged operation execution record.

### Claim 7 (depends on 1)

The method according to claim 1, further comprising:
applying the recommended configuration parameter of the target database to the target database.

### Claim 8

A computer device, comprising one or more processors and a memory, the memory storing at least one computer-readable instruction, at least one program, a code set, or a computer-readable instruction set, the at least one computer-readable instruction, the at least one program, the code set, or the computer-readable instruction set being loaded and executed by the one or more processors to implement a plurality of operations comprising:
receiving a performance tuning request of tuning a configuration parameter of a target database;
obtaining a status indicator of the target database; and
inputting the status indicator of the target database into a deep reinforcement learning model, to obtain a recommended configuration parameter of the target database, the deep reinforcement learning model comprising a first deep reinforcement learning network and a second deep reinforcement learning network, the first deep reinforcement learning network being configured to provide a recommendation policy for outputting a recommended configuration parameter according to a status indicator, the second deep reinforcement learning network being configured to evaluate the recommendation policy provided by the first deep reinforcement learning network.

### Claim 9 (depends on 8)

The device according to claim 8, wherein an input parameter of the first deep reinforcement learning network comprises the status indicator, and an output parameter of the first deep reinforcement learning network comprises the recommended configuration parameter; and an input parameter of the second deep reinforcement learning network comprises the input parameter and the output parameter of the first deep reinforcement learning network, an output parameter of the second deep reinforcement learning network comprises a score value, and the score value is used for evaluating the recommendation policy provided by the first deep reinforcement learning network and adjusting the first deep reinforcement learning network.

### Claim 10 (depends on 8)

The device according to claim 8, wherein the plurality of operations further comprises:
invoking a standard deep reinforcement learning model, the standard deep reinforcement learning model being trained with standard database instances; and
retraining the standard deep reinforcement learning model, to obtain a tuned deep reinforcement learning model, the tuned deep reinforcement learning model being used for providing the recommended configuration parameter of the target database.

### Claim 11 (depends on 10)

The device according to claim 10, wherein the retraining the standard deep reinforcement learning model, to obtain a tuned deep reinforcement learning model comprises:
replaying an actual workload of the target database;
performing at least one round of retraining process on the standard deep reinforcement learning model in a process of running the target database according to the actual workload; and
stopping retraining the standard deep reinforcement learning model when a training stop condition is met, to obtain the tuned deep reinforcement learning model.

### Claim 12 (depends on 11)

The device according to claim 11, wherein the performing at least one round of retraining process on the standard deep reinforcement learning model comprises:
obtaining an ith round of status indicator of the target database in an ith round of retraining process, i being a positive integer;
inputting the ith round of status indicator into the first deep reinforcement learning network, and outputting an ith round of recommended configuration parameter of the target database;
applying the ith round of recommended configuration parameter to the target database;
inputting the ith round of status indicator and the ith round of recommended configuration parameter into the second deep reinforcement learning network, and outputting the score value corresponding to the first deep reinforcement learning network; and
tuning a parameter of the first deep reinforcement learning network according to the score value, to increase a reward value corresponding to the first deep reinforcement learning network, the reward value indicating a difference between performance of the target database before the ith round of recommended configuration parameter is applied and performance of the target database after the ith round of recommended configuration parameter is applied.

### Claim 13 (depends on 11)

The device according to claim 11, wherein replaying the actual workload of the target database comprises:
obtaining an operation execution record of the target database;
returning the target database to a state at a previous timestamp;
re-executing a plurality of operations logged in the operation execution record starting from the previous timestamp according to a same execution sequence logged operation execution record.

### Claim 14 (depends on 8)

The device according to claim 8, wherein the plurality of operations further comprises:
applying the recommended configuration parameter of the target database to the target database.

### Claim 15

A non-transitory computer-readable storage medium, storing at least one computer-readable instruction, at least one program, a code set, or a computer-readable instruction set, the at least one computer-readable instruction, the at least one program, the code set, or the computer-readable instruction set being loaded and executed by one or more processors to implement a plurality of operations comprising:
receiving a performance tuning request of tuning a configuration parameter of a target database;
obtaining a status indicator of the target database; and
inputting the status indicator of the target database into a deep reinforcement learning model, to obtain a recommended configuration parameter of the target database, the deep reinforcement learning model comprising a first deep reinforcement learning network and a second deep reinforcement learning network, the first deep reinforcement learning network being configured to provide a recommendation policy for outputting a recommended configuration parameter according to a status indicator, the second deep reinforcement learning network being configured to evaluate the recommendation policy provided by the first deep reinforcement learning network.

### Claim 16 (depends on 15)

The storage medium according to claim 15, wherein an input parameter of the first deep reinforcement learning network comprises the status indicator, and an output parameter of the first deep reinforcement learning network comprises the recommended configuration parameter; and an input parameter of the second deep reinforcement learning network comprises the input parameter and the output parameter of the first deep reinforcement learning network, an output parameter of the second deep reinforcement learning network comprises a score value, and the score value is used for evaluating the recommendation policy provided by the first deep reinforcement learning network and correcting the first deep reinforcement learning network.

### Claim 17 (depends on 15)

The storage medium according to claim 15, wherein the plurality of operations further comprises:
invoking a standard deep reinforcement learning model, the standard deep reinforcement learning model being trained with standard database instances; and
retraining the standard deep reinforcement learning model, to obtain a tuned deep reinforcement learning model, the tuned deep reinforcement learning model being used for providing the recommended configuration parameter of the target database.

### Claim 18 (depends on 17)

The storage medium according to claim 17, wherein the retraining the standard deep reinforcement learning model, to obtain a tuned deep reinforcement learning model comprises:
replaying an actual workload of the target database;
performing at least one round of retraining process on the standard deep reinforcement learning model in a process of running the target database according to the actual workload; and
stopping retraining the standard deep reinforcement learning model when a training stop condition is met, to obtain the tuned deep reinforcement learning model.

### Claim 19 (depends on 18)

The storage medium according to claim 18, wherein the performing at least one round of retraining process on the standard deep reinforcement learning model comprises:
obtaining an ith round of status indicator of the target database in an ith round of retraining process, i being a positive integer;
inputting the ith round of status indicator into the first deep reinforcement learning network, and outputting an ith round of recommended configuration parameter of the target database;
applying the ith round of recommended configuration parameter to the target database;
inputting the ith round of status indicator and the ith round of recommended configuration parameter into the second deep reinforcement learning network, and outputting the score value corresponding to the first deep reinforcement learning network; and
tuning a parameter of the first deep reinforcement learning network according to the score value, to increase a reward value corresponding to the first deep reinforcement learning network, the reward value indicating a difference between performance of the target database before the ith round of recommended configuration parameter is applied and performance of the target database after the ith round of recommended configuration parameter is applied.

### Claim 20 (depends on 15)

The storage medium according to claim 15, wherein the plurality of operations further comprises:
applying the recommended configuration parameter of the target database to the target database.
