A Database Intelligent Operation and Maintenance Method Based on a Large Language Model

By dynamically correcting the causal topology in a large-scale distributed database system using dual data buffer queues and verifying operation and maintenance instructions in a shadow database, the problem of spatiotemporal mismatch between the causal topology and the system's physical state is solved, achieving deterministic verification of operation and maintenance instructions and improving security.

CN121579487BActive Publication Date: 2026-04-21ZHONGQI MULTIPLIER TECH (HANGZHOU) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHONGQI MULTIPLIER TECH (HANGZHOU) CO LTD
Filing Date
2026-01-27
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing technologies cannot capture distribution drift in non-stationary time-series data streams in real time in large-scale distributed database systems, resulting in a spatiotemporal mismatch between the causal topology and the physical state of the system. The generated operation and maintenance instructions lack deterministic verification, posing a systemic risk of unsafe operation.

Method used

By maintaining a dual data buffer queue of reference window and detection window in memory, calculating the probability distribution divergence, dynamically correcting the causal topology, and instantiating an isolated verification environment in the shadow database, the system generates operation and maintenance instructions using a large language model. Combined with copy-on-write technology and dynamic simulation verification, the system ensures the effectiveness of the instructions.

Benefits of technology

It achieves alignment of the causal topology with the current physical moment, eliminates the characteristic noise introduced by the static graph, improves the fault attribution signal-to-noise ratio, ensures the safety and stability of operation and maintenance, and avoids high resource consumption and systemic risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579487B_ABST
    Figure CN121579487B_ABST
Patent Text Reader

Abstract

This invention relates to the field of electronic digital data processing technology and discloses a database intelligent operation and maintenance method based on a large language model. The method includes: establishing a reference window buffer queue and a detection window buffer queue in memory to store historical and real-time data respectively to construct steady-state and transient probability distributions; calculating the divergence of the probability distribution of key indicators between the two windows, triggering a local subgraph conditional independence test when the divergence exceeds a threshold, and updating the causal topology connection weights; extracting a subset of related indicators based on the updated topology and encoding them into structured cue vectors, inputting them into a large language model to generate candidate instructions; executing the instructions in a snapshot-based isolated shadow database, and generating formal instructions if the state vector distance is less than a convergence threshold. This invention addresses the problem of inference illusion caused by causal mismatch under non-stationary loads by detecting data distribution drift and repairing the causal topology in real time, thereby improving the accuracy of fault attribution and operational safety.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a database intelligent operation and maintenance method based on a large language model, belonging to the field of electronic digital data processing technology. Background Technology

[0002] In current large-scale distributed database system operation and maintenance scenarios, facing massive amounts of high-dimensional runtime sequence indicator data, using large language models to diagnose faults and generate instructions is a research direction in the field of data processing. Due to the physical length of the input context window of the large language model, existing technologies usually adopt a dimensionality reduction scheme based on causal topological graph features. They use PC algorithm statistical tools to analyze historical time-series data and construct a static directed acyclic graph that reflects the probabilistic dependencies between indicators. When an anomaly occurs, they extract a subset of local features with causal relationships based on the graph as inference input. The database system's operating state has non-stationary characteristics, and the causal dependency structure between internal indicators changes dynamically with the switching of business load modes. Existing technologies use offline construction or periodic updates of static topological structures to process real-time transient data, resulting in a spatiotemporal mismatch between data statistical features and logical topological structure.

[0003] To address the spatiotemporal mismatch problem, existing technologies attempt to introduce complex models for fault diagnosis and instruction generation. However, these solutions often have inherent flaws in their key design aspects, failing to form a true safety closed loop. For example, Chinese invention patent CN108034729A discloses a database intelligent operation and maintenance method based on a large language model, proposing to use a large language model to assist in diagnosis. However, the constructed causal graph is still based on an offline or periodically updated static model. When faced with rapid switching of database system load modes, it cannot capture the phase transition of causal dependency structure between indicators in real time, resulting in the extracted feature subset containing logical noise, which undermines the semantic inference foundation of the language model and causes uncertainty risks in the generated instructions. After generating operation and maintenance instructions, existing solutions lack a dynamic simulation and distance measurement mechanism based on physical state vector space to deterministically verify the effectiveness of the instructions. They rely on textual semantics or simple rule checks, making it difficult to quantify and evaluate the actual impact of the instructions on non-stationary systems, resulting in operational insecurity and systemic risks.

[0004] Therefore, the technical problem to be solved by this invention is how to capture distribution drift in real time in large-scale non-stationary time-series data streams, dynamically correct causal topology through low-overhead local computation, and ensure that data processing logic is aligned with the physical state of the system in real time. Summary of the Invention

[0005] To address the problems mentioned in the background section, the technical solution of this invention is as follows: A database intelligent operation and maintenance method based on a large language model, comprising the following steps:

[0006] A reference window buffer queue and a detection window buffer queue for key performance indicators of the database are established and maintained in memory respectively. The reference window buffer queue stores historical time-series data for a first preset duration to construct a steady-state probability distribution, and the detection window buffer queue stores real-time time-series data for a second preset duration to construct a transient probability distribution.

