Parameter setting method, parameter setting device, computer equipment, computer program, and parameter setting system

JP2026534191APending Publication Date: 2026-10-14TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2026517497
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-08
Filing Date
2024-10-22
Publication Date
2026-10-14

AI Technical Summary

Benefits of technology

【0021】 本願の実施例で提供される構成は、以下のような有益な効果をもたらすことができる。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026534191000001_ABST
    Figure 2026534191000001_ABST
Patent Text Reader

Abstract

The present invention relates to a parameter setting method, system, apparatus, device, storage medium, and program product, and concerns the field of database systems. The method includes the steps of: obtaining the parameter ranges of multiple parameters of a database and the objective function of the database (S310), wherein the objective function is for measuring the performance indicators of the database (S310); constructing a traveling salesperson problem (TSP) model based on the parameter ranges of multiple parameters and the objective function (S320), 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 (S320); constructing a quantum algorithm model based on the TSP model (S330); finding the optimal solution of the TSP model based on the quantum algorithm model (S340); and setting multiple parameters of the database based on the combination of parameter values ​​corresponding to the optimal solution of the TSP model (S350).
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application claims priority to a Chinese patent application filed on November 8, 2023, with application number 202311482543.7 and titled "Parameter Setting Method, System, Apparatus, Device, Storage Medium, and Program Product", the entire contents of which are incorporated herein by reference.

[0002] The present application relates to the technical field of database systems, and in particular, to a parameter setting method, system, apparatus, device, storage medium, and program product. BACKGROUND ART

[0003] How to select an optimal parameter configuration is an important issue in database systems.

[0004] In the related art, the database parameter tuning problem can usually be solved based on experience and trial and error. Current research on parameter tuning mainly focuses on automatic tuning, statistics-based tuning, machine learning-based tuning, deep learning-based tuning, and the like.

[0005] However, since the number of parameters of the database system is enormous, the tuning methods in the related art consume a huge amount of time and resources, resulting in low efficiency of database parameter tuning. SUMMARY OF THE INVENTION PROBLEMS TO BE SOLVED BY THE INVENTION

[0006] The present application provides a parameter setting method, system, apparatus, device, storage medium, and program product that can solve the database parameter tuning problem faster and more efficiently, and ensure the efficiency and accuracy of database parameter setting. The configuration thereof is as follows. MEANS FOR SOLVING THE PROBLEMS

[0007] According to one aspect of the present invention, a parameter setting method for computer equipment is provided. The method is: A step of obtaining the parameter ranges of multiple parameters of a database and the objective function of the database, wherein the objective function is for measuring the performance indicators of the database. A step of constructing a Traveling Salesperson Problem (TSP) model based on the parameter ranges of the plurality of parameters and the objective function, wherein the path in the TSP model is a combination of the parameter values ​​of the plurality of parameters, and the path length in the TSP model is the objective function, The steps include constructing a quantum algorithm model based on the aforementioned TSP model, The steps include: finding the optimal solution for the TSP model based on the quantum algorithm model; The step includes setting the plurality of parameters of the database based on the combination of parameter values ​​corresponding to the optimal solution of the TSP model.

[0008] According to one aspect of the present invention, a parameter setting system is provided. The system is Including databases, classical computers, and quantum computers, The classical computer obtains the parameter ranges of multiple parameters in the database and the objective function of the database, constructs a Traveling Salesperson Problem (TSP) model based on the parameter ranges of the multiple parameters and the objective function, constructs a quantum algorithm model based on the TSP model, the objective function is for measuring the performance indicators of the database, 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. The quantum computer, based on the quantum algorithm model, finds the optimal solution to the TSP model. The classical computer sets the plurality of parameters of the database based on the combination of parameter values ​​corresponding to the optimal solution of the TSP model.

[0009] According to one aspect of the present invention, a parameter setting device is provided. The device is An acquisition module that acquires the parameter ranges of multiple parameters of a database and the objective function of the database, wherein the objective function is for measuring the performance indicators of the database, and A first model building module that constructs a Traveling Salesperson Problem (TSP) model based on the parameter ranges of the plurality of parameters and the objective function, wherein the path in the TSP model is a combination of the parameter values ​​of the plurality of parameters, and the path length in the TSP model is the objective function, A second model construction module constructs a quantum algorithm model based on the aforementioned TSP model, A solution module that finds the optimal solution of the TSP model based on the aforementioned quantum algorithm model, The system includes a parameter setting module that sets the plurality of parameters of the database based on the parameter value combination corresponding to the optimal solution of the TSP model.

[0010] In some embodiments, the second model construction module constructs a first quantum algorithm model and a second quantum algorithm model based on the TSP model, the first quantum algorithm model for querying the solution space of the TSP problem, and the second quantum algorithm model for querying the optimal solution in the solution space, wherein each solution in the solution space corresponds to one of the parameter value combinations of the plurality of parameters.

[0011] In some embodiments, the first quantum algorithm model is a Hamiltonian cycle problem model, where each solution in the solution space corresponds to a Hamiltonian cycle in the Hamiltonian cycle problem model.

[0012] In some embodiments, the second quantum algorithm model is a Grover algorithm model, and each solution in the solution space corresponds to a single qubit state in the Grover algorithm model.

[0013] In some embodiments, the solution-finding module executes a quantum circuit corresponding to the first quantum algorithm model on a quantum computer, obtains each solution in the solution space, maps each solution in the solution space to a single qubit state in the second quantum algorithm model, executes a quantum circuit corresponding to the second quantum algorithm model, obtains the probability of each qubit state corresponding to each solution in the solution space, and determines the solution with the highest probability of the corresponding qubit state among the solutions in the solution space as the optimal solution of the TSP model.

[0014] In some embodiments, the apparatus further includes a processing module that performs a normalization process on the parameter ranges of the plurality of parameters before the first model building module, the normalization process being for unifying the parameter ranges of the plurality of parameters into a specified numerical range. The first model construction module constructs the TSP model based on the parameter ranges of the multiple parameters after normalization and the objective function.

[0015] In some embodiments, the parameter setting module performs the reverse process of the normalization process on the parameter values ​​in the parameter value combination corresponding to the optimal solution, obtains the tuned parameter values ​​of the plurality of parameters, and sets the plurality of parameters in the database based on the tuned parameter values ​​of the plurality of parameters.

[0016] In some embodiments, the plurality of parameters includes a parameter corresponding to query deployment of the database.

[0017] In some embodiments, the plurality of parameters includes a plurality of cache parameters, concurrent connection parameters, query optimization parameters, index parameters, log parameters, memory allocation parameters, disk input / output parameters, and processor utilization parameters.

[0018] According to another aspect of the present application, a computer device comprising a processor and a memory is provided, wherein the memory stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, the at least one program, the code set or the instruction set, when loaded and executed by the processor, implements the parameter setting method in the above aspects.

[0019] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the readable storage medium stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, the at least one program, the code set or the instruction set, when loaded and executed by a processor, implements the parameter setting method in the above aspects.

[0020] According to another aspect of the present application, a computer program product comprising computer instructions is provided, wherein the computer instructions are 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 in the above aspects. Advantageous Effects of the Invention

[0021] The configurations provided in the embodiments of the present application can bring the following beneficial effects.

