A database dynamic optimization method and system based on real-time data analysis

By constructing a full-link database monitoring system and a PPO reinforcement learning model, database metrics are collected and optimized in real time, solving the static and lagging problems of database optimization technology and realizing dynamic optimization and improved resource utilization in high-concurrency environments.

CN123178445APending Publication Date: 2026-11-27INSPUR SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611169817.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-04
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing database optimization techniques cannot adapt to the dynamic changes in the real-time data environment, leading to index failure and resource mismatch, and failing to meet the real-time adaptive optimization needs of high-concurrency and highly volatile business scenarios.

Method used

By constructing a full-link database monitoring system, multi-dimensional heterogeneous indicators are collected in real time. The PPO multi-objective reinforcement learning model is used to capture load and resource status characteristics, output optimization actions such as index adjustment, storage reorganization and query rewriting, and achieve synergistic optimization of query performance, storage efficiency and resource utilization through closed-loop control.

Benefits of technology

It enables real-time adaptive optimization of the database in high-concurrency and dynamically changing data environments, improving query performance and storage efficiency while reducing resource waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178445A_ABST
    Figure CN123178445A_ABST
Patent Text Reader

Abstract

The application discloses a database dynamic optimization method and system based on real-time data analysis, and relates to the technical field of database management. In view of the defects of the traditional optimization technology of the database, such as staticity, hysteresis and locality, the scheme comprises the following steps: collecting heterogeneous indexes of a query layer, a storage layer, a resource layer and a business layer in the database in real time, and preprocessing; capturing database load, query and resource related state characteristics based on a multi-objective reinforcement learning model based on the preprocessed index data, and outputting optimization actions of index adjustment, storage reorganization and query rewriting; generating an optimization task based on the optimization action, dividing the optimization task priority according to the business SLA, and executing the corresponding control operation according to the task priority; the model continuously monitors the optimization index, and when the optimization index does not meet the standard, the model is rolled back or the reward weight is adjusted, the learning rate is adjusted combined with the data distribution change, and the feature extractor is iteratively updated. The application can realize the collaborative optimization of query performance, storage efficiency and resource utilization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database management technology, specifically a database dynamic optimization method and system based on real-time data analysis. Background Technology

[0002] Current database optimization techniques are mainly divided into two categories: static optimization and offline analysis. Their core drawback lies in their inability to adapt to dynamic changes in real-time data environments. Static optimization methods rely on pre-configured optimization rules or assumptions about historical data distribution. For example, traditional database management systems generate execution plans through cost estimators, but this model is based solely on offline statistics. When data skew or query patterns change abruptly, it can lead to index failure or suboptimal execution plans. While offline analysis methods can utilize historical query logs to train predictive models, they suffer from significant latency. Existing technologies often focus on single-dimensional optimization, lack cross-layer collaboration mechanisms, and fail to consider the heterogeneity of node loads within the database cluster, easily leading to resource misallocation. In summary, existing technologies cannot meet the real-time adaptive optimization needs of high-concurrency, highly volatile business scenarios. Summary of the Invention

[0003] This invention addresses the static, lagging, and localized nature of traditional database optimization techniques by providing a dynamic database optimization method and system based on real-time data analysis. Through closed-loop control involving indicator collection, optimization decision-making, task execution, and feedback collection, it achieves coordinated optimization of query performance, storage efficiency, and resource utilization.

[0004] In a first aspect, the present invention provides a database dynamic optimization method based on real-time data analysis, and the technical solution adopted to solve the above-mentioned technical problems is as follows: A database dynamic optimization method based on real-time data analysis includes the following steps: S1. Construct a full-link monitoring system for the database, collect multi-dimensional heterogeneous indicators from the query layer, storage layer, resource layer and business layer of the database in real time, and perform preprocessing. S2. Based on the indicator data output in step S1, capture the database load, query, and resource-related status features using the PPO multi-objective reinforcement learning model, and output three types of database optimization actions: index adjustment, storage reorganization, and query rewriting according to preset rules. S3. Generate corresponding optimization tasks based on database optimization actions, prioritize optimization tasks according to business SLA, and execute corresponding control operations based on task priorities; S4. The PPO-based multi-objective reinforcement learning model continuously monitors and optimizes metrics. If the metrics are not met, the model is rolled back or the reward weights are adjusted. The learning rate is adjusted in combination with changes in data distribution, and the feature extractor is iteratively updated.