[0007] The processor periodically calculates the probability distribution divergence of each key performance indicator between the detection window buffer queue and the reference window buffer queue. When the probability distribution divergence exceeds the preset drift threshold, the corresponding key performance indicator node is identified as a drift node. The local subgraph range formed by the drift node and its preset order neighboring nodes is locked. The conditional independence test is performed on the nodes within the local subgraph range using only the data in the detection window buffer queue. The connection weights of the corresponding local regions in the global causal topology graph are updated according to the test results.

[0008] In response to database anomaly trigger signals, the updated global causal topology graph is traversed in reverse with the anomaly indicator node as the endpoint. A subset of related indicators with direct causal path connections is extracted, and the subset of related indicators and the query statement during the anomaly period are encoded into structured prompt information.

[0009] Using copy-on-write technology, an isolated shadow database is instantiated based on a storage snapshot of the target database. Candidate operation and maintenance instructions generated by a large language model based on structured prompt information are executed in the shadow database. The feature distance between the shadow state feature value after instruction execution and the preset health benchmark feature value is calculated. When the feature distance is less than the preset convergence threshold, the formal execution instruction is generated.

[0010] Preferably, the step of calculating the probability distribution divergence of each key performance indicator between the detection window buffer queue and the reference window buffer queue specifically includes: discretizing the data in the reference window buffer queue into a first probability distribution P(x), and discretizing the data in the detection window buffer queue into a second probability distribution Q(x), where x represents the numerical range of the key performance indicator; and calculating the probability distribution divergence D based on the Kullback-Leibler divergence definition. KL The calculation formula is as follows: , where x i Let Q(x) represent the i-th numerical interval. i This indicates that the index value falls into the first position in the detection window buffer queue. The probability of a range of values, P(x) i This indicates that the index value falls into the first position in the reference window buffer queue. The probability of each numerical interval; the calculated probability distribution divergence D KL The data distribution of key performance indicators is compared with a preset drift threshold to determine whether the load pattern has changed.

[0011] Preferably, the step of performing conditional independence testing on nodes within the local subgraph using only data in the detection window buffer queue specifically includes: constructing a covariance matrix between nodes within the local subgraph based on real-time time-series data in the detection window buffer queue; calculating the partial correlation coefficient between any two nodes using the covariance matrix, and comparing the partial correlation coefficient with a preset confidence level threshold to determine whether conditional independence exists between nodes; removing connection edges that satisfy conditional independence, and determining the propagation direction of the remaining connection edges based on the V-structure orientation rule, generating an updated local directed acyclic graph structure, and replacing the corresponding region in the global causal topology graph with the local directed acyclic graph structure.

[0012] Preferably, before the step of encoding the subset of related indicators and the query statement of the abnormal period into structured prompt information, the method further includes: extracting the current abnormal scenario feature vector based on the abnormal trigger signal; retrieving the historical failure record with the highest cosine similarity to the abnormal scenario feature vector in the preset historical failure vector database; extracting the corresponding historical invalid instructions from the historical failure records, and adding the historical invalid instructions as negative constraints to the structured prompt information to instruct the large language model to avoid the operation logic corresponding to the historical invalid instructions when generating candidate operation and maintenance instructions.

[0013] Preferably, the steps of instantiating an isolated shadow database based on a storage snapshot of the target database using copy-on-write technology specifically include: freezing the current file system state of the target database and generating a storage volume snapshot; creating a new independent process namespace, mounting the storage volume snapshot to the independent process namespace in read-only mode, and overlaying a copy-on-write layer to carry subsequent data changes; starting the shadow database process in the independent process namespace, and configuring the network interface of the shadow database process to only receive traffic requests from the local loopback address, thereby building a verification environment physically isolated from the production environment.

[0014] Preferably, before executing the candidate maintenance instructions generated by the large language model based on structured prompt information in the shadow database, the method further includes: parsing the database execution plan of the candidate maintenance instructions, extracting the expected number of rows to be scanned and the expected index depth to be used; obtaining the dirty page ratio data in the current buffer pool, calculating the write amplification prediction coefficient generated by the candidate maintenance instructions at the write-time replication layer; calculating the product of the expected number of rows to be scanned and the write amplification prediction coefficient, and when the product is greater than the current system's idle IOPS threshold, intercepting the candidate maintenance instructions and terminating subsequent verification steps, and directly returning a feedback signal that the instruction execution cost is too high.

[0015] Preferably, the step of calculating the feature distance between the shadow state feature value after the instruction is executed and the preset health benchmark feature value specifically includes: collecting a set of runtime key performance indicators of the shadow database after executing the candidate operation and maintenance instructions; normalizing the set of runtime key performance indicators to construct multi-dimensional shadow state feature values; calculating the Euclidean distance between the shadow state feature value and the preset health benchmark feature value; determining whether the Euclidean distance shows a convergence trend, and when the Euclidean distance is less than the preset convergence threshold and shows a convergence trend, the verification is deemed successful.