[0022] After converting the parameter tuning problem into a quantum computation problem, the target solution of the parameter tuning problem can be obtained by solving the quantum computation problem using a quantum algorithm. Compared with classical computers, quantum computers can process data at an exponential level, and can simultaneously process or predict the performance of a plurality of possible parameter combinations. Therefore, according to the solution provided in the embodiments of the present application, the database parameter tuning problem can be solved faster and more efficiently, the efficiency and accuracy of database parameter configuration can be guaranteed, and further, the efficiency and accuracy of database queries can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] [Figure 1] 1 is an architecture diagram of a distributed database provided in an exemplary embodiment of the present application. [Figure 2] 1 is a schematic diagram of an application scenario of the solution provided in an embodiment of the present application. [Figure 3] 1 is a flowchart of a parameter configuration method provided in an exemplary embodiment of the present application. [Figure 4] 1 is a flowchart of a parameter configuration method provided in another exemplary embodiment of the present application. [Figure 5] 1 is a flowchart of a parameter configuration method provided in still another exemplary embodiment of the present application. [Figure 6] 1 is a flowchart of a parameter configuration method provided in yet another exemplary embodiment of the present application. [Figure 7] 1 is a flowchart of a parameter configuration method provided in a further exemplary embodiment of the present application. [Figure 8] 1 is a flowchart of a solution for solving a parameter tuning problem based on a classical computer, provided in an exemplary embodiment of the present application. [Figure 9]This is a flowchart of a configuration for solving a parameter tuning problem based on a quantum computer provided in one exemplary embodiment of the present application. [Figure 10] This is a flowchart of a parameter selection method provided in one exemplary embodiment of the present application. [Figure 11] This is a block diagram of a parameter setting device shown in one exemplary embodiment of the present application. [Figure 12] This is a block diagram of the configuration of a computer device provided in one exemplary embodiment of the present application. [Figure 13] This is a schematic diagram of a parameter setting system provided in one exemplary embodiment of the present application. [Modes for carrying out the invention]

[0024] The following provides interpretations of some terms related to this application.

[0025] A database (DB) is an organic collection of large amounts of shareable data, organized in a specific structure and stored for long periods within a computer. Each database has one or more different application programming interfaces (APIs) for creating, accessing, managing, searching, and replicating the stored data.

[0026] Quantum computing is a computational method that uses quantum logic to complete computational tasks at high speed by utilizing properties such as the superposition and entanglement of quantum states. In quantum computing, the basic unit of data storage is the qubit.

[0027] A qubit is a form of quantum information and the fundamental unit of quantum computation. Classical computers use 0 and 1 as the fundamental units of binary. In contrast, quantum computation can handle 0 and 1 simultaneously, and a system can exist in a linear superposition state of 0 and 1: |Ψ〉=α|0〉+β|1〉. Here, α and β represent the complex probability range of the system in terms of 0 and 1. The square of the norm of α and β is |α| 2 , |β| 2 These represent the probabilities of being 0 and 1, respectively.

[0028] Quantum operation: This involves manipulating qubits to process the quantum information contained within them. Common quantum operations include Pauli X, Y, and Z transforms (or σx, σy, and σz), Hadamard transforms (H), and controlled Pauli X transforms, i.e., controlled NOT gates (CNOT).

[0029] A quantum circuit is a descriptive model of quantum computing, consisting of qubits and quantum operations on qubits, representing a hardware implementation of a corresponding quantum algorithm / program using a quantum gate model. A quantum circuit consists of a sequence of quantum gates, which perform the computation. If a quantum circuit includes tunable parameters that control the quantum gates, it is called a parameterized quantum circuit.

[0030] A quantum computing device is a physical device that performs quantum computations.

[0031] The Traveling Salesman Problem (TSP) is a classic combinatorial optimization problem. The classical TSP can be described as follows: A salesman needs to visit several cities to sell his goods. The salesman must start from a certain city, visit all the cities, and then return to his starting point. What route should he choose to minimize the total distance? From a graph theory perspective, the essence of this problem is to find the Hamiltonian cycle with the minimum weights in a weighted, completely undirected graph. The feasible solutions to this problem are all permutations of all vertices, and as the number of vertices increases, a combinatorial explosion occurs, so the TSP is an NP-complete problem.

[0032] A Hamiltonian cycle is defined as a path within a graph G=(V,E) that passes through each vertex exactly once. A cycle within G that passes through each vertex exactly once is called a Hamiltonian cycle. A graph containing Hamiltonian cycles is called a Hamiltonian graph.

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

[0034] Grover's algorithm, also known as the Quantum Search Algorithm, is an unstructured search algorithm that runs on a quantum computer and is one of the representative algorithms of quantum computing.

[0035] A distributed database (DDB) is a database system that is physically distributed but logically centralized, combining database technology with computer networks. A DDB includes a compute layer that performs data access permission checks and routing access, a storage layer that stores data, and a metadata layer that stores metadata information. When the compute layer of a distributed database starts up, it accesses the metadata layer to retrieve all cluster information, enabling it to correctly perform tasks such as parsing structured query language (SQL) and routing.

[0036] Refer to Figure 1. Figure 1 shows an architectural diagram of a distributed database provided in one exemplary embodiment of the present application. As shown in Figure 1, this distributed database includes a Scheduler, a ZK cluster, a gateway, and a Set.

[0037] Scheduler: 1. Pull the DDL task from ZK and execute it on the actual MySQL® instance.

[0038] 2. Retrieve tasks from ZK and generate extended tasks.

[0039] 3. Controls the switching from the main to the backup within the Set.

[0040] 4. Multiple Schedulers themselves achieve fault tolerance through ZK elections.

[0041] gateway: 1. Recognize DDL operations and save them to the ZK cluster in task format.

[0042] 2. The system recognizes the DML operation, performs the SQL conversion, and sends the result to the main or backup machine within the corresponding Set.

[0043] 3. Collect the responses from each node in the Set, perform combined processing, and send the result back to the API of the front-end application.

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

[0045] Set: 1. Check the instance status and report it to ZK.

[0046] 2. Check the table status and report to ZK.

[0047] 3. Pull the transition task from ZK and execute it.

[0048] 4. Participate in the process of switching from the main to the backup.

[0049] Data Definition Language (DDL): A language used to create and delete databases for storing data, and objects such as tables within those databases.

[0050] Data Manipulation Language (DML): Used to query and modify records within a table.

[0051] ZooKeeper (ZK) cluster: Its main functions include deployment maintenance, election decision-making, and routing synchronization, and it can also assist in storing information such as routing, control information, task information, and heartbeats.

[0052] Parameter tuning is a critical issue in database systems, related to selecting the optimal parameter configuration to improve the performance and reliability of the database system. Database system parameters include cache size, thread pool size, log size, and lock granularity. Different parameter configurations have different effects on the performance and reliability of the database system. Therefore, selecting the optimal parameter configuration is extremely important for the performance and reliability of the database system.

[0053] Traditional parameter tuning methods are typically based on experience and trial and error, requiring extensive human intervention and experimentation. Such methods are inefficient and make it difficult to find the optimal parameter configuration. Therefore, research into how to automatically select the optimal parameter configuration has become one of the hot spots in database systems research.

[0054] Current research on parameter tuning primarily focuses on automated tuning, statistical tuning, machine learning-based tuning, and deep learning-based tuning. These research findings can help database administrators and developers select optimal parameter configurations to improve the performance and reliability of database systems.

[0055] Quantum computing is attracting widespread attention in many research fields because researchers hope to gain quantum advantages in complex calculations. Although quantum computing has been studied for decades, the rapid development of quantum computing hardware in recent years has steadily increased researchers' interest in it. Furthermore, cloud-accessible quantum systems are making quantum computing more feasible for researchers, allowing initial experiments to be conducted on actual quantum processing units (QPUs).

[0056] Unlike central processing units (CPUs), QPUs perform computations using qubits or quantum bits. The mathematical states of QPUs have a larger exponential level than classical bits, enabling phenomena such as quantum superposition, quantum entanglement, and quantum interference. Generally, given the assumptions of accepted complexity theory, quantum systems are considered to offer higher computational power than classical systems. Several quantum algorithms have been proven to have acceleration effects, and several pioneering experiments have demonstrated the quantum superiority in actual hardware.

[0057] Furthermore, quantum computing excels at optimization problems that require determining elements with specific attributes in a search space (with a large exponential level). Such problems are common in database systems and are particularly highly correlated with database query optimization.

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

[0059] Among database optimization problems, parameter tuning is a crucial one. Conventional computers require enormous amounts of time and resources to solve this problem. This is because parameter tuning is inherently a nondeterministic polynomial (NP) hard problem due to the enormous size of its parameter space. Therefore, a faster and more efficient method is needed to solve this problem.

