Database system performance prediction method based on domain knowledge and semi-supervised learning

Through a method based on domain knowledge and semi-supervised learning, new samples are generated using knowledge graphs and large language models, which solves the problems of high cost and insufficient accuracy of database performance prediction, and achieves efficient and accurate database performance prediction.

CN120448367APending Publication Date: 2025-08-08YANTAI VOCATIONAL COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510627881.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

Existing machine learning-based database performance prediction methods are costly and the scarcity of samples leads to insufficient prediction accuracy.

Method used

Using a method based on domain knowledge and semi-supervised learning, the knowledge graph is used to characterize the dependence between configuration parameters, and new samples are generated through large language models, combining Latin hypercube sampling and Monte Carlo Dropout estimation pseudo-labels to train the database system performance prediction model.

Benefits of technology

It reduces model training costs, improves prediction accuracy and training efficiency, can migrate between different database systems, and reduces expert experience intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448367A_ABST
    Figure CN120448367A_ABST
Patent Text Reader

Abstract

The invention discloses a database system performance prediction method based on domain knowledge and semi-supervised learning, and the method comprises the steps: selecting important configuration parameters of a to-be-tested database according to a knowledge graph which is used for representing the dependency relationship among various configuration parameters; inputting the important configuration parameters into a trained database system performance prediction model to obtain a performance prediction result of the to-be-tested database; wherein the database system performance prediction model is trained based on a semi-supervised learning method, and a new sample during training is generated by a large language model according to an original sample of which the uncertainty is higher than an uncertainty threshold and a knowledge graph. The method is low in cost and good in prediction accuracy and stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of database system optimization, and in particular relates to a database system performance prediction method based on domain knowledge and semi-supervised learning. Background Art

[0002] With the development of information technology, database systems have become one of the core components of modern information infrastructure. To meet the performance requirements of various application scenarios, database systems provide a large number of configurable parameters. Optimizing these parameters is crucial for achieving optimal database performance. However, due to the large number of parameters and the complex dependencies and constraints between them, capturing the mapping between database system configuration parameters and system performance is challenging, which increases the difficulty of tuning database system configuration parameters. Consequently, database system performance modeling has attracted widespread attention in academia and industry in recent years, and a large number of research methods have been proposed.

[0003] The core goal of database system performance modeling is to establish a mapping between database system configuration parameters and system performance, thereby enabling accurate performance prediction for any configuration parameter. In recent years, with the development of machine learning technology, learning-based performance modeling methods have gradually become mainstream. Based on the machine learning method used, performance modeling methods can be mainly divided into linear regression-based performance modeling methods, classification and regression tree-based performance modeling methods, and neural network-based performance modeling methods.

[0004] To use machine learning methods to build accurate performance prediction models, it is necessary to collect a large number of high-quality samples. However, it is very expensive to perform workload measurement performance indicators in large databases, resulting in a shortage of samples for building performance prediction models.

[0005] Therefore, the current database performance prediction methods based on machine learning are costly. Summary of the Invention

[0006] The embodiment of the present invention provides a database system performance prediction method based on domain knowledge and semi-supervised learning, which can solve the above technical problems.

[0007] In a first aspect, an embodiment of the present invention provides a method for predicting database system performance based on domain knowledge and semi-supervised learning, the method comprising:

[0008] Select important configuration parameters of the database to be tested based on the knowledge graph, where the knowledge graph is used to represent the dependencies between various configuration parameters;

[0009] Inputting the important configuration parameters into the trained database system performance prediction model to obtain the performance prediction results of the database to be tested;

[0010] The database system performance prediction model is trained based on a semi-supervised learning method, and new samples during training are generated by a large language model based on original samples with uncertainties higher than an uncertainty threshold and the knowledge graph.

[0011] In a second aspect, an embodiment of the present invention provides a database system performance prediction device based on domain knowledge and semi-supervised learning, comprising:

[0012] An acquisition unit, configured to select important configuration parameters of the database to be tested based on a knowledge graph, wherein the knowledge graph is used to characterize dependencies between various configuration parameters;

[0013] A prediction unit, configured to input the important configuration parameters into a trained database system performance prediction model to obtain a performance prediction result of the database to be tested;

[0014] The database system performance prediction model is trained based on a semi-supervised learning method, and new samples during training are generated by a large language model based on original samples with uncertainties higher than an uncertainty threshold and the knowledge graph.

[0015] The advantageous effects of the embodiments of the present invention compared with the prior art are: since the model used in the present invention is trained based on a semi-supervised learning method, and the new samples during training are generated by a large language model based on a knowledge graph and original samples with uncertainties higher than an uncertainty threshold; this makes the model in the present invention less expensive to train; and, by generating new samples based on the knowledge graph to detect areas with higher model prediction uncertainty, the training efficiency of the model and the prediction accuracy of the model can be improved; therefore, the present invention has a lower cost and a higher prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A flowchart of a configuration sampling method for a database system provided by an embodiment of the present invention;

[0017] Figure 2 A schematic diagram of a metadata extraction prompt template for a large language model provided by an embodiment of the present invention;

[0018] Figure 3 A schematic diagram of a scenario for extracting metadata of configuration parameters provided by an embodiment of the present invention;

[0019] Figure 4 A schematic diagram of a configuration relationship type determination template for a large language model provided by an embodiment of the present invention;

[0020] Figure 5a-5cA schematic diagram of an extraction prompt template for different dependency relationships of a large language model provided by an embodiment of the present invention;

[0021] Figure 6 A schematic diagram of a knowledge graph and configuration parameter dependency graph provided by an embodiment of the present invention;

[0022] Figure 7 A flowchart of a method for training a database system performance prediction model provided by an embodiment of the present invention;

[0023] Figure 8 A schematic diagram of a configuration sample generation template for a large language model provided by an embodiment of the present invention;

[0024] Figure 9 A flowchart of a method for predicting database system performance based on domain knowledge and semi-supervised learning provided by an embodiment of the present invention;

[0025] Figure 10 A schematic diagram of the structure of a database system performance prediction device based on domain knowledge and semi-supervised learning provided by an embodiment of the present invention;

[0026] Figure 11a-Figure 11c A schematic diagram comparing the prediction effects of different methods on different data sets. DETAILED DESCRIPTION

[0027] In the following description, specific details such as particular system structures and techniques are provided for purposes of illustration, not limitation, to facilitate a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.

[0028] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0029] It will also be understood that the term "and / or" used in the present description and appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0030] As used in the present specification and the appended claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0031] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0032] References to "one embodiment" or "some embodiments" in the present specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present invention. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0033] The present invention will be further described in detail below with reference to specific examples, but the embodiments of the present invention are not limited thereto.

[0034] The method provided in the embodiment of the present invention can be applied to electronic devices such as mobile terminals, personal notebook computers, supercomputers, etc. The embodiment of the present invention does not impose any restrictions on the specific type of electronic devices.

[0035] Figure 1 The flowchart shown is an implementation flow of a configuration sampling method for a database system provided by an embodiment of the present invention. As an example and not a limitation, the method may include steps S101-S104, each of which is described below.

[0036] S101: Perform domain knowledge structuring processing on the sample database to extract metadata of each configuration parameter.

[0037] In some embodiments, database optimization knowledge is often scattered across heterogeneous documents such as manuals, blogs, code, and papers. These documents contain a large amount of metadata about configuration parameters, such as their type, value range, default value, and related parameters. However, this knowledge exists in an unstructured form, making it difficult to directly use in configuration sampling and performance modeling. Therefore, a Retrieval-Augmented Generation (RAG) method can be used to extract configuration parameter metadata from an external knowledge base.

[0038] For example, RAG is a hybrid architecture that combines information retrieval and a large language model. Its core idea is to provide contextual knowledge support for the large language model by dynamically retrieving relevant document fragments from an external knowledge base, thereby improving the accuracy and interpretability of the generated content.

[0039] In one possible implementation, unstructured text can be collected from external knowledge bases such as official database documentation, tuning manuals, and technical blogs. This text can then be segmented into multiple text blocks. These blocks are then encoded to generate embedding vectors. An index for each block is then constructed based on the embedding vectors. This allows for the use of similarity metrics to retrieve blocks related to the query sample from the corpus, thereby extracting metadata for each configuration parameter.

[0040] In one example, a sliding window method may be used to segment text.

[0041] Exemplarily, the size of the sliding window may be 512 tokens, and the overlapping step may be 128 tokens, to ensure that key descriptions (such as parameter value ranges) are not truncated.

[0042] In one example, the bge-large-en-v1.5 pre-trained model can be used to encode each text block into a 1024-dimensional vector, capturing the complex semantic features of the document block. The embedding vector obtained by encoding the text block is then used using a vector database (Facebook AI Similarity Search, FAISS).

[0043] In one possible implementation, a hybrid search strategy can be used, using configuration parameters as query samples and retrieving relevant text blocks based on their embedding vectors. The relevant text blocks are then sorted and concatenated based on their relevance to the configuration parameters. The processed text is then input into the large language model using its metadata extraction prompt template to obtain metadata for the configuration parameters.

[0044] In one example, a hybrid search strategy may include semantic search and exact match search.

[0045] For example, a semantic search strategy involves calculating the cosine similarity between the query sample and the embedding vectors of the text blocks to match the most relevant text blocks (i.e., related text blocks). For example, if the query "innodb_buffer_pool_size value range, valid values, default values, and related parameters" is entered, FAISS will retrieve the five most relevant text blocks.

[0046] Exemplarily, exact match retrieval refers to retrieving text blocks related to the query by keyword matching, supplementing the precise description that may be missed by semantic retrieval.

[0047] In one example, a prompt word project can be used to sort the relevant text blocks in descending order of their relevance to the configuration parameters, and then the sorted relevant text blocks are spliced into a context and input into the metadata extraction prompt template of the large language model (see Figure 2 ), and then use the large language model to parse the search results and generate structured metadata of the configuration parameters.

[0048] For example, the structured metadata of the configuration parameter "nnodb_flush_sync" extracted by the hybrid retrieval strategy and context enhancement hint and generation strategy can be as follows Figure 3 shown.

[0049] S102: extracting dependencies of configuration parameters according to metadata of configuration parameters, and constructing a knowledge graph based on the dependencies.

[0050] In one possible implementation, the dependency information and description information of the configuration parameters can be first extracted from the metadata of the configuration parameters, and this information can be input into the large language model according to the configuration relationship judgment template of the large language model to obtain the dependency relationship types between various configuration parameters. Finally, the large language model can be used to uniformly represent the dependency relationships between the configuration parameters according to the types of these dependency relationships, which is convenient for the computer to read and recognize.

[0051] Illustratively, the dependency relationship between configuration parameters may include a mutual exclusion relationship, a constraint relationship, and a competition relationship.

[0052] A mutually exclusive relationship means that two parameters cannot take specific values at the same time, or the value of one parameter determines the value of another parameter (eg, query_cache_size is 0 when query_cache_type=OFF).

[0053] Constraints refer to the size constraints between two parameters (such as innodb_max_dirty_pages_pct_lwm <innodb_max_dirty_pages_pct)。

[0054] Competition refers to the sharing of limited resources by multiple parameters (such as limiting the total amount of memory parameters to no more than 90% of physical memory).

[0055] Complex interactions exist between database configuration parameters, which directly impact the validity of configuration sampling and system performance. Most current research fails to consider the dependencies between configuration parameters during model sampling and optimization, resulting in a large number of samples that violate domain knowledge rules, negatively impacting the efficiency of sampling and tuning. Therefore, this paper extracts the dependencies between configuration parameters before sampling and constructs a knowledge graph based on these dependencies, which can improve the efficiency of sampling and tuning.

[0056] In one example, the dependency information of the configuration parameters (such as the "related_parameters" field in the metadata) and the description information (such as the "description" field in the metadata) can be used as context to fill in the configuration relationship type determination template of the large language model (see Figure 4 ), using a large language model to classify the dependency type of each pair of associated parameters.

[0057] In one example, different types of dependencies need to be uniformly represented for sample verification during the subsequent sampling process. This can be achieved by using a few-shot approach, utilizing extraction prompt templates for different dependencies, and a large language model to uniformly represent the dependencies.

[0058] For example, it can be achieved by Figure 5a The template shown uses a large language model to extract mutually exclusive relationship attributes to generate logical expressions such as "if knob1>a, then knob2!=b". It then uses the four attributes "if_operator", "if_value", "then_operator", and "then_value" to decompose the logical expression, facilitating subsequent sample verification.

[0059] For example, the template shown in 5b can be used to extract constraint relationship attributes using a large language model to generate a linear constraint expression such as "knob1<=0.8*knob2", and the expression can be decomposed using the two attributes "operator" and "multiplier".

[0060] For example, it can be achieved by Figure 5c The template shown uses a large language model to extract competitive relationship attributes and determine the resource types that two configuration parameters will compete for.

[0061] In one possible implementation, in order to efficiently manage and query the dependencies between configuration parameters and facilitate the use of the dependencies between configuration parameters in subsequent processes, the dependencies between configuration parameters can be stored in the form of a knowledge graph.

[0062] Exemplarily, a knowledge graph may include multiple configuration parameter nodes, and two nodes with a dependency relationship are connected by a directed edge. The directed edge can be set on the dependent node, and the attributes of the edge can indicate the type of dependency relationship between the two nodes it connects.

[0063] For example, see Figure 6 , the attribute of node 2 in the knowledge graph 601 is the configuration parameter "knob1", and the attribute of node 3 is the configuration parameter "knob2". The dependency relationship between the two is a constraint relationship. "knob1" is constrained by "knob2", so the directed edge points from node 3 to node 2.

[0064] Specifically, a knowledge graph can be constructed and stored based on the Neo4j graph database.

[0065] S103 , selecting important configuration parameters from the configuration parameters based on the correlation between each configuration parameter and database performance.

[0066] In one example, a database can have various performance metrics, such as throughput, latency, and resource utilization. Different performance metrics can be predicted based on different configuration parameters. Therefore, before sampling, it is necessary to select the corresponding configuration parameters as key parameters based on the model's prediction purpose. These parameters will be used in the subsequent model training process. For example, if the model is used to predict database throughput, configuration parameters related to throughput can be selected as key parameters.

[0067] For example, the correlation between each configuration parameter and the performance indicator of the database may be calculated, and configuration parameters with a correlation greater than a correlation threshold may be selected as important configuration parameters.

[0068] S104, under the constraints of the knowledge graph, sample original samples from the sample database based on the Latin hypercube sampling method.

[0069] For example, the original sample may be a set of specific values of important configuration parameters.

[0070] For example, the Latin hypercube sampling method performed under the constraints of the knowledge graph can also be called the "constraint-aware Latin hypercube sampling" method.

[0071] Latin Hypercube Sampling (LHS) is a multidimensional space uniform sampling method. Its core idea is to divide the value range of each parameter into equal-width intervals and randomly select a value in each interval to ensure that the sample points in each dimension are evenly distributed. However, it ignores the dependencies between parameters. The generated samples may violate the mutual exclusion, constraints or resource competition restrictions between parameters, resulting in a large number of invalid samples. For example, if the parameters "knob1" and "knob2" are mutually exclusive, traditional LHS cannot avoid illegal combinations. The core idea of the Constraint-Aware LHS (CA-LHS) method is to embed the rule constraints of the knowledge graph into the sampling process, which can ensure that all samples meet the domain knowledge rules.

[0072] In one possible implementation, the dependency relationships of important configuration parameters can be extracted from the knowledge graph to construct an important configuration parameter dependency graph; then, based on a depth-first search strategy, the topological sampling order of the important configuration parameters is determined according to the dependency graph; the value range of each important configuration parameter is determined according to the topological sampling order, and the value range of the unsampled parameters is adjusted according to the sampled parameter values, and the unsampled important configuration parameters are sampled according to the adjusted range to obtain the original samples to be verified; finally, the original samples to be verified are verified according to the dependency graph, and the samples that meet the dependency graph are used as the original samples, and those that do not meet the dependency graph are corrected until they meet the dependency graph.

[0073] In one example, dependent parameters are prioritized in the topological sampling order so that their constraints can be passed to the sampling process of subsequent parameters.

[0074] For example, see Figure 6 In the knowledge graph 601, nodes 2, 3, and 5 are important configuration parameters. Then, an important configuration parameter dependency graph as shown in 602 can be extracted based on the knowledge graph 601. The topological sampling order of the important configuration parameters determined according to the dependency graph can be: 3, 2, 5 from front to back.

[0075] In one example, for unsampled numeric configuration parameters, they can be sampled uniformly within their adjusted value range; for unsampled enumeration configuration parameters, they can be randomly selected within their adjusted value range; for unsampled Boolean parameters, they can be randomly sampled from "ON" and "OFF".

[0076] According to the sampling method provided by the present invention, the dependencies of configuration parameters are extracted through a large language model to construct a knowledge graph. Under the constraints of the knowledge graph, the metadata of the configuration parameters is sampled so that the sampled original samples meet the dependencies and constraints. This can avoid sampling a large number of samples that violate domain knowledge rules, improve sample quality, and thus enhance the training effect of the model. At the same time, the external knowledge base is structured through the RAG method, and configuration parameters with high relevance and significant impact on database performance are selected to participate in the model training and prediction process. This can improve the scalability of the model, enable its migration between different database systems, and avoid the excessive involvement of human factors such as expert experience.

[0077] Figure 7 The flowchart shown is an implementation flow of a method for training a database system performance prediction model provided by an embodiment of the present invention. As an example and not a limitation, the method may include steps S701-S709, each of which is described below.

[0078] S701 , extracting the i-th round training samples from the unlabeled original samples and inputting them into the database system performance prediction model after the i-1-th round of training to obtain pseudo labels for the i-th round training samples.

[0079] For example, i is a positive integer, and the database system performance prediction model f after the 0th round of training is θ (x) is based on the labeled initial training set D′ labd The initial training set D′ with labels is obtained by training the initial database system performance prediction model. labd The unlabeled initial training set X vaild Obtained by inputting the initial database system performance prediction model.

[0080] In one example, the original sample X unlabel It can be sampled from the metadata of the configuration parameters based on the above sampling method.

[0081] For example, p samples can be randomly selected from the unlabeled original samples as the i-th round training samples X i sampled .

[0082] For example, pseudo labels can be used to indicate the performance of a sample database.

[0083] S702 , evaluating the uncertainty of the pseudo labels of the i-th round training samples, and selecting samples whose pseudo label uncertainty is higher than an uncertainty threshold as the first basic samples of the i-th round.

[0084] For example, Monte Carlo Dropout can be used to estimate the uncertainty of pseudo labels, and then filter out those with uncertainty higher than the uncertainty threshold σthreshold The sample is used as the first basic sample X in round i i unc .

[0085] S703: Using the large language model, generate new samples for the i-th round based on the knowledge graph and the first basic samples for the i-th round.

[0086] For example, it can be based on Figure 8 The configuration sample shown generates a template, using a large language model, based on the knowledge graph and X i unc Generate q new samples X for round i i llm , explore uncovered areas.

[0087] S704 : Input the new samples of the i-th round into the database system performance prediction model trained after the i-1-th round to obtain pseudo labels of the new samples of the i-th round.

[0088] S705 , evaluating the uncertainty of the pseudo labels of the new samples in the i-th round, and selecting samples whose pseudo label uncertainty is higher than the uncertainty threshold as the second basic samples in the i-th round.

[0089] Similarly, we can use Monte Carlo Dropout to estimate the uncertainty of pseudo labels and then filter out those with uncertainty above the uncertainty threshold σ threshold The sample is used as the second basic sample X in round i i llm_unc .

[0090] S706: Input the first basic sample of the i-th round and the second basic sample of the i-th round into the database system performance prediction model after the i-1-th round training to obtain the pseudo labels of the first basic sample of the i-th round and the pseudo labels of the second basic sample of the i-th round.

[0091] S707 , updating the model parameters of the database system performance prediction model after the i-1th round of training according to the i-th round input samples and their pseudo labels, to obtain the database system performance prediction model after the i-th round of training.

[0092] For example, the input samples of round i may include the input samples of round i-1, the first basic samples of round i, the second basic samples of round i, the new samples X of round i, and the input samples X of round i. i llm and X in the i-th round training sample i sampled high confidence samples.

[0093] S708: Determine whether the database system performance prediction model has remaining prediction times.

[0094] For example, the number of predictions remaining after the i-th round of training can be calculated using the following formula:

[0095] B i =B i-1 -|X i llm |-|X i llm_unc |

[0096] Among them, B 0 =B-|D′ labd |, B is the preset total number of predictions.

[0097] In one example, if B i If it is greater than 0, there are still remaining prediction times, and the next training can be started from step S701 by setting i=i+1.

[0098] In another example, if B i If it is less than or equal to 0, there are no remaining prediction times, and step S709 can be performed.

[0099] S709: Output the database system performance prediction model after the i-th round of training as a trained database system performance prediction model.

[0100] According to the method provided by the present invention, semi-supervised learning is used to generate pseudo labels using a large number of unlabeled samples, which can expand the data scale and alleviate the problem of data scarcity. A large language model is used to explore areas with high model prediction uncertainty, and new samples are generated based on the large language model and knowledge graph, which can improve the training efficiency of the model.

[0101] Figure 9 The flowchart shown is an implementation flow of a method for predicting database system performance based on domain knowledge and semi-supervised learning provided by an embodiment of the present invention. As an example and not a limitation, the method may include steps S901-S902, each of which is described below.

[0102] S901: Select important configuration parameters of the database to be tested based on the knowledge graph.

[0103] Exemplarily, a knowledge graph is constructed when executing the above-mentioned sampling method.

[0104] Exemplarily, the important configuration parameters of the database to be tested may be selected by a method similar to the above step S104.

[0105] S902: Input important configuration parameters into the trained database system performance prediction model to obtain the performance prediction results of the database to be tested.

[0106] Exemplarily, the database system performance prediction model is trained based on the above training method.

[0107] Since the model used in the present invention is trained based on the semi-supervised learning method, and new samples are generated by the large language model according to the knowledge graph and the original samples whose uncertainty is higher than the uncertainty threshold during training; this makes the model in the present invention less expensive to train; and, by generating new samples based on the knowledge graph to detect areas where the model prediction uncertainty is higher, the training efficiency of the model and the prediction accuracy of the model can be improved; therefore, the cost of the present invention is relatively low and the prediction accuracy is relatively high.

[0108] Furthermore, in the sampling process before training the model, the present invention extracts the dependency of configuration parameters through a large language model to construct a knowledge graph, and samples the metadata of the configuration parameters under the constraints of the knowledge graph, so that the sampled original samples meet the dependency and constraint conditions, which can avoid sampling a large number of samples that violate domain knowledge rules, improve sample quality, and thus improve the training effect of the model; the external knowledge base is structured through the RAG method, and configuration parameters with high relevance and significant impact on database performance are selected to participate in the training and prediction process of the model, which can improve the scalability of the model and enable it to be migrated between different database systems, avoiding excessive involvement of human factors such as expert experience.

[0109] Figure 10 The diagram shows a schematic diagram of a database system performance prediction device based on domain knowledge and semi-supervised learning according to an embodiment of the present invention. As an example and not a limitation, the device may include an acquisition unit 1010 and a prediction unit 1020.

[0110] Exemplarily, the acquisition unit 1010 is used to select important configuration parameters of the database to be tested based on the knowledge graph, wherein the knowledge graph is used to characterize the dependency relationship between various configuration parameters; the prediction unit 1020 is used to input the important configuration parameters into the trained database system performance prediction model to obtain the performance prediction results of the database to be tested; wherein the database system performance prediction model is trained based on a semi-supervised learning method, and the new samples during training are generated by the large language model based on the original samples and the knowledge graph whose uncertainty is higher than the uncertainty threshold.

[0111] In order to better illustrate the beneficial effects of the present invention, the following simulation experiments were conducted:

[0112] For example, the simulation experiment can select three representative benchmark test data sets in the field of database performance testing, namely TPC-H, TPC-C and JOB, to verify the effectiveness of the prediction method provided by the present invention in online analytical processing (OLAP), online transaction processing (OLTP) and complex connection load scenarios.

[0113] For example, simulation experiments can also compare the prediction results of the prediction method provided by the present invention with those based on the DeepPerf model, the Random Forest (RF) model, and the Support Vector Regression (SVR) model. The quality of the prediction results can be measured by two indicators: Mean Relative Error (MRE) and Margin of Error.

[0114] See Table 1 for the prediction results of different methods on different datasets. Figure 11a-Figure 11c Shown are the prediction effects of different methods on three data sets; “EfficPerf” represents the prediction method provided by the present invention.

[0115] From the following Table 1 and Figure 11a-Figure 11c As can be seen, the prediction accuracy of the present invention is higher than that of other methods in different scenarios and datasets. With the same sampling cost, the prediction accuracy of the present invention is improved by an average of 8.90%, 21.30%, and 26.50% compared to DeepPerf, RF, and SVR, respectively. Furthermore, the margin of error of the present invention is smaller than that of other methods in almost all cases. Therefore, the present invention has better accuracy and stability.

[0116] Table 1

[0117]

[0118] Since the model used in the present invention is trained based on the semi-supervised learning method, and new samples are generated during training based on the knowledge graph and original samples with uncertainty higher than the uncertainty threshold; this makes the model in the present invention less expensive to train; and, by generating new samples based on the knowledge graph to detect areas with higher model prediction uncertainty, the training efficiency of the model and the prediction accuracy of the model can be improved; therefore, the cost of the present invention is relatively low and the prediction accuracy is relatively high.

[0119] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

Claims

1. A database system performance prediction method based on domain knowledge and semi-supervised learning, characterized in that: include: Select important configuration parameters of the database to be tested based on the knowledge graph, where the knowledge graph is used to represent the dependencies between various configuration parameters; Inputting the important configuration parameters into the trained database system performance prediction model to obtain the performance prediction results of the database to be tested; The database system performance prediction model is trained based on a semi-supervised learning method, and new samples during training are generated by a large language model based on original samples with uncertainties higher than an uncertainty threshold and the knowledge graph.

2. The method according to claim 1, characterized in that The training method of the database system performance prediction model includes: Extracting the i-th round of training samples from the unlabeled original samples and inputting them into the database system performance prediction model after the i-1-th round of training to obtain pseudo labels for the i-th round of training samples, wherein the original samples are important configuration parameter values sampled from the metadata of the configuration parameters; Evaluate the uncertainty of the pseudo labels of the i-th round training samples, and select samples whose pseudo label uncertainty is higher than an uncertainty threshold as the first basic samples of the i-th round; Using a large language model, generate new samples for round i based on the knowledge graph and the basic samples for round i; Input the new samples of the i-th round into the database system performance prediction model trained after the i-1-th round to obtain pseudo labels of the new samples of the i-th round; Evaluate the uncertainty of the pseudo labels of the new samples in the i-th round, and select samples whose pseudo label uncertainty is higher than the uncertainty threshold as the second basic samples in the i-th round; Inputting the first basic sample of the i-th round and the second basic sample of the i-th round into the database system performance prediction model after the i-1-th round training to obtain the pseudo labels of the first basic sample of the i-th round and the pseudo labels of the second basic sample of the i-th round; updating model parameters of the database system performance prediction model after the i-1th round of training based on the i-th round input samples and their pseudo labels to obtain the database system performance prediction model after the i-th round of training, wherein the i-th round input samples include: the i-1th round input samples, the first basic samples of the i-th round, the second basic samples of the i-th round, the i-th round new samples, and high-confidence samples in the i-th round training samples; Determine whether the database system performance prediction model has remaining prediction times. If not, output the database system performance prediction model after the i-th round of training as a trained database system performance prediction model.

3. The method according to claim 2, characterized in that Before extracting the i-th round of training samples from the unlabeled original samples, the method further includes: Perform domain knowledge structuring on the external knowledge base to extract metadata of each configuration parameter; Extracting dependencies of the configuration parameters according to the metadata of the configuration parameters, and constructing a knowledge graph based on the dependencies; Selecting the important configuration parameters from the configuration parameters according to the correlation between each configuration parameter and the database performance indicator; Under the constraints of the knowledge graph, original samples are sampled from the metadata of the configuration parameters based on the Latin hypercube sampling method.

4. The method according to claim 3, characterized in that The domain knowledge structuring process is performed on the external knowledge base to extract metadata of each configuration parameter, including: Extracting text from the external knowledge base and segmenting the text to obtain multiple text blocks; Encoding the text block to obtain an embedding vector; Metadata of each configuration parameter is extracted according to the embedding vector.

5. The method according to claim 4, characterized in that Extracting metadata of each configuration parameter according to the embedded vector includes: Based on a hybrid retrieval strategy, the configuration parameters are used as query samples, and relevant text blocks are retrieved according to the embedding vectors of the text blocks, wherein the hybrid retrieval strategy includes semantic retrieval and exact match retrieval; The relevant text blocks are sorted and spliced in sequence according to their relevance to the configuration parameters, and the processed texts are input into the large language model according to the metadata extraction prompt template of the large language model to obtain the metadata of the configuration parameters.

6. The method according to claim 3, characterized in that The extracting the dependency relationship of the configuration parameters according to the metadata of the configuration parameters includes: Extracting dependency information and description information of the configuration parameters from metadata of the configuration parameters; Inputting the dependency information and the description information into the large language model according to the configuration relationship type determination template of the large language model to obtain the dependency relationship type between the configuration parameters; The dependency relationships between configuration parameters are uniformly represented according to the dependency relationship types using a large language model.

7. The method according to claim 3, characterized in that The knowledge graph includes multiple configuration parameter nodes, which are connected by directed edges. The attributes of the directed edges are used to indicate the dependency relationship between the configuration parameters.

8. The method according to claim 3, characterized in that The selecting the important configuration parameters from the configuration parameters according to the correlation between each configuration parameter and the database performance indicator includes: Determining a correlation between each configuration parameter and the database performance indicator; The configuration parameters whose correlation is greater than the correlation threshold are determined as the important configuration parameters.

9. The method according to claim 3, characterized in that The step of sampling original samples from the metadata of the configuration parameters based on the Latin hypercube sampling method under the constraints of the knowledge graph includes: Extract the dependency relationship from the knowledge graph and construct an important configuration parameter dependency graph; Based on a depth-first search strategy, determining a topological sampling order of the important configuration parameters according to the important configuration parameter dependency graph; Determining a value range of each important configuration parameter according to the topology sampling order, and adjusting a value range of an unsampled important configuration parameter according to the sampled important configuration parameter values; Sampling of important configuration parameters that have not been sampled is performed according to the adjusted value range; After completing the sampling of all important configuration parameters, the original sample to be verified is obtained; The original samples to be verified are verified according to the important configuration parameter dependency graph, and the original samples to be verified that conform to the important configuration parameter dependency graph are used as the original samples.

10. A database system performance prediction device based on domain knowledge and semi-supervised learning, characterized in that: include: An acquisition unit, configured to select important configuration parameters of the database to be tested based on a knowledge graph, wherein the knowledge graph is used to characterize dependencies between various configuration parameters; A prediction unit, configured to input the important configuration parameters into a trained database system performance prediction model to obtain a performance prediction result of the database to be tested; The database system performance prediction model is trained based on a semi-supervised learning method, and new samples during training are generated by a large language model based on original samples with uncertainties higher than an uncertainty threshold and the knowledge graph.