Parameter setting method, system and device, equipment, storage medium and program product

By converting the database parameter tuning problem into the traveling salesman problem and using quantum algorithms to solve it, and using quantum computers to quickly find the optimal parameter combination, the time-consuming problem of parameter tuning in the database system is solved, and query efficiency and accuracy are improved.

CN118606291AActive Publication Date: 2024-09-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Application Number
CN202311482543.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-08
Publication Date
2024-09-06
Estimated Expiration
2043-11-08

AI Technical Summary

Technical Problem

Parameter tuning in the database system consumes a lot of time and resources. It is difficult to find the optimal parameter configuration quickly and efficiently with existing technology, which affects the efficiency and accuracy of database query.

Method used

The parameter tuning problem is transformed into the Traveling Salesman Problem (TSP) and solved using quantum algorithms. Multiple parameter combinations are quickly processed through quantum computers to find the optimal parameter combination to optimize database performance.

Benefits of technology

It achieves a faster and more efficient solution to parameter tuning problems, improves the efficiency and accuracy of database queries, and reduces resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606291A
    Figure CN118606291A
Patent Text Reader

Abstract

The invention relates to a parameter setting method, system and device, equipment, a storage medium and a program product, and relates to the technical field of database systems. The method comprises the steps of obtaining parameter value domains of various parameters of a database and a target function of the database; the objective function is used for measuring performance indexes of the database; constructing a traveling salesman problem TSP model based on the parameter value domains of the various parameters and the target function, wherein a path in the TSP model is a parameter value combination of the various parameters; the path length in the TSP model is a target function; constructing a quantum algorithm model based on a TSP model; based on the quantum algorithm model, solving an optimal solution of the TSP model; and setting various parameters of the database based on a parameter value combination corresponding to the optimal solution of the TSP model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of database systems, and in particular to a parameter setting method, system, device, equipment, storage medium and program product. Background Art

[0002] How to choose the optimal parameter configuration is an important issue in database systems.

[0003] In related technologies, parameter tuning problems can usually be solved based on experience and trial and error. Current parameter tuning research mainly focuses on automated tuning, statistics-based tuning, machine learning-based tuning, and deep learning-based tuning.

[0004] However, due to the huge magnitude of database system parameters, the relevant techniques require a lot of time and resources to solve, so an efficient method is needed. Summary of the invention

[0005] The present application provides a parameter setting method, system, device, equipment, storage medium and program product, which can solve parameter tuning problems more quickly and efficiently, thereby improving the efficiency and accuracy of database queries; the content of the technical solution is as follows.

[0006] According to one aspect of the present application, a parameter setting method is provided, the method comprising:

[0007] Obtaining parameter value ranges of multiple parameters of a database and an objective function of the database; the objective function is used to measure performance indicators of the database;

[0008] A traveling salesman problem (TSP) model is constructed based on the parameter value ranges of the multiple parameters and the objective function, wherein the path in the TSP model is a combination of the parameter values ​​of the multiple parameters; and the path length in the TSP model is the objective function;

[0009] Based on the TSP model, a quantum algorithm model is constructed;

[0010] Based on the quantum algorithm model, solving the optimal solution of the TSP model;

[0011] The multiple parameters of the database are set based on a combination of parameter values ​​corresponding to an optimal solution of the TSP model.

[0012] According to one aspect of the present application, a parameter setting system is provided, the system comprising:

[0013] Databases, classical computers, and quantum computers;

[0014] The classical computer is used to obtain parameter value ranges of multiple parameters of a database and an objective function of the database; the objective function is used to measure the performance index of the database; a traveling salesman problem TSP model is constructed based on the parameter value ranges of the multiple parameters and the objective function, wherein the path in the TSP model is a combination of parameter values ​​of the multiple parameters; the path length in the TSP model is the objective function; and a quantum algorithm model is constructed based on the TSP model;

[0015] The quantum computer is used to solve the optimal solution of the TSP model based on the quantum algorithm model;

[0016] The classical computer is used to set the multiple parameters of the database based on the parameter value combination corresponding to the optimal solution of the TSP model.

[0017] According to one aspect of the present application, a parameter setting device is provided, the device comprising:

[0018] An acquisition module, used to acquire parameter value ranges of various parameters of a database, and an objective function of the database; the objective function is used to measure performance indicators of the database;

[0019] A first model building module is used to build a traveling salesman problem TSP model based on the parameter value ranges of the multiple parameters and the objective function, wherein the path in the TSP model is a combination of the parameter values ​​of the multiple parameters; and the path length in the TSP model is the objective function;

[0020] A second model building module is used to build a quantum algorithm model based on the TSP model;

[0021] A solution module, used for solving the optimal solution of the TSP model based on the quantum algorithm model;

[0022] The parameter setting module is used to set the multiple parameters of the database based on the parameter value combination corresponding to the optimal solution of the TSP model.

[0023] In some embodiments, the second model building module is used to:

[0024] Based on the TSP model, a first quantum algorithm model and a second quantum algorithm model are constructed, wherein the first quantum algorithm model is used to query the solution space of the TSP problem, and the second quantum algorithm model is used to query the optimal solution in the solution space;

[0025] Each solution in the solution space corresponds to a parameter value combination of the multiple parameters.

[0026] In some embodiments, the first quantum algorithm model is a Hamiltonian circuit problem model;

[0027] Each solution in the solution space corresponds to a Hamiltonian circuit in the Hamiltonian circuit problem model.

[0028] In some embodiments, the second quantum algorithm model is a Grover algorithm model;

[0029] Each solution in the solution space corresponds to a quantum bit state in the Grover algorithm model.

[0030] In some embodiments, the solution module is used to:

[0031] Executing the quantum circuit corresponding to the first quantum algorithm model by a quantum computer to obtain each solution in the solution space;

[0032] Mapping each solution in the solution space to a quantum bit state in the second quantum algorithm model, and running the quantum circuit corresponding to the second quantum algorithm model to obtain the probability of the quantum bit state corresponding to each solution in the solution space;

[0033] Among the solutions in the solution space, the solution with the highest probability of the corresponding quantum bit state is determined as the optimal solution of the TSP model.

[0034] In some embodiments, the device further comprises: a processing module, configured to:

[0035] Before the first model building module, the parameter value ranges of the multiple parameters are normalized, wherein the normalization process is used to unify the parameter value ranges of the multiple parameters into a specified value range;

[0036] The first model building module is used to build the TSP model based on the parameter value ranges of the multiple parameters after normalization and the objective function.

[0037] In some embodiments, the parameter setting module is used to:

[0038] Performing an inverse process of the normalization process on the parameter values ​​in the parameter value combination corresponding to the optimal solution to obtain tuned parameter values ​​of the multiple parameters;

[0039] The various parameters of the database are set based on the tuned parameter values ​​of the various parameters.

[0040] In some embodiments, the plurality of parameters include parameters corresponding to a query configuration of the database.

[0041] In some embodiments, the plurality of parameters include a plurality of the following parameters:

[0042] Cache parameters, concurrent connection parameters, query optimization parameters, index parameters, log parameters, memory allocation parameters, disk input / output parameters, processor utilization parameters.

[0043] According to another aspect of the present application, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the parameter setting method as described above.

[0044] According to another aspect of the present application, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the parameter setting method described above.

[0045] According to another aspect of the present application, a computer program product is provided, which includes computer instructions stored in a computer-readable storage medium, and a processor reads and executes the computer instructions from the computer-readable storage medium to implement the parameter setting method described above.