[0060] The advent of quantum computers presents new opportunities for solving parameter tuning problems. Quantum computers are based on the principles of quantum mechanics and can, in some cases, solve some problems faster than classical computers. Quantum machine learning is a method of accelerating machine learning using quantum computers. In parameter tuning optimization, quantum machine learning can speed up the optimization process using techniques such as quantum support vector machines (QSVMs) and parameterized quantum circuits (PQCs).

[0061] Refer to Figure 2. Figure 2 shows a schematic diagram of a configuration application scenario provided in one embodiment of the present invention. As shown in Figure 2, this application scenario may be a superconducting quantum computing platform. This application scenario includes a quantum computing device 21, a dilution refrigerator 22, a control device 23, and a computer 24.

[0062] The quantum computing device 21 is a circuit that acts on physical qubits. The quantum computing device 21 can be realized as a quantum chip (for example, a superconducting quantum chip near absolute zero). The dilution refrigerator 22 provides an absolute zero environment for the superconducting quantum chip.

[0063] The control device 23 controls the quantum computing device 21, and the computer 24 controls the control device 23. For example, a created quantum program is compiled into instructions by software in the computer 24 and sent to the control device 23 (e.g., an electron / microwave control system), which converts the above instructions into electron / microwave control signals and inputs them to the dilution refrigerator 22 to control superconducting qubits at a temperature of less than 10 mK. The reading process is the reverse, and the read waveform is transmitted to the quantum computing device 21.

[0064] Before describing the embodiments of the method of this application, we will first describe the execution environment of the method. The method provided in the embodiments of this application can be executed in a hybrid equipment environment of classical and quantum computers.

[0065] Here, a classical computer refers to a computer that uses a binary system to store and process information using bits. Although the computational power of classical computers has improved with the development of hardware, there are still physical limitations to their computational speed, making it difficult to reach theoretically optimal solutions for some problems. For example, NP-complete problems can only be solved by enumeration on classical computers, and they have a very high time complexity.

[0066] On the other hand, a quantum computer refers to a computer that stores and processes information using qubits. Unlike the bits of a classical computer, which can only handle states of 0 or 1, qubits have the characteristics of quantum superposition and quantum entanglement. As a result, quantum computers have more powerful computing capabilities than classical computers.

[0067] In the following method embodiments, for the sake of explanation, only cases where the execution entity for each step is a computer device will be described. It should be understood that this computer device may include a hybrid execution environment of classical and quantum computers. The embodiments of this application are not limited to this.

[0068] Refer to Figure 3. Figure 3 shows a flowchart of a parameter setting method provided in one exemplary embodiment of the present application. This method is performed by a computer device. As shown in Figure 3, this method may include steps 310, 320, 330, 340, and 350.

[0069] Step 310 involves obtaining the parameter ranges for several database parameters and the database's objective function, which is used to measure the database's performance metrics.

[0070] In embodiments of the present invention, a computer device may determine the parameter ranges of multiple parameters by collecting multiple parameters from a database and obtain an objective function for the database. Here, the objective function is used to measure an indicator of the performance or effectiveness of the database. Optionally, the objective function is a function for measuring the performance or effectiveness of the database. For example, the objective function is a function that takes the parameter values ​​of multiple parameters of the database as input and outputs an indicator of the performance or effectiveness of the database. The database may be an enterprise database or a cloud database, etc.

[0071] Here, multiple parameters include cache size, thread pool size, log size, and lock granularity. Different parameter configurations will have different effects on the performance and reliability of the database system.

[0072] Here, the parameter range refers to the range of values ​​for the parameter, and the parameter ranges for multiple parameters are usually finite. For example, the parameter range for a thread is 1 to 10.

[0073] In some embodiments, a computer device may perform a normalization process on the parameter ranges of multiple parameters to unify them into a specified numerical range.

[0074] In one possible implementation, performing normalization on the parameter ranges of the above-mentioned multiple parameters may refer to performing normalization individually on the parameter range of each parameter and unifying the parameter range of that parameter to a specified numerical range. Here, different parameters may have the same numerical range for their parameter ranges after normalization. Alternatively, different parameters may have different numerical ranges for their parameter ranges after normalization.

[0075] In step 320, a Traveling Salesperson Problem (TSP) model is constructed based on the parameter ranges of multiple parameters and the objective function. In the TSP model, the path is a combination of the parameter values ​​of multiple parameters, and the path length in the TSP model is the objective function.

[0076] In embodiments of the present invention, a computer device may construct a Traveling Salesperson Problem (TSP) model based on the parameter ranges of several parameters obtained in step 310 and an objective function.

[0077] The TSP model refers to a mathematical model of the TSP problem. The mathematical description of the TSP problem can be expressed using graph theory. Assume there is a graph G=(V,E). Here, V is the set of vertices and represents cities, and E is the set of edges and represents the connections between cities. Each edge (i,j) has a weight w(i,j) that represents the distance from city i to city j. The objective of TSP is to find the path that minimizes the total distance. This path must pass through each vertex once and return to the starting point.

[0078] In the embodiment of the present invention, the route in the TSP model is, in other words, a combination of parameter values ​​of multiple parameters. A combination of parameter values ​​is typically a variable that requires adjustment and optimization. In the TSP model, the combination of parameter values ​​can be considered as the route selection of a traveling salesman, that is, the decision of the order in which the traveling salesman will visit each city.

[0079] Here, the path length in the TSP model is the objective function. The objective function is typically an indicator used to measure the performance or effectiveness of the parameter settings. In the TSP model, the objective function is to find the shortest route for a traveling salesman to return to the starting city after passing through each city once.

[0080] In other words, constructing a TSP model based on the parameter ranges of the multiple parameters mentioned above and the objective function is equivalent to constructing a TSP model where the combination of parameter values ​​of the multiple parameters is the path and the objective function is the path length.

[0081] In step 330, we construct a quantum algorithm model based on the TSP model.

[0082] In embodiments of the present invention, a computer device may construct a quantum algorithm model based on the TSP model constructed in step 320.

[0083] Here, TSP is an NP-hard problem in combinatorial optimization, and solving a TSP model based on conventional computational models requires enormous time and resources. On the other hand, solving quantum algorithm models can be completed quickly based on quantum logic, utilizing properties such as superposition and entanglement of quantum states. Compared to classical computers, quantum computers can process data at an exponential level, and by utilizing the properties of quantum superposition and quantum parallelism, they improve the query efficiency of the final database by simultaneously processing or predicting the performance of multiple possible parameter combinations.

[0084] Here, the quantum algorithm model described above is also called a quantum computing model or quantum circuit model, and is a mathematical model for representing quantum circuits.

[0085] In step 340, the optimal solution for the TSP model is found based on the quantum algorithm model.

[0086] In the embodiments of the present invention, a computer device may find the optimal solution to the TSP model based on the quantum algorithm model constructed in step 330.

[0087] Here, finding the optimal solution to the TSP model based on the quantum algorithm model described above may refer to obtaining the optimal solution to the TSP model by executing the quantum algorithm model and obtaining the execution result of the quantum algorithm model.

[0088] In step 350, multiple parameters of the database are set based on the combination of parameter values ​​that corresponds to the optimal solution of the TSP model.

[0089] In embodiments of the present invention, a computer device may set multiple parameters in the database based on the combination of parameter values ​​corresponding to the optimal solution obtained in step 340. For example, the computer device may set each parameter value corresponding to the combination of parameter values ​​corresponding to the optimal solution of the TSP model to the parameter values ​​of multiple parameters in the database.

[0090] In summary, the configuration provided in the embodiment of the present application optimizes the performance metrics of the database by constructing combinations of parameter values ​​for multiple database parameters as paths in the TSP model, constructing the database objective function as the path length in the TSP model, constructing a quantum algorithm model based on the TSP model, finding the optimal solution of the TSP model using quantum computation based on the quantum algorithm model, and setting multiple database parameters accordingly. Compared to conventional computation, quantum computation can process data at an exponential level and can simultaneously process or predict the performance of multiple possible parameter combinations. Therefore, according to the configuration shown in the embodiment of the present application, the database parameter tuning problem can be solved more quickly and efficiently, the efficiency and accuracy of database parameter setting can be guaranteed, and the efficiency and accuracy of database queries can be improved.

[0091] Refer to Figure 4 based on the configuration shown in any one or more of the above embodiments of the present application. Figure 4 shows a flowchart of a parameter setting method provided in other exemplary embodiments of the present application. The method is performed by computer equipment. As shown in Figure 4, step 330 in the embodiment shown in Figure 3 above may be implemented as step 330a.

[0092] In step 330a, a first quantum algorithm model and a second quantum algorithm model are constructed based on the TSP model. 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.

[0093] Here, each solution in the solution space corresponds to one of the combinations of parameter values ​​of multiple parameters.

[0094] In embodiments of the present invention, a computer device may construct a first quantum algorithm model for querying the solution space of a 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. Here, each solution in the solution space corresponds to one of the combinations of parameter values ​​of a plurality of parameters.

[0095] In other words, constructing the first and second quantum algorithm models based on the TSP model described above means constructing a first quantum algorithm model for querying the solution space of a TSP problem, and a second quantum algorithm model for querying the optimal solution in that solution space.

[0096] In some embodiments, the first quantum algorithm model may be an NP-complete problem model (e.g., a Hamiltonian cycle problem model).

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

[0098] Quantum computers utilize the superposition and entanglement properties of qubits to handle multiple possibilities in a single computation. This gives quantum computers a potential advantage in areas such as search, optimization, and simulation. For NP problems, quantum computers can explore the solution space using quantum parallelism and quantum coherence with the aim of finding a solution to the problem. Here, quantum parallelism allows quantum computers to process multiple possible solutions simultaneously, and quantum coherence allows quantum computers to increase the probability of finding the correct solution by utilizing interference effects during the search process.

[0099] In quantum computing, results are typically obtained by measuring the state of qubits as a feedback mechanism. The output of a quantum computer is the result of a series of measured qubits, and these results are expressed in probabilistic form. By performing the same calculation multiple times, the frequencies of the measurement results can be aggregated, and the solution to the problem can be estimated from these frequencies.

[0100] In the embodiments of this application, a configuration is provided to construct quantum algorithm models based on a TSP model, and two quantum algorithm models are constructed: one for querying the solution space of a TSP problem, and the other for querying the optimal solution in the solution space. Compared to classical computers, quantum computers can use quantum parallelism and quantum coherence to explore the solution space at an exponential level, find the optimal solution to the TSP problem, and solve the parameter tuning problem faster and more efficiently.

[0101] Based on the configurations shown in any one or more of the above embodiments of the present application, in some embodiments, the first quantum algorithm model is a Hamiltonian cycle problem model, and each solution in the solution space corresponds to one Hamiltonian cycle in the Hamiltonian cycle problem model.

[0102] Here, the quantum existence problem can be mapped to the Hamiltonian cycle existence problem, and the results of quantum computation can be reflected in the solution of the Hamiltonian cycle.

[0103] NP-complete problems can be reduced to each other; both the Time Strike Problem (TSP) and the Hamiltonian cycle problem are NP-complete problems. The TSP problem can be reduced to the Hamiltonian cycle problem, meaning that solving the Hamiltonian cycle problem will solve the TSP problem, and thus the database parameter optimization problem.

[0104] In the embodiments of the present invention, an optional configuration of the first quantum algorithm model is provided, specifically a Hamiltonian cycle problem model for querying the solution space of a TSP problem. The completeness and reliability of the configuration of the present invention can be further optimized by associating one Hamiltonian cycle in the Hamiltonian cycle problem model with one solution in the solution space.

[0105] Based on the configurations shown in any one or more of the above embodiments of the present application, in some embodiments, the second quantum algorithm model is a Grover algorithm model, and each solution in the solution space corresponds to a single qubit state in the Grover algorithm model.

[0106] In embodiments of the present invention, a quantum counting algorithm can be used to expedite the solution of NP-complete problems. An example of an NP-complete problem is the Hamiltonian cycle problem. The method for determining whether a graph is a Hamiltonian cycle problem is as follows: Assuming that Hamiltonian cycles exist, a simple solution to the Hamiltonian cycle problem is to check whether each vertex order is a Hamiltonian cycle. Finding all possible orders of vertices in a graph can be accomplished by quantum counting following the Grover algorithm. Here, the quantum counting algorithm itself is sufficient to determine whether or not Hamiltonian cycles exist.

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

[0108] In the embodiments of this invention, the solution space of an NP problem can be considered as an unsorted database, and therefore the Grover algorithm can be used to search for solutions in the solution space. By mapping each solution in the solution space to a single parameter item in the database, the Grover algorithm can be used to search for the optimal solution in the solution space.

[0109] For example, suppose we are searching for a solution that satisfies several conditions in a solution space containing N elements. Using conventional search algorithms, finding the solution would take O(N) time. However, using the Grover algorithm, the solution can be found in O(sqrt(N)) time. Specifically, assuming the same problem is given, the Grover algorithm can solve it in 10,000 calculations, while a classical computer would require 10,000^2 = 10,000,000 calculations.

[0110] In the configuration shown in the embodiment of the present invention, by mapping the above solution space to an unsorted database, a computer can use the Grover algorithm to search for the optimal solution in the solution space.

[0111] In the embodiments of this application, an optional configuration of a second quantum algorithm model is provided, specifically, a Grover algorithm model. Here, the qubit states in the Grover algorithm model correspond to the solutions in the solution space. The Grover algorithm can speed up the search for the optimal solution in the solution space and improve the efficiency of solving parameter optimization problems.

[0112] Refer to Figure 5 based on the configuration shown in any one or more of the above embodiments of the present application. Figure 5 shows a flowchart of a parameter setting method provided in another exemplary embodiment of the present application. The method is performed by computer equipment. As shown in Figure 5, step 340 in the embodiment shown in Figure 4 above may be implemented as steps 340a, 340b, and 340c.

[0113] In step 340a, the quantum circuit corresponding to the first quantum algorithm model is executed on the quantum computer, and each solution in the solution space is obtained.

[0114] In embodiments of the present invention, after constructing a first quantum algorithm model and a second quantum algorithm model based on the TSP model in the above steps, a computer device may execute a quantum circuit corresponding to the first quantum algorithm model on a quantum computer and obtain each solution in the solution space.

[0115] In step 340b, each solution in the solution space is mapped to a single qubit state in the second quantum algorithm model, the quantum circuit corresponding to the second quantum algorithm model is executed, and the probability of each qubit state corresponding to each solution in the solution space is obtained.

[0116] In the embodiments of the present invention, after obtaining each solution in the solution space in step 340a, the computer equipment may map each solution in the solution space to a single qubit state in a second quantum algorithm model, execute a quantum circuit corresponding to the second quantum algorithm model, and obtain the probability of each qubit state corresponding to each solution in the solution space.

[0117] Here, mapping each solution in the solution space described above to a single qubit state in the second quantum algorithm model means mapping each solution in the solution space to a single qubit state in the second quantum algorithm model, that is, mapping different solutions in the solution space to different qubit states in the second quantum algorithm model.

[0118] In step 340c, the solution with the highest probability of corresponding qubit states among the solutions in the solution space is determined as the optimal solution for the TSP model.

[0119] In the embodiments of the present invention, after obtaining the probability of the corresponding qubit state for each solution in the solution space in step 340b, the computer equipment may determine the solution with the highest probability of the corresponding qubit state among the solutions in the solution space as the optimal solution of the TSP model.

[0120] Here, the optimal parameter setting for a database is one of all possible parameter combinations. Therefore, the database parameter tuning problem can be mapped to a combinatorial optimization problem (e.g., the Traveling Salesperson Problem (TSP)). The relationship between the parameter tuning problem and the Traveling Salesperson Problem (TSP) can be understood in the following way.

[0121] Objective function: In parameter tuning problems, the objective function is usually an indicator used to measure the performance or effectiveness of parameter settings. In the TSP problem, the objective function is to find the shortest route for a traveling salesman to return to his starting city after visiting each city once.

[0122] Parameter setting: In parameter tuning problems, parameter setting is the variable that needs to be adjusted and optimized. In the TSP problem, parameter setting can be seen as the route selection of a traveling salesman, that is, the decision of the order in which the traveling salesman visits each city.

[0123] Constraints: In parameter tuning problems, several constraints may exist (e.g., data dependencies between parameters, overall performance balance), limiting the range or relationship of parameter values. In the TSP problem, a constraint is that the traveling salesman must visit each city once and eventually return to the starting city.

[0124] Here, in step 320, the parameter optimization problem is mapped to the Traveling Salesperson Problem (TSP) problem by constructing a TSP model based on the parameter ranges of multiple parameters and the objective function. Here, the parameter settings are mapped to the path in the TSP model, the objective function is mapped to the path length, and the constraints are mapped to the condition that the path is a loop and that the path passes through each city only once.

[0125] In step 330, a quantum algorithm model is constructed based on the TSP model, that is, the TSP problem (i.e., the parameter optimization problem) is transformed into a quantum computing problem. In step 340, the optimal solution (i.e., the optimal parameter setting) of the TSP problem can be found quickly based on the quantum computing model. Finally, several parameters for the database are set accordingly.

[0126] Specifically, for example, quantum algorithm models include Hamiltonian cycle problem models and Grover algorithm models. First, the Hamiltonian cycle problem model searches for all possible vertex orders in the Hamiltonian graph, that is, all possible paths in the TSP problem, that is, all possible combinations of parameter values ​​for multiple parameters. Then, the Grover algorithm model searches for the optimal vertex order (i.e., the optimal combination of parameter values). Specifically, The steps include: representing all possible vertex orders (i.e., combinations of parameter values) as different qubit states, Steps to mark the target qubit state in Oracle, The Grover iteration increases the probability of the target qubit state, A step of measuring a qubit, wherein the measurement result is expressed in probabilistic form, This includes the step of associating the qubit state with the highest probability with the optimal vertex order (i.e., the optimal combination of parameter values).

[0127] Here, taking the case where the second quantum algorithm model is the Grover algorithm model as an example, the modeling and feedback of the Grover algorithm in quantum computing are related to the following steps.

[0128] S1 (Modeling): Through the above steps, the parameter tuning problem is transformed into a format that can be processed by a quantum computer. For the Grover algorithm, the computer can represent the search space of the problem as a state of qubits. Each item in the search space is mapped to the state of a single qubit that contains information about the problem.

[0129] S2 (Initialization): In the Grover algorithm, qubits must be initialized to a uniform superposition state. This can be achieved by setting all qubits to a superposition state of Hadamard gates.

[0130] S3 (Oracle): Oracle is a key component of the Grover algorithm and is used to mark target items. In quantum computing, Oracle can be represented as a quantum gate or quantum circuit that can manipulate the state of qubits according to specific conditions of the problem.

[0131] S4 (Grover iteration): The Grover algorithm increases the probability of a target item by applying Grover iterations multiple times. Here, each Grover iteration consists of three steps: S41 (applying the Oracle), S42 (applying the reflective action), and S43 (repeating).

[0132] S41 (Application of Oracle): In each iteration of the Grover algorithm, the Oracle operation is first applied. Here, the role of the Oracle is to mark the target item, that is, to distinguish the target item from other items. A quantum computer can achieve this by manipulating the state of the qubits.

[0133] Specifically, Oracle manipulates the state of qubits according to specific conditions of the problem to distinguish the target item from other items. This can be achieved, for example, by applying a specific quantum gate or quantum circuit.

[0134] S42 (Application of Reflective Action): After applying Oracle in S41, a reflective action is applied in S42. The reflective action is a core part of the Grover algorithm and helps increase its amplitude so that the probability of the target item can be measured more easily.

[0135] Specifically, the reflection action can be implemented using a quantum gate or quantum circuit called a Grover reflection. The role of the reflection action is to increase the amplitude of the probability of the target item by inverting the state of the qubit with respect to the mean amplitude.

[0136] S43 (Iteration): Following the application of Oracle in S41 and the reflection operation in S42, the Grover algorithm repeats these two steps. Here, the number of iterations is determined by the size of the problem and the amplitude of the target item's probability. Typically, the number of iterations is around the square root of N, where N is the number of items for multiple parameters in the database. By repeating the application of Oracle and the reflection operation, the amplitude of the target item's probability gradually increases so that it becomes easier to measure.

[0137] By repeating these three steps, the Grover algorithm can efficiently search for the target item in an unsorted database. Each iteration helps improve the accuracy and efficiency of finding the target item by increasing the amplitude of the target item's probability.

[0138] S5 (Measurement): At the end of the Grover algorithm, it is necessary to measure the qubits to obtain the final result. The measurement result is expressed in the form of a probability, and the result with the highest probability corresponds to the optimal solution of the TSP model.

[0139] Here, the measurement method and procedure can be implemented by the hardware of a quantum computer, and can be completed, for example, using quantum measurement gates or measurement circuits. These quantum measurement gates or measurement circuits perform a corresponding operation based on the state of a qubit and convert it to the state of a classical bit.

[0140] Specifically, the S5 (measurement) process described above can be simply described as the following few steps.

[0141] S51 (Preparation): Before performing the measurement, it is necessary to ensure that the qubits are in the desired state. This involves applying a series of quantum operations, such as applying a Hadamard gate to create a uniform superposition state.

[0142] S52 (Measurement): A measurement operation is performed in response to the qubit being in the desired state. The measurement operation causes the qubit's state to decay to a classical bit state, i.e., 0 or 1. The result of the measurement is random, but the probability is proportional to the square of the amplitude of the qubit's state.

[0143] S53 (Results): The measurement results are expressed in the form of probabilities, and the result with the highest probability corresponds to the solution of the problem. For example, in the Grover algorithm, if the target item is marked correctly, the probability of the corresponding target item in the measurement results will be high.

[0144] Let's explain the measurement process with an example. Assume we have a qubit in a superposition state (|0〉+|1〉) / √2. When we perform a measurement, the possible results are 0 or 1, and the probability of each result is 1 / 2. This means that in the process of repeating the measurement multiple times, 0 will be obtained in about half the time and 1 will be obtained in the other half.

[0145] It is important to note that the measurement process causes the qubit state to collapse into a classical bit state, resulting in the loss of qubit information after measurement. Therefore, the Grover algorithm typically requires multiple iterations and measurements to increase the amplitude of the target item's probability. This improves the accuracy and efficiency of finding the target item.

[0146] Regarding feedback, the results of the Grover algorithm are typically obtained by running the algorithm multiple times and aggregating the frequencies of the measurement results. By repeatedly running the Grover algorithm, the probability of the target item increases, and ultimately, a result closer to the optimal solution can be obtained.

[0147] In the embodiment of this application, a configuration is provided for finding the optimal solution of the TSP model based on a quantum algorithm model, and by utilizing the quantum algorithm, the optimal solution of the TSP model can be obtained more quickly and efficiently. Specifically, each solution in the solution space is obtained by executing the quantum circuit of the first quantum algorithm model on a quantum computer, then each solution in the solution space is mapped to a qubit state in the second quantum algorithm model, and the probability of the qubit state corresponding to each solution in the solution space is obtained by executing the quantum circuit of the second quantum algorithm model, and finally, the solution with the highest probability of the corresponding qubit state among the solutions in the solution space is determined as the optimal solution of the TSP model. This makes it possible to subsequently set multiple parameters in the database based on the parameter value combination corresponding to the optimal solution of the TSP model.

[0148] Refer to Figure 6 based on the configuration shown in any one or more of the above embodiments of the present application. Figure 6 shows a flowchart of a parameter setting method provided in yet another exemplary embodiment of the present application. The method is performed by computer equipment. As shown in Figure 6, prior to step 320, the method may further include step 312.

[0149] Step 312 performs a normalization process on the parameter ranges of multiple parameters. The normalization process is performed to unify the parameter ranges of multiple parameters into a specified numerical range.

[0150] Step 320 described above may also be implemented as step 320a.

[0151] In step 320a, a TSP model is constructed based on the parameter ranges of multiple parameters after normalization and the objective function.

[0152] In the embodiment of the present invention, the computer device normalizes multiple parameters so that all parameters are within a single numerical range, and then constructs a TSP model based on the parameter ranges of the normalized parameters and the objective function.

[0153] Here, constructing a TSP model based on the parameter ranges of the multiple parameters after the normalization process described above and the objective function means constructing a TSP model where the combination of parameter values ​​of the multiple parameters after the normalization process is the path, and the objective function is the path length.

[0154] In the embodiments of this application, a configuration is provided in which a normalization process is performed on multiple parameters before constructing a Traveling Salesperson Problem (TSP) model. Furthermore, the computer equipment can construct the TSP model based on the parameter ranges of the multiple parameters after normalization and the objective function. This not only unifies the parameter ranges of the multiple parameters into a specified numerical range, but also facilitates subsequent processing and improves the efficiency of finding the optimal solution for the TSP model.

[0155] Refer to Figure 7 based on the configuration shown in any one or more of the above embodiments of the present application. Figure 7 shows a flowchart of a parameter setting method provided in yet another exemplary embodiment of the present application. The method is performed by computer equipment. As shown in Figure 7, step 350 may be implemented as steps 350a and 350b.

[0156] In step 350a, the reverse of the normalization process is performed on the parameter values ​​within the parameter value combination corresponding to the optimal solution to obtain the parameter values ​​after tuning of multiple parameters.

[0157] In step 350b, multiple parameters of the database are set based on the parameter values ​​after tuning multiple parameters.

[0158] In the embodiment of this application, since normalization processing is performed on multiple parameters in the above step, the reverse normalization processing can be performed on the parameter values ​​within the parameter value combination corresponding to the optimal solution to obtain the parameter values ​​after tuning of the multiple parameters. Next, multiple parameters of the database are set based on the parameter values ​​after tuning of the multiple parameters.

[0159] Here, the inverse of the normalization process refers to obtaining the tuned parameter values ​​by mapping the parameter values ​​within a combination of parameter values ​​to the parameter range before the inverse processing of the corresponding parameter.

[0160] For example, a computer device setting multiple parameters in a database based on the tuned parameter values ​​of multiple parameters includes, but is not limited to, directly setting the tuned parameter values ​​of multiple parameters to multiple parameters in the database.

[0161] In the embodiments of this application, a configuration for the reverse processing of the normalization process described above is provided, which facilitates obtaining parameter values ​​after tuning multiple parameters and further setting multiple parameters in the database, thereby further improving the efficiency of solving parameter optimization problems and optimizing database performance.

[0162] Based on the configurations shown in any one or more of the above embodiments of the present application, in some embodiments, according to the configuration of the embodiment shown in Figure 3, the multiple parameters include parameters corresponding to the database query arrangement.

[0163] In the embodiments of this application, a computer device can perform query operations against a database via an API. To complete the query operations with the least execution time and resource consumption, it is necessary to configure parameters related to the queries within the database. Therefore, the multiple parameters in the embodiments of this application include parameters corresponding to the query placement in the database.

[0164] The embodiments of this application provide one application scenario for the configuration of this application. Specifically, it is applied to a database query scenario, and the relevant parameters are parameters corresponding to the database query configuration, which can further optimize the applicability and operability of the configuration of this application.

[0165] Based on the configuration shown in any one or more of the above embodiments of this application, in some embodiments, multiple parameters are: This includes multiple parameters from among cache parameters, concurrent connection parameters, query optimization parameters, index parameters, log parameters, memory allocation parameters, magnetic disk I / O parameters, and processor utilization parameters.

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

[0167] Cache Size: MySQL's cache size refers to the amount of data that MySQL caches in memory. Increasing the cache size can improve query performance, but it will use more memory resources.

[0168] Common cache parameters here include innodb_buffer_pool_size, key_buffer_size, etc.

[0169] Concurrent Connections: The concurrent connection count for MySQL refers to the number of connections that MySQL processes simultaneously. Increasing the number of concurrent connections can improve concurrency, but it will also consume more system resources.

[0170] Common concurrent connection parameters include max_connections, thread_cache_size, etc.

[0171] Query Optimizer: A MySQL query optimizer refers to the algorithm that MySQL uses to optimize the query execution plan. Different query optimizers can have different effects on query performance.

[0172] Common query optimization parameters include optimizer_switch, join_buffer_size, and so on.

[0173] Indexes: MySQL indexes are data structures designed to speed up queries. Increasing the number of indexes can improve query performance, but it also consumes more storage space and system resources.

[0174] Common index parameters here include innodb_ft_result_cache_limit and innodb_ft_total_cache_size.

[0175] Logs: MySQL logs are information used to record MySQL operations. Increasing the logging level can improve fault detection capabilities, but it will use more storage space and system resources.

[0176] Common log parameters here include log_error, slow_query_log, etc.

[0177] Memory Allocation: In MySQL, memory allocation refers to the size of the memory blocks that MySQL allocates in memory. Increasing the memory allocation size can improve query performance, but it will use more memory resources.

[0178] Common memory allocation parameters here include innodb_log_buffer_size, sort_buffer_size, etc.

[0179] Magnetic Disk Input / Output (IO): In MySQL, magnetic disk IO refers to the read and write speeds of the magnetic disk. Optimizing magnetic disk IO can improve query performance, but factors such as the magnetic disk capacity and read / write speeds must also be considered.

[0180] Common magnetic disk I / O parameters include innodb_io_capacity, innodb_flush_method, etc.

[0181] CPU Utilization: In MySQL, CPU utilization refers to the efficiency with which MySQL uses the CPU. Optimizing CPU utilization can improve query performance, but factors such as the number of CPU cores and CPU load must also be considered.

[0182] Common CPU utilization parameters here include innodb_thread_concurrency and innodb_spin_wait_delay.

[0183] The embodiments of this application provide exemplary configurations of several parameters, introduce parameter types that can be tuned by the configurations shown, clarify application scenarios for the configurations shown, and facilitate the resolution of MySQL parameter tuning problems.

[0184] Refer to Figure 8. Figure 8 shows a flowchart of a configuration for solving a parameter tuning problem based on a classical computer provided in one exemplary embodiment of the present application. As shown in Figure 8, the computer equipment may convert the parameter tuning problem into a TSP problem and use a TSP algorithm to find the optimal parameter setting.

[0185] Specifically, the parameter settings may be mapped to the traveling salesman's route, and the objective function may be mapped to the route length. Then, typically, the shortest path is found using a TSP algorithm (e.g., dynamic programming, genetic algorithm, etc.).

[0186] Refer to Figure 9. Figure 9 shows a flowchart of a configuration for solving a parameter tuning problem based on a quantum computer provided in one exemplary embodiment of the present invention. As shown in Figure 9, first, the parameter tuning problem is transformed into a TSP problem. Both TSP and Hamiltonian cycle problems are NP-complete problems, and there is reduction between NP-complete problems. For this reason, the TSP problem can be reduced to a Hamiltonian cycle problem. That is, solving the Hamiltonian cycle problem also solves the TSP problem (i.e., the parameter optimization problem). Next, a database search problem Grover algorithm is constructed to solve the Hamiltonian cycle problem. Subsequently, modeling and computation can be performed on a quantum computer using the Grover algorithm. This solves the TSP problem. The solution to the TSP problem is used as the solution to the parameter optimization problem to optimize the parameters of the database.

[0187] Refer to Figure 10. To illustrate an implementation of the configuration of the present invention, Figure 10 shows a flowchart of a parameter selection method provided in one exemplary embodiment of the present invention. As shown in Figure 10, this method includes the following steps:

[0188] In S101, database parameters are collected, parameter ranges are determined, and modeling is performed as a parameter tuning problem.

[0189] In S102, the parameter tuning problem is transformed into a quantum computing problem. Specifically, the parameter tuning problem is transformed into a TSP problem, and the TSP problem is then transformed into a quantum computing problem.

[0190] In S103, quantum computation problems are solved using quantum algorithms (for example, Grover's algorithm, quantum simulation algorithms).

[0191] In S104, the optimal parameter selection for the database is determined based on the quantum computation results.

[0192] Subsequently, the computer equipment can apply the optimal parameter selection to the database query layout to improve the efficiency and accuracy of query optimization.

[0193] In summary, this invention utilizes the properties of quantum computing to solve parameter tuning problems more quickly and efficiently, thereby improving the efficiency and accuracy of queries across the entire database. Compared to classical computers, quantum computers can process data at an exponential level, and by utilizing the properties of quantum superposition and quantum parallelism, they can simultaneously process or predict the performance of multiple possible parameter combinations, thereby improving the final query efficiency of the database. Furthermore, quantum computers can optimize query performance through the properties of quantum entanglement and quantum interference, improving the accuracy and efficiency of queries.

[0194] This invention enables faster and more efficient resolution of parameter tuning problems, improving the efficiency and accuracy of query optimization. The system of this invention can be applied to various database query optimization scenarios, including enterprise databases, cloud databases, and big data analytics. Here, the database may be a database corresponding to a server. The server may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing base 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 (CDNs), and big data and artificial intelligence platforms.

[0195] The role of database parameter tuning is to optimize the performance and reliability of the database system to meet different service and user needs. Database system parameters include cache size, thread pool size, log size, and lock granularity. Different parameter configurations have different effects on the performance and reliability of the database system. Therefore, selecting the optimal parameter configuration is crucial for the performance and reliability of the database system.

[0196] This application has strong practical significance in enhancing the competitiveness and technological influence of distributed databases by utilizing the latest quantum computing technology.

[0197] Quantum computing is a new computing technology that utilizes the principles of quantum mechanics to process large amounts of data and complex computational problems in a short amount of time. Quantum computing offers several advantages to database parameter tuning, including the following:

[0198] 1. Faster parameter tuning speed: Quantum computing technology can process large amounts of data and complex computational problems in a short time, allowing the parameter tuning process to be completed more quickly and improving tuning efficiency.

[0199] 2. More accurate parameter tuning results: Quantum computing technology can handle more complex computational problems, allowing for a more accurate analysis of the relationship between database system performance and parameter placement, thereby improving the accuracy of tuning results.

[0200] 3. More comprehensive parameter tuning configurations: Quantum computing technology can process more data and parameter combinations, allowing for the generation of more comprehensive parameter tuning configurations and improving the effectiveness of tuning.

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

[0202] 5. Better Scalability: Quantum computing technology can handle larger datasets and computational problems, better meeting the scalability needs of database systems and improving their sustainable development.

[0203] In short, quantum computing technology can lead to faster, more accurate, more comprehensive, more efficient, and more scalable parameter tuning configurations, improving the performance and reliability of database systems and enhancing the service efficiency and competitiveness of enterprises.

[0204] Figure 11 shows a block diagram of a parameter setting device as shown in one exemplary embodiment of the present application. This device can be used to perform the methods shown in Figures 3, 4, 5, 6, or 9. All or some of the steps performed by the computer equipment are as shown in Figure 11. This device is An acquisition module 1101 that acquires the parameter ranges of multiple parameters of a database and the objective function of the database, wherein the objective function is used to measure the performance indicators of the database, and the acquisition module 1101, A first model building module 1102 constructs a Traveling Salesperson Problem (TSP) model based on the parameter ranges of multiple parameters and an 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, and the first model building module 1102 The second model construction module 1103 constructs a quantum algorithm model based on the TSP model, A solution module 1104 that finds the optimal solution to the TSP model based on a quantum algorithm model, It includes a parameter setting module 1105 that sets multiple parameters for the database based on the combination of parameter values ​​corresponding to the optimal solution of the TSP model.

[0205] In some embodiments, the second model construction module 1103 constructs a first quantum algorithm model and a second quantum algorithm model based on the TSP model, the first quantum algorithm model for querying the solution space of the TSP problem, and the second quantum algorithm model for querying the optimal solution in the solution space, where each solution in the solution space corresponds to one of the combinations of parameter values ​​of multiple parameters.

[0206] In some embodiments, the first quantum algorithm model is a Hamiltonian cycle problem model, where each solution in the solution space corresponds to one Hamiltonian cycle in the Hamiltonian cycle problem model.

[0207] In some embodiments, the second quantum algorithm model is a Grover algorithm model, and each solution in the solution space corresponds to a single qubit state in the Grover algorithm model.

[0208] In some embodiments, the solution-finding module 1104 executes a quantum circuit corresponding to the first quantum algorithm model on a quantum computer, obtains each solution in the solution space, maps each solution in the solution space to one qubit state in the second quantum algorithm model, executes a quantum circuit corresponding to the second quantum algorithm model, obtains the probability of each qubit state corresponding to each solution in the solution space, and determines the solution with the highest probability of the corresponding qubit state among the solutions in the solution space as the optimal solution of the TSP model.

[0209] In some embodiments, the apparatus further includes a processing module that performs a normalization process on the parameter ranges of multiple parameters before the first model building module 1102 builds a Traveling Salesperson Problem (TSP) model based on the parameter ranges of multiple parameters and an objective function, the normalization process being for unifying the parameter ranges of multiple parameters into a specified numerical range.

[0210] The first model construction module 1102 constructs a TSP model based on the parameter ranges of multiple parameters after normalization and the objective function.

[0211] In some embodiments, the parameter setting module 1105 performs the reverse of the normalization process on the parameter values ​​within the parameter value combination corresponding to the optimal solution, obtains the parameter values ​​after tuning multiple parameters, and sets multiple parameters in the database based on the parameter values ​​after tuning multiple parameters.

[0212] In some embodiments, multiple parameters include parameters corresponding to the query arrangement in the database.

[0213] In some embodiments, the multiple parameters include several of the following: cache parameters, concurrent connection parameters, query optimization parameters, index parameters, log parameters, memory allocation parameters, magnetic disk I / O parameters, and processor utilization parameters.

[0214] Figure 12 shows a block diagram of a computer device 1200 as shown in one exemplary embodiment of the present invention. The computer device 1200 includes a central processing unit (CPU) 1201, a system memory 1204 including random access memory (RAM) 1202 and 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 further includes a mass storage device 1206 for storing an operating system 1209, application programs 1210, and other program modules 1211.

[0215] The mass storage device 1206 is connected to the central processing unit 1201 via a mass storage controller (not shown) connected to the system bus 1205. The mass storage device 1206 and its associated computer-readable media provide non-volatile storage to the computer equipment 1200. In other words, the mass storage device 1206 may include computer-readable media (not shown), such as a hard disk or a Compact Disc Read-Only Memory (CD-ROM) drive.

[0216] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, movable and immovable media implemented by any method or technique 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), Electrically-Erasable Programmable Read-Only Memory (EEPROM), flash memory or other solid-state memory, CD-ROM, Digital Versatile Disc (DVD) or other optical storage devices, tape cartridges, magnetic tapes, magnetic disk storage devices or other magnetic storage devices. Of course, those skilled in the art will see that the computer storage media are not limited to these. The system memory 1204 and mass storage device 1206 described above may be collectively referred to as memory.

[0217] According to various embodiments of this disclosure, the computer device 1200 may be connected to and run on a remote computer on a network, such as the Internet. That is, the computer device 1200 may be connected to a network 1208 via a network interface unit 1207 connected to the system bus 1205, or in other words, it may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 1207.

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

[0219] In exemplary embodiments, a chip including programmable logic circuits and / or program instructions is further provided, which, when executed on a computer device, implements the parameter setting method of the above embodiment.

[0220] In exemplary embodiments, a computer program product including computer instructions is further provided. The computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads and executes the computer instructions from the computer-readable storage medium to implement the parameter setting method provided in the embodiments of each of the above methods.

[0221] In exemplary embodiments, a computer-readable storage medium storing a computer program is further provided, which, when loaded and executed by a processor, implements the parameter setting method provided in each embodiment of the above method.

[0222] Refer to Figure 13. Figure 13 shows a schematic diagram of the configuration of a parameter setting system provided in one exemplary embodiment of the present application. As shown in Figure 13, the system may include a database 1310, a classical computer 1320, and a quantum computer 1330.

[0223] Classical computer 1320 obtains the parameter ranges of multiple parameters and the objective function of database 1310. Based on the parameter ranges of multiple parameters and the objective function, it constructs a Traveling Salesperson Problem (TSP) model. Based on the TSP model, it constructs a quantum algorithm model. The objective function is used to measure the performance indicator of database 1310. In the TSP model, the path is a combination of parameter values ​​of multiple parameters, and the path length in the TSP model is the objective function.

[0224] The quantum computer 1330 finds the optimal solution to the TSP model based on a quantum algorithm model.

[0225] The classical computer 1320 sets multiple parameters in the database based on the combination of parameter values ​​corresponding to the optimal solution of the TSP model.

[0226] Here, the classical computer 1320 may be realized as computer 24 in the application scenario shown in Figure 2, and the quantum computer 1330 may be realized as quantum computing device 21, dilution refrigerator 22, and control equipment 23 in the application scenario shown in Figure 2.

[0227] In an exemplary embodiment, a quantum computer is further provided. This quantum computer solves the optimal solution of the TSP model based on a quantum algorithmic model. This allows a classical computer to set multiple parameters of the database based on the parameter value combinations corresponding to the optimal solution of the TSP model. Here, the quantum algorithmic model is a model constructed based on the Traveling Salesperson Problem (TSP) model, where the classical computer obtains the parameter ranges of multiple parameters of the database and the objective function of the database, and constructs a TSP model based on the parameter ranges of multiple parameters and the objective function. Here, the objective function is used to measure the performance metrics of the database, the path in the TSP model is the parameter value combination of multiple parameters, and the path length in the TSP model is the objective function.

Claims

1. A method for setting parameters performed by computer equipment, A step of obtaining the parameter ranges of multiple parameters of a database and the objective function of the database, wherein the objective function is for measuring the performance indicators of the database. A step of constructing a Traveling Salesperson Problem (TSP) model based on the parameter ranges of the plurality of parameters and the objective function, wherein the path in the TSP model is a combination of the parameter values ​​of the plurality of parameters, and the path length in the TSP model is the objective function. The steps include constructing a quantum algorithm model based on the aforementioned TSP model, The steps include: finding the optimal solution for the TSP model based on the quantum algorithm model; The step of setting the plurality of parameters in the database based on the combination of parameter values ​​corresponding to the optimal solution of the TSP model, A parameter setting method characterized by the following:

2. The step of constructing a quantum algorithm model based on the TSP model is: A step of constructing a first quantum algorithm model and a second quantum algorithm model based on a TSP model, wherein the first quantum algorithm model is for querying the solution space of the TSP problem, and the second quantum algorithm model is for querying the optimal solution in the solution space, Each solution in the solution space corresponds to one of the combinations of parameter values ​​of the plurality of parameters. The parameter setting method according to feature 1.

3. The first quantum algorithm model described above is a Hamiltonian cycle problem model, Each solution in the aforementioned solution space corresponds to one Hamiltonian cycle in the Hamiltonian cycle problem model. The parameter setting method according to feature 2.

4. The aforementioned second quantum algorithm model is the Grover algorithm model, Each solution in the aforementioned solution space corresponds to one qubit state in the Grover algorithm model. The parameter setting method according to feature 2.

5. The step of finding the optimal solution to the TSP model based on the quantum algorithm model is: The steps include: executing a quantum circuit corresponding to the first quantum algorithm model on a quantum computer and obtaining each solution in the solution space; The steps include mapping each solution in the solution space to a single qubit state in the second quantum algorithm model, executing a quantum circuit corresponding to the second quantum algorithm model, and obtaining the probability of each qubit state corresponding to each solution in the solution space; The step includes determining, among the solutions in the solution space, the one with the highest probability of corresponding qubit states as the optimal solution of the TSP model, The parameter setting method according to feature 2.

6. Before the step of constructing a Traveling Salesperson Problem (TSP) model based on the parameter ranges of the aforementioned multiple parameters and the objective function, A step of performing a normalization process on the parameter ranges of the plurality of parameters, wherein the normalization process is for unifying the parameter ranges of the plurality of parameters into a specified numerical range, further comprising the step of performing a normalization process on the parameter ranges of the plurality of parameters. The step of constructing a Traveling Salesperson Problem (TSP) model based on the parameter ranges of the aforementioned multiple parameters and the objective function is as follows: The step of constructing the TSP model based on the parameter ranges of the multiple parameters after normalization and the objective function, The parameter setting method according to feature 1.

7. The step of setting the plurality of parameters in the database based on the combination of parameter values ​​corresponding to the optimal solution of the TSP model is: The steps include: performing the reverse process of the normalization process on the parameter values ​​within the parameter value combination corresponding to the optimal solution to obtain the parameter values ​​after tuning the multiple parameters; The step of setting the plurality of parameters of the database based on the parameter values ​​after tuning the plurality of parameters, The parameter setting method according to feature 6.

8. The aforementioned multiple parameters include parameters corresponding to the query arrangement in the database, The parameter setting method according to feature 1.

9. The aforementioned multiple parameters include multiple of the following: cache parameters, concurrent connection parameters, query optimization parameters, index parameters, log parameters, memory allocation parameters, magnetic disk I / O parameters, and processor utilization parameters. The method according to feature 1.

10. A parameter setting device, An acquisition module that acquires the parameter ranges of multiple parameters of a database and the objective function of the database, wherein the objective function is for measuring the performance indicators of the database, and A first model building module for constructing a Traveling Salesperson Problem (TSP) model based on the parameter ranges of the plurality of parameters and the objective function, wherein the path in the TSP model is a combination of the parameter values ​​of the plurality of parameters, and the path length in the TSP model is the objective function, A second model construction module constructs a quantum algorithm model based on the aforementioned TSP model, A solution module that finds the optimal solution of the TSP model based on the aforementioned quantum algorithm model, A parameter setting module that sets the plurality of parameters in the database based on the combination of parameter values ​​corresponding to the optimal solution of the TSP model, is included. A parameter setting device characterized by the following features.

11. A computer device comprising a processor and memory, wherein at least one computer instruction is stored in the memory, and the at least one computer instruction, when loaded and executed by the processor, realizes the parameter setting method described in any one of claims 1 to 9.

12. A computer program characterized by causing a computer to execute the parameter setting method described in any one of claims 1 to 9.

13. A parameter setting system, Including databases, classical computers, and quantum computers, The classical computer obtains the parameter ranges of multiple parameters in the database and the objective function of the database, constructs a Traveling Salesperson Problem (TSP) model based on the parameter ranges of the multiple parameters and the objective function, constructs a quantum algorithm model based on the TSP model, the objective function is for measuring the performance indicators of the database, 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. The quantum computer, based on the quantum algorithm model, finds the optimal solution to the TSP model. The classical computer sets the plurality of parameters in the database based on the combination of parameter values ​​corresponding to the optimal solution of the TSP model. A parameter setting system characterized by the following: