A parameter adjustment method and device, electronic equipment and storage medium
By constructing a tree model to determine the importance of database parameters and automatically adjusting them, the problem of high labor costs caused by manual adjustment is solved, and automatic optimization of database parameters is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- AGRICULTURAL BANK OF CHINA
- Filing Date
- 2023-03-29
- Publication Date
- 2026-07-03
Smart Images

Figure CN116450606B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a parameter adjustment method, apparatus, electronic device and storage medium. Background Technology
[0002] In today's information and big data era, databases are used to store, organize, and manage user and system data, and are an indispensable computer system software for application systems.
[0003] It should be noted that databases have a variety of parameters, which directly affect their performance. Currently, to ensure effective database operation, these parameters are primarily adjusted manually by technical personnel, resulting in extremely high labor costs, a problem that urgently needs to be addressed. Summary of the Invention
[0004] This invention provides a parameter adjustment method, apparatus, electronic device, and storage medium to achieve automatic adjustment of parameters in a target database, thereby reducing labor costs.
[0005] According to one aspect of the present invention, a parameter adjustment method is provided, which may include:
[0006] Obtain the target parameter value of at least one parameter of the target database, and obtain the target running data of the target database under the target parameter value, and use the target parameter value and the target running data as a set of target construction samples;
[0007] Based on at least one set of target samples, a tree model is constructed, and based on the tree model, the parameter importance corresponding to at least one parameter is obtained;
[0008] Based on the importance of each of the at least one parameters, the target parameter value of the important parameter among the at least one parameters is adjusted.
[0009] According to another aspect of the present invention, a parameter adjustment device is provided, which may include:
[0010] The target construction sample is used as a module to obtain the target parameter value of at least one parameter of the target database, and to obtain the target running data of the target database under the target parameter value, and to use the target parameter value and the target running data as a set of target construction samples;
[0011] The parameter importance acquisition module is used to construct samples based on at least one set of targets, construct a tree model, and obtain the parameter importance corresponding to at least one parameter based on the tree model.
[0012] The target parameter value adjustment module is used to adjust the target parameter value of the important parameter among the at least one parameters based on the parameter importance corresponding to each of the at least one parameter.
[0013] According to another aspect of the present invention, an electronic device is provided, which may include:
[0014] At least one processor; and
[0015] A memory that is communicatively connected to at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by at least one processor, such that when the at least one processor executes the program, it implements the parameter adjustment method provided in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided having computer instructions stored thereon for causing a processor to execute and implement the parameter adjustment method provided in any embodiment of the present invention.
[0018] The technical solution of this invention involves obtaining target parameter values for at least one parameter of a target database, and obtaining target running data of the target database under the target parameter values. The target parameter values and target running data are then used as a set of target construction samples. Based on the obtained at least one set of target construction samples, a tree model is constructed, and the parameter importance corresponding to at least one parameter is obtained according to the tree model. Based on the parameter importance corresponding to at least one parameter, the target parameter values of the important parameters among the at least one parameter are adjusted. This technical solution of the present invention, by adjusting the target parameter values of the important parameters among at least one parameter based on the parameter importance obtained from the constructed tree model, can achieve automatic adjustment of the parameters of the target database, thereby reducing labor costs.
[0019] It should be understood that the description in this section is not intended to identify key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0020] Figure 1 This is a flowchart of a parameter adjustment method provided in Embodiment 1 of the present invention;
[0021] Figure 2 This is a flowchart of a tree model construction method provided in Embodiment 1 of the present invention;
[0022] Figure 3 This is a flowchart of a parameter adjustment method provided in Embodiment 2 of the present invention;
[0023] Figure 4 This is a flowchart of a parameter adjustment method provided in Embodiment 3 of the present invention;
[0024] Figure 5 This is a flowchart of an optional example of a parameter adjustment method provided in Embodiment 3 of the present invention;
[0025] Figure 6 This is a structural block diagram of the parameter adjustment device provided in Embodiment 4 of the present invention;
[0026] Figure 7 This is a schematic diagram of the structure of an electronic device that implements the parameter adjustment method of the present invention. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The same applies to "target," "original," etc., and will not be repeated here. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0029] Example 1
[0030] Figure 1 This is a flowchart of a parameter adjustment method provided in Embodiment 1 of the present invention. This embodiment is applicable to the adjustment of parameters in a database. The method can be executed by the parameter adjustment device provided in this embodiment of the invention. This device can be implemented in software and / or hardware, and can be integrated into an electronic device, which can be various user terminals or servers.
[0031] See Figure 1The method of this invention specifically includes the following steps:
[0032] S110. Obtain the target parameter value of at least one parameter of the target database, and obtain the target running data of the target database under the target parameter value, and use the target parameter value and the target running data as a set of target construction samples.
[0033] In this context, the target database can be understood as the database whose parameters need to be adjusted. Parameters can be understood as parameters within the target database, or as parameters within the target database that can be adjusted, such as system parameters within the database. Target parameter values can be understood as the parameter values corresponding to the parameters. Target operational data can be understood as data that characterizes the stability or performance of the target database when it runs under target parameter values. In practical applications, the dimensions of the target operational data can optionally include at least one of system processing capacity, throughput, and latency. System processing capacity can be, for example, the number of transactions per second (TPS), and throughput can be, for example, the number of queries per second (QPS). Combined with subsequent steps, it can be seen that collecting target operational data under different dimensions helps to ensure the operational performance of the target database across multiple dimensions. Target construction samples can be understood as samples used to construct the tree model. A tree model can be understood as a tree-structured model or a model that includes a tree-structured model.
[0034] In this embodiment of the invention, the target parameter value of at least one parameter of the target database and the target running data of the target database under the target parameter value can be collected in advance and the above data can be saved. When needed, the target parameter value of at least one parameter of the target database and the target running data of the target database under the target parameter value can be obtained directly, and the target parameter value and the target running data can be used as a set of target construction samples.
[0035] S120. Based on at least one set of targets, construct samples to obtain a tree model, and based on the tree model, obtain the parameter importance corresponding to at least one parameter.
[0036] It should be noted that the tree model in this embodiment of the invention is a tree model capable of determining parameter importance based on the tree model itself, such as a random forest model or an XGB model, etc., without specific limitations. Parameter importance can be understood as the importance score of the parameters in the target construction samples for building the tree model. The parameters can be regarded as features of the constructed tree model, and parameter importance is the feature importance that can be obtained based on the tree model. In this embodiment of the invention, the method for obtaining the parameter importance corresponding to at least one parameter based on the tree model is not specifically limited. Optionally, any method for calculating the feature importance of the tree model can be used to calculate parameter importance.
[0037] For example, a tree model can be constructed through the following steps:
[0038] The step of randomly selecting at least one set of target construction samples from at least one set of target construction samples as a sample construction set can be performed at least once with sampling replacement;
[0039] Based on the at least one sample construction set obtained above, for each sample construction set in the at least one sample construction set, see [link to documentation]. Figure 2 From the parameters included in the sample construction set, at least one parameter can be randomly and without repetition selected as at least one root node parameter, and the root node Gini index or root node information entropy of each root node parameter in the at least one root node parameter can be determined based on the sample construction set. The root node Gini index can be understood as the Gini index of the root node parameter, and the root node information entropy can be understood as the information entropy of the root node parameter.
[0040] The root node with the smallest Gini index or root node information entropy is used as the root node of the decision tree corresponding to the sample set, and the root node is updated to the current node.
[0041] The current node Gini index is determined based on the sample construction set. This current node Gini index can be understood as the Gini index corresponding to the current node.
[0042] Based on the Gini index of the current node and a preset threshold, it is determined whether the current node can be split or whether its corresponding child nodes have not yet been split. The preset threshold can be understood as a pre-set Gini index threshold for determining whether the current node can be split. For example, the preset threshold can be determined according to the pruning requirements of the decision tree corresponding to the sample construction set.
[0043] If the current node is splittable or its corresponding child nodes have not yet split, randomly and without repetition select at least one parameter from the parameters included in the sample construction set as at least one current node parameter, and determine the current node Gini index or current node information entropy of each current node parameter in the at least one current node parameter based on the sample construction set. The current node Gini index can be understood as the Gini index of the current node parameter, and the current node information entropy can be understood as the information entropy of the current node parameter.
[0044] Split the current node according to the Gini index or the parameter of the current node with the smallest information entropy, update the current node with at least one child node obtained after the split, and update the decision tree corresponding to the sample construction set based on the split result;
[0045] Determine whether all current nodes are unsplittable. If there is a current node that is splittable or whose corresponding child nodes have not yet split, update the current node that is splittable or whose corresponding child nodes have not yet split to the current node, and return to the steps described above for determining the current node Gini index based on the sample construction set.
[0046] If no split is possible at the current node, then the decision tree corresponding to the sample construction set is obtained;
[0047] Based on at least one decision tree, a tree model is obtained;
[0048] If the current node cannot be split and all its corresponding child nodes have been split, then proceed to determine whether the current node cannot be split at all.
[0049] It should be noted that the tree model constructed in the embodiments of the present invention can also be used to predict the stability or performance of a target database, or a similar database of the same type as the target database. For example, the parameter values of the target database can be input into the tree model, and the prediction results related to the stability or performance of the target database can be determined based on the output results of the tree model. As another example, the parameter values of the similar database can be input into the tree model, and the prediction results related to the stability or performance of the similar database can be determined based on the output results of the tree model.
[0050] S130. Based on the importance of each parameter, adjust the target parameter value of the important parameter among the at least one parameters.
[0051] Among them, important parameters can be understood as at least one parameter that requires parameter adjustment.
[0052] In this embodiment of the invention, considering that the importance of a parameter can characterize the degree of importance of the parameter, the important parameters that require adjustment can be determined based on the importance of at least one parameter, and the target parameter values of the important parameters can be adjusted.
[0053] In this embodiment of the invention, the important parameters can be selected based on their respective importance, with all parameters in the at least one parameter considered as important parameters, and the important parameters adjusted sequentially according to the target parameter values corresponding to the importance of the at least one parameter. Alternatively, a predetermined number or a predetermined proportion of parameters in the at least one parameter can be selected as important parameters based on their respective importance, and the target parameter values of the important parameters can be adjusted. For example, the top 5 most important parameters in the at least one parameter can be selected as important parameters, and the target parameter values of the important parameters can be adjusted accordingly. Another example is selecting the top 5% most important parameters in the at least one parameter as important parameters, and the target parameter values of the important parameters can be adjusted accordingly. And so on.
[0054] The technical solution of this invention involves obtaining target parameter values for at least one parameter of a target database, and obtaining target running data of the target database under the target parameter values. The target parameter values and target running data are then used as a set of target construction samples. Based on the obtained at least one set of target construction samples, a tree model is constructed, and the parameter importance corresponding to at least one parameter is obtained according to the tree model. Based on the parameter importance corresponding to at least one parameter, the target parameter values of the important parameters among the at least one parameter are adjusted. This technical solution of the present invention, by adjusting the target parameter values of the important parameters among at least one parameter based on the parameter importance obtained from the constructed tree model, can achieve automatic adjustment of the parameters of the target database, thereby reducing labor costs.
[0055] An optional technical solution involves obtaining the parameter importance corresponding to at least one parameter based on a tree model, including: determining the Gini index of each tree node in the tree model based on the target parameter value of at least one parameter in at least one set of target construction samples; determining the target tree node to be split based on the parameter for each of the at least one parameters; determining the change in the Gini index of the target tree node based on the Gini index of each tree node; and determining the parameter importance of the parameter based on the change in the Gini index.
[0056] In this context, a tree node can be understood as a node in a tree model, specifically a node on a decision tree within that model. A target tree node can be understood as a tree node that splits based on parameters. The change in the Gini index represents the change in the Gini index of the target tree node before and after branching based on the parameters; this change in the Gini index characterizes the importance of the parameters to the target tree node.
[0057] For example, based on the target parameter values of at least one parameter in at least one set of target construction samples, the Gini index of each tree node in the tree model is determined. The formula for determining the Gini index of each tree node can be:
[0058]
[0059] in, Let be the Gini index of tree node q in the m-th decision tree. C is the number of classes in the samples for at least one set of objectives. Let be the proportion of category c in tree node q of the m-th decision tree. Let be the proportion of category d in tree node q of the m-th decision tree.
[0060] For each of the at least one parameters, determine the target tree node to be split according to the parameter from each tree node; based on the Gini index of each tree node, determine the change in the Gini index of the target tree node, and the formula for determining the change in the Gini index can be:
[0061]
[0062] in, GINI represents the change in Gini index before and after the target tree node q is branched according to parameter i. q This can be understood as the Gini index of the target tree node q, GINI o and GINI p These represent the Gini indexes of at least two tree nodes after the branch.
[0063] Based on the change in the Gini index of the target tree node, the importance of the parameter in each decision tree in the tree model can be determined. The formula for determining the importance of the parameter in each decision tree can be:
[0064]
[0065] Among them, VR in This can be understood as the importance of parameter i in the nth decision tree. M is the set of nodes in the target tree.
[0066] The importance of a parameter in a tree model is determined based on its importance in each decision tree within that model. The formula for determining the importance of a parameter in a tree model can be:
[0067]
[0068] Among them, VR i VR represents the importance of parameter i in the tree model. ij Let i represent the importance of parameter i in the j-th decision tree, and k represent the number of decision trees in the tree model.
[0069] The importance of parameters in the tree model is normalized to obtain the parameter importance. The formula for calculating the parameter importance is:
[0070]
[0071] Among them, VIM i The importance of parameter i. a is the number of parameters with at least one value. VR j The importance of parameter j in the tree model.
[0072] In this embodiment of the invention, the Gini index of each tree node in the tree model is determined based on the target parameter value of at least one parameter in at least one set of target construction samples; for each of the at least one parameter, a target tree node for splitting according to the parameter is determined from each tree node; the change in the Gini index of the target tree node is determined based on the Gini index of each tree node; and the parameter importance is determined based on the change in the Gini index. This scheme can determine the parameter importance of parameters with relatively high accuracy.
[0073] Example 2
[0074] Figure 3 This is a flowchart of another parameter adjustment method provided in Embodiment 2 of the present invention. This embodiment is an optimization based on the above-described technical solutions. In this embodiment, optionally, adjusting the target parameter value of the important parameter among the at least one parameter based on the parameter importance corresponding to each of the at least one parameter includes: sorting the at least one parameter based on the parameter importance corresponding to each of the at least one parameter, and determining the important parameter among the at least one parameter based on the obtained sorting result; and adjusting the target parameter value of the important parameter. The explanations of terms that are the same as or corresponding to those in the above embodiments will not be repeated here.
[0075] See Figure 3 The method in this embodiment may specifically include the following steps:
[0076] S210. Obtain the target parameter value of at least one parameter of the target database, and obtain the target running data of the target database under the target parameter value, and use the target parameter value and the target running data as a set of target construction samples.
[0077] S220. Based on at least one set of targets, construct samples to obtain a tree model, and based on the tree model, obtain the parameter importance corresponding to at least one parameter.
[0078] S230. Based on the importance of each parameter, sort the at least one parameter, and based on the sorting result, determine the important parameter among the at least one parameters.
[0079] In this embodiment of the invention, at least one parameter can be sorted based on the importance of each parameter. For example, at least one parameter can be sorted in descending order of importance. Based on the sorting result, important parameters among the at least one parameter can be determined. For example, based on the sorting result, a predetermined number of parameters or a predetermined proportion of the parameters among the at least one parameter can be determined as important parameters. Alternatively, based on the sorting result, the first-ranked parameter among the at least one parameter can be determined as an important parameter, so that the performance and stability of the target database can be improved by adjusting only some of the more important parameters.
[0080] S240. Adjust the target parameter values for important parameters.
[0081] The technical solution of this invention involves sorting at least one parameter based on its importance, determining the most important parameter among the at least one parameters based on the sorting results, and adjusting the target parameter values of the most important parameters. In this invention, by sorting at least one parameter, determining the most important parameter, and adjusting the target parameter values of the most important parameter, the automatic adjustment of parameters in the target database can be further achieved, thereby reducing labor costs.
[0082] An optional technical solution, wherein the number of at least one parameter is at least two, and based on the obtained sorting result, determining the important parameter among the at least one parameter includes: based on the obtained sorting result, determining at least two important parameters among the at least two parameters; the parameter adjustment method further includes: obtaining the adjustment order of each important parameter among the at least two important parameters; adjusting the target parameter value of the important parameter includes: based on the adjustment order, sequentially adjusting the target parameter value of the at least two important parameters.
[0083] In this embodiment of the invention, when the number of at least two parameters is at least one, at least two important parameters can be determined based on the obtained sorting results; the adjustment order of each important parameter can be obtained, which can characterize the order in which important parameters are adjusted sequentially; based on the adjustment order, the target parameter values of the at least two important parameters are adjusted sequentially, for example, the important parameters with higher adjustment orders can be adjusted first. The above scheme can enable the prioritization of adjusting more important parameters when there are multiple parameters that need adjustment, thereby improving the performance and stability of the target database as quickly as possible.
[0084] Example 3
[0085] Figure 4 This is a flowchart of another parameter adjustment method provided in Embodiment 3 of the present invention. This embodiment is an optimization based on the above technical solutions. In this embodiment, optionally, the parameter adjustment method further includes: determining a similar database of the same type as the target database, wherein at least one parameter of the similar database is the same as at least one parameter of the target database; obtaining similar parameter values of at least one parameter of the similar database, and obtaining similar running data of the similar database running under similar parameter values, and using the similar parameter values and similar running data as a set of similar construction samples; constructing a tree model based on the obtained at least one set of target construction samples, including: constructing a tree model based on the obtained at least one set of target construction samples and at least one set of similar construction samples. The explanations of terms that are the same as or corresponding to those in the above embodiments will not be repeated here.
[0086] See Figure 4 The method in this embodiment may specifically include the following steps:
[0087] S310. Obtain the target parameter value of at least one parameter of the target database, and obtain the target running data of the target database under the target parameter value, and use the target parameter value and the target running data as a set of target construction samples.
[0088] S320. Identify a database of the same or similar type as the target database, wherein at least one parameter of the database of the same type is the same as at least one parameter of the target database.
[0089] Among them, a similar database can be understood as a database of the same or similar type as the target database. The similar database has little difference from the target database in terms of parameters, attributes and / or performance, and at least one parameter of the similar database is the same as at least one parameter of the target database.
[0090] S330. Obtain the same parameter value of at least one parameter of the same type of database, and obtain the same running data of the same type of database running under the same parameter value, and take the same parameter value and the same running data as a set of same construction samples.
[0091] Here, "similar parameter values" can be understood as parameter values corresponding to those of similar databases. "Similar operational data" can be understood as data obtained by running similar databases under similar parameter values, which can characterize the stability or performance of similar databases. Typically, optionally, the dimensions of the similar operational data are the same as the dimensions of the target operational data. "Similar construction samples" can be understood as samples obtained based on similar parameter values and similar operational data, used to construct the tree model. A tree model can be understood as a tree-structured model or a model that includes a tree-structured model.
[0092] In this embodiment of the invention, it may involve pre-collecting the similar parameter values of at least one parameter of a similar database, obtaining similar running data of the similar database under similar parameter values, and saving the above data. When needed, it may be possible to directly obtain the similar parameter values of at least one parameter of a similar database, obtain similar running data of the similar database under similar parameter values, and use the similar parameter values and similar running data as a set of similar construction samples.
[0093] In this embodiment of the invention, before using similar parameter values and similar operational data as a set of similar construction samples, and / or using target parameter values and target operational data as a set of target construction samples, the similar parameter values and / or target parameter values, and / or similar operational data and / or target operational data can be preprocessed. Specifically, the similar parameter values and / or target parameter values can be value-based, the similar operational data and / or target operational data can be standardized, and the similar parameter values and / or target parameter values, and / or similar operational data and / or target operational data can be updated according to the preprocessing results.
[0094] S340. Based on at least one set of target construction samples and at least one set of similar construction samples, construct a tree model.
[0095] In this embodiment of the invention, at least one set of target construction samples and at least one set of similar construction samples can be used as samples for constructing a tree model. Based on the at least one set of target construction samples and at least one set of similar construction samples, a tree model is constructed.
[0096] S350. Based on the tree model, obtain the parameter importance corresponding to at least one parameter.
[0097] S360. Based on the importance of each parameter, adjust the target parameter value of the important parameter among the at least one parameters.
[0098] The technical solution of this invention involves identifying a similar database of the same type as the target database, wherein at least one parameter of the similar database is identical to at least one parameter of the target database; obtaining similar parameter values for at least one parameter of the similar database; and obtaining similar operational data of the similar database running under the similar parameter values, and using the similar parameter values and similar operational data as a set of similar construction samples; and constructing a tree model based on the obtained at least one set of target construction samples and at least one set of similar construction samples. In this invention, by constructing a tree model based on the obtained at least one set of target construction samples and at least one set of similar construction samples, the accuracy of the constructed tree model can be higher, and correspondingly, the accuracy of obtaining the parameter importance corresponding to at least one parameter is higher.
[0099] An optional technical solution involves obtaining target operating data of a target database running under target parameter values, including: obtaining target operating data of the target database running under target parameter values and a target environment; and obtaining similar operating data of similar databases running under similar parameter values, including: obtaining similar operating data of similar databases running under similar parameter values and a similar environment, wherein the similar environment is the same as or similar to the target environment.
[0100] The target environment can be understood as the environment in which the target database runs. The target environment may include hardware and / or workload environments, etc. In this embodiment of the invention, the specific types of environments included in the target environment are not limited. A similar environment can be understood as the environment in which similar databases run.
[0101] It is understandable that different database operating environments will affect the database's operating results. Therefore, in this embodiment of the invention, the target database can be obtained under target parameter values and target environment; similar databases can be obtained under similar parameter values and similar environments to the target environment to further improve the accuracy of the constructed tree model, and correspondingly, further improve the accuracy of the parameter importance corresponding to at least one parameter.
[0102] Based on any of the above technical solutions, optionally, the tree model includes a random forest model, and / or the dimensions of the target running data include at least one of system processing capacity, throughput capacity, and latency.
[0103] In this embodiment of the invention, the tree model may include a random forest model, and / or the dimensions of the target running data and / or similar running data include at least one of system processing capacity, throughput capacity and latency. The system processing capacity may be, for example, the number of transactions per second (TPS), and the throughput capacity may be, for example, the number of queries per second (QPS), so as to further improve the accuracy of the parameter importance corresponding to at least one parameter.
[0104] To better understand the technical solutions of the above embodiments of the present invention, an optional example is provided herein. For example, see... Figure 5 The technical solution of this invention can include three steps: data acquisition, data processing, and parameter sorting. Specifically, sample acquisition can include acquiring the similar parameter values of at least one parameter from similar databases, and acquiring similar running data of similar databases running under similar parameter values and similar environments; acquiring the target parameter values of at least one parameter from a target database, and acquiring target running data of the target database running under target parameter values and target environments. Data processing can include preprocessing the acquired data to obtain at least one set of target construction samples and at least one set of similar construction samples based on the preprocessing results. Parameter sorting can include constructing a tree model from the obtained at least one set of target construction samples and at least one set of similar construction samples, and obtaining the parameter importance corresponding to at least one parameter based on the tree model; adjusting the target parameter values of the important parameters among the at least one parameter based on the parameter importance corresponding to at least one parameter.
[0105] Example 4
[0106] Figure 6 This is a structural block diagram of the parameter adjustment device provided in Embodiment 4 of the present invention. This device is used to execute the parameter adjustment method provided in any of the above embodiments. This device and the parameter adjustment methods of the above embodiments belong to the same inventive concept. Details not described in detail in the embodiments of the parameter adjustment device can be found in the embodiments of the above parameter adjustment methods. See also... Figure 6 The device may specifically include: a target construction sample module 410, a parameter importance acquisition module 420, and a target parameter value adjustment module 430.
[0107] Among them, the target construction sample is module 410, which is used to obtain the target parameter value of at least one parameter of the target database, and to obtain the target running data of the target database running under the target parameter value, and to use the target parameter value and the target running data as a set of target construction samples;
[0108] The parameter importance acquisition module 420 is used to construct samples based on at least one set of targets, construct a tree model, and obtain the parameter importance corresponding to at least one parameter based on the tree model.
[0109] The target parameter value adjustment module 430 is used to adjust the target parameter value of the important parameter among the at least one parameters based on the parameter importance corresponding to each of the at least one parameter.
[0110] Optionally, the target parameter value adjustment module 430 may include:
[0111] The important parameter determination unit is used to sort at least one parameter based on the importance of the parameters corresponding to at least one parameter, and to determine the important parameters among at least one parameter based on the sorting results.
[0112] The target parameter value adjustment unit is used to adjust the target parameter values of important parameters.
[0113] Based on the above scheme, optionally, the number of at least one parameter is at least two, and the important parameter determination unit may include:
[0114] The important parameter determination sub-unit is used to determine at least two important parameters out of at least two parameters based on the obtained sorting results;
[0115] The parameter adjustment device may further include:
[0116] The adjustment order module is used to obtain the adjustment order of each of at least two important parameters;
[0117] The target parameter value adjustment unit may include:
[0118] The target parameter value adjustment unit subunit is used to adjust the target parameter values of at least two important parameters sequentially based on the adjustment order.
[0119] Optionally, the parameter adjustment device may also include:
[0120] A similar database identification module is used to identify similar databases that are the same type as or similar to the target database, wherein at least one parameter of the similar database is the same as at least one parameter of the target database.
[0121] The same type of construction sample is used as a module to obtain the same type of parameter value of at least one parameter of the same type of database, and to obtain the same type of running data of the same type of database under the same type of parameter value, and to use the same type of parameter value and the same type of running data as a set of same type of construction sample;
[0122] Module 420, which determines the importance of parameters, may include:
[0123] Tree model building unit, used to build a tree model based on at least one set of target building samples and at least one set of similar building samples.
[0124] Based on the above scheme, optionally, the target construction sample as module 410 may include:
[0125] The target operation data acquisition unit is used to acquire the target operation data of the target database under the target parameter values and the target environment.
[0126] Similar sample builds, as modules, can include:
[0127] The same type of running data acquisition unit is used to acquire the same type of running data of the same type of database running under the same parameter values and the same environment, wherein the same type of environment is the same as or similar to the target environment.
[0128] Optionally, the parameter importance determination module 420 may include:
[0129] The Gini index determination unit is used to determine the Gini index of each tree node in the tree model based on the target parameter values in at least one set of target construction samples, according to at least one parameter.
[0130] The target tree node determination unit is used to determine the target tree node to be split according to the parameter from each tree node for each of at least one parameter.
[0131] The Gini index change determination unit is used to determine the change in the Gini index of the target tree node based on the Gini index of each tree node.
[0132] The parameter importance determination unit is used to determine the parameter importance based on the change in the Gini index.
[0133] Based on the above scheme, optionally, the tree model includes a random forest model, and / or the dimensions of the target running data include at least one of system processing capacity, throughput capacity, and latency.
[0134] The parameter adjustment device provided in Embodiment 4 of the present invention obtains target parameter values for at least one parameter of a target database through a target construction sample module, and obtains target running data of the target database under the target parameter values, and uses the target parameter values and target running data as a set of target construction samples; a parameter importance determination module constructs a tree model based on the obtained at least one set of target construction samples, and obtains the parameter importance corresponding to at least one parameter according to the tree model; a target parameter value adjustment module adjusts the target parameter values of important parameters among the at least one parameter based on the parameter importance corresponding to at least one parameter. The above device, by adjusting the target parameter values of important parameters among at least one parameter based on the parameter importance obtained from the constructed tree model, can realize the automatic adjustment of parameters in the target database, thereby reducing labor costs.
[0135] The parameter adjustment device provided in this embodiment of the invention can execute the parameter adjustment method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.
[0136] It is worth noting that in the embodiments of the above parameter adjustment device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0137] Example 5
[0138] Figure 7 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0139] As shown in the figure, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer programs stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0140] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0141] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as parameter tuning methods.
[0142] In some embodiments, the parameter adjustment method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the parameter adjustment method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the parameter adjustment method by any other suitable means (e.g., by means of firmware).
[0143] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0144] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0145] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0146] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0147] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0148] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0149] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0150] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A parameter adjustment method, characterized in that, include: The target parameter values of at least one parameter of the target database are obtained respectively, and the target running data of the target database under the target parameter values are obtained. The target parameter values and the target running data are used as a set of target construction samples, wherein the target running data is data that can characterize the stability of the target database obtained by running the target database under the target parameter values. Based on at least one set of target samples, a tree model is constructed, and the parameter importance corresponding to each of the at least one parameter is obtained according to the tree model. Based on the importance of each of the at least one parameter, the target parameter values of the important parameters among the at least one parameters are adjusted; The method further includes: Identify a database of the same or similar type as the target database, wherein at least one parameter of the database of the same type is the same as at least one parameter of the target database; Obtain the similar parameter values of at least one parameter of the similar database respectively, and obtain the similar running data of the similar database running under the similar parameter values, and take the similar parameter values and the similar running data as a set of similar construction samples; The process of constructing a tree model based on at least one set of target samples includes: A tree model is constructed based on at least one set of target construction samples and at least one set of similar construction samples.
2. The method according to claim 1, characterized in that, The step of adjusting the target parameter value of the important parameter among the at least one parameters based on the parameter importance corresponding to each of the at least one parameter includes: Based on the importance of the parameters corresponding to each of the at least one parameter, the at least one parameter is sorted, and based on the sorting results, the important parameters among the at least one parameter are determined. Adjust the target parameter values of the important parameters.
3. The method according to claim 2, characterized in that, The number of the at least one parameter is at least two, and the determination of the important parameters among the at least one parameter based on the obtained sorting results includes: Based on the obtained sorting results, determine at least two important parameters among the at least two parameters; The method further includes: The adjustment order of each of the at least two important parameters is obtained; The adjustment of the target parameter value of the important parameter includes: Based on the adjustment order, the target parameter values of the at least two important parameters are adjusted sequentially.
4. The method according to claim 1, characterized in that, The step of obtaining the target operating data of the target database under the target parameter value includes: Obtain the target database's target operating data under the target parameter values and target environment; The step of obtaining similar operational data of the same database under the same parameter values includes: Obtain similar operational data from the same database under the same parameter values and similar environments, wherein the same environment is the same as or similar to the target environment.
5. The method according to claim 1, characterized in that, The step of obtaining the parameter importance corresponding to each of the at least one parameter based on the tree model includes: Based on the target parameter values of the at least one parameter in the at least one set of target construction samples, the Gini index of each tree node in the tree model is determined respectively; For each of the at least one parameter, determine the target tree node to be split according to the parameter from each tree node; Based on the Gini index of each tree node, determine the change in the Gini index of the target tree node; The parameter importance is determined based on the change in the Gini index.
6. The method according to any one of claims 1-5, characterized in that, The tree model includes a random forest model, and / or the dimensions of the target running data include at least one of system processing capacity, throughput capacity, and latency.
7. A parameter adjustment device, characterized in that, include: The target construction sample is used as a module to obtain target parameter values of at least one parameter of the target database, and to obtain target running data of the target database running under the target parameter values, and to use the target parameter values and the target running data as a set of target construction samples, wherein the target running data is data that can characterize the stability of the target database obtained by running the target database under the target parameter values; The parameter importance acquisition module is used to construct samples based on at least one set of targets, construct a tree model, and obtain the parameter importance corresponding to the at least one parameter according to the tree model; The target parameter value adjustment module is used to adjust the target parameter value of the important parameter among the at least one parameters based on the parameter importance corresponding to each of the at least one parameter; The parameter adjustment device further includes: A similar database determination module is used to determine similar databases that are the same type as or similar to the target database, wherein at least one parameter of the similar database is the same as at least one parameter of the target database; The similar construction sample is used as a module to obtain the similar parameter value of at least one parameter of the similar database, and to obtain the similar running data of the similar database under the similar parameter value, and to take the similar parameter value and the similar running data as a set of similar construction samples; The module for determining the importance of the parameters includes: Tree model building unit, used to build a tree model based on at least one set of target building samples and at least one set of similar building samples.
8. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform the parameter adjustment method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the parameter adjustment method as described in any one of claims 1-6.