[0046] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0047] By converting the parameter tuning problem into a quantum computing problem, and then solving the quantum computing problem through a quantum algorithm, the target solution to the parameter tuning problem can be obtained. Compared with traditional computers, quantum computers can process data at an exponential level and can simultaneously process or estimate the performance of multiple possible parameter combinations. Therefore, the technical solution provided in the embodiment of the present application can solve the parameter tuning problem more quickly and efficiently, thereby improving the efficiency and accuracy of database queries. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0049] Figure 1 is a distributed database architecture diagram provided by an exemplary embodiment of the present application;

[0050] Figure 2 It is a schematic diagram of an application scenario of a solution provided by an embodiment of the present application;

[0051] Figure 3 is a flow chart of a parameter setting method provided by an exemplary embodiment of the present application;

[0052] Figure 4 is a flow chart of a parameter setting method provided by another exemplary embodiment of the present application;

[0053] Figure 5 is a flow chart of a parameter setting method provided by another exemplary embodiment of the present application;

[0054] Figure 6 is a flow chart of a parameter setting method provided by yet another exemplary embodiment of the present application;

[0055] Figure 7 is a flow chart of a parameter setting method provided by another exemplary embodiment of the present application;

[0056] Figure 8 is a flow chart of solving parameter tuning problems based on traditional computers provided by an exemplary embodiment of the present application;

[0057] Fig. 9 is a flow chart of solving parameter tuning problems based on quantum computers provided by an exemplary embodiment of the present application;

[0058] Fig.10 is a flow chart of a parameter selection method provided by an exemplary embodiment of the present application;

[0059] Fig.11 is a block diagram of a parameter setting device shown in an exemplary embodiment of the present application;

[0060] Fig.12 is a structural block diagram of a computer device provided by an exemplary embodiment of the present application;

[0061] Fig.13 It is a schematic diagram of a parameter setting system provided by an exemplary embodiment of the present application.

[0062] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application. DETAILED DESCRIPTION

[0063] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0064] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0065] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0066] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the object behaviors such as attack operations involved in this application are all obtained with full authorization.

[0067] It should be understood that although the terms first, second, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first parameter may also be referred to as the second parameter, and similarly, the second parameter may also be referred to as the first parameter. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0068] The following are some definitions of terms involved in this application:

[0069] Database (DB): is an organic collection of large amounts of data that are organized in a certain structure and stored in a computer for a long time and can be shared. Each database has one or more different application programming interfaces (APIs) for creating, accessing, managing, searching, and copying the stored data.

[0070] Quantum computing: A computing method based on quantum logic that uses the superposition and entanglement of quantum states to quickly complete computing tasks. The basic unit of data storage in quantum computing is the quantum bit.

[0071] Qubit: The carrier form of quantum information and the basic unit of quantum computing. Traditional computers use 0 and 1 as the basic units of binary. The difference is that quantum computing can process 0 and 1 at the same time, and the system can be in a linear superposition state of 0 and 1: |ψ>=α|0>+β|1>, where α and β represent the complex probability amplitude of the system at 0 and 1. The square of the modulus of α and β |α| 2 、|β| 2 represent the probabilities of being 0 and 1 respectively.

[0072] Quantum Operation: Manipulate quantum bits to process the quantum information they carry. Common quantum operations include Pauli X, Y, and Z transformations (or σ x , σ y , σ z ), Hadamard transform (H), controlled Pauli X transform, i.e. controlled not gate (CNOT), etc.

[0073] Quantum Circuit: A description model of quantum computing, consisting of quantum bits and quantum operations on quantum bits, representing the hardware implementation of the corresponding quantum algorithm / program under the quantum gate model. A quantum circuit consists of a series of quantum gate sequences, and the quantum gates perform the calculations. If the quantum circuit contains adjustable parameters for controlling the quantum gates, it is called a parameterized quantum circuit.

[0074] Quantum Computing Device: A physical device that performs quantum computing.

[0075] Traveling Salesman Problem (TSP): is a classic combinatorial optimization problem. The classic TSP can be described as: a salesman has to go to several cities to sell goods. The salesman starts from one city and needs to go through all cities before returning to the starting point. How should the route be chosen to make the total journey shortest? From the perspective of graph theory, the problem is essentially to find a Hamiltonian circuit with the minimum weight in a weighted completely undirected graph. Since the feasible solution to this problem is the full arrangement of all vertices, as the number of vertices increases, there will be a combinatorial explosion. Therefore, TSP is an NP-complete problem.

[0076] Hamiltonian cycle: Let G = (V, E) be a graph. If a path in G passes through each vertex only once, this path is called a Hamiltonian path. If a loop in G passes through each vertex only once, this loop is called a Hamiltonian cycle. If a graph has a Hamiltonian cycle, it is called a Hamiltonian graph.

[0077] Nondeterminism Polynomial (NP) problem: All decision problems that can be solved in nondeterministic polynomial time constitute NP problems.

[0078] Grover algorithm: also known as the quantum search algorithm, refers to an unstructured search algorithm that runs on a quantum computer and is one of the typical algorithms of quantum computing.

[0079] Distributed Database (DDB): A physically dispersed but logically centralized database system, a product of the combination of database technology and computer networks. DDB includes computing layer, storage layer and metadata layer. The computing layer is used to check data access permissions, route access, etc. The storage layer is used to store data; the metadata layer is used to store metadata information. When the computing layer of the distributed database is started, it accesses the metadata layer to obtain all cluster information, so that the Structured Query Language (SQL) can be parsed and routed correctly.

[0080] Please refer to Figure 1 , which shows a distributed database architecture diagram provided by an exemplary embodiment of the present application. Figure 1 As shown, the distributed database includes a scheduler (Scheduler), a ZK cluster, a gateway and a setting (Set).

[0081] Scheduler:

[0082] 1. Pull the DDL task from ZK and execute it on the actual MySQL instance;

[0083] 2. Obtain tasks from ZK and generate expansion tasks;

[0084] 3. Control the master / slave switching within Set;

[0085] 4. Multiple Schedulers achieve disaster recovery through ZK elections.

[0086] Gateway:

[0087] 1. Identify DDL operations and save them to the ZK cluster in the form of tasks;

[0088] 2. Identify DML operations, convert them into SQL, and send them to the master or slave in the corresponding Set;

[0089] 3. Collect responses from each node in the Set, combine them, and return them to the front-end application API;

[0090] 4. Check the ZK cluster and pull information such as routing and permissions.

[0091] Set:

[0092] 1. Check the instance status and report it to ZK;

[0093] 2. Check the status of the table and report it to ZK;

[0094] 3. Pull the migration task from ZK and execute it;

[0095] 4. Participate in the master-slave switching process.

[0096] Data Definition Language (DDL): used to create or delete databases and tables in databases for storing data.

[0097] Data Manipulation Language (DML): used to query or change records in a table.

[0098] Decision-making (ZooKeeper, ZK) cluster: The main functions are configuration maintenance, election decision-making, routing synchronization, etc.; at the same time, it can also assist in storing routing, control information, task information, heartbeat and other information.

[0099] Parameter tuning is an important issue in database systems, which involves how to select the optimal parameter configuration to improve the performance and reliability of the database system. Parameters in database systems include cache size, thread pool size, log size, lock granularity, etc. Different parameter configurations will have different effects on the performance and reliability of the database system. Therefore, selecting the optimal parameter configuration is crucial to the performance and reliability of the database system.

[0100] Traditional parameter tuning methods are usually based on experience and trial and error, requiring a lot of manual intervention and experiments. This method is inefficient and it is difficult to find the optimal parameter configuration. Therefore, studying how to automatically select the optimal parameter configuration has become one of the hot topics in database system research.

[0101] Current parameter tuning research focuses on automated tuning, statistics-based tuning, machine learning-based tuning, and deep learning-based tuning. These research results can help database administrators and developers select the optimal parameter configuration and improve the performance and reliability of database systems.

[0102] Quantum computing has attracted widespread attention in many research fields as researchers hope to gain quantum advantages in complex calculations. Although quantum computing has been studied for decades, the accelerated development of quantum computing hardware in recent years has led to an increasing interest in quantum computing. In addition, cloud access to quantum systems has made quantum computing more feasible for researchers, allowing the first experiments to be conducted on real quantum processing units (QPUs).

[0103] Unlike central processing units (CPUs), QPUs use quantum bits or qubits for computation. The mathematical states of QPUs are exponentially larger than classical bits and can realize phenomena such as quantum superposition, quantum entanglement or quantum interference. It is generally believed that quantum systems offer higher computing power than classical systems, given the accepted assumptions of complexity theory. Several quantum algorithms have been shown to have a speed-up effect, and a groundbreaking experiment has demonstrated quantum advantage on real hardware, even on artificially constructed problems.

[0104] Furthermore, quantum computing excels at optimization problems that require identifying elements with certain properties in a (exponentially large) search space. Such problems are common in database systems and are particularly relevant for database query optimization.

[0105] Therefore, exploring the application of quantum cloud services (QCs) in database query optimization is a challenging and promising research direction.

[0106] Parameter tuning is an important problem in database optimization. Traditional computers need to spend a lot of time and resources to solve this problem, because parameter tuning is essentially a nondeterministic polynomial (NP) hard problem due to its huge parameter space. Therefore, a faster and more efficient method is needed to solve this problem.

[0107] The emergence of quantum computers provides new opportunities to solve parameter tuning problems. Quantum computers are computers based on the principles of quantum mechanics that can solve certain problems faster than traditional computers in some cases. Quantum machine learning is a method of using quantum computers to accelerate machine learning. In parameter tuning optimization, quantum machine learning can use technologies such as quantum support vector machines (QSVM) and parameterized quantum circuits (PQC) to accelerate the optimization process.

[0108] Please refer to Figure 2 , which shows a schematic diagram of an application scenario of a solution provided by an embodiment of the present application. Figure 2 As shown, the application scenario may be a superconducting quantum computing platform, which includes: a quantum computing device 21, a dilution refrigerator 22, a control device 23 and a computer 24.

[0109] The quantum computing device 21 is a circuit that acts on a physical quantum bit. The quantum computing device 21 can be realized as a quantum chip, such as a superconducting quantum chip near absolute zero. The dilution refrigerator 22 is used to provide an absolute zero environment for the superconducting quantum chip.

[0110] The control device 23 is used to control the quantum computing device 21, and the computer 24 is used to control the control device 23. For example, the written quantum program is compiled into instructions by the software in the computer 24 and sent to the control device 23 (such as an electronic / microwave control system). The control device 23 converts the above instructions into electronic / microwave control signals and inputs them into the dilution refrigerator 22 to control the superconducting quantum bits at a temperature less than 10mK. The reading process is the opposite, and the reading waveform is transmitted to the quantum computing device 21.

[0111] Before introducing the method embodiment of the present application, the operating environment of the method is first introduced. The method provided by the embodiment of the present application can be executed in a hybrid device environment of a classical computer and a quantum computer.

[0112] In the following method embodiments, for ease of description, only the execution subject of each step is introduced as a computer device. It should be understood that the computer device may include a hybrid execution environment of a classical computer and a quantum computer, and the embodiments of the present application do not limit this.

[0113] Please refer to Figure 3 , which shows a flow chart of a parameter setting method provided by an exemplary embodiment of the present application. The method is executed by a computer device, such as Figure 3As shown, the method may include step 310 , step 320 , step 330 , step 340 and step 350 .

[0114] Step 310: Obtain parameter value ranges of various parameters of the database, and the objective function of the database; the objective function is used to measure the performance index of the database.

[0115] In an embodiment of the present application, the computer device can determine the parameter value range of multiple parameters by collecting multiple parameters from the database and obtain the objective function of the database. The objective function is an indicator for measuring the performance or effect of the database, and the database can be an enterprise-level database, a cloud database, etc.

[0116] Among them, various parameters include cache size, thread pool size, log size, lock granularity, etc. Different parameter configurations will have different effects on the performance and reliability of the database system.

[0117] The parameter value ranges of various parameters are usually limited, for example, the parameter value range of threads is 1-10.

[0118] In some embodiments, the computer device may normalize the parameter value ranges of the various parameters to unify the parameter value ranges of the various parameters into a specified numerical range.

[0119] Step 320: construct a traveling salesman problem TSP model based on the parameter value ranges of the various parameters and the objective function. The path in the TSP model is a combination of the parameter values ​​of the various parameters; and the path length in the TSP model is the objective function.

[0120] In the embodiment of the present application, the computer device can construct a traveling salesman problem TSP model based on the parameter value ranges of the various parameters obtained in step 310 and the objective function.

[0121] The path in the TSP model is a combination of parameter values ​​of multiple parameters. The parameter value combination is usually a variable that needs to be adjusted and optimized. In the TSP model, the parameter value combination can be regarded as the path selection of the traveling salesman, that is, it determines the order in which the traveling salesman visits each city.

[0122] Among them, the path length in the TSP model is the objective function. The objective function is usually an indicator to measure the performance or effect of parameter settings. In the TSP model, the objective function is to find the shortest travel path so that the traveling salesman passes through each city once and returns to the starting city.

[0123] Step 330: Construct a quantum algorithm model based on the TSP model.

[0124] In an embodiment of the present application, the computer device can construct a quantum algorithm model based on the TSP model constructed in step 320.

[0125] Among them, TSP is an NP-hard problem in combinatorial optimization. Based on the traditional computing model, the TSP model requires a lot of time and resources to solve. The solution of the quantum algorithm model can be based on quantum logic and can be completed quickly by using the superposition and entanglement of quantum states. Compared with traditional computers, quantum computers can process data at an exponential level, and use the characteristics of quantum superposition and quantum parallelism to simultaneously process or estimate the performance of multiple possible parameter combinations, thereby improving the query efficiency of the final database.

[0126] Step 340: Based on the quantum algorithm model, find the optimal solution of the TSP model.

[0127] In an embodiment of the present application, the computer device can solve the optimal solution of the TSP model based on the quantum algorithm model constructed in step 330.

[0128] Step 350: Based on the parameter value combination corresponding to the optimal solution of the TSP model, various parameters of the database are set.

[0129] In the embodiment of the present application, the computer device can set various parameters of the database based on the parameter value combination corresponding to the optimal solution solved in step 340.

[0130] In summary, the technical solution provided by the embodiment of the present application is to construct the parameter value combination of various parameters of the database as the path in the TSP model, and to construct the objective function of the database as the path length in the TSP model; based on the TSP model, a quantum algorithm model is constructed; based on the quantum algorithm model, the optimal solution of the TSP model is solved by quantum computing, and various parameters of the database are set accordingly, thereby optimizing the performance indicators of the database. Compared with traditional computing, quantum computing can process data at an exponential level, and can simultaneously process or estimate the performance of multiple possible parameter combinations. Therefore, the solution shown in the embodiment of the present application can solve the parameter tuning problem more quickly and efficiently, thereby improving the efficiency and accuracy of database queries.

[0131] Please refer to Figure 4 , which shows a flow chart of a parameter setting method provided by another exemplary embodiment of the present application. The method is executed by a computer device. Figure 4 As shown above Figure 3 Step 330 in the illustrated embodiment may be implemented as step 330a.

