Database tuning method and apparatus based on quantum computing, medium, and device

By mapping database parameters to qubit superposition states and using a quantum policy network for iterative optimization, the problem of dependence on high-quality samples in existing technologies is solved, achieving efficient database parameter tuning and improving database performance.

CN120804062BActive Publication Date: 2026-01-23CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511247814.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-03
Publication Date
2026-01-23
Estimated Expiration
2045-09-03

AI Technical Summary

Technical Problem

Existing database parameter tuning methods rely on high-quality samples, which are time-consuming, labor-intensive, and inefficient, making it difficult to achieve high-performance optimization.

Method used

Database parameters are mapped to superposition states of qubits, and iterative optimization is performed using a quantum policy network. The parameters of the quantum policy network are trained by combining real-time database state information to achieve adaptive tuning.

Benefits of technology

By breaking the reliance on high-quality samples, the efficiency of parameter optimization is significantly improved, achieving excellent performance tuning results for the database.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804062B_ABST
    Figure CN120804062B_ABST
Patent Text Reader

Abstract

The application discloses a database tuning method and device based on quantum computing, a medium and equipment, the method comprises: obtaining the value range of multiple database parameters, and setting a tuning target; based on the value range, mapping the database parameters into the initial superposition state of the quantum bit, and inputting the initial superposition state into the quantum strategy network; based on the tuning target, and combining the database state information measured in real time in the training process, training and optimizing the built-in parameters in the quantum strategy network; after the training is completed, measuring and decoding the output quantum state of the quantum strategy network to obtain the optimized database parameter configuration. The application can achieve excellent performance optimization effect without relying on high-quality samples, and greatly improves the efficiency of parameter optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of quantum computing and database management technology, and in particular to a database optimization method, apparatus, computer-readable storage medium, electronic device and computer program product based on quantum computing. Background Technology

[0002] Database parameter tuning is a key technical step in improving database system performance and achieving optimal resource allocation. Currently, database parameter tuning methods include manual configuration methods based on expert experience and parameter optimization methods based on traditional models.

[0003] Manual configuration methods based on expert experience heavily rely on experts' accumulated knowledge and practical experience. Performance optimization goals are achieved through manual judgment and repeated adjustments, a process that is time-consuming, labor-intensive, and inefficient. To address this, a parameter optimization method based on traditional models was proposed. This method trains traditional models using historical experience to automatically guide parameter adjustments. However, the model's performance is highly dependent on the scale and quality of the training samples, typically requiring a large number of high-quality labeled samples covering diverse scenarios. Summary of the Invention

[0004] The purpose of this invention is to provide a database optimization method, apparatus, computer-readable storage medium, electronic device, and computer program product based on quantum computing. By mapping database parameters to the superposition state of qubits and using a quantum policy network for iterative optimization, excellent performance optimization can be achieved without relying on high-quality samples, while significantly improving the efficiency of parameter optimization.

[0005] A first aspect of this invention provides a database optimization method based on quantum computing, comprising:

[0006] Obtain the value range of multiple database parameters and set the optimization target;

[0007] Based on the value range, the database parameters are mapped to the initial superposition state of the qubits, and the initial superposition state is input into the quantum policy network;

[0008] Based on the optimization objective and combined with the database state information measured in real time during training, the built-in parameters in the quantum policy network are trained and optimized.

[0009] After training, the output quantum states of the quantum policy network are measured and decoded to obtain the optimized database parameter configuration.

[0010] Optionally, mapping the database parameters to the initial superposition state of the qubit based on the value range includes:

[0011] Based on the discrete granularity of each database parameter, the corresponding value range is discretized into one or more value points;

[0012] Based on the number of value points, a set of qubits is allocated to the corresponding database parameters;

[0013] Apply a Hadamard gate operation to each of the qubits to obtain the initial superposition state corresponding to all the database parameters.

[0014] Optionally, the step of training and optimizing the built-in parameters in the quantum policy network based on the optimization objective and in conjunction with the database state information measured in real time during training includes:

[0015] The initial superposition state is quantum-evolved through the quantum policy network to obtain the corresponding probability distribution, and the probability distribution is decoded to obtain the candidate parameter configuration.

[0016] The candidate parameter configuration is applied to the target database system to drive the update of database status information;

[0017] The updated database status information is obtained, and combined with the optimization objective, the gradient update information of the built-in parameters is calculated. The built-in parameters are then optimized and adjusted based on the gradient update information.

[0018] Optionally, the plurality of database parameters includes at least one of the following: cache allocation parameters, disk input / output parameters, concurrency control parameters, number of open files, query optimizer parameters, and index selection parameters.

[0019] Optionally, the tuning objective consists of at least one or more of minimizing resource usage, maximizing queries per second, and maximizing transactions per second.

[0020] Optionally, the quantum strategy network includes: a variable quantum circuit layer and an additional circuit layer; wherein all the qubits have a ring logic relationship that is connected end to end in the variable quantum circuit layer and the additional circuit layer.

[0021] Optionally, the variable quantum circuit layer includes a first logic gate combination on the line where each of the qubits is located; wherein each first logic gate combination includes: a first control NOT gate, a first rotation gate around the Z-axis, a second control NOT gate, and a rotation gate around the X-axis;

[0022] The first connection sequence of each line is: the target end of the first control NOT gate, the first rotating gate around the Z-axis, the target end of the second control NOT gate, and the rotating gate around the X-axis.

[0023] The control terminals of the first and second control NOT gates are both coupled to the circuit of the previous qubit to form corresponding ring entanglement topologies.

[0024] The rotating gate around the X-axis is located at the end of the variable quantum circuit layer and is used to couple to the input of the additional circuit layer.

[0025] Optionally, the additional circuit layer includes a second logic gate combination on the line where each of the qubits is located; wherein each second logic gate combination includes: a rotation gate about the Y-axis, a second rotation gate about the Z-axis, and a third control NOT gate;

[0026] The second connection sequence of each line is a rotating gate around the Y-axis, a second rotating gate around the Z-axis, and the target end of a third control NOT gate;

[0027] The control terminal of the third control NOT gate is coupled to the circuit of the previous qubit to form the corresponding ring entanglement topology.

[0028] A second aspect of the present invention provides a database optimization device based on quantum computing, comprising:

[0029] The data acquisition module is used to obtain the value range of multiple database parameters and set optimization targets;

[0030] A quantum input module is used to map the database parameters to an initial superposition state of qubits based on the value range, and input the initial superposition state to the quantum policy network;

[0031] The quantum training module is used to train and optimize the built-in parameters in the quantum policy network based on the optimization target and combined with the database state information measured in real time during the training process.

[0032] The result output module is used to measure and decode the output quantum state of the quantum policy network after training to obtain the optimized database parameter configuration.

[0033] A third aspect of the present invention provides a computer-readable storage medium comprising a stored computer program; wherein, when the computer program is executed, it controls the device in which the computer-readable storage medium is located to perform the quantum computing-based database tuning method described in any embodiment of the first aspect.

[0034] A fourth aspect of the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the quantum computing-based database optimization method described in any embodiment of the first aspect.

[0035] A fifth aspect of the present invention provides an electronic device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the quantum computing-based database tuning method described in any embodiment of the first aspect.

[0036] Compared with existing technologies, embodiments of the present invention provide a database optimization method, apparatus, computer-readable storage medium, electronic device, and computer program product based on quantum computing, which has the following beneficial effects: By mapping database parameters to quantum states, the embodiments of the present invention transform the database parameter optimization problem into a quantum state optimization problem. This not only overcomes the dependence of traditional methods on a large number of high-quality samples, but also utilizes the unique parallel processing and quantum state superposition capabilities of quantum computing to significantly improve the search efficiency and optimization effect of database parameters. Furthermore, the embodiments of the present invention continuously adjust the quantum circuit parameters based on real-time collected database state information, enabling adaptive optimization of the database parameter configuration. Attached Figure Description

[0037] Figure 1 This is a flowchart illustrating an embodiment of the quantum computing-based database optimization method provided by the present invention.

[0038] Figure 2 This is a schematic diagram of the structure of an embodiment of the quantum strategy network provided by the present invention;

[0039] Figure 3 This is a schematic diagram of an embodiment of the quantum computing-based database optimization device provided by the present invention;

[0040] Figure 4 This is a schematic diagram of the structure of an embodiment of the electronic device provided by the present invention. Detailed Implementation

[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0042] See Figure 1 This is a flowchart illustrating an embodiment of the quantum computing-based database optimization method provided by the present invention.

[0043] A first aspect of the present invention provides a database optimization method based on quantum computing, comprising steps S1 to S4, as detailed below:

[0044] Step S1: Obtain the value range of multiple database parameters and set the optimization target;

[0045] Step S2: Based on the value range, map the database parameters to the initial superposition state of the qubit, and input the initial superposition state into the quantum policy network;

[0046] Step S3: Based on the optimization objective and combined with the database state information measured in real time during training, train and optimize the built-in parameters in the quantum policy network;

[0047] Step S4: After training, the output quantum state of the quantum policy network is measured and decoded to obtain the optimized database parameters.

[0048] Specifically, in step S1, this embodiment of the invention obtains multiple database parameters to be optimized and their value ranges, and sets clear optimization goals according to actual application needs, such as maximizing throughput, minimizing resource usage, maximizing queries per second, and maximizing transactions per second, to provide optimization directions for the subsequent training of the quantum policy network; among them, multiple database parameters include at least one of the following: cache allocation parameters, disk input / output parameters, concurrency control parameters, number of open files, query optimizer parameters, and index selection parameters, which can be flexibly set according to specific optimization goals.

[0049] In step S2, based on the value range of each database parameter, each database parameter is mapped to one or more qubits, and its initial superposition state is constructed. These initial superposition states can represent all possible parameter combinations in quantum space, thereby fully utilizing quantum parallelism to enhance search efficiency. The constructed initial superposition states are input into a preset quantum policy network as the starting point for parameter optimization search.

[0050] In step S3, guided by a preset optimization goal, database status information (such as load, query response time, CPU resource usage, and memory resource usage) is measured in real time during training. Based on the feedback database status information, the built-in parameters in the quantum policy network (such as the rotation angle of quantum gates) are dynamically adjusted. During training, a strategy based on gradient descent or the Quantum Approximate Optimization Algorithm (QAOA) is employed. By continuously adjusting the built-in parameters in the quantum policy network, the quantum states of the database parameter combinations converge towards the optimization goal. The training process in this embodiment of the invention is a closed loop of continuous interaction with the database environment, namely, "training-practice-feedback-retraining".

[0051] In step S4, after the quantum policy network is trained, a quantum measurement operation is performed on its output quantum state to obtain a binary sequence of 0s and 1s. This binary sequence is then decoded to restore the specific database parameter configuration. These optimized database parameter configurations can be directly applied to the database system to achieve the expected performance tuning goals.

[0052] This invention transforms the database parameter tuning problem into a quantum state optimization problem, which not only breaks through the dependence of traditional methods on a large number of high-quality samples, but also utilizes the unique parallel processing and quantum state superposition capabilities of quantum computing to significantly improve the search efficiency and tuning effect of database parameters.

[0053] In an optional embodiment, step S2 above, which maps the database parameters to the initial superposition state of the qubit based on the value range, includes:

[0054] Based on the discrete granularity of each database parameter, the corresponding value range is discretized into one or more value points;

[0055] Based on the number of value points, a set of qubits is allocated to the corresponding database parameters;

[0056] Apply a Hadamard gate operation to each of the qubits to obtain the initial superposition state corresponding to all the database parameters.

[0057] It should be noted that, in this embodiment of the invention, the discrete granularity (i.e., tuning granularity) of each database parameter can be determined according to the actual business requirements or performance sensitivity of each parameter. Based on the discrete granularity, the value range of the database parameter is discretized into one or more specific value points. This discretization process ensures coverage of the parameter space and provides a foundation for subsequent quantum state preparation.

[0058] Furthermore, based on the number of value points after discretization of each database parameter, an appropriate number of qubits are allocated to ensure comprehensive coverage of the parameter space. For example, if a database parameter is discretized into N value points, then an appropriate number of qubits needs to be allocated. N qubits are used to encode all possible values ​​of the database parameters; where N≥1.

[0059] Applying Hadamard (H) gate operations to each qubit assigned to all database parameters yields an initial superposition state for all database parameters. The H gate is a quantum logic gate used to convert a single ground-state qubit into an equally probable superposition state. Each qubit, after passing through an H gate, is in a superposition state. and The initial superposition states are such that all initial superposition states can cover the search space of all parameter combinations, providing a starting point for subsequent global parallel search and optimization based on quantum policy networks.

[0060] In an optional embodiment, step S3 above, which involves training and optimizing the built-in parameters in the quantum policy network based on the optimization objective and in conjunction with the database state information measured in real time during training, includes:

[0061] The initial superposition state is quantum-evolved through the quantum policy network to obtain the corresponding probability distribution, and the probability distribution is decoded to obtain the candidate parameter configuration.

[0062] The candidate parameter configuration is applied to the target database system to drive the update of database status information;

[0063] The updated database status information is obtained, and combined with the optimization objective, the gradient update information of the built-in parameters is calculated. The built-in parameters are then optimized and adjusted based on the gradient update information.

[0064] It should be noted that, in this embodiment of the invention, the initial superposition state of the input is first subjected to quantum evolution operation through a quantum policy network. The quantum evolution process is implemented by parameterized quantum circuits, each of which includes a series of quantum gates with tunable built-in parameters. After quantum evolution, a new quantum superposition state is formed, and its measurement yields a probability distribution representing different parameter configurations. Decoding this probability distribution yields a set of specific candidate parameter configurations, which represent the current quantum policy network's exploration of multiple database parameters towards the optimization target.

[0065] Next, the decoded candidate parameter configurations are applied to the target database system to drive updates to the database's running status, i.e., to interact with the database environment. After the candidate parameter configurations are applied, the database's built-in monitoring tools (such as MySQL's Performance Schema, OpenGauss's performance views, etc.) or third-party monitoring tools (such as Percona Monitoring and Management, Zabbix, Sysbench, etc.) are used to measure and collect updated database status information in real time, such as load, query response time (query speed), CPU resource usage, memory resource usage, and disk I / O. These collectively reflect the database performance under the current candidate parameter configurations.

[0066] Furthermore, based on the pre-set optimization objectives, the collected database state information is quantitatively evaluated, and the corresponding reward signal is calculated. Based on this reward signal, gradient estimation is used to calculate the gradient update information of each built-in parameter in the quantum policy network, indicating the direction and magnitude of parameter adjustment. Finally, based on the calculated gradient update information, a classical optimizer is used to adjust and optimize the built-in parameters of the quantum policy network.

[0067] Through multiple iterations and repeated processes, the quantum policy network can adaptively learn better database parameter setting strategies, thereby gradually converging to the optimal or near-optimal solution. In other words, this embodiment of the invention achieves efficient interaction and collaborative optimization between the quantum policy network and the real database environment through the above closed-loop process of "training-practice-feedback-retraining," enabling the quantum policy network to adaptively learn and approximate the optimal or near-optimal database parameter configuration.

[0068] In an optional embodiment, the multiple database parameters in step S1 above include at least one of the following: cache allocation parameters, disk input / output parameters, concurrency control parameters, number of open files, query optimizer parameters, and index selection parameters.

[0069] It should be noted that the cache allocation parameters include: cache pool size (innodb_buffer_pool_size), size of memory blocks in the buffer pool (innodb_buffer_pool_chunk_size), number of memory block instances in the buffer pool (innodb_buffer_pool_instances), number of cached tables (table_open_cache), and maximum number of cached prepared statements (max_prepared_stmt_count).

[0070] Concurrency control parameters include: maximum number of connections (max_connections) and parallelism.

[0071] The open-files-limit setting controls the number of files that a database process can open simultaneously.

[0072] Query optimizer parameters (i.e., query optimizer strategies) and index selection parameters (i.e., index selection strategies) affect retrieval efficiency.

[0073] In an optional embodiment, the tuning objective in step S1 above consists of at least one or more of minimizing resource usage, maximizing queries per second, and maximizing transactions per second.

[0074] It should be noted that the optimization objective can be selected by combining one or more objectives based on the specific business scenario, performance bottlenecks, and resource constraints. If a combination of multiple objectives is selected as the optimization objective, a weighted summation or priority ranking method can be used to transform the multiple objectives into a single objective function. For example, if the optimization objective is to "maximize the number of queries per second (QPS) and maximize the number of transactions per second (TPS)," then the constructed objective function can be F(x) = max(TPS) + max(QPS).

[0075] See Figure 2 This is a schematic diagram of the structure of an embodiment of the quantum strategy network provided by the present invention.

[0076] In an optional embodiment, the quantum strategy network includes: a variable quantum circuit layer and an additional circuit layer; wherein all the qubits are connected in a ring logic relationship in the variable quantum circuit layer and the additional circuit layer.

[0077] Furthermore, the variable quantum circuit layer includes a first logic gate combination on the line where each of the qubits is located; wherein each first logic gate combination includes: a first control NOT gate, a first rotation gate around the Z-axis, a second control NOT gate, and a rotation gate around the X-axis;

[0078] The first connection sequence of each line is: the target end of the first control NOT gate, the first rotating gate around the Z-axis, the target end of the second control NOT gate, and the rotating gate around the X-axis.

[0079] The control terminals of the first and second control NOT gates are both coupled to the circuit of the previous qubit to form corresponding ring entanglement topologies.

[0080] The rotating gate around the X-axis is located at the end of the variable quantum circuit layer and is used to couple to the input of the additional circuit layer.

[0081] For example, such as Figure 2 As shown, the quantum policy network provided in this embodiment of the invention includes a Variational Quantum Circuit (VQC) layer and an additional circuit layer. Specifically, the quantum state initialization operation in this embodiment involves initializing all qubits using H-gates to generate a superposition of database parameters. The VQC circuit layer can apply a phase shift of the loss function to each set of "database state information—candidate parameter configurations," simulating the optimization objective of database tuning. The additional circuit layer uses a series of rotating gates and control-NOT gates (CNOT gates) to adjust the superposition of quantum states, increasing the probability of high-reward parameter configurations.

[0082] exist Figure 2 In the diagram, the symbol "H" represents the H gate, located on the far left of each qubit circuit, which transforms the qubit from its ground state to a superposition state. The CNOT gate consists of a vertical line connecting the plus sign "+" (target end) and the solid dot "•" above it (control end), used to achieve entanglement between two qubits. The symbol "RZ" represents the rotation gate around the Z-axis; the symbol "RX" represents the rotation gate around the X-axis; and the symbol "RY" represents the rotation gate around the Y-axis. "P0", "P3", "P6", and "P8" are the adjustable parameters of the rotation gates. The symbol with the instrument is the measurement gate, located on the far right of each qubit circuit, which measures the output quantum state after the quantum computation is completed, obtaining a binary sequence of 0s and 1s.

[0083] exist Figure 2 In this circuit, all qubits (Q0~Q11) form a ring-shaped logical relationship. The VQC circuit layer includes the first logic gate combination on the line where each qubit is located, and the first connection order of each line is: CNOT(+) → RZ → CNOT(+) → RX. The control terminals of all control NOT gates in the VQC circuit layer are coupled to the line of the previous qubit, so that the entire circuit forms a ring-shaped entangled topology among all qubits.

[0084] The rotating gate around the X-axis (RX) is located at the end of the VQC circuit layer, and its output is directly coupled to the input of the additional circuit layer to realize quantum state transfer between the two layers.

[0085] In conjunction with the above embodiments, the additional circuit layer includes a second logic gate combination on the line where each of the qubits is located; wherein each second logic gate combination includes: a rotation gate around the Y-axis, a second rotation gate around the Z-axis, and a third control NOT gate;

[0086] The second connection sequence of each line is a rotating gate around the Y-axis, a second rotating gate around the Z-axis, and the target end of a third control NOT gate;

[0087] The control terminal of the third control NOT gate is coupled to the circuit of the previous qubit to form the corresponding ring entanglement topology.

[0088] In this embodiment of the invention, the additional circuit layer includes a combination of second logic gates on the lines where each of the qubits is located, and the second connection order of each line is: RY → RZ → CNOT (+). A third control NOT gate is coupled to the line of the previous qubit, so that the additional circuit layer also maintains a ring entangled topology. After the additional circuit layer is completed, all output quantum states of the quantum policy network are measured. Figure 2 The red measurement gate in the quantum network converts quantum information into a binary sequence of 0s and 1s, which serves as the output of the current quantum policy network.

[0089] This invention implements quantum embedding and evolution of the database parameter space through the aforementioned VQC circuit layer and additional circuit layer. All rotation gate parameters constitute a trainable built-in parameter set, which is iteratively optimized according to the defined tuning objective and real-time database state feedback through quantum gradient estimation methods (such as parameter shift rules), and finally outputs an output quantum state that can be decoded into a high-performance database parameter configuration.

[0090] The following specific embodiment will further illustrate the quantum computing-based database optimization method provided by the present invention.

[0091] In this embodiment of the invention, the performance of the database's sysbench will be optimized using the following database parameters: number of open files (open-files-limit), maximum number of connections (max_connections), maximum number of cached prepared statements (max_prepared_stmt_count), cache pool size (innodb_buffer_pool_size), size of memory blocks in the buffer pool (innodb_buffer_pool_chunk_size), number of memory block instances in the buffer pool (innodb_buffer_pool_instances), and number of cached tables (table_open_cache). Of course, other parameters can be added as needed.

[0092] The goal of this tuning is to optimize the database's sysbench performance. Therefore, the objective function is to maximize the performance of TPS and QPS, i.e., F(x) = max(TPS) + max(QPS).

[0093] For each database parameter to be optimized, one or more qubits are used for encoding. Specifically, the range of parameter values ​​is discretized and then mapped to the values ​​of the qubits using binary digital encoding.

[0094] Taking the cache pool size as an example: if its value ranges from 0 to 16GB and is discretized in 256MB intervals, it can be converted into an integer range [0, 64], where the maximum integer value is 64. Since 2^6 = 64, 6 qubits are needed to encode all possible values ​​of this parameter.

[0095] Similarly, if the maximum number of connections ranges from 0 to 8000, and is discretized in 500 increments, the corresponding integer range is [0, 16], with a maximum value of 16. Since 2^4 = 16, 4 qubits are needed for encoding.

[0096] After each evolution round, the output quantum state of the current quantum policy network is measured, yielding a binary sequence of 0s and 1s. This sequence is then decoded into specific parameter configurations and applied to the target database system. To evaluate the configuration's effectiveness, the sysbench tool is used to perform database performance tests, obtain current database state information, and feed it back to... Figure 2 The quantum policy network is further passed to the parameter optimizer of the quantum circuit. The classical optimizer (such as gradient descent-based algorithms) calculates the gradient based on the obtained database state information and the set tuning objective, and updates the adjustable parameters in the quantum circuit (such as the rotation angle in QAOA) accordingly. Through multiple rounds of evolution, the quantum circuit parameters (built-in parameters) will gradually converge, and finally output the database parameter configuration policy with optimal performance.

[0097] Taking a measurement result as an example, the resulting binary sequence is [0 1 0 1 0 0 0 1 0 1 ...]. According to the predefined quantum state preparation rules, the first 6 bits (010100) in this sequence correspond to the buffer pool size parameter, with a decimal value of 20. If the buffer pool size is discretized in 256MB intervals, the current value corresponds to 20 × 256MB = 5.12GB (rounded to 5GB). The next 4 bits (0101) represent the maximum number of connections, with a decimal value of 5. If the maximum number of connections is discretized in 500 intervals, the actual value is 5 × 500 = 2500. After applying the above decoded parameter configuration to the target database system, performance testing is performed using tools such as sysbench. Based on the test results, classical optimization algorithms (such as gradient descent) are used to iteratively update the built-in parameters of the quantum circuit until the performance of the target database system converges to the optimal state, thereby determining the final database parameter configuration strategy.

[0098] See Figure 3 This is a schematic diagram of an embodiment of the quantum computing-based database optimization device provided by the present invention.

[0099] A second aspect of the present invention provides a database optimization device based on quantum computing, comprising:

[0100] The data acquisition module 11 is used to acquire the value range of multiple database parameters and set the optimization target;

[0101] The quantum input module 12 is used to map the database parameters to the initial superposition state of the qubits based on the value range, and input the initial superposition state to the quantum policy network;

[0102] The quantum training module 13 is used to train and optimize the built-in parameters in the quantum policy network based on the optimization target and combined with the database state information measured in real time during the training process.

[0103] The result output module 14 is used to measure and decode the output quantum state of the quantum policy network after training to obtain the optimized database parameter configuration.

[0104] It should be noted that the quantum computing-based database optimization device provided in the second aspect embodiment of the present invention can realize all the processes of the quantum computing-based database optimization method described in any of the first aspect embodiments. The functions and technical effects of each module and unit in the device are the same as the functions and technical effects of the quantum computing-based database optimization method described in any of the first aspect embodiments, and will not be repeated here.

[0105] A third aspect of the present invention provides a computer-readable storage medium comprising a stored computer program; wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the quantum computing-based database optimization method described in any of the first aspects above.

[0106] A fourth aspect of the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the quantum computing-based database optimization method described in any of the first aspects of the present invention.

[0107] See Figure 4 This is a schematic diagram of an embodiment of the electronic device provided by the present invention.

[0108] A fifth aspect of the present invention provides an electronic device including a processor 21, a memory 22, and a computer program stored in the memory 22 and configured to be executed by the processor 21, wherein the processor, when executing the computer program, implements the quantum computing-based database tuning method described in any of the first aspects of the present invention.

[0109] Preferably, the computer program can be divided into one or more modules / units (such as computer program one, computer program two, ...), and the one or more modules / units are stored in the memory 22 and executed by the processor 21 to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device.

[0110] The processor 21 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or the processor 21 can be any conventional processor. The processor 21 is the control center of the electronic device, connecting various parts of the electronic device through various interfaces and lines.

[0111] The memory 22 mainly includes a program storage area and a data storage area. The program storage area can store the operating system, applications required for at least one function, etc., and the data storage area can store related data, etc. In addition, the memory 22 can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, and a flash card, etc., or the memory 22 can also be other volatile solid-state storage devices.

[0112] It should be noted that the aforementioned electronic devices may include, but are not limited to, processors and memory, as will be understood by those skilled in the art. Figure 4 The structural block diagram shown is merely a structural example of the above-described electronic device and does not constitute a limitation on the structure of the above-described electronic device. The above-described electronic device may include more or fewer components than shown, or combine certain components, or different components.

[0113] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A database optimization method based on quantum computing, characterized in that, include: Obtain the value range of multiple database parameters and set the optimization target; Based on the value range, the database parameters are mapped to the initial superposition state of the qubits, and the initial superposition state is input into the quantum policy network; Based on the optimization objective and combined with the database state information measured in real time during training, the built-in parameters in the quantum policy network are trained and optimized. After training, the output quantum state of the quantum policy network is measured and decoded to obtain the optimized database parameter configuration; The step of training and optimizing the built-in parameters in the quantum policy network based on the optimization objective and combined with the database state information measured in real time during training includes: The initial superposition state is quantum-evolved through the quantum policy network to obtain the corresponding probability distribution, and the probability distribution is decoded to obtain the candidate parameter configuration. The candidate parameter configuration is applied to the target database system to drive the update of database status information; The updated database status information is obtained, and combined with the optimization objective, the gradient update information of the built-in parameters is calculated. The built-in parameters are then optimized and adjusted based on the gradient update information.

2. The database optimization method based on quantum computing as described in claim 1, characterized in that, The step of mapping the database parameters to the initial superposition state of the qubit based on the value range includes: Based on the discrete granularity of each database parameter, the corresponding value range is discretized into one or more value points; Based on the number of value points, a set of qubits is allocated to the corresponding database parameters; Apply a Hadamard gate operation to each of the qubits to obtain the initial superposition state corresponding to all the database parameters.

3. The database optimization method based on quantum computing as described in claim 1, characterized in that, The database parameters include at least one of the following: cache allocation parameters, disk input / output parameters, concurrency control parameters, number of open files, query optimizer parameters, and index selection parameters.

4. The database optimization method based on quantum computing as described in claim 1, characterized in that, The tuning objective consists of at least one or more of the following: minimizing resource usage, maximizing queries per second, and maximizing transactions per second.

5. The database optimization method based on quantum computing as described in claim 1, characterized in that, The quantum strategy network includes a variable quantum circuit layer and an additional circuit layer; wherein all the qubits are connected in a ring logic relationship in the variable quantum circuit layer and the additional circuit layer.

6. The database optimization method based on quantum computing as described in claim 5, characterized in that, The variable quantum circuit layer includes a first logic gate combination on the line where each quantum bit is located; wherein each first logic gate combination includes: a first control NOT gate, a first rotation gate around the Z-axis, a second control NOT gate, and a rotation gate around the X-axis; The first connection sequence of each line is: the target end of the first control NOT gate, the first rotating gate around the Z-axis, the target end of the second control NOT gate, and the rotating gate around the X-axis. The control terminals of the first and second control NOT gates are both coupled to the circuit of the previous qubit to form corresponding ring entanglement topologies. The rotating gate around the X-axis is located at the end of the variable quantum circuit layer and is used to couple to the input of the additional circuit layer.

7. The database optimization method based on quantum computing as described in claim 5, characterized in that, The additional circuit layer includes a second logic gate combination on the line where each of the qubits is located; wherein each second logic gate combination includes: a rotation gate about the Y-axis, a second rotation gate about the Z-axis, and a third control NOT gate; The second connection sequence of each line is a rotating gate around the Y-axis, a second rotating gate around the Z-axis, and the target end of a third control NOT gate; The control terminal of the third control NOT gate is coupled to the circuit of the previous qubit to form the corresponding ring entanglement topology.

8. A database optimization device based on quantum computing, characterized in that, The apparatus, applicable to the quantum computing-based database optimization method as described in any one of claims 1 to 7, comprises: The data acquisition module is used to obtain the value range of multiple database parameters and set optimization targets; A quantum input module is used to map the database parameters to an initial superposition state of qubits based on the value range, and input the initial superposition state to the quantum policy network; The quantum training module is used to train and optimize the built-in parameters in the quantum policy network based on the optimization target and combined with the database state information measured in real time during the training process. The result output module is used to measure and decode the output quantum state of the quantum policy network after training to obtain the optimized database parameter configuration.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program; wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the quantum computing-based database tuning method as described in any one of claims 1 to 7.

10. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the quantum computing-based database optimization method as described in any one of claims 1 to 7.

11. An electronic device, characterized in that, The system includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the quantum computing-based database tuning method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

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

    WO2025098136A1