[0005] Optionally, in step S1, the query layer combines the SQL parsing engine with the kernel probe to capture the SQL execution plan, operator-level time consumption, lock wait timeout events, and fluctuations in the number of concurrent connections. The storage layer is based on model tables and sampling scan technology to calculate tablespace fragmentation rate, index selectivity, data distribution skewness, and unused storage ratio. The resource layer integrates the / proc and iostat tools to collect CPU utilization, memory level, disk IOPS and throughput, and network bandwidth in real time. The business layer associates application metadata, marking the SLA level and query priority label for each query, providing complete business context support for dynamic database optimization.

[0006] Alternatively, the database end-to-end monitoring system adopts a differentiated dynamic sampling strategy: for indicators exceeding the preset frequency, a circular buffer and asynchronous batch processing mode are used for collection; for indicators below the preset frequency, collection is triggered by a threshold; and a slow query log dynamic filtering mechanism is used to optimize data collection efficiency.

[0007] Further optionally, for the real-time collected indicator data, Flink streaming processing capabilities are integrated on the Agent side to smooth the noise in the collected data through the EWMA algorithm and eliminate extreme values ​​of the indicators by means of quantile normalization; then, time-series features, text features and aggregate features are extracted through feature engineering, and finally the key feature selection is completed by relying on the XGBoost algorithm to achieve fine cleaning and optimization of real-time collected data.

[0008] Optionally, the PPO-based multi-objective reinforcement learning model adopts a hierarchical architecture design: the state space dynamically captures real-time load characteristics, query patterns, and resource utilization from the indicator data output in step S1; the action space covers three optimization operations: index adjustment, storage reorganization, and query rewriting; the reward function calculates a comprehensive benefit by weighting the reduction in query response time, the increase in throughput, and the reduction in resource consumption.

[0009] Further optionally, the training process of the PPO-based multi-objective reinforcement learning model adopts an offline-online hybrid mode: in the offline stage, a simulated environment is built based on historical logs to pre-train the policy network; in the online stage, the model is continuously fine-tuned through an experience replay mechanism, and high-reward samples and rare state samples are sampled first to accelerate the learning of key scenarios; after the policy is generated, the effectiveness of the actions is verified, and finally the policies are executed in batches in the form of transactions to ensure the atomicity of operations and data consistency.

[0010] Optionally, optimization tasks can be categorized into high, medium, and low priorities based on the business SLA; where: Operations that directly affect the availability of online services are set to high priority, and a distributed lock mechanism ensures that only one node executes conflicting operations at the same time. Tasks involving cross-partition resource coordination are classified as medium priority, and a two-phase commit protocol is used to coordinate multi-node operations. All relevant partitions are locked by a global transaction ID before changes are executed to avoid data inconsistency. Maintenance operations with a frequency lower than the preset frequency are set to low priority. Operation progress is recorded through persistent logs, and recovery from breakpoints is allowed after interruption. At the same time, resource queues are used to limit concurrency to reduce the impact on the main business.

[0011] Optionally, the PPO-based multi-objective reinforcement learning model continuously monitors and captures data, compares the changes in database load, query, and resource-related state features before and after optimization, and analyzes and locates optimization bottlenecks: when all indicators fail to meet the standards, the model is rolled back to the previous version of the strategy or the reward function weights are adjusted; when changes in data distribution are detected, the model learning rate is dynamically reset, and the state feature extractor is updated periodically using new data increments; when a sudden change in load pattern is detected or the optimization fails to meet expectations, incremental learning of the model is triggered, and only the parameter layers in the action value network that are strongly correlated with the current state are updated to quickly adapt to environmental changes. The model periodically quantifies the contribution of rules based on SHAP values ​​and eliminates rules that have not been triggered within the time limit or have low effective identification value. When optimization leads to an increase in SLA violation rate, the model automatically rolls back the three most recent action sequences to the state before optimization, and fine-tunes the reward function weights for failed actions, forming a closed-loop feedback to ensure dynamic matching between strategy and business needs.