[0132] Step 330a: Based on the TSP model, a first quantum algorithm model and a second quantum algorithm model are constructed, wherein the first quantum algorithm model is used to query the solution space of the TSP problem, and the second quantum algorithm model is used to query the optimal solution in the solution space;

[0133] Each solution in the solution space corresponds to a combination of parameter values ​​of multiple parameters.

[0134] In an embodiment of the present application, the computer device can construct a first quantum algorithm model for querying the solution space of the TSP problem and a second quantum algorithm model for querying the optimal solution in the solution space based on the TSP model constructed in step 320. Each solution in the solution space corresponds to a parameter value combination of multiple parameters.

[0135] In some embodiments, the first quantum algorithm model may be an NP-complete problem model, such as a Hamiltonian circuit problem model.

[0136] In some embodiments, the second quantum algorithm model may be a Grover algorithm model, or may be a quantum simulation algorithm model.

[0137] Quantum computers use the superposition and entanglement properties of quantum bits (qubits) to process multiple possibilities in a single calculation, which gives quantum computers potential advantages in areas such as search, optimization, and simulation. For NP problems, quantum computers can use quantum parallelism and quantum coherence to search the solution space in the hope of finding a solution to the problem. Among them, quantum parallelism allows quantum computers to process multiple possible solutions at the same time, while quantum coherence allows quantum computers to use interference effects during the search process to enhance the probability of the correct solution.

[0138] In quantum computing, feedback is usually obtained by measuring the state of quantum bits. The output of a quantum computer is a series of measured quantum bit results, which are expressed in the form of probabilities. By running the same calculation multiple times, the frequency of measurement results can be counted and the solution to the problem can be estimated based on the frequency.

[0139] The embodiment of the present application provides a technical solution for constructing a quantum algorithm model based on the TSP model, and constructs two quantum algorithm models, one for querying the solution space of the TSP problem, and the other for querying the optimal solution in the solution space. For the TSP problem, compared with traditional computers, quantum computers can use quantum parallelism and quantum coherence to search the solution space at an exponential level and find the optimal solution to the TSP problem, thereby solving the parameter tuning problem more quickly and efficiently.

[0140] In some embodiments, the first quantum algorithm model is a Hamiltonian circuit problem model; each solution in the solution space corresponds to a Hamiltonian circuit in the Hamiltonian circuit problem model.

[0141] Among them, the quantum existence problem can be mapped to the Hamiltonian circuit existence problem, and the results of quantum calculation can be reflected in the solution of the Hamiltonian circuit.

[0142] NP-complete problems have a reducible property. TSP and Hamiltonian cycle problems are both NP-complete problems. TSP problem can be reduced to Hamiltonian problem, that is, if the Hamiltonian cycle problem is solved, then the TSP problem can also be solved, that is, the parameter optimization problem can be solved.

[0143] The embodiment of the present application provides a selection scheme for the first quantum algorithm model, specifically a Hamiltonian circuit problem model, which is used to query the solution space of the TSP problem, and corresponds a Hamiltonian circuit in the Hamiltonian circuit problem model to each solution in the solution space, which can further optimize the completeness and reliability of the technical solution of the present application.

[0144] In some embodiments, the second quantum algorithm model is a Grover algorithm model; each solution in the solution space corresponds to a quantum bit state in the Grover algorithm model.

[0145] In an embodiment of the present application, a quantum counting algorithm can be used to accelerate the solution of NP-complete problems. An example of an NP-complete problem is the Hamiltonian circuit problem. The method for determining whether a graph is a Hamiltonian circuit problem is as follows: Assuming there is a Hamiltonian circuit, a simple solution to the Hamiltonian circuit problem is to check each vertex order to see if it is a Hamiltonian circuit; finding all possible orderings of vertices in the graph can be accomplished by following the quantum counting of the Grover algorithm, which implements a square root acceleration similar to that of , which finds the Hamiltonian circuit (assuming that the Hamiltonian circuit exists). Among them, the quantum counting algorithm itself is sufficient to determine whether a Hamiltonian circuit exists.

[0146] Grover's algorithm is a quantum algorithm that can search for a target item in an unsorted database in O(sqrt(N)) time. Although Grover's algorithm cannot directly solve NP problems, it can be used to speed up the solution of certain NP problems.

[0147] In the embodiment of the present application, the solution space of the NP problem can be regarded as an unsorted database, and the Grover algorithm can be used to search for solutions in the solution space. By mapping each solution in the solution space to an item in a database, the Grover algorithm can be used to search for the optimal solution in the solution space.

[0148] For example, suppose you want to search for a solution that satisfies certain conditions in a solution space containing N elements. If you use a traditional search algorithm, it takes O(N) time to find a solution. However, if you use Grover's algorithm, you can find a solution in O(sqrt(N)) time. For example: given the same problem, Grover's algorithm solves it in 10,000 times, but a classical computer needs 10000^2=100,000,000, which is the difference between 10,000 and 100 million.

[0149] It should be noted that the acceleration effect of Grover's algorithm is limited, because Grover's algorithm can only provide O(sqrt(N)) acceleration. For large-scale NP problems, this acceleration may still not be enough to make the problem solvable. In addition, the implementation of Grover's algorithm also needs to take into account the hardware limitations of quantum computers and error correction issues.

[0150] In summary, although Grover's algorithm cannot directly solve NP problems, it can be used to speed up the solution of certain NP problems. By mapping the solution space into an unsorted database, a computer device can use Grover's algorithm to search for the optimal solution in the solution space.

[0151] The embodiment of the present application provides a selection scheme for the second quantum algorithm model, specifically the Grover algorithm model; wherein the quantum bit state in the Grover algorithm model corresponds to the solution in the solution space, and the Grover algorithm can be used to accelerate the search for the optimal solution in the solution space, thereby improving the efficiency of solving parameter optimization problems.

[0152] Based on the above Figure 4 For the solution in the embodiment shown, please refer to Figure 5 , which shows a flow chart of a parameter setting method provided by another exemplary embodiment of the present application. The method is executed by a computer device. Figure 5 As shown above Figure 4 Step 340 in the illustrated embodiment may be implemented as step 340a, step 340b, and step 340c.

[0153] Step 340a: Execute the quantum circuit corresponding to the first quantum algorithm model through a quantum computer to obtain each solution in the solution space.

[0154] In an embodiment of the present application, after the above steps construct the first quantum algorithm model and the second quantum algorithm model based on the TSP model, the computer device can execute the quantum circuit corresponding to the first quantum algorithm model through a quantum computer to obtain each solution in the solution space.

[0155] Step 340b: Map each solution in the solution space to a quantum bit state in the second quantum algorithm model, and run the quantum circuit corresponding to the second quantum algorithm model to obtain the probability of the quantum bit state corresponding to each solution in the solution space.

[0156] In an embodiment of the present application, after obtaining each solution in the solution space in step 340a, the computer device can map each solution in the solution space to a quantum bit state in the second quantum algorithm model, and run the quantum circuit corresponding to the second quantum algorithm model to obtain the probability of the quantum bit state corresponding to each solution in the solution space.

[0157] Step 340c: Determine the solution with the highest probability of the corresponding quantum bit state among the solutions in the solution space as the optimal solution of the TSP model.

[0158] In an embodiment of the present application, after obtaining the probabilities of the quantum bit states corresponding to the solutions in the solution space in step 340b, the computer device can determine the solution with the highest probability of the corresponding quantum bit state among the solutions in the solution space as the optimal solution of the TSP model.

[0159] The optimal parameter setting is one of all possible combinations of parameter values. Therefore, the parameter tuning problem can be mapped to a combinatorial optimization problem, such as the traveling salesman problem TSP. The relationship between the parameter tuning problem and the traveling salesman problem TSP can be understood in the following way:

[0160] Objective function: In parameter tuning problems, the objective function is usually an indicator to measure the performance or effect of parameter settings; in the TSP problem, the objective function is to find the shortest travel path so that the traveling salesman passes through each city once and returns to the starting city.

[0161] Parameter setting: In the parameter tuning problem, parameter setting is the variable that needs to be adjusted and optimized; in the TSP problem, parameter setting can be regarded as the path selection of the traveling salesman, that is, determining the order in which the traveling salesman visits each city.

[0162] Constraints: In the parameter tuning problem, there may be some constraints (such as data dependency between parameters, overall performance balance), which limit the range or relationship of parameter values; in the TSP problem, the constraint is that the traveling salesman must pass through each city once and eventually return to the starting city.

[0163] In step 320, a TSP model of the traveling salesman problem is constructed based on the parameter ranges of multiple parameters and the objective function, and the parameter optimization problem is mapped to the TSP problem. The parameter setting is mapped to the path of the TSP model, the objective function is mapped to the length of the path, and the constraint condition is mapped to the path being a loop and the path can and can only pass through each city once.

[0164] Among them, in step 330, a quantum algorithm model is constructed based on the TSP model, that is, the TSP problem (i.e., parameter optimization problem) is converted into a quantum computing problem; in step 340, the optimal solution to the TSP problem (i.e., the optimal parameter setting) can be quickly found based on the quantum algorithm model; finally, various parameters of the database are set accordingly.

[0165] For example, the quantum algorithm model includes the Hamiltonian circuit problem model and the Grover algorithm model. First, the Hamiltonian circuit problem model is used to find all possible vertex orderings in the Hamiltonian graph, that is, to find all possible paths for the TSP problem, that is, to find all possible parameter value combinations for multiple parameters; then the Grover algorithm model is used to search for the optimal vertex ordering (that is, the optimal parameter value combination), which specifically includes:

[0166] Represent all possible vertex orderings (i.e., parameter value combinations) as different qubit states;

[0167] Through Oracle, mark the target quantum bit state;

[0168] Increase the probability of the target quantum bit state through Grover iteration;

[0169] Performing a measurement on the quantum bit; wherein the measurement result is expressed in the form of probability;

[0170] The quantum bit state with the highest probability corresponds to the optimal vertex ordering (i.e. the optimal combination of parameter values).

[0171] Among them, taking the second quantum algorithm model as the Grover algorithm model as an example, modeling and feedback of the Grover algorithm in quantum computing involves the following steps.

[0172] S1, Modeling: The above steps have transformed the parameter tuning problem into a form that can be processed by a quantum computer. For the Grover algorithm, the computer device can represent the search space of the problem as the state of a quantum bit (qubit). Each item in the search space is mapped to the state of a quantum bit, which contains information about the problem.

[0173] S2, Initialization: In the Grover algorithm, the qubits need to be initialized to a uniform superposition state. This can be achieved by setting all qubits to the superposition state of the Hadamard gate.

[0174] S3, Oracle: Oracle is a key part of Grover's algorithm and is used to mark the target item. In quantum computing, Oracle can be represented as a quantum gate or quantum circuit that can manipulate the state of quantum bits according to the specific conditions of the problem.

[0175] S4, Grover iteration: The Grover algorithm increases the probability of the target item by applying Grover iterations multiple times. Each Grover iteration includes three steps: S41 applying Oracle, S42 applying reflection operation, and S43 repeating.

[0176] S41, Apply Oracle: In each iteration of the Grover algorithm, the Oracle operation is first applied. The role of the Oracle is to mark the target item, that is, to distinguish the target item from other items. The computer device can achieve this goal by manipulating the state of the quantum bit.

[0177] Specifically, the oracle manipulates the state of the qubits according to the specific conditions of the problem to distinguish the target term from the other terms. For example, this can be achieved by applying a specific quantum gate or quantum circuit.

[0178] S42, apply reflection operation: After S41 applies Oracle, S42 applies reflection operation. Reflection operation is the core part of Grover's algorithm, which helps to increase the probability amplitude of the target item, making it easier to measure.

[0179] Specifically, the reflection operation can be implemented by a quantum gate or quantum circuit called Grover reflection. The reflection operation reverses the state of the quantum bit with respect to the average amplitude, thereby increasing the probability amplitude of the target item.

[0180] S43, Repeat: After applying the Oracle in S41 and the reflection operation in S42, the Grover algorithm repeats these two steps. The number of repetitions depends on the size of the problem and the probability amplitude of the target item. Usually, the number of repetitions is approximately square root N, where N is the number of items in the database with multiple parameters. By repeatedly applying the Oracle and reflection operations, the probability amplitude of the target item will gradually increase, making it easier to measure.

[0181] By iterating these three steps, Grover's algorithm can efficiently search for the target item in the unsorted database. Each iteration helps to increase the probability amplitude of the target item, thereby improving the accuracy and efficiency of finding the target item.

[0182] S5, Measurement: At the end of the Grover algorithm, the qubits need to be measured to obtain the final result. The measurement results are expressed in the form of probabilities, where the result with the highest probability corresponds to the optimal solution of the TSP model.

[0183] Among them, the measurement mode and method can be realized by the hardware of the quantum computer, which can be completed using quantum measurement gates or measurement circuits. These measurement gates or circuits will perform corresponding operations according to the state of the quantum bit and convert it into the state of the classical bit.

[0184] Specifically, the process of S5 measurement can be simply described as the following steps.

[0185] S51, Preparation: Before making a measurement, you need to ensure that the qubit is in the desired state. This may involve applying a series of quantum operations, such as applying a Hadamard gate to create a homogeneous superposition state.

[0186] S52, measurement: In response to the qubit being in the desired state, a measurement operation is performed. The measurement operation causes the state of the qubit to collapse to the state of a classical bit, i.e., 0 or 1. The result of the measurement is random, but the probability is proportional to the square of the state amplitude of the qubit.

[0187] S53, Result: The result of the measurement is expressed in the form of probability, where the result with the highest probability corresponds to the solution of the problem. For example, in the Grover algorithm, if the target item is correctly labeled, then the probability of the corresponding target item in the measurement result will be high.

[0188] Let's take an example to illustrate the measurement process: suppose there is a quantum bit in a superposition state (|0>+|1>) / √2. After measurement, the possible results are 0 or 1, and the probability of each result is 1 / 2. This means that in the process of repeated measurements, about half of the time you will get 0, and the other half of the time you will get 1.

[0189] It should be noted that the measurement operation causes the state of the qubit to collapse to the state of the classical bit, so after the measurement, the information of the qubit will be lost. Therefore, in the Grover algorithm, multiple iterations and measurements are usually required to increase the probability amplitude of the target item, thereby improving the accuracy and efficiency of finding the target item.

[0190] In terms of feedback, the results of the Grover algorithm are usually obtained by running the algorithm multiple times and statistically measuring the frequency of the results. By repeatedly running the Grover algorithm, the probability of the target item can be increased, and ultimately a result closer to the optimal solution can be obtained.

[0191] The embodiment of the present application provides a technical solution for solving the optimal solution of the TSP model based on a quantum algorithm model, which can use quantum algorithms to obtain the optimal solution of the TSP model more quickly and efficiently. Specifically, the quantum computer executes the quantum circuit of the first quantum algorithm model to obtain each solution in the solution space; then each solution in the solution space is mapped to the quantum bit state in the second quantum algorithm model, and the quantum circuit of the second quantum algorithm model is run to obtain the probability of the quantum bit state corresponding to each solution in the solution space; finally, the solution with the highest probability of the corresponding quantum bit state among each solution in the solution space is determined as the optimal solution of the TSP model, so that the various parameters of the database can be set based on the parameter value combination corresponding to the optimal solution of the TSP model.

[0192] based on Figure 3 For the solution in the embodiment shown, please refer to Figure 6 , which shows a flow chart of a parameter setting method provided by another exemplary embodiment of the present application. The method is executed by a computer device. Figure 6 As shown, before the above step 320, the method may further include step 312:

[0193] Step 312: performing normalization processing on parameter value ranges of the multiple parameters, wherein the normalization processing is used to unify the parameter value ranges of the multiple parameters into a specified value range;

[0194] The above step 320 can be implemented as step 320a:

[0195] Step 320a: construct a TSP model based on the parameter ranges of the normalized parameters and the objective function.

[0196] In an embodiment of the present application, a computer device normalizes multiple parameters so that all parameters are within a numerical range; then, a TSP model is constructed based on the parameter value ranges of the multiple parameters after normalization and the objective function.

[0197] The embodiment of the present application provides a technical solution for normalizing multiple parameters before constructing a TSP model of a traveling salesman problem. At the same time, a computer device can construct a TSP model based on the parameter value ranges of the multiple parameters after normalization and an objective function. Not only does it unify the parameter value ranges of the multiple parameters to a specified numerical range, but it also facilitates subsequent processing and improves the efficiency of solving the optimal solution of the TSP model.

[0198] based on Figure 6 For the solution in the embodiment shown, please refer to Figure 7 , which shows a flow chart of a parameter setting method provided by another exemplary embodiment of the present application. The method is executed by a computer device. Figure 7 As shown, the above step 350 can be implemented as step 350a and step 350b.

[0199] Step 350a: performing an inverse process of the normalization process on the parameter values ​​in the parameter value combination corresponding to the optimal solution to obtain tuned parameter values ​​of multiple parameters;

[0200] Step 350b: Based on the optimized parameter values ​​of the various parameters, set various parameters of the database.

[0201] In the embodiment of the present application, since the multiple parameters are normalized in the above steps, the parameter values ​​in the parameter value combination corresponding to the optimal solution can be inversely processed by the normalization process to obtain the tuned parameter values ​​of the multiple parameters; then, based on the tuned parameter values ​​of the multiple parameters, the multiple parameters of the database are set.

[0202] The embodiment of the present application provides an inverse processing solution relative to the above-mentioned normalization processing, which facilitates obtaining the tuned parameter values ​​of various parameters, and then setting various parameters of the database, which can further improve the efficiency of solving parameter optimization problems, thereby optimizing database performance.

[0203] In some embodiments, based on Figure 3 In the solution of the embodiment shown, the various parameters include parameters corresponding to the query configuration of the database.

[0204] In the embodiment of the present application, the computer device can query the database through the API. How to complete the query operation with the least execution time and resource consumption requires setting the parameters related to the query in the database. Therefore, the various parameters in the embodiment of the present application include parameters corresponding to the query configuration of the database.

[0205] The embodiment of the present application provides an applicable scenario of the technical solution of the present application, specifically a query scenario applied to a database, and the parameters involved are parameters corresponding to the query configuration of the database, which can further optimize the applicability and operability of the technical solution of the present application.

[0206] In some embodiments, the plurality of parameters includes a plurality of the following parameters:

[0207] Cache parameters, concurrent connection parameters, query optimization parameters, index parameters, log parameters, memory allocation parameters, disk input / output parameters, processor utilization parameters.

[0208] In the embodiment of the present application, taking MySQL as an example, the multiple parameters include multiple of the following parameters.

[0209] Cache size: MySQL cache size refers to the amount of data that MySQL caches in memory. Increasing the cache size can improve query performance, but it will also take up more memory resources.

[0210] Among them, common cache parameters include: innodb_buffer_pool_size, key_buffer_size, etc.

[0211] Concurrent connections: MySQL concurrent connections refer to the number of connections that MySQL processes at the same time. Increasing the number of concurrent connections can improve concurrency performance, but it will also occupy more system resources.

[0212] Among them, common concurrent connection parameters include: max_connections, thread_cache_size, etc.

[0213] Query optimizer: MySQL query optimizer refers to the algorithm that MySQL uses to optimize query execution plans. Different query optimizers may have different effects on query performance.

[0214] Among them, common query optimization parameters include optimizer_switch, join_buffer_size, etc.

[0215] Index: MySQL index is a data structure used to speed up queries. Adding indexes can improve query performance, but it will also take up more storage space and system resources.

[0216] Among them, common index parameters include: innodb_ft_result_cache_limit, innodb_ft_total_cache_size, etc.

[0217] Log: MySQL log is used to record information about MySQL operations. Increasing the log level can improve troubleshooting capabilities, but it will also take up more storage space and system resources.

[0218] Among them, common log parameters include: log_error, slow_query_log, etc.

[0219] Memory allocation: MySQL memory allocation refers to the size of the memory blocks allocated by MySQL in memory. Increasing the memory allocation size can improve query performance, but it will also occupy more memory resources.

[0220] Among them, common memory allocation parameters include: innodb_log_buffer_size, sort_buffer_size, etc.

[0221] Disk Input Output (IO): MySQL disk IO refers to the speed at which MySQL reads and writes to the disk. Optimizing disk IO can improve query performance, but you also need to consider factors such as disk capacity and disk read and write speed.

[0222] Among them, common disk IO parameters include: innodb_io_capacity, innodb_flush_method, etc.

[0223] CPU utilization: MySQL CPU utilization refers to how efficiently MySQL uses the CPU. Optimizing CPU utilization can improve query performance, but you also need to consider factors such as the number of CPU cores and CPU load.

[0224] Among them, common CPU utilization parameters include: innodb_thread_concurrency, innodb_spin_wait_delay, etc.

[0225] The embodiment of the present application provides an example solution for multiple parameters, which is convenient for solving the parameter tuning problem of MySQL.

[0226] Please refer to Figure 8 , which shows a flowchart of solving the parameter tuning problem based on a traditional computer provided by an exemplary embodiment of the present application. Figure 8 As shown, the computer device can transform the parameter tuning problem into a TSP problem, and then use the TSP algorithm to find the optimal parameter settings.

[0227] Specifically, the parameter settings can be mapped to the path of the traveling salesman, the objective function can be mapped to the length of the travel path, and then a TSP algorithm (such as dynamic programming, genetic algorithm, etc.) is usually used to solve the shortest path.

[0228] Please refer to Fig. 9 , which shows a flowchart of solving parameter tuning problems based on quantum computers provided by an exemplary embodiment of the present application. Fig. 9 As shown in the figure, since both TSP and Hamiltonian circuit problems are NP-complete problems, there is a reduction property between NP-complete problems. Therefore, the TSP problem can be reduced to the Hamiltonian circuit problem, that is, if the Hamiltonian circuit problem is solved, the TSP problem can also be solved, that is, the parameter optimization problem can be solved.

[0229] For example, the TSP problem can be solved by modeling and calculating on a quantum computer through the Grover algorithm.

[0230] Please refer to Fig.10 , which shows a flow chart of a parameter selection method provided by an exemplary embodiment of the present application, and is used to illustrate the implementation of the present application solution. Fig.10 As shown, the following steps are included:

[0231] S101: Collect parameters, determine parameter ranges, and model them into parameter tuning problems;

[0232] S102: Convert parameter tuning problem into quantum computing problem;

[0233] S103: Use quantum algorithms, such as Grover's algorithm and quantum simulation algorithm, to solve quantum computing problems;

[0234] S104: Determine the optimal parameter selection based on the quantum calculation results.

[0235] Apply optimal parameter selection to database query configuration to improve the efficiency and accuracy of query optimization.

[0236] In summary, this application utilizes the characteristics of quantum computing to solve parameter tuning problems more quickly and efficiently, thereby improving the efficiency and accuracy of the overall database query. Compared with traditional computers, quantum computers can process data at an exponential level, while utilizing the characteristics of quantum superposition and quantum parallelism to simultaneously process or estimate the performance of multiple possible parameter combinations, thereby improving the query efficiency of the final database. In addition, quantum computers can optimize the performance of queries through the characteristics of quantum entanglement and quantum interference, thereby improving the accuracy and efficiency of queries.

[0237] The present application can solve parameter problems more quickly and efficiently, thereby improving the efficiency and accuracy of query optimization. The system of the present application can be applied to various database query optimization scenarios, including enterprise-level databases, cloud databases, and big data analysis. Among them, the above-mentioned database can be a database corresponding to a server, which can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0238] The role of database parameter tuning is to optimize the performance and reliability of the database system to meet different business and user needs. Parameters in the database system include cache size, thread pool size, log size, lock granularity, etc. Different parameter configurations will have different effects on the performance and reliability of the database system. Therefore, choosing the optimal parameter configuration is crucial to the performance and reliability of the database system.

[0239] This application utilizes the latest quantum computing technology and has strong practical significance for improving the competitiveness and technological influence of distributed databases.

[0240] Quantum computing technology is an emerging computing technology that uses the principles of quantum mechanics to process large amounts of data and complex computing problems in a short period of time. In terms of database parameter tuning, quantum computing technology can bring the following benefits:

[0241] 1. Faster parameter tuning speed: Quantum computing technology can process large amounts of data and complex computing problems in a short period of time, so the parameter tuning process can be completed faster and the tuning efficiency can be improved.

[0242] 2. More accurate parameter tuning results: Quantum computing technology can handle more complex computing problems, so it can more accurately analyze the relationship between the performance and parameter configuration of the database system and improve the accuracy of the tuning results.

[0243] 3. More comprehensive parameter tuning solutions: Quantum computing technology can process more data and parameter combinations, so it can generate more comprehensive parameter tuning solutions and improve the tuning effect.

[0244] 4. More efficient resource utilization: Quantum computing technology can optimize the resource utilization of database systems, including CPU utilization, memory utilization, disk utilization, etc. This can improve the efficiency and sustainable development capabilities of database systems.

[0245] 5. Better scalability: Quantum computing technology can handle larger-scale data and computing problems, so it can better meet the scalability requirements of database systems and improve the sustainable development capabilities of database systems.

[0246] In short, quantum computing technology can bring faster, more accurate, more comprehensive, more efficient and more scalable parameter tuning solutions, improve the performance and reliability of database systems, and enhance the business efficiency and competitiveness of enterprises.

[0247] Fig.11 It shows a block diagram of a parameter setting device shown in an exemplary embodiment of the present application, which can be used to perform the following steps: Figure 3 , Figure 4 , Figure 5 , Figure 6 or Fig. 9 In the method shown, all or part of the steps performed by the computer device are as follows Fig.11 As shown, the device comprises:

[0248] The acquisition module 1101 is used to obtain the parameter value ranges of various parameters of the database and the objective function of the database; the objective function is used to measure the performance index of the database;

[0249] The first model building module 1102 is used to build a TSP model of the traveling salesman problem based on the parameter value ranges of multiple parameters and the objective function, wherein the path in the TSP model is a combination of parameter values ​​of multiple parameters; and the path length in the TSP model is the objective function;

[0250] The second model building module 1103 is used to build a quantum algorithm model based on the TSP model;

[0251] A solution module 1104 is used to solve the optimal solution of the TSP model based on the quantum algorithm model;

[0252] The parameter setting module 1105 is used to set various parameters of the database based on the parameter value combination corresponding to the optimal solution of the TSP model.

[0253] In some embodiments, the second model building module 1103 is used to:

[0254] Based on the TSP model, the first quantum algorithm model and the second quantum algorithm model are constructed. The first quantum algorithm model is used to query the solution space of the TSP problem, and the second quantum algorithm model is used to query the optimal solution in the solution space.

[0255] Each solution in the solution space corresponds to a combination of parameter values ​​of multiple parameters.

[0256] In some embodiments, the first quantum algorithm model is a Hamiltonian circuit problem model;

[0257] Each solution in the solution space corresponds to a Hamiltonian circuit in the Hamiltonian circuit problem model.

[0258] In some embodiments, the second quantum algorithm model is a Grover algorithm model;

[0259] Each solution in the solution space corresponds to a quantum bit state in the Grover algorithm model.

[0260] In some embodiments, the solution module 1104 is used to execute the quantum circuit corresponding to the first quantum algorithm model through a quantum computer to obtain each solution in the solution space;

[0261] Mapping each solution in the solution space to a quantum bit state in the second quantum algorithm model, and running the quantum circuit corresponding to the second quantum algorithm model to obtain the probability of the quantum bit state corresponding to each solution in the solution space;

[0262] Among the solutions in the solution space, the solution with the highest probability of the corresponding quantum bit state is determined as the optimal solution of the TSP model.

[0263] In some embodiments, the apparatus further comprises: a processing module, configured to:

[0264] Before the first model building module 1102 builds the TSP model based on the parameter value ranges of the multiple parameters and the objective function, the parameter value ranges of the multiple parameters are normalized, and the normalization is used to unify the parameter value ranges of the multiple parameters into a specified value range;

[0265] The first model building module 1102 is used to:

[0266] The TSP model is constructed based on the parameter ranges of various parameters after regularization and the objective function.

[0267] In some embodiments, the parameter setting module 1105 is used to:

[0268] Performing an inverse process of the normalization process on the parameter values ​​in the parameter value combination corresponding to the optimal solution to obtain the tuned parameter values ​​of multiple parameters;

[0269] Set various parameters of the database based on the tuned parameter values ​​of various parameters.

[0270] In some embodiments, the plurality of parameters include parameters corresponding to a query configuration of a database.

[0271] In some embodiments, the plurality of parameters includes a plurality of the following parameters:

[0272] Cache parameters, concurrent connection parameters, query optimization parameters, index parameters, log parameters, memory allocation parameters, disk input / output parameters, processor utilization parameters.

[0273] Fig.12The block diagram of the structure of a computer device 1200 shown in an exemplary embodiment of the present application is shown. The computer device 1200 includes a central processing unit (CPU) 1201, a system memory 1204 including a random access memory (RAM) 1202 and a read-only memory (ROM) 1203, and a system bus 1205 connecting the system memory 1204 and the central processing unit 1201. The computer device 1200 also includes a large-capacity storage device 1206 for storing an operating system 1209, an application program 1210, and other program modules 1211.

[0274] The mass storage device 1206 is connected to the central processing unit 1201 through a mass storage controller (not shown) connected to the system bus 1205. The mass storage device 1206 and its associated computer readable medium provide non-volatile storage for the computer device 1200. That is, the mass storage device 1206 may include a computer readable medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.

[0275] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electronically-Erasable Programmable Read-Only Memory (EEPROM) flash memory or other solid-state storage technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above. The above-mentioned system memory 1204 and mass storage device 1206 can be collectively referred to as memory.

[0276] According to various embodiments of the present disclosure, the computer device 1200 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 1200 can be connected to the network 1208 through the network interface unit 1207 connected to the system bus 1205, or the network interface unit 1207 can be used to connect to other types of networks or remote computer systems (not shown).

[0277] The memory also includes at least one computer program, which is stored in the memory. The central processing unit 1201 implements all or part of the steps in the methods shown in the above embodiments by executing the at least one computer program.

[0278] In an exemplary embodiment, a chip is also provided. The chip includes a programmable logic circuit and / or program instructions. When the chip runs on a computer device, it is used to implement the parameter setting method in the above aspect.

[0279] In an exemplary embodiment, a computer program product is also provided, the computer program product includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor reads and executes the computer instructions from the computer-readable storage medium to implement the parameter setting method provided by the above-mentioned method embodiments.

[0280] In an exemplary embodiment, a computer-readable storage medium is further provided, in which a computer program is stored. The computer program is loaded and executed by a processor to implement the parameter setting methods provided by the above-mentioned method embodiments.

[0281] Please refer to Fig.13 , which shows a schematic diagram of the structure of a parameter setting system provided by an exemplary embodiment of the present application. Fig.13 As shown, the system may include a database 1310 , a classical computer 1320 , and a quantum computer 1330 .

[0282] The classical computer 1320 is used to obtain the parameter value ranges of the various parameters of the database 1310 and the objective function of the database 1310; the objective function is used to measure the performance index of the database 1310; a traveling salesman problem TSP model is constructed based on the parameter value ranges of the various parameters and the objective function, wherein the path in the TSP model is a combination of the parameter values ​​of the various parameters; the path length in the TSP model is the objective function; and a quantum algorithm model is constructed based on the TSP model;

[0283] Quantum computer 1330, used to find the optimal solution of TSP model based on quantum algorithm model;

[0284] The classical computer 1320 is used to set various parameters of the database based on the parameter value combination corresponding to the optimal solution of the TSP model.

[0285] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0286] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0287] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A parameter setting method, characterized in that: The method comprises: Obtaining parameter value ranges of multiple parameters of a database and an objective function of the database; the objective function is used to measure performance indicators of the database; A traveling salesman problem (TSP) model is constructed based on the parameter value ranges of the multiple parameters and the objective function, wherein the path in the TSP model is a combination of the parameter values ​​of the multiple parameters; and the path length in the TSP model is the objective function; Based on the TSP model, a quantum algorithm model is constructed; Based on the quantum algorithm model, solving the optimal solution of the TSP model; The multiple parameters of the database are set based on a combination of parameter values ​​corresponding to an optimal solution of the TSP model.

2. The method according to claim 1, characterized in that The step of constructing a quantum algorithm model based on the TSP model includes: Based on the TSP model, a first quantum algorithm model and a second quantum algorithm model are constructed, wherein the first quantum algorithm model is used to query the solution space of the TSP problem, and the second quantum algorithm model is used to query the optimal solution in the solution space; Each solution in the solution space corresponds to a parameter value combination of the multiple parameters.

3. The method according to claim 2, characterized in that The first quantum algorithm model is a Hamiltonian circuit problem model; Each solution in the solution space corresponds to a Hamiltonian circuit in the Hamiltonian circuit problem model.

4. The method according to claim 2, characterized in that: The second quantum algorithm model is a Grover algorithm model; Each solution in the solution space corresponds to a quantum bit state in the Grover algorithm model.

5. The method according to any one of claims 2 to 4, characterized in that: Solving the optimal solution of the TSP model based on the quantum algorithm model includes: Executing the quantum circuit corresponding to the first quantum algorithm model by a quantum computer to obtain each solution in the solution space; Mapping each solution in the solution space to a quantum bit state in the second quantum algorithm model, and running the quantum circuit corresponding to the second quantum algorithm model to obtain the probability of the quantum bit state corresponding to each solution in the solution space; Among the solutions in the solution space, the solution with the highest probability of the corresponding quantum bit state is determined as the optimal solution of the TSP model.

6. The method according to claim 1, characterized in that Before constructing the TSP model based on the parameter value ranges of the multiple parameters and the objective function, the method further includes: Performing normalization processing on the parameter value ranges of the multiple parameters, wherein the normalization processing is used to unify the parameter value ranges of the multiple parameters into a specified numerical range; The constructing of the traveling salesman problem (TSP) model based on the parameter value ranges of the multiple parameters and the objective function includes: The TSP model is constructed based on the parameter value ranges of the multiple parameters after normalization and the objective function.

7. The method according to claim 6, characterized in that The parameter value combination corresponding to the optimal solution of the TSP model is used to set the multiple parameters of the database, including: Performing an inverse process of the normalization process on the parameter values ​​in the parameter value combination corresponding to the optimal solution to obtain tuned parameter values ​​of the multiple parameters; The various parameters of the database are set based on the tuned parameter values ​​of the various parameters.

8. The method according to claim 1, characterized in that The multiple parameters include parameters corresponding to the query configuration of the database.

9. The method according to claim 8, characterized in that The multiple parameters include multiple of the following parameters: Cache parameters, concurrent connection parameters, query optimization parameters, index parameters, log parameters, memory allocation parameters, disk input / output parameters, processor utilization parameters.

10. A parameter setting device, characterized in that: The device comprises: An acquisition module, used to acquire parameter value ranges of various parameters of a database, and an objective function of the database; the objective function is used to measure a performance index of the database; A first model building module is used to build a TSP model of the traveling salesman problem based on the parameter value ranges of the multiple parameters and the objective function, wherein the path in the TSP model is a combination of the parameter values ​​of the multiple parameters; and the path length in the TSP model is the objective function; A second model building module is used to build a quantum algorithm model based on the TSP model; A solution module, used for solving the optimal solution of the TSP model based on the quantum algorithm model; The parameter setting module is used to set the multiple parameters of the database based on the parameter value combination corresponding to the optimal solution of the TSP model.

11. The device according to claim 10, characterized in that The second model building module is used to: Based on the TSP model, a first quantum algorithm model and a second quantum algorithm model are constructed, wherein the first quantum algorithm model is used to query the solution space of the TSP problem, and the second quantum algorithm model is used to query the optimal solution in the solution space; Each solution in the solution space corresponds to a parameter value combination of the multiple parameters.

12. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one computer instruction, and the at least one computer instruction is loaded and executed by the processor to implement the parameter setting method according to any one of claims 1 to 9.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer instruction, and the computer instruction is loaded and executed by a processor to implement the parameter setting method according to any one of claims 1 to 9.

14. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; the computer instructions are read and executed by a processor of a computer device to implement the parameter setting method according to any one of claims 1 to 9.

15. A parameter setting system, characterized in that: The system comprises: Databases, classical computers, and quantum computers; The classical computer is used to obtain parameter value ranges of multiple parameters of a database and an objective function of the database; the objective function is used to measure the performance index of the database; a traveling salesman problem TSP model is constructed based on the parameter value ranges of the multiple parameters and the objective function, wherein the path in the TSP model is a combination of parameter values ​​of the multiple parameters; the path length in the TSP model is the objective function; and a quantum algorithm model is constructed based on the TSP model; The quantum computer is used to solve the optimal solution of the TSP model based on the quantum algorithm model; The classical computer is used to set the multiple parameters of the database based on the parameter value combination corresponding to the optimal solution of the TSP model.

Citation Information

Patent Citations

  • Database query optimization method based on extremum optimization

    CN101576880A

  • Integer decomposition optimization method and system based on Grover quantum computing search algorithm

    CN112182494A

  • Hybrid quantum algorithm-based combinatorial optimization solving method, system and solver architecture

    CN113392580A

  • Data processing method and device, equipment and storage medium

    CN114897172A

  • Service combination recommendation method and device, electronic equipment and storage medium

    CN114996581A

Cited By

  • Parameter-setting method, system, and apparatus, device, storage medium, and program product

    WO2025098136A1