[0016] Preferably, the step of generating structured prompt information further includes: obtaining the current number of concurrent connections and the lock wait queue length of the target database as system load constraint parameters; encoding the system load constraint parameters into a system-level instruction segment that embeds hard constraints into the structured prompt information; and when the large language model generates candidate operation and maintenance instructions, for operations involving table structure changes, adding non-blocking execution options or batch execution parameters according to hard constraints.

[0017] Preferably, the method further includes a closed-loop feedback step based on the verification result: when the feature distance is greater than or equal to a preset convergence threshold, the candidate operation and maintenance instruction is determined to have failed verification; the abnormal scenario feature vector and the corresponding candidate operation and maintenance instruction are extracted when the verification fails, and a negative sample data packet is constructed; the negative sample data packet is stored in the vector database, and the path weight that caused the invalid inference in the global causal topology graph is updated to reduce the probability of the path being selected in the subsequent reverse traversal.

[0018] Preferably, the step of executing candidate operation and maintenance instructions generated by the large language model based on structured prompt information in the shadow database also includes a traffic replay operation: extracting business traffic data within a preset backtracking time window before the time of anomaly triggering from the binary log of the target database; parsing the business traffic data and filtering read-only query requests, retaining only write and update transaction requests; replaying write and update transaction requests in accelerated replay mode in the shadow database process, and injecting candidate operation and maintenance instructions during the replay process to simulate the dynamic impact of candidate operation and maintenance instructions on database performance under high-concurrency write load scenarios.

[0019] Compared with the prior art, the beneficial effects of the present invention are:

[0020] 1. In the database of large language models, a dynamic local topology repair mechanism based on probability distribution differences is used to solve the spatiotemporal mismatch problem between causal models and real-time data features under non-stationary loads. A dual data buffer of reference window and detection window is maintained in memory. The probability distribution divergence of key indicators at different time scales is calculated. When the divergence exceeds the threshold and the data distribution is determined to have drifted, the system triggers the local conditional independence test and weight update for the neighborhood of the drifting node. The local calculation strategy is triggered as needed so that the system can capture the instantaneous phase change of the database load mode with extremely low computing power. This ensures that the causal topology used for inference is aligned with the running logic at the current physical moment, eliminates feature noise introduced by using the lagging static graph, and improves the signal-to-noise ratio of fault attribution.

[0021] 2. Construct a closed-loop control logic from probabilistic text generation to deterministic state verification to avoid systemic risks caused by directly executing generative instructions. Introduce copy-on-write technology to build an isolated shadow simulation environment, transforming candidate operation and maintenance instructions generated by the large language model into shadow instance execution actions. Calculate the Euclidean distance or cosine similarity of the state vectors in multidimensional space before and after execution, transforming the difficult-to-quantify natural language suggestions into measurable physical state deviation values. Release the instruction when the state vector converges to the preset health benchmark domain. Preserve the semantic reasoning ability of the generative model while using deterministic vector space constraints to filter the risk of model illusion and misoperation, ensuring the security and stability of core database operation and maintenance.

[0022] 3. By combining static cost estimation with dynamic simulation verification of the graded circuit breaker mechanism, adaptive control of resource consumption during the verification process is achieved. Before starting the shadow instance, the instruction execution plan is parsed and the physical IO write amplification factor is estimated to directly intercept high resource consumption instructions. During the simulation, the state vector feedback is used as a dynamic gate and graded processing logic to prevent high-risk instructions from exhausting the host machine's physical IO resources or polluting the production environment buffer pool during the verification stage. This balances the timeliness of fault repair with the system resource utilization rate and ensures the availability of intelligent operation and maintenance process engineering under high concurrency or resource-constrained conditions. Attached Figure Description

[0023] Figure 1 This is a flowchart of the closed-loop processing of the present invention, which integrates dynamic causal repair and shadow simulation verification.

[0024] Figure 2 This is a comparison chart showing the dynamic correction of the causal connection weight of key indicators before and after the non-stationary load switching of the present invention.

[0025] Figure 3 The fishbone diagram shows the system architecture of this invention that integrates drift detection, topology reconstruction, and security verification. Detailed Implementation

[0026] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0027] This invention discloses a database intelligent operation and maintenance method based on a large language model, comprising four core processing stages: data distribution drift detection and topology hot repair, structured prompt information encoding, shadow space simulation verification, and closed-loop negative feedback correction. Addressing the technical problem of static graph failure caused by phase transitions in causal logic during multimodal load switching in database systems, this implementation adopts a local topology dynamic reconstruction mechanism based on probability distribution divergence. The system maintains two sliding time window data buffer queues in memory for key performance indicators in real time: one is a reference window buffer queue storing long-period historical time-series data, used to construct the steady-state probability distribution P(x); the other is a detection window buffer queue storing short-period real-time time-series data, used to construct the transient probability distribution Q(x). In the specific deployment of this implementation, the time span of the reference window is set to the past 24 hours, and the time span of the detection window is set to the current 5 minutes. The processor periodically calculates the Kullback-Leibler divergence, D, of each key performance indicator between the two windows. KL The calculation formula is as follows: , where x i Let Q(x) represent the i-th numerical interval of the key performance indicator. i This indicates that the index value falls into the first position in the detection window buffer queue. The probability of a range of values, P(x) i This indicates that the index value falls into the first position in the reference window buffer queue. The probability of each numerical interval is given by the system, which presets a nonlinear drift threshold θ. When the calculated D... KL When the value is greater than θ, the key performance indicator node is determined to be a drift node, and the load mode of the data subspace where the indicator is located is determined to have changed.

[0028] In response to this determination, the system locks the local subgraph range centered on the drifting node and its neighboring nodes of a preset order. It performs conditional independence checks on nodes within this local subgraph range using only data from the detection window buffer queue. This check uses the PC algorithm to construct the covariance matrix between nodes, calculates the partial correlation coefficient, compares it with the confidence level threshold, removes connecting edges that satisfy conditional independence, and determines the propagation direction of the remaining connecting edges based on the V-structure orientation rule. The system uses the generated updated local directed acyclic graph structure to replace the corresponding region in the global causal topology graph, achieving online hot patching of causal logic. This ensures that the causal path used for subsequent inference is consistent with the operating logic at the current physical moment. The causal topology reconstruction computational complexity control procedure is as follows: the processor reads the current system CPU load rate (Lcpu). Set the order of the conditional independence test to determine the maximum condition set. ;like ,set up ;like ,set up Alternatively, pause topology updates and utilize low-order partial correlation coefficients. Pre-screening of connection edges ensures that the causal discovery algorithm has a defined execution boundary in resource-constrained environments; verification is performed using the Fisher Z-transform. Where r represents the partial correlation coefficient between any two nodes, when the p-value is less than the confidence level α=0.01, it is determined that there is a causal connection between the nodes, avoiding high-overhead computation occupying core system resources. After completing the topology repair, in response to the database anomaly trigger signal, the system traverses the updated global causal topology graph in reverse with the anomaly indicator node as the endpoint, extracts the subset of related indicators with direct causal path connections, and in order to avoid the large language model repeating historical error paths, the system extracts the feature vector of the current anomaly scenario and retrieves the historical failure record with the highest cosine similarity to the feature vector in the preset historical fault vector database. The system extracts the corresponding historical invalid instructions in the historical record and uses them as negative constraints. Together with the aforementioned subset of related indicators and the query statement of the anomaly period, they are encoded into structured prompt information. After inputting it into the large language model, candidate operation and maintenance instructions are generated. In this process, the system obtains the current concurrent connection number and lock waiting queue length of the target database as system load constraint parameters, encodes the above parameters into a system-level instruction segment that embeds hard constraints into the structured prompt information, and adds non-blocking execution options or batch execution parameters when generating operations involving table structure changes.

[0029] To address the systemic risks that may arise from the direct execution of generative instructions, this implementation introduces a shadow database verification mechanism based on copy-on-write technology. Before verification, the system first parses the database execution plan of the candidate maintenance instruction, extracts the expected number of rows scanned and the expected index depth, obtains the proportion of dirty pages in the current buffer pool, and calculates the write amplification prediction coefficient generated by the instruction on the copy-on-write layer. If the product of the expected number of rows scanned and the write amplification prediction coefficient is greater than the current system's idle IOPS threshold, the system intercepts the instruction and terminates the verification, directly returning a feedback signal that the instruction execution cost is too high. After the instruction passes the cost prediction check, the system freezes the current file system state of the target database and generates a storage volume snapshot, creates a new independent process namespace, mounts the storage volume snapshot to this namespace in read-only mode, overlays the copy-on-write layer to handle subsequent data changes, starts the shadow database process within the independent process namespace, and configures its network interface to only accept traffic requests from the local loopback address, thereby constructing a verification environment physically isolated from the production environment. The formula for calculating the write amplification prediction coefficient λ is as follows: , where R dirty The current dirty page ratio in the buffer pool is... k io The penalty factor for random writes to physical storage media is set to 1.2 for NVMe SSDs and 3.0 for HDDs, with the processor calculating the execution cost. N scan To estimate the number of rows to scan, when When the circuit breaker is triggered, the processor sends a KILL instruction to the session management module of the database instance or injects instruction-level blocking logic into the host kernel-level eBPF hook. The database session corresponding to the candidate operation and maintenance instruction enters the no-operation NOP state, ensuring that high-cost instructions are isolated and blocked at the process scheduling or instruction set level before I / O contention occurs physically.