[0012] Secondly, the present invention provides a database dynamic optimization system based on real-time data analysis, and the technical solution adopted to solve the above-mentioned technical problems is as follows: A database dynamic optimization system based on real-time data analysis, used to implement the method described in the first aspect, specifically includes: The real-time data acquisition and preprocessing module is used to build a full-link monitoring system for the database, collect multi-dimensional heterogeneous indicators from the query layer, storage layer, resource layer and business layer of the database in real time, and perform preprocessing. The reinforcement learning intelligent optimization strategy generation module is used to capture database load, query, and resource-related state features based on the multi-objective reinforcement learning model of PPO for the indicator data output by the real-time data acquisition and preprocessing module, and output three types of database optimization actions: index adjustment, storage reorganization, and query rewriting according to preset rules. The optimized task distributed collaborative execution module is used to generate corresponding optimization tasks based on database optimization actions, prioritize optimization tasks according to business SLAs, and perform corresponding control operations based on task priorities. The model evaluation and update module is used to continuously monitor and optimize metrics of PPO-based multi-objective reinforcement learning models. If the metrics are not met, the model is rolled back or the reward weights are adjusted. The learning rate is adjusted in combination with changes in data distribution, and the feature extractor is iteratively updated.

[0013] The database dynamic optimization method and system based on real-time data analysis of the present invention have the following advantages compared with the prior art: This invention is applicable to distributed database systems with high concurrency and dynamically changing data volumes. Through closed-loop control of indicator collection, optimization decision-making, task execution, and feedback collection, it achieves coordinated optimization of query performance, storage efficiency, and resource utilization, breaking through the static, lagging, and local nature of traditional database optimization techniques. Attached Figure Description

[0014] Appendix Figure 1 This is a flowchart of the method according to Embodiment 1 of the present invention; Appendix Figure 2 This is a module connection block diagram of Embodiment 2 of the present invention. Detailed Implementation

[0015] To make the technical solution, the technical problem solved, and the technical effect of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with specific embodiments.

[0016] Example 1: Refer to Appendix Figure 1 This embodiment proposes a dynamic database optimization method based on real-time data analysis, which includes the following steps: S1. Construct a full-link monitoring system for the database, collect multi-dimensional heterogeneous indicators from the query layer, storage layer, resource layer and business layer of the database in real time, and perform preprocessing.

[0017] The system collects multi-dimensional heterogeneous metrics from the query, storage, resource, and business layers of the database in real time. The specific process is as follows: The query layer combines an SQL parsing engine with a kernel probe to capture fine-grained metrics such as SQL execution plans, operator-level latency, lock wait timeout events, and fluctuations in concurrent connections. The storage layer, based on model tables and sampling scan technology, calculates storage status metrics such as tablespace fragmentation rate, index selectivity, data distribution skew, and unused storage percentage. The resource layer integrates the / proc and iostat tools to collect server resource metrics in real time, including CPU utilization, memory level, disk IOPS and throughput, and network bandwidth. The business layer associates application metadata, marking the SLA level and query priority label for each query, providing complete business context support for dynamic database optimization.

[0018] For real-time collected indicator data, Flink streaming processing capabilities are integrated on the Agent side. The EWMA algorithm is used to smooth the noise in the collected data and the quantile normalization is used to eliminate extreme values ​​of the indicators. Then, feature engineering is used to extract time-series features, text features and aggregate features. Finally, the XGBoost algorithm is used to complete the key feature screening, so as to achieve fine cleaning and optimization of real-time collected data.

[0019] In practice, the database end-to-end monitoring system employs a differentiated dynamic sampling strategy: metrics exceeding the preset frequency are collected using a circular buffer and asynchronous batch processing mode; metrics below the preset frequency are collected based on a threshold trigger; and a slow query log dynamic filtering mechanism is used to optimize data collection efficiency. The preset frequency refers to the baseline metric collection and reporting frequency pre-configured by the database end-to-end monitoring system.

[0020] S2. Based on the metric data output in step S1, the PPO multi-objective reinforcement learning model captures database load, query, and resource-related status features, and outputs three types of database optimization actions according to preset rules: index adjustment, storage reorganization, and query rewriting. For example, if the real-time monitoring metrics of the business table show that in the past 5 minutes, more than 80% of user information queries performed full table scans, single-field index selectivity was less than 20%, and the average query time exceeded the SLA standard by more than 3 times, the PPO multi-objective reinforcement learning model automatically captures the characteristics of inefficient query load, high disk I / O resources, and index failure storage, matches the preset rules for index adjustment, and finally outputs the optimization actions: adding a composite index (user ID + status + creation time) and deleting 3 redundant single-field indexes that have not been hit in the past 30 days, thereby improving query execution efficiency.

[0021] The PPO-based multi-objective reinforcement learning model mentioned in this step adopts a hierarchical architecture design: the state space dynamically captures real-time load characteristics, query patterns, and resource utilization from the indicator data output in step S1; the action space covers three optimization operations: index adjustment, storage reorganization, and query rewriting; the reward function calculates a comprehensive benefit by weighting the reduction in query response time, the increase in throughput, and the reduction in resource consumption.

[0022] The training process of the PPO-based multi-objective reinforcement learning model mentioned in this step adopts an offline-online hybrid mode: in the offline stage, a simulated environment is built based on historical logs to pre-train the policy network; in the online stage, the network is continuously fine-tuned through an experience replay mechanism, and high-reward samples and rare state samples are sampled first to accelerate the learning of key scenarios; after the policy is generated, the effectiveness of the actions is verified, and finally, the policies are executed in batches in the form of transactions to ensure the atomicity of operations and data consistency.

[0023] S3. Generate corresponding optimization tasks based on database optimization actions, prioritize optimization tasks according to business SLA, and execute corresponding control operations based on task priorities.

[0024] Based on the database optimization actions output in step S2, they are first automatically packaged into standardized optimization tasks, bound with corresponding execution parameters, execution time periods and resource constraints, and synchronously associated with log recording and progress tracking mechanisms to form schedulable, executable and traceable database optimization tasks.

[0025] In practice, optimization tasks are divided into three priority levels: high, medium, and low, based on the business SLA; among which: Operations that directly affect the availability of online services are set to high priority, and a distributed lock mechanism ensures that only one node executes conflicting operations at the same time. Tasks involving cross-partition resource coordination are classified as medium priority, and a two-phase commit protocol is used to coordinate multi-node operations. All relevant partitions are locked by a global transaction ID before changes are executed to avoid data inconsistency. Maintenance operations with a frequency below the preset priority are set to low priority. Operation progress is supported through persistent logging, allowing recovery from breakpoints after interruption. Concurrency is limited using resource queues to minimize impact on main business operations. The preset frequency refers to a pre-defined baseline frequency for maintenance operations.

[0026] S4. The PPO-based multi-objective reinforcement learning model continuously monitors and optimizes metrics. When metrics are not met, the model is rolled back or the reward weights are adjusted. The learning rate is adjusted in conjunction with changes in data distribution, and the feature extractor is iteratively updated. Specifically, this includes: continuously monitoring and capturing data based on the PPO-based multi-objective reinforcement learning model, comparing changes in database load, query, and resource-related state features before and after optimization, and analyzing and locating optimization bottlenecks; when all metrics are not met, the model is rolled back to the previous version of the strategy or the reward function weights are adjusted; when changes in data distribution are detected, the model learning rate is dynamically reset, and the state feature extractor is updated periodically using new data increments; when a sudden change in load pattern is detected or optimization does not meet expectations, incremental learning of the model is triggered, updating only the parameter layers in the action value network that are strongly correlated with the current state to quickly adapt to environmental changes.

[0027] It should be added that the multi-objective reinforcement learning model periodically quantifies the contribution of rules based on SHAP values, and eliminates rules that have not been triggered within the time limit or have low effective identification value.

[0028] When optimization leads to an increase in SLA violation rate, the multi-objective reinforcement learning model automatically rolls back the three most recent action sequences to the state before optimization, and fine-tunes the reward function weights for failed actions, forming a closed-loop feedback to ensure dynamic matching between strategy and business needs.

[0029] Example 2: Refer to Appendix Figure 2 This embodiment proposes a database dynamic optimization system based on real-time data analysis, which is used to implement the method described in Embodiment 1, specifically including: a real-time data acquisition and preprocessing module, a reinforcement learning intelligent optimization strategy generation module, a distributed collaborative execution module for optimization tasks, and a model evaluation and update module.

[0030] 1. Real-time data acquisition and preprocessing module, used to build a full-link monitoring system for the database, to collect multi-dimensional heterogeneous indicators from the query layer, storage layer, resource layer and business layer of the database in real time, and to perform preprocessing.

[0031] Specifically, the real-time data acquisition and preprocessing module collects multi-dimensional heterogeneous metrics data in real time as follows: The query layer combines an SQL parsing engine with a kernel probe to capture fine-grained metrics such as SQL execution plans, operator-level latency, lock wait timeout events, and fluctuations in concurrent connections; the storage layer calculates storage status metrics such as tablespace fragmentation rate, index selectivity, data distribution skew, and unused storage ratio based on model tables and sampling scanning technology; the resource layer integrates / proc and iostat tools to collect server resource metrics such as CPU utilization, memory level, disk IOPS and throughput, and network bandwidth in real time; and the business layer associates application metadata to mark the SLA level and query priority label for each query, providing complete business context support for dynamic database optimization.

[0032] The real-time data acquisition and preprocessing module integrates Flink streaming capabilities on the Agent side for real-time acquired indicator data. It smooths the noise in the acquired data through the EWMA algorithm and eliminates extreme values ​​of the indicators by using quantile normalization. Then, it extracts time-series features, text features, and aggregate features through feature engineering. Finally, it uses the XGBoost algorithm to complete the key feature screening, thereby achieving fine cleaning and optimization of real-time acquired data.

[0033] It should be added that the database end-to-end monitoring system built by the real-time data acquisition and preprocessing module adopts a differentiated dynamic sampling strategy: indicators exceeding the preset frequency are collected using a circular buffer and asynchronous batch processing mode, while indicators below the preset frequency are triggered for collection based on a threshold. This is combined with a slow query log dynamic filtering mechanism to optimize data acquisition efficiency. The preset frequency refers to the baseline acquisition and reporting frequency of indicators pre-configured by the database end-to-end monitoring system.

[0034] The database end-to-end monitoring system deploys a lightweight monitoring probe architecture, relying on lightweight kernel probes, middleware probes, and OS-level agents to complete low-redundancy data collection; among them, the OS-level agent uses a shared memory mechanism to reduce resource consumption caused by repeated collection.

[0035] 2. The reinforcement learning intelligent optimization strategy generation module is used to capture the database load, query, and resource-related state features based on the multi-objective reinforcement learning model of PPO for the indicator data output by the real-time data acquisition and preprocessing module, and output three types of database optimization actions according to preset rules: index adjustment, storage reorganization, and query rewriting.

[0036] Among them, the PPO-based multi-objective reinforcement learning model adopts a hierarchical architecture design: the state space dynamically captures real-time load characteristics, query patterns and resource utilization from the indicator data output by the real-time data acquisition and preprocessing module; the action space covers three optimization operations: index adjustment, storage reorganization and query rewriting; the reward function calculates the comprehensive benefit by weighting the reduction in query response time, the increase in throughput and the reduction in resource consumption.

[0037] The training process of the PPO-based multi-objective reinforcement learning model adopts an offline-online hybrid mode: in the offline stage, a simulated environment is built based on historical logs to pre-train the policy network; in the online stage, the model is continuously fine-tuned through an experience replay mechanism, and high-reward samples and rare state samples are sampled first to accelerate the learning of key scenarios; after the policy is generated, the effectiveness of the actions is verified, and finally the policies are executed in batches in the form of transactions to ensure the atomicity of operations and data consistency.

[0038] 3. Optimize the distributed collaborative execution module for tasks, which generates corresponding optimization tasks based on database optimization actions, prioritizes optimization tasks according to business SLAs, and performs corresponding control operations based on task priorities.

[0039] In practice, optimization tasks are divided into three priority levels: high, medium, and low, based on the business SLA; among which: Operations that directly affect the availability of online services are set to high priority, and a distributed lock mechanism ensures that only one node executes conflicting operations at the same time. Tasks involving cross-partition resource coordination are classified as medium priority, and a two-phase commit protocol is used to coordinate multi-node operations. All relevant partitions are locked by a global transaction ID before changes are executed to avoid data inconsistency. Maintenance operations with a frequency below the preset priority are set to low priority. Operation progress is supported through persistent logging, allowing recovery from breakpoints after interruption. Concurrency is limited using resource queues to minimize impact on main business operations. The preset frequency refers to a pre-defined baseline frequency for maintenance operations.

[0040] 4. Model Evaluation and Update Module: This module continuously monitors and optimizes metrics for PPO-based multi-objective reinforcement learning models. If metrics are not met, the model is rolled back or the reward weights are adjusted. The learning rate is adjusted in conjunction with changes in data distribution, and the feature extractor is iteratively updated.

[0041] Specifically, the PPO-based multi-objective reinforcement learning model continuously monitors and captures data. The model evaluation and update module compares the changes in database load, query, and resource-related state characteristics before and after optimization, and analyzes and locates optimization bottlenecks: when all indicators fail to meet the standards, the model is rolled back to the previous version of the strategy or the reward function weights are adjusted; when changes in data distribution are detected, the model learning rate is dynamically reset, and the state feature extractor is updated periodically using new data increments; when a sudden change in load pattern is detected or the optimization does not meet expectations, incremental learning of the model is triggered, and only the parameter layers in the action value network that are strongly correlated with the current state are updated to quickly adapt to environmental changes.

[0042] It should be added that the model evaluation and update module regularly quantifies the contribution of rules based on SHAP values, and eliminates rules that have not been triggered within the time limit or have low effective identification value.

[0043] When optimization leads to an increase in SLA violation rate, the model evaluation and update module drives the multi-objective reinforcement learning model to automatically roll back the three most recent action sequences to the state before optimization, and fine-tunes the reward function weights for failed actions, forming a closed-loop feedback to ensure dynamic matching between strategy and business needs.

[0044] In summary, the database dynamic optimization method and system based on real-time data analysis of this invention achieves coordinated optimization of query performance, storage efficiency, and resource utilization through closed-loop control of indicator collection, optimization decision-making, task execution, and feedback collection. It breaks through the static, lagging, and local nature of traditional database optimization techniques and is suitable for distributed database systems with high concurrency and dynamically changing data volumes.

[0045] The above specific examples illustrate the principles and implementation methods of the present invention in detail. These embodiments are merely for the purpose of helping to understand the core technical content of the present invention. Based on the above specific embodiments of the present invention, any improvements and modifications made to the present invention by those skilled in the art without departing from the principles of the present invention should fall within the patent protection scope of the present invention.

Claims

1. A database dynamic optimization method based on real-time data analysis, characterized in that, Includes the following steps: S1. Construct a full-link monitoring system for the database, collect multi-dimensional heterogeneous indicators from the query layer, storage layer, resource layer and business layer of the database in real time, and perform preprocessing. S2. Based on the indicator data output in step S1, capture the database load, query, and resource-related status features using the PPO multi-objective reinforcement learning model, and output three types of database optimization actions: index adjustment, storage reorganization, and query rewriting according to preset rules. S3. Generate corresponding optimization tasks based on database optimization actions, prioritize optimization tasks according to business SLA, and execute corresponding control operations based on task priorities; S4. The PPO-based multi-objective reinforcement learning model continuously monitors and optimizes metrics. If the metrics are not met, the model is rolled back or the reward weights are adjusted. The learning rate is adjusted in combination with changes in data distribution, and the feature extractor is iteratively updated.

2. The database dynamic optimization method based on real-time data analysis according to claim 1, characterized in that, In step S1, the query layer combines the SQL parsing engine with the kernel probe to capture the SQL execution plan, operator-level time consumption, lock wait timeout events, and fluctuations in the number of concurrent connections. The storage layer is based on model tables and sampling scan technology to calculate tablespace fragmentation rate, index selectivity, data distribution skewness, and unused storage ratio. The resource layer integrates the / proc and iostat tools to collect CPU utilization, memory level, disk IOPS and throughput, and network bandwidth in real time. The business layer associates application metadata, marking the SLA level and query priority label for each query, providing complete business context support for dynamic database optimization.

3. The database dynamic optimization method based on real-time data analysis according to claim 2, characterized in that, The database end-to-end monitoring system adopts a differentiated dynamic sampling strategy: for indicators exceeding the preset frequency, a circular buffer and asynchronous batch processing mode are used for collection; for indicators below the preset frequency, collection is triggered by a threshold; and a slow query log dynamic filtering mechanism is used to optimize data collection efficiency.

4. The database dynamic optimization method based on real-time data analysis according to claim 3, characterized in that, For real-time collected indicator data, Flink streaming processing capabilities are integrated on the Agent side. The EWMA algorithm is used to smooth the noise in the collected data and the quantile normalization is used to eliminate extreme values ​​of the indicators. Then, feature engineering is used to extract time-series features, text features and aggregate features. Finally, the XGBoost algorithm is used to complete the key feature screening, so as to achieve fine cleaning and optimization of real-time collected data.

5. The database dynamic optimization method based on real-time data analysis according to claim 1, characterized in that, The PPO-based multi-objective reinforcement learning model adopts a hierarchical architecture design: the state space dynamically captures real-time load characteristics, query patterns, and resource utilization from the indicator data output in step S1; the action space covers three optimization operations: index adjustment, storage reorganization, and query rewriting; the reward function calculates a comprehensive benefit by weighting the reduction in query response time, the increase in throughput, and the reduction in resource consumption.

6. The database dynamic optimization method based on real-time data analysis according to claim 5, characterized in that, The training process of the PPO-based multi-objective reinforcement learning model adopts an offline-online hybrid mode: in the offline stage, a simulated environment is built based on historical logs to pre-train the policy network; in the online stage, the model is continuously fine-tuned through an experience replay mechanism, and high-reward samples and rare state samples are sampled first to accelerate the learning of key scenarios; after the policy is generated, the effectiveness of the actions is verified, and finally the policies are executed in batches in the form of transactions to ensure the atomicity of operations and data consistency.

7. The database dynamic optimization method based on real-time data analysis according to claim 1, characterized in that, Based on the business SLA, optimization tasks are divided into three priority levels: high, medium, and low; among which: Operations that directly affect the availability of online services are set to high priority, and a distributed lock mechanism ensures that only one node executes conflicting operations at the same time. Tasks involving cross-partition resource coordination are classified as medium priority, and a two-phase commit protocol is used to coordinate multi-node operations. All relevant partitions are locked by a global transaction ID before changes are executed to avoid data inconsistency. Maintenance operations with a frequency lower than the preset frequency are set to low priority. Operation progress is recorded through persistent logs, and recovery from breakpoints is allowed after interruption. At the same time, resource queues are used to limit concurrency to reduce the impact on the main business.

8. The database dynamic optimization method based on real-time data analysis according to claim 1, characterized in that, The PPO-based multi-objective reinforcement learning model continuously monitors and captures data, compares changes in database load, query, and resource-related state characteristics before and after optimization, and analyzes and locates optimization bottlenecks: when all indicators fail to meet the standards, the model is rolled back to the previous version of the strategy or the reward function weights are adjusted; when changes in data distribution are detected, the model learning rate is dynamically reset, and the state feature extractor is updated periodically using new data increments; when a sudden change in load pattern is detected or the optimization does not meet expectations, incremental learning of the model is triggered, and only the parameter layers in the action value network that are strongly correlated with the current state are updated to quickly adapt to environmental changes. The model periodically quantifies the contribution of rules based on SHAP values ​​and eliminates rules that have not been triggered within the time limit or have low effective identification value. When optimization leads to an increase in SLA violation rate, the model automatically rolls back the three most recent action sequences to the state before optimization, and fine-tunes the reward function weights for failed actions, forming a closed-loop feedback to ensure dynamic matching between strategy and business needs.

9. A database dynamic optimization system based on real-time data analysis, characterized in that, It is used to implement the method as described in any one of claims 1-8, specifically comprising: The real-time data acquisition and preprocessing module is used to build a full-link monitoring system for the database, collect multi-dimensional heterogeneous indicators from the query layer, storage layer, resource layer and business layer of the database in real time, and perform preprocessing. The reinforcement learning intelligent optimization strategy generation module is used to capture database load, query, and resource-related state features based on the multi-objective reinforcement learning model of PPO for the indicator data output by the real-time data acquisition and preprocessing module, and output three types of database optimization actions: index adjustment, storage reorganization, and query rewriting according to preset rules. The optimized task distributed collaborative execution module is used to generate corresponding optimization tasks based on database optimization actions, prioritize optimization tasks according to business SLAs, and perform corresponding control operations based on task priorities. The model evaluation and update module is used to continuously monitor and optimize metrics of PPO-based multi-objective reinforcement learning models. If the metrics are not met, the model is rolled back or the reward weights are adjusted. The learning rate is adjusted in combination with changes in data distribution, and the feature extractor is iteratively updated.