[0030] In the shadow database, the system performs a traffic replay operation. The system extracts business traffic data within a preset backtracking time window before the anomaly trigger time from the binary log of the target database, filters read-only query requests, and retains only write and update transaction requests. The system replays these requests in accelerated replay mode in the shadow database process and injects candidate maintenance instructions during the replay process. After the instructions are executed, the system collects the set of key performance indicators of the shadow database at runtime, normalizes them to construct multi-dimensional shadow state feature values, and calculates the Euclidean distance between the shadow state feature value and the preset health benchmark feature value. When the Euclidean distance is less than the preset convergence threshold and shows a convergence trend, the verification is deemed successful, and a formal execution instruction is generated. If the Euclidean distance is greater than or equal to the convergence threshold, the verification is deemed unsuccessful. The system extracts the abnormal scenario feature vector and the corresponding candidate maintenance instructions at the time of verification failure to construct a negative sample data packet, stores it in the vector database, and updates the path weights in the global causal topology graph that led to the invalid inference, reducing the probability of the path being selected in subsequent reverse traversal.

[0031] Example 1: In a distributed database cluster carrying high-frequency transaction settlement business, the system faces a situation where the business load mode changes from daytime high-concurrency read operations to end-of-day batch write operations. Under this situation, the causal dependencies between internal database indicators change, and the fluctuation of query response latency changes from being mainly constrained by CPU utilization to showing a strong causal correlation with disk I / O queue depth. This example uses a detection window buffer queue maintained in memory to collect real-time time-series data of the most recent 5 minutes and compares it with historical data in the reference window buffer queue. The processor calculates the probability distribution divergence of the key performance indicator, disk I / O queue depth. When the divergence value is greater than the preset drift threshold θ, the system determines that the index node is in a distribution drift state, locks the local subgraph range centered on the drift node and its preset order neighboring nodes, and performs conditional independence checks on the nodes within the local subgraph range using transient data in the detection window.

[0032] The system reconstructs local causal connections based on the test results, establishes a causal path between disk I / O queue depth and transaction commit latency, and updates the global causal topology graph. In response to a sudden increase in latency, the system extracts a subset of disk I / O-related indicators based on the updated topology, encodes this subset of indicators and abnormal SQL text into structured prompt information, inputs it into a large language model, and generates candidate maintenance instructions to adjust the log flushing strategy. The system parses the execution plan and calculates the write amplification prediction coefficient. When the product of the coefficient and the expected number of scanned rows is less than the system idle IOPS threshold, it uses copy-on-write technology to mount a storage snapshot and start an isolated shadow database instance. In the shadow database instance, it replays the intercepted write and update transaction requests and injects the candidate maintenance instructions. The system collects the shadow status feature values ​​after the instructions are executed and calculates the Euclidean distance between them and the preset health benchmark feature values. When the Euclidean distance is less than the preset convergence threshold and shows a convergence trend, the system generates the formal execution instructions. This process verifies the causal topology and shadow environment in real time to ensure that the maintenance operation logic is consistent with the current physical conditions of limited disk I / O.

[0033] Example 2: This example verifies the improvement effect of the method of the present invention on the accuracy of fault attribution and operational safety under non-stationary load. To this end, a distributed database test cluster containing 1 master node and 3 read-only replica nodes was constructed and deployed on a physical server configured with a 64-core CPU, 256GB memory and NVMeSSD storage array. The test environment uses the Sysbench tool to simulate real online transaction processing (OLTP) load, and random I / O latency jitter (0-50ms) is introduced as environmental noise during the test to simulate storage performance fluctuations in a cloud-native environment. This experiment aims to compare the performance of the method of the present invention (experimental group) and the traditional operation and maintenance method that only relies on static cause-effect graphs (control group) when dealing with drastic load mode changes.

[0034] The experiment was divided into three stages: steady-state operation, load switching, and anomaly injection. The system ran for 24 hours under a steady-state load dominated by read-only operations to build a baseline probability distribution. The read / write ratio was adjusted using Sysbench to switch the system from 95% read requests to 80% write requests within 10 seconds, triggering a load mode phase change. Thirty seconds after the switch, an index missing fault targeting the core transaction table was artificially injected, causing a surge in transaction commit latency. The processor of this invention calculates the Kullback-Leibler divergence of the disk I / O queue depth between the detection window (last 5 minutes) and the reference window (last 24 hours) in real time. Data shows that at the moment of load switching, the divergence value rapidly climbed to 0.85, exceeding the preset drift threshold of 0.5, accurately triggering the local topology reconstruction mechanism. In contrast, the control group failed to detect this distribution drift and still used the old static graph for fault analysis (see Table 1).

[0035] Table 1: Comparison of key intermediate data and final decision results generated by the two methods

[0036]

[0037] Referring to Table 1, the control group, due to causal mismatch, incorrectly attributed the latency spike to insufficient CPU resources. Its topology connection weights showed a high correlation between CPU utilization and latency (0.82), while the correlation between IO queue depth and latency was only 0.12. This resulted in the generated expansion instructions being unable to resolve the IO bottleneck caused by missing indexes. In contrast, the experimental group, through local reconstruction, identified a strong causal relationship between IO queue depth and latency, corrected the weights from 0.12 to 0.88, and generated targeted optimization instructions accordingly. After executing these instructions in the shadow database, the Euclidean distance between the system state characteristic value and the health benchmark converged to below 0.1 within 45 seconds.

[0038] Example 3: This example combines Figures 1 to 3 This section describes a database intelligent operation and maintenance method based on a large language model, such as... Figure 1 As shown, a reference window buffer queue and a detection window buffer queue are established in memory to store historical time-series data to construct a steady-state distribution and real-time time-series data to construct a transient distribution, respectively. Probability distribution divergence is calculated. If the calculated KL divergence exceeds the drift threshold, a local subgraph conditional independence test is triggered, and the causal topology connection weights are updated. After the causal topology update is completed, the system combines negative constraints and invalid instructions retrieved from the historical fault vector database to encode structured prompt information. The associated indicators and system load constraints are input into the large language model to generate candidate operation and maintenance instructions. The generated instructions are processed through an instruction cost estimation stage to calculate the write amplification factor and IOPS threshold. If the cost is too high, it is directly intercepted. If the cost is acceptable, it enters the shadow database simulation verification stage based on copy-on-write and traffic replay. Finally, the state feature distance is calculated. If the Euclidean distance is greater than or equal to the convergence threshold, the system feeds back the scenario features of the failed verification as negative samples to the historical fault vector database to update the path weights. When the Euclidean distance is less than the convergence threshold, the verification is deemed successful, and a formal execution instruction is generated to repair the system state.

[0039] like Figure 2As shown, the horizontal axis covers four causal relationships: CPU utilization → latency, disk I / O queue depth → latency, memory utilization → latency, and network bandwidth → latency. The vertical axis represents the weight values ​​of these causal connections. It can be seen that before load switching, the static graph shows a higher weight for CPU utilization → latency. However, after load switching, the dynamically reconstructed graph shows a significant increase in the weight of disk I / O queue depth → latency, making it dominant. The weight of CPU utilization → latency decreases accordingly, while the weights of memory utilization → latency and network bandwidth → latency are also fine-tuned based on real-time data distribution. Figure 3 As shown, the main framework points to an intelligent database operation and maintenance method to solve causal mismatches under non-stationary loads. The data perception and drift detection dimension includes elements such as reference window buffer queue, detection window buffer queue, and probability distribution divergence calculation. The causal topology reconstruction dimension covers steps such as local subgraph locking, conditional independence testing, and dynamic updating of connection weights. The intelligent instruction generation dimension integrates mechanisms such as hard constraints on system load, structured prompt information encoding, and avoidance of historical invalid instructions. The security verification and feedback dimension consists of negative sample closed-loop correction, instruction execution cost estimation, and write-time replication shadow database, thus establishing a complete closed-loop logic from perception, reasoning to verification.

[0040] Example 4: This example details the calibration procedure and quantification logic of key control parameters in a database intelligent operation and maintenance system. During the cold start phase of system deployment or within a periodic calibration window, the processor executes a statistical calibration procedure for the drift threshold θ. During a fault-free steady-state operation cycle, the system continuously collects the probability distribution divergence D of key performance indicators between the reference window and the detection window. KL Construct a sample set S={d1,d2,...,d n} where n is the number of samples, with a value not less than 1440 to cover all-weather load fluctuations. The processor calculates the arithmetic mean μ and standard deviation σ of the sample set, and sets the preset drift threshold to θ=μ+3σ according to Chebyshev's inequality or the 3-Sigma criterion. This calibration procedure ensures that the threshold setting is directly related to the historical load characteristics of a specific database instance, rather than relying on empirical fixed values, thereby ensuring the anomaly detection rate while suppressing false alarms caused by normal load fluctuations. For the computational complexity control in the local subgraph conditional independence test, the system introduces dynamic depth constraint logic when executing the PC algorithm. The processor reads the current system CPU load rate L. cpu When L cpu When the percentage is below 30%, the order of the maximum condition set for the independence test is set to 3; when L cpu When the value is in the 30% to 70% range, the order is reduced to 2; when L cpuWhen the p-value is higher than 70%, the system further downgrades to 1 or suspends topology updates. Meanwhile, for the partial correlation coefficient test, the system uses Fisher's Z-transformation. Only when the calculated p-value is less than the preset confidence level α=0.01 is it determined that there is a causal connection between nodes.

[0041] In the shadow database verification phase, to quantify the execution cost of candidate operation and maintenance instructions, the system executes a deterministic calculation procedure for the write amplification prediction coefficient λ, and the system reads the dirty page ratio R of the current buffer pool of the target database. dirty (Right now The metadata overhead constant C of the Copy-on-Write Layer (COWLayer) is also included. meta Based on the read-copy-update characteristics of the copy-on-write mechanism when dealing with dirty pages, the processor follows the formula... Calculate the magnification factor, where k io The random write penalty factor for physical storage media is set to 1.2 for NVMe SSDs and 3.0 for HDDs. The system extracts the expected number of scan lines N from the candidate instruction execution plan. scan Calculate the product of the two. The system collects the current idle IOPS value of the host machine in real time. free ,when If the system determines that the instruction meets the security constraints, it will start the shadow instance; otherwise, it will trigger a circuit breaker.

[0042] Example 5: This example constructs a deterministic offline calibration and data filling procedure. During the deployment phase before the system goes live, the processor performs historical log mining and vectorization operations. The system ingests archived operation logs and incident reports from the target database for at least one year. A pre-built regular expression parser is used to extract structured triple data containing abnormal time windows, executed SQL statements, and performance index snapshots. The system uses the same embedding model as the online inference engine to map the above triples into high-dimensional feature vectors. Invalid instruction paths are explicitly marked based on historical rollback records or manual review labels. This process constructs a basic negative sample set Vinit={v1,v2,...,vm} to ensure that the inference engine has the ability to suppress known risks immediately upon going live.

[0043] In response to the risk of missing procedures for shadow verification resource contention, this embodiment formulates a pre-deployment calibration procedure. Before activating the automatic shadow verification function, the system creates a fictitious shadow instance and executes a synthetic load L(t)=k·t with linear stepwise growth in IOPS demand, where k is the load growth slope coefficient and t is the duration of load application. At the same time, the system continuously monitors the latency jitter of the production database instance located in the main namespace. The processor records the critical IOPS value Icrit when the latency of the production instance deviates from its baseline mean by more than 5%, and writes this measured critical value into the system configuration file as a hard upper limit for the product of the expected number of scan lines for candidate instructions and the write amplification factor.

[0044] Example 6: In the actual deployment and iteration of the database intelligent operation and maintenance system, in order to ensure the accuracy and stability of state vector calculation, this example formulates a set of deterministic health benchmark feature value initialization calibration procedures. After the system is first deployed or undergoes a major version upgrade, the processor starts a 72-hour benchmark acquisition program. During this period, the system continuously collects the set of key performance indicators of the database instance in the state without abnormal alarms at a granularity of 1 minute, and constructs a benchmark dataset containing 4320 sample points. For each feature in the dataset, the system uses an outlier removal algorithm based on interquartile range (IQR) to clean the noisy data and calculates the arithmetic mean of the remaining samples as the benchmark feature value component of that dimension.

[0045] To address the distance calculation bias caused by differences in performance metric dimensions across different business scenarios, the system executes standardized processing logic based on Z-Score for each collected real-time metric value. The processor uses the mean μ and standard deviation σ of the indicator obtained from the benchmark dataset, and then applies the formula... The system converts the data into dimensionless standard scores and calculates the Euclidean distance using only the standardized feature vectors, thus eliminating the weight imbalance caused by different physical units of the indicators. In order to address the benchmark drift caused by data volume growth or hardware aging during the long-term operation of the database system, this embodiment constructs an adaptive benchmark update mechanism. The system sets a 30-day sliding time window and periodically recalculates the benchmark feature values ​​using the most recent fault-free operating data within the window. When the relative deviation between the newly calculated benchmark mean and the current effective benchmark mean exceeds a preset threshold of 5%, the system automatically updates the effective benchmark and records the update log.

[0046] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0047] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A database intelligent operation and maintenance method based on a large language model, characterized in that, Includes the following steps: A reference window buffer queue and a detection window buffer queue for key performance indicators of the database are established and maintained in memory respectively. The reference window buffer queue stores historical time-series data for a first preset duration to construct a steady-state probability distribution, and the detection window buffer queue stores real-time time-series data for a second preset duration to construct a transient probability distribution. The processor periodically calculates the probability distribution divergence of each key performance indicator between the detection window buffer queue and the reference window buffer queue. When the probability distribution divergence exceeds the preset drift threshold, the corresponding key performance indicator node is identified as a drift node. The local subgraph range formed by the drift node and its preset order neighboring nodes is locked. The conditional independence test is performed on the nodes within the local subgraph range using only the data in the detection window buffer queue. The connection weights of the corresponding local regions in the global causal topology graph are updated according to the test results. In response to database anomaly trigger signals, the updated global causal topology graph is traversed in reverse with the anomaly indicator node as the endpoint. A subset of related indicators with direct causal path connections is extracted, and the subset of related indicators and the query statement during the anomaly period are encoded into structured prompt information. Using copy-on-write technology, an isolated shadow database is instantiated based on a storage snapshot of the target database. Candidate operation and maintenance instructions generated by a large language model based on structured prompt information are executed in the shadow database. The feature distance between the shadow state feature value after instruction execution and the preset health benchmark feature value is calculated. When the feature distance is less than the preset convergence threshold, the formal execution instruction is generated.

2. The database intelligent operation and maintenance method based on a large language model according to claim 1, characterized in that, The steps for calculating the probability distribution divergence of each key performance indicator (KPI) between the detection window buffer queue and the reference window buffer queue specifically include: discretizing the data in the reference window buffer queue into a first probability distribution P(x), and discretizing the data in the detection window buffer queue into a second probability distribution Q(x), where x represents the numerical range of the KPI; and calculating the probability distribution divergence D based on the Kullback-Leibler divergence definition. KL The calculation formula is as follows: , where x i Let Q(x) represent the i-th numerical interval. i P(x) represents the probability that the index value falls into the i-th numerical interval in the detection window buffer queue. i The probability that the index value falls within the i-th numerical interval in the reference window buffer queue is represented by ); the calculated probability distribution divergence D KL The data distribution of key performance indicators is compared with a preset drift threshold to determine whether the load pattern has changed.

3. The intelligent database operation and maintenance method based on a large language model according to claim 1, characterized in that, The steps for performing conditional independence checks on nodes within a local subgraph using only data from the detection window buffer queue include: constructing a covariance matrix between nodes within the local subgraph based on real-time time-series data from the detection window buffer queue; calculating the partial correlation coefficient between any two nodes using the covariance matrix and comparing the partial correlation coefficient with a preset confidence level threshold to determine whether conditional independence exists between nodes; removing connection edges that satisfy conditional independence and determining the propagation direction of the remaining connection edges based on V-structure orientation rules to generate an updated local directed acyclic graph structure; and replacing the corresponding region in the global causal topology graph with the local directed acyclic graph structure.

4. The database intelligent operation and maintenance method based on a large language model according to claim 1, characterized in that, Before encoding the subset of related indicators and the query statements of the abnormal period into structured prompt information, the method further includes: extracting the current abnormal scenario feature vector based on the abnormal trigger signal; retrieving the historical failure record with the highest cosine similarity to the abnormal scenario feature vector in the preset historical failure vector database; extracting the corresponding historical invalid instructions from the historical failure records; adding the historical invalid instructions as negative constraints to the structured prompt information to instruct the large language model to avoid the operation logic corresponding to the historical invalid instructions when generating candidate operation and maintenance instructions.

5. The intelligent database operation and maintenance method based on a large language model according to claim 1, characterized in that, The steps for instantiating an isolated shadow database based on a storage snapshot of the target database using copy-on-write technology include: freezing the current file system state of the target database and generating a storage volume snapshot; creating a new independent process namespace, mounting the storage volume snapshot to the independent process namespace in read-only mode, and overlaying a copy-on-write layer to handle subsequent data changes; starting the shadow database process within the independent process namespace, and configuring the shadow database process's network interface to only accept traffic requests from the local loopback address, thereby building a verification environment physically isolated from the production environment.

6. The database intelligent operation and maintenance method based on a large language model according to claim 5, characterized in that, Before executing candidate maintenance instructions generated by the large language model based on structured prompts in the shadow database, the process includes: parsing the database execution plan of the candidate maintenance instructions, extracting the expected number of rows scanned and the expected index depth; obtaining the dirty page ratio data in the current buffer pool, calculating the write amplification prediction coefficient generated by the candidate maintenance instructions at the write-time replication layer; calculating the product of the expected number of rows scanned and the write amplification prediction coefficient; when the product is greater than the current system's idle IOPS threshold, intercepting the candidate maintenance instructions and terminating subsequent verification steps, and directly returning a feedback signal that the instruction execution cost is too high.

7. The intelligent database operation and maintenance method based on a large language model according to claim 1, characterized in that, The steps for calculating the feature distance between the shadow state feature value after instruction execution and the preset health benchmark feature value specifically include: collecting a set of runtime key performance indicators of the shadow database after executing candidate operation and maintenance instructions; normalizing the set of runtime key performance indicators to construct multi-dimensional shadow state feature values; calculating the Euclidean distance between the shadow state feature value and the preset health benchmark feature value; and determining whether the Euclidean distance shows a convergence trend. When the Euclidean distance is less than the preset convergence threshold and shows a convergence trend, the verification is deemed successful.

8. The intelligent database operation and maintenance method based on a large language model according to claim 1, characterized in that, The steps for generating structured prompt information also include: obtaining the current number of concurrent connections and the lock wait queue length of the target database as system load constraint parameters; encoding the system load constraint parameters into a system-level instruction segment that embeds hard constraints into the structured prompt information; and when the large language model generates candidate operation and maintenance instructions, for operations involving table structure changes, adding non-blocking execution options or batch execution parameters based on hard constraints.

9. The intelligent database operation and maintenance method based on a large language model according to claim 5, characterized in that, The steps of executing candidate operation and maintenance instructions generated by the large language model based on structured prompt information in the shadow database also include traffic replay operations: extracting business traffic data within a preset backtracking time window before the time of an anomaly trigger from the binary log of the target database; parsing the business traffic data and filtering read-only query requests, retaining only write and update transaction requests; In the shadow database process, write and update transaction requests are replayed in accelerated replay mode, and candidate operation and maintenance instructions are injected during the replay process to simulate the dynamic impact of candidate operation and maintenance instructions on database performance under high-concurrency write load scenarios.

Citation Information

Patent Citations

  • EST-STR (expressed sequence tag-short tandem repeats) marker Lv-F36a related to litopenaeus vannamei growth characteristics, amplification primer of marker and application of marker

    CN108034729A

  • Comprehensive energy large model knowledge base dynamic construction method and system

    CN121144529A

  • MemoryOS: AI-Enhanced Context-Persistent Memory Layer and Self-Healing Restoration Method

    KR102893361B1