Database tuning method and device based on quantum computing, medium and equipment
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, and efficient adaptive tuning of database parameters is achieved.
Patent Information
- Application Number
- CN202511247814.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-03
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-03
AI Technical Summary
Existing database parameter tuning methods rely on high-quality samples, which are inefficient, time-consuming, and labor-intensive, making it difficult to achieve efficient performance optimization.
The database parameters are mapped to the superposition state of qubits, and iterative optimization is performed using a quantum policy network. The network is trained by combining real-time database state information, and the parameters of the quantum policy network are adaptively adjusted to achieve adaptive tuning of the database parameters.
It breaks through the dependence on high-quality samples, significantly improves the efficiency and effectiveness of database parameter optimization, and achieves adaptive performance optimization.
Smart Images

Figure CN120804062A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of quantum computing and database management, and particularly relates to a database optimization method and device based on quantum computing, a computer readable storage medium, an electronic device and a computer program product. BACKGROUND
[0002] Database parameter optimization is a key technical link in improving the performance of a database system and realizing optimal allocation of resources. At present, database parameter optimization methods include an artificial configuration method based on expert experience and a parameter optimization method based on a traditional model.
[0003] The artificial configuration method based on expert experience highly depends on the knowledge accumulation and practical experience of experts, and achieves a performance optimization target through artificial research and repeated debugging. This process is time-consuming, labor-intensive and inefficient. Therefore, the parameter optimization method based on a traditional model is further proposed, which trains a traditional model with historical experience to automatically guide parameter adjustment. However, the performance of the model highly depends on the size and quality of training samples, and usually needs a large number of high-quality labeled samples covering various scenarios as support. SUMMARY
[0004] The purpose of the embodiments of the present application is to provide a database optimization method and device based on quantum computing, a computer readable storage medium, an electronic device and a computer program product. By mapping database parameters to superposed states of quantum bits and using a quantum policy network for iterative optimization, excellent performance optimization effects can be achieved without relying on high-quality samples, and the efficiency of parameter optimization is greatly improved.
[0005] The first aspect of the present application provides a database optimization method based on quantum computing, comprising: obtaining the value range of multiple database parameters and setting an optimization target; mapping the database parameters to initial superposed states of quantum bits based on the value range, and inputting the initial superposed states to a quantum policy network; training and optimizing the built-in parameters in the quantum policy network based on the optimization target and in combination with the database state information measured in real time during the training process; after the training is completed, measuring and decoding the output quantum state of the quantum policy network to obtain the optimized database parameter configuration.
[0006] Optionally, the mapping of the database parameters to the initial superposed states of quantum bits based on the value range comprises: discretizing the corresponding value range into one or more value points according to the discrete granularity of each database parameter; a set of qubits is assigned to the corresponding database parameter based on the number of value points; A Hadamard gate operation is applied to all qubits respectively to obtain an initial superposition state corresponding to all the database parameters.
[0007] Optionally, the built-in parameters in the quantum policy network are trained and optimized based on the tuning target and in combination with the real-time measured database state information during the training process, including: The initial superposition state is subjected to quantum evolution through the quantum policy network to obtain a corresponding probability distribution, and the candidate parameter configuration is obtained by decoding the probability distribution; The candidate parameter configuration is applied to the target database system to drive the update of the database state information; The updated database state information is obtained, the gradient update information of the built-in parameters is calculated in combination with the tuning target, and the built-in parameters are optimized and adjusted based on the gradient update information.
[0008] Optionally, the plurality of database parameters include at least one of cache allocation parameters, disk input / output parameters, concurrency control parameters, the number of open files, query optimizer parameters, and index selection parameters.
[0009] Optionally, the tuning target is composed of one or more of minimizing resource usage, maximizing queries per second, and maximizing transactions per second.
[0010] Optionally, the quantum policy network includes a variational quantum circuit layer and an additional circuit layer; wherein all the qubits have a ring-shaped logical relationship between the variational quantum circuit layer and the additional circuit layer.
[0011] Optionally, the variational quantum circuit layer includes a first combination of logic gates on the line on which each qubit is located; wherein each first combination of logic gates includes a first controlled NOT gate, a first rotation gate around the Z axis, a second controlled NOT gate, and a rotation gate around the X axis; The first connection order of each line is the target end of the first controlled NOT gate, the first rotation gate around the Z axis, the target end of the second controlled NOT gate, and the rotation gate around the X axis; The control end of the first controlled NOT gate and the control end of the second controlled NOT gate are coupled to the line of the previous qubit to form a corresponding ring-shaped entanglement topology; The rotation gate around the X axis is located at the end of the variational quantum circuit layer and is used to couple the input end of the additional circuit layer.
[0012] Optionally, the additional circuit layer comprises a second logic gate combination on the line on which each of the qubits is located; wherein each of the second logic gate combinations comprises a rotation gate around the Y axis, a second rotation gate around the Z axis, and a third controlled NOT gate; The second connection sequence of each of the lines is the target end of the rotation gate around the Y axis, the second rotation gate around the Z axis, and the third controlled NOT gate. The control end of the third controlled NOT gate is coupled to the line of the previous qubit to form a corresponding ring entanglement topology.
[0013] The second aspect embodiment of the present application provides a database optimization device based on quantum computing, comprising: A data acquisition module is configured to acquire a value range of a plurality of database parameters and set an optimization target. A quantum input module is configured to map the database parameters to an initial superposition state of a qubit based on the value range and input the initial superposition state to a quantum strategy network. A quantum training module is configured to train and optimize built-in parameters in the quantum strategy network based on the optimization target and in combination with database state information measured in real time during a training process. A result output module is configured to measure and decode an output quantum state of the quantum strategy network after the training is completed to obtain an optimized database parameter configuration.
[0014] The third aspect embodiment of the present application provides a computer readable storage medium, comprising a stored computer program; wherein the computer program controls a device in which the computer readable storage medium is located to execute the database optimization method based on quantum computing of any one of the first aspect embodiments when running.
[0015] The fourth aspect embodiment of the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the database optimization method based on quantum computing of any one of the first aspect embodiments.
[0016] The fifth aspect embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the database optimization method based on quantum computing of any one of the first aspect embodiments when executing the computer program.
[0017] Compared with the prior art, the embodiment of the present application provides a database optimization method, device, computer readable storage medium, electronic equipment and computer program product based on quantum computing, which has the following beneficial effects: the embodiment of the present application converts the database parameter optimization problem into a quantum state optimization problem by mapping the database parameters to quantum states, breaks through the dependence of traditional methods on a large number of high-quality samples, and simultaneously utilizes the parallel processing and quantum state superposition ability of quantum computing to significantly improve the search efficiency and optimization effect of the database parameters. In addition, the embodiment of the present application continuously adjusts the quantum circuit parameters according to the real-time collected database state information, and can realize adaptive optimization of the database parameter configuration. BRIEF DESCRIPTION OF DRAWINGS
[0018] Figure 1 is a flowchart of one embodiment of the database optimization method based on quantum computing provided by the present application; Figure 2 is a structural diagram of one embodiment of the quantum strategy network provided by the present application; Figure 3 is a structural diagram of one embodiment of the database optimization device based on quantum computing provided by the present application; Figure 4 is a structural diagram of one embodiment of the electronic equipment provided by the present application. DETAILED DESCRIPTION
[0019] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the protection scope of the present application.
[0020] Referring to Figure 1 is a flowchart of one embodiment of the database optimization method based on quantum computing provided by the present application.
[0021] The embodiment of the first aspect of the present application provides a database optimization method based on quantum computing, which comprises steps S1 to S4, and the details are as follows: Step S1: acquiring the value range of multiple database parameters, and setting an optimization target; Step S2: based on the value range, mapping the database parameters into an initial superposition state of quantum bits, and inputting the initial superposition state into a quantum strategy network; Step S3: based on the optimization target, and in combination with the database state information measured in real time during the training process, training and optimizing the built-in parameters in the quantum strategy network; Step S4: After the training is completed, the output quantum state of the quantum policy network is measured and decoded to obtain the optimized database parameters.
[0022] Specifically, in step S1, the embodiment of the present application obtains a plurality of database parameters to be optimized and their value ranges, and sets clear optimization targets according to actual application requirements, such as maximizing throughput, minimizing resource usage, maximizing query per second, and maximizing transaction per second, etc., to provide an optimization direction for subsequent training of the quantum policy network; wherein the plurality of database parameters include at least one of cache allocation parameters, disk input / output parameters, concurrency control parameters, the number of open files, query optimizer parameters, and index selection parameters, which can be flexibly set according to the specific optimization target.
[0023] In step S2, based on the value ranges of the database parameters, each database parameter is mapped to one or more qubits, and an initial superposition state thereof is constructed. These initial superposition states can represent all possible parameter combinations in the quantum space, thereby fully utilizing quantum parallelism to enhance search efficiency. The constructed initial superposition state is input to the preset quantum policy network as the starting point of parameter optimization search.
[0024] In step S3, guided by the preset optimization target, the database state information (such as load condition, query response time, CPU resource usage, and memory resource usage, etc.) is measured in real time during the training process, and based on the feedback database state information, the built-in parameters (such as the rotation angle of the quantum gate) in the quantum policy network are dynamically adjusted. In the training process, the strategy based on gradient descent or quantum approximate optimization algorithm (Quantum Approximate Optimization Algorithm, QAOA) is adopted, and by continuously adjusting the built-in parameters in the quantum policy network, the quantum state of the database parameter combination converges to the optimization target. The training process of the embodiment of the present application is a closed loop that continuously interacts with the database environment, i.e. "training-practice-feedback-retraining".
[0025] In step S4, after the quantum policy network training is completed, a quantum measurement operation is performed on the output quantum state to obtain a binary sequence composed of 0 and 1, and the binary sequence is decoded and restored to specific database parameter configurations. These optimized database parameter configurations can be directly applied to the database system to achieve the expected performance optimization target.
[0026] The embodiment of the present application converts the database parameter optimization 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 superposition ability of quantum computing to significantly improve the search efficiency and optimization effect of the database parameters.
[0027] In an optional embodiment, the step S2 of mapping the database parameters into initial superposition states of qubits based on the value ranges comprises: Discretizing the value range of each database parameter into one or more value points according to the discrete granularity of each database parameter; Assigning a set of qubits to the corresponding database parameter based on the number of value points; Applying Hadamard gate operations to all qubits respectively to obtain initial superposition states corresponding to all database parameters.
[0028] It should be noted that the embodiments of the present application can determine the discrete granularity (i.e. the tuning granularity) of each database parameter according to the actual business requirements or performance sensitivity of the database parameter. According to the discrete granularity, the value range of the database parameter is discretized into one or more specific value points. The discretization process not only ensures the coverage of the parameter space, but also provides a basis for subsequent quantum state preparation.
[0029] Further, the number of value points of each database parameter after discretization is assigned an appropriate number of qubits (Qubits) to ensure comprehensive coverage of the parameter space. For example, if a database parameter is discretized into N value points, it needs to be assigned qubits to encode all possible value points of the database parameter; wherein N≥1.
[0030] Applying Hadamard (Hadamard, H) gate operations to the qubits assigned to all database parameters to obtain initial superposition states of all database parameters. H gate is a quantum logic gate used to convert a single ground state qubit into an equal probability superposition state. Each qubit is in an initial superposition state of and after the H gate, so 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.
[0031] In an optional embodiment, the step S3 of training and optimizing the built-in parameters in the quantum policy network based on the tuning target and combining the real-time measured database state information during the training process comprises: Performing quantum evolution on the initial superposition states through the quantum policy network to obtain a corresponding probability distribution, decoding the probability distribution to obtain a candidate parameter configuration; Applying the candidate parameter configuration to the target database system to drive the update of the database state information; Obtain updated database state information, combine the tuning target, calculate the gradient update information of the built-in parameters, and optimize and adjust the built-in parameters based on the gradient update information.
[0032] It should be noted that the embodiment of the present application first performs quantum evolution operation on the input initial superposition state through the quantum policy network. The quantum evolution process is realized by a parameterized quantum circuit, each quantum circuit includes a series of quantum gates, and the built-in parameters of the quantum gates are adjustable. After quantum evolution, a new quantum superposition state is formed, and measurement is performed thereon to obtain a probability distribution representing different parameter configurations. Decoding the probability distribution can obtain a set of specific candidate parameter configurations, which represent the exploration of the current quantum policy network to the tuning target direction of multiple database parameters.
[0033] Then, the candidate parameter configuration decoded is actually applied to the target database system to drive the update of the database running state, that is, to interact with the database environment. After the application of the candidate parameter configuration, the updated database state information is measured and collected in real time using the monitoring tools provided by the database itself (such as the Performance Schema of MySQL, the performance view of OpenGauss, etc.) or third-party monitoring tools (such as Percona Monitoring and Management, Zabbix, Sysbench, etc.), such as load condition, query response time (query speed), CPU resource usage, memory resource usage, and disk I / O condition, etc., which collectively reflect the database performance under the current candidate parameter configuration.
[0034] Further, according to the pre-set tuning target, the collected database state information is quantitatively evaluated, and the corresponding reward signal is calculated. Based on this reward signal, the gradient estimation method is used to calculate the gradient update information of each built-in parameter in the quantum policy network, which indicates the direction and amplitude of the parameter adjustment. Finally, based on the calculated gradient update information, the built-in parameters of the quantum policy network are adjusted and optimized by using the classical optimizer.
[0035] Through multiple iterations, the above process is repeatedly performed, so that the quantum policy network can adaptively learn a better database parameter setting strategy, and gradually converge to the optimal or approximately optimal solution. In other words, through the above "training-practice-feedback-retraining" closed loop process, the embodiment of the present application realizes the efficient interaction and collaborative optimization of the quantum policy network and the real database environment, so that the quantum policy network can adaptively learn and approximate the optimal or approximately optimal database parameter configuration.
[0036] In an optional embodiment, the database parameters in step S1 include at least one of cache allocation parameters, disk input / output parameters, concurrency control parameters, open file numbers, query optimizer parameters and index selection parameters.
[0037] 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 precompiled statements (max_prepared_stmt_count).
[0038] The concurrency control parameters include: maximum number of connections (max_connections) and parallelism.
[0039] The open file number (open-files-limit) is used to control the number of files that can be opened simultaneously by the database process.
[0040] The query optimizer parameters (i.e., query optimizer strategy) and index selection parameters (i.e., index selection strategy) affect retrieval efficiency.
[0041] In an optional embodiment, the tuning target in step S1 is composed of one or more of minimizing resource usage, maximizing queries per second and maximizing transactions per second.
[0042] It should be noted that the tuning target can be selected according to the specific business scenario, performance bottleneck and resource constraints, and one or more targets can be selected for combined optimization. If a combination of multiple targets is selected as the tuning target, a weighted sum or priority ordering method can be used to convert the multi-objective into a single objective function. For example, if the tuning target is "maximizing queries per second (QPS) and maximizing transactions per second (TPS)", the objective function can be F(x)=max(TPS)+ max(QPS).
[0043] Referring to Figure 2 is a structural schematic diagram of an embodiment of the quantum policy network provided by the application.
[0044] In an optional embodiment, the quantum policy network includes: a variational quantum circuit layer and an additional circuit layer; wherein all the quantum bits have a ring-shaped logical relationship that connects at the beginning and end in the variational quantum circuit layer and the additional circuit layer.
[0045] Further, the variational quantum circuit layer comprises a first combination of logic gates on a line on which each of the quantum bits is located; wherein each first combination of logic gates comprises a first controlled NOT gate, a first rotation gate around a Z axis, a second controlled NOT gate, and a rotation gate around an X axis; The first connection order of each of the lines is a target end of the first controlled NOT gate, the first rotation gate around the Z axis, a target end of the second controlled NOT gate, and the rotation gate around the X axis; The control end of the first controlled NOT gate and the control end of the second controlled NOT gate are coupled to the line of the previous quantum bit to form a corresponding ring entanglement topology, respectively; The rotation gate around the X axis is located at the end of the variational quantum circuit layer, and is used to couple an input end of the additional circuit layer.
[0046] Exemplarily, as shown in Figure 2 The quantum strategy network provided by the embodiment of the present application comprises a variational quantum (VQC) circuit layer and an additional circuit layer. The quantum state initialization operation of the embodiment of the present application is specifically: using an H gate to initialize all quantum bits to generate a superposition state of database parameters. The VQC circuit layer can apply a phase offset of a loss function to each group of “database state information-candidate parameter configuration”, simulating the optimization goal of database tuning. The additional circuit layer adjusts the superposition of the quantum state by a series of rotation gates and controlled NOT gates (CNOT gates), so that the probability of high reward parameter configuration increases.
[0047] In Figure 2 , the “H” symbol is an H gate, which is located at the leftmost side of each quantum bit line and changes the quantum bit from a ground state to a superposition state; the controlled NOT gate (CNOT gate) is composed of a plus sign “+” (target end) and a solid point “•” (control end) connected by a vertical line, and is used to realize the entanglement between two quantum bits; the “RZ” symbol is a rotation gate around a Z axis; the “RX” symbol is a rotation gate around an X axis; the “RY” symbol is a rotation gate around a Y axis; “P0”, “P3”, “P6”, and “P8” are adjustable parameters of the rotation gate; the symbol with an instrument is a measurement gate, which is located at the rightmost side of each quantum bit line, and measures the output quantum state after quantum computation to obtain a binary sequence composed of 0 and 1.
[0048] In Figure 2In the embodiment, all the quantum bits (Q0~Q11) form a ring-shaped logical relationship. The VQC circuit layer includes a first combination of logic gates on the line on which each quantum bit is located, and the first connection order of each line is: CNOT (+)-->RZ-->CNOT (+)-->RX. The control end of all the control non-gates in the VQC circuit layer is coupled to the line of the previous quantum bit, so that the entire circuit forms a ring-shaped entanglement topology among all the quantum bits.
[0049] The rotation gate around the X axis (RX) is located at the end of the VQC circuit layer, and the output thereof is directly coupled to the input end of the additional circuit layer, so as to realize quantum state transmission between the two layers.
[0050] In combination with the above embodiment, the additional circuit layer includes a second combination of logic gates on the line on which each quantum bit is located; wherein each second combination of logic gates includes a rotation gate around the Y axis, a second rotation gate around the Z axis, and a third control non-gate; The second connection order of each line is the target end of the rotation gate around the Y axis, the second rotation gate around the Z axis, and the third control non-gate; The control end of the third control non-gate is coupled to the line of the previous quantum bit, so as to form a corresponding ring-shaped entanglement topology.
[0051] In the embodiment, the additional circuit layer includes a second combination of logic gates on the line on which each quantum bit is located, and the second connection order of each line is: RY-->RZ-->CNOT (+). The third control non-gate is coupled to the line of the previous quantum bit, so that the additional circuit layer also maintains a ring-shaped entanglement topology. After the additional circuit layer ends, the output quantum states of the quantum strategy network are measured (the red measurement gate in the figure), and the quantum information is converted into a binary sequence composed of 0 and 1, as the output of the current quantum strategy network. Figure 2
[0052] The embodiment realizes quantum embedding and evolution of the database parameter space through the VQC circuit layer and the additional circuit layer. All the rotation gate parameters constitute a set of trainable built-in parameters, which will be iteratively optimized through a quantum gradient estimation method (such as a parameter shift rule) according to the defined optimization target and real-time database state feedback, and finally output an output quantum state which can be decoded into a high-performance database parameter configuration.
[0053] A specific embodiment will be given below to further illustrate the database optimization method based on quantum computing provided by the present application.
[0054] In this embodiment of the present invention, the sysbench performance of the database is optimized. The following database parameters can be set: the number of open files (open-files-limit), the maximum number of connections (max_connections), the maximum number of cached prepared statements (max_prepared_stmt_count), the buffer pool size (innodb_buffer_pool_size), the size of the memory blocks in the buffer pool (innodb_buffer_pool_chunk_size), the number of memory block instances in the buffer pool (innodb_buffer_pool_instances), and the number of cached tables (table_open_cache). Of course, other parameters can also be added.
[0055] The tuning goal of this time is the SysBench performance of the database. Therefore, the objective function is to maximize the performance of TPS and QPS, that is, F(x) = max(TPS) + max(QPS).
[0056] Each database parameter to be optimized is encoded using one or more qubits. Specifically, the parameter's value range is discretized and then mapped to the qubit value using binary digital encoding.
[0057] Take the cache pool size as an example: if its value range is 0 to 16GB and is discretized in intervals of 256MB, it can be converted to an integer interval [0, 64], where the maximum integer value is 64. Since 2^6 = 64, 6 qubits are required to encode all possible values of this parameter.
[0058] Similarly, if the maximum number of connections ranges from 0 to 8000 and is discretized at intervals of 500, the corresponding integer interval is [0, 16], and the maximum value is 16. Since 2^4 = 16, 4 quantum bits are required for encoding.
[0059] After each round of evolution, the output quantum state of the current quantum strategy network is measured to obtain a binary sequence consisting of 0s and 1s, which is decoded into a specific parameter configuration and applied to the target database system. To evaluate the configuration effect, the sysbench tool is used to perform database performance testing, obtain the current database status information, and feed it back to Figure 2The quantum strategy network in the quantum circuit is further passed to the parameter optimizer of the quantum circuit. The classical optimizer (such as a gradient descent-based algorithm) calculates a gradient according to the obtained database state information and a set tuning target, and updates the adjustable parameters (such as rotation angles in QAOA) in the quantum circuit according to the gradient. Through multiple rounds of evolution, the quantum circuit parameters (built-in parameters) will gradually converge, and finally output the database parameter configuration strategy with the optimal performance.
[0060] Taking a measurement result as an example, the obtained binary sequence is [0 1 0 1 0 0 0 1 0 1...]. According to the pre-defined quantum state preparation rule, the first 6 bits 010100 in the sequence correspond to the cache pool size parameter, and the decimal value is 20. If the cache pool size is discretized at intervals of 256 MB, the current value corresponds to 20*256 MB = 5.12 GB (rounded to 5 GB). The next 4 bits 0101 represent the maximum number of connections, and the decimal value is 5. If the maximum number of connections is discretized at intervals of 500, the actual value is 5*500 = 2500. After applying the parameter configuration obtained by the above decoding to the target database system, performance testing is performed using tools such as sysbench, and according to the test results, the built-in parameters of the quantum circuit are iteratively updated using classical optimization algorithms (such as gradient descent) until the performance of the target database system converges to the optimal state, thereby determining the final database parameter configuration strategy.
[0061] Referring to Figure 3 is a structural schematic diagram of an embodiment of the database tuning apparatus based on quantum computing provided by the application.
[0062] The second aspect embodiment of the application provides a database tuning apparatus based on quantum computing, comprising: The data acquisition module 11 is configured to acquire the value range of multiple database parameters and set a tuning target. The quantum input module 12 is configured to map the database parameters to an initial superposition state of a quantum bit based on the value range, and input the initial superposition state to a quantum strategy network. The quantum training module 13 is configured to train and optimize the built-in parameters in the quantum strategy network based on the tuning target and in combination with the database state information measured in real time during the training process. The result output module 14 is configured to measure and decode the output quantum state of the quantum strategy network after the training is completed, and obtain the optimized database parameter configuration.
[0063] It should be noted that the quantum computing-based database optimization apparatus provided by the second aspect of the present application can implement all processes of the quantum computing-based database optimization method described in any one of the embodiments of the first aspect, and the functions and technical effects of each module and unit in the apparatus are the same as those of the quantum computing-based database optimization method described in any one of the embodiments of the first aspect. Here, no longer be repeated.
[0064] The third aspect of the present application provides a computer readable storage medium, the computer readable storage medium includes stored computer program;Wherein, the computer program when running controls the device where the computer readable storage medium is located executes the quantum computing-based database optimization method described in any one of the embodiments of the first aspect.
[0065] The fourth aspect of the present application provides a computer program product, comprising a computer program, the computer program is executed by the processor to realize the quantum computing-based database optimization method described in any one of the embodiments of the first aspect.
[0066] Referring to Figure 4 , is a structural schematic diagram of an embodiment of the electronic device provided by the present application.
[0067] The fifth aspect of the present application provides an electronic device, comprising a processor 21, a memory 22 and a computer program stored in the memory 22 and configured to be executed by the processor 21, the processor realizes the quantum computing-based database optimization method described in any one of the embodiments of the first aspect when executing the computer program.
[0068] Preferably, the computer program can be divided into one or more modules / units (such as computer program one, computer program two, …), the one or more modules / units are stored in the memory 22 and executed by the processor 21 to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which is used to describe the execution process of the computer program in the electronic device.
[0069] The processor 21 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) 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 also be any conventional processor. The processor 21 is a control center of the electronic device, and connects various parts of the electronic device through various interfaces and lines.
[0070] The memory 22 mainly includes a program storage area and a data storage area. The program storage area can store an operating system, at least one application required by a 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, and can also be a non-volatile memory such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., or the memory 22 can also be other volatile solid-state storage devices.
[0071] It should be noted that the above electronic device can include, but is not limited to, a processor and a memory, and those skilled in the art can understand that, Figure 4 The structural block diagram shown is only an example of the structure of the above electronic device, and does not constitute a limitation on the structure of the above electronic device. The above electronic device can include more or less components than those shown, or combine certain components, or different components. The above is only a preferred embodiment of the present application. It should be noted that those skilled in the art can make several improvements and modifications without departing from the technical principles of the present application. These improvements and modifications should also be considered within the scope of protection of the present application.
Claims
1. A database tuning method based on quantum computing, characterized in that: include: Obtain the value ranges of multiple database parameters and set tuning targets; Based on the value range, mapping the database parameter to an initial superposition state of a quantum bit, and inputting the initial superposition state into a quantum strategy network; Based on the tuning target and in combination with database state information measured in real time during training, training and optimizing built-in parameters in the quantum strategy network; After the training is completed, the output quantum state of the quantum strategy network is measured and decoded to obtain the optimized database parameter configuration.
2. The database tuning method based on quantum computing according to claim 1, characterized in that: Mapping the database parameter to an initial superposition state of a quantum bit based on the value range includes: According to 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 quantum bits is assigned to the corresponding database parameters; A Hadamard gate operation is applied to all quantum bits to obtain initial superposition states corresponding to all the database parameters.
3. The database tuning method based on quantum computing according to claim 1, characterized in that: The training and optimization of built-in parameters in the quantum strategy network based on the tuning target and in combination with database state information measured in real time during the training process includes: Performing quantum evolution on the initial superposition state through the quantum strategy network to obtain a corresponding probability distribution, decoding the probability distribution to obtain a candidate parameter configuration; Apply the candidate parameter configuration to the target database system to drive the update of database status information; Obtain updated database status information, calculate gradient update information of the built-in parameters in combination with the tuning target, and optimize and adjust the built-in parameters based on the gradient update information.
4. The database tuning method based on quantum computing according to claim 1, characterized in that: The plurality of database parameters include at least one of cache allocation parameters, disk input / output parameters, concurrency control parameters, the number of open files, query optimizer parameters, and index selection parameters.
5. The database tuning method based on quantum computing according to claim 1, characterized in that: The tuning goal is at least composed of one or more of minimizing resource usage, maximizing the number of queries per second, and maximizing the number of transactions per second.
6. The database tuning method based on quantum computing according to claim 1, characterized in that: The quantum strategy network includes: a variational quantum circuit layer and an additional circuit layer; wherein all the quantum bits have an end-to-end ring logical relationship in the variational quantum circuit layer and the additional circuit layer.
7. The database tuning method based on quantum computing according to claim 6, characterized in that: The variational 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 controlled NOT gate, a first Z-axis rotation gate, a second controlled NOT gate and an X-axis rotation gate; The first connection sequence of each of the lines 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 end of the first controlled NOT gate and the control end of the second controlled NOT gate are both coupled to the circuit of the previous quantum bit to form corresponding ring entangled topologies respectively; The X-axis rotating gate is located at the end of the variational quantum circuit layer and is used to couple to the input end of the additional circuit layer.
8. The database tuning method based on quantum computing according to claim 6, characterized in that: The additional circuit layer includes a second logic gate combination on the line where each quantum bit 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 controlled NOT gate; The second connection sequence of each of the lines is a rotary door around the Y axis, a second rotary door around the Z axis, and a target end of a third control NOT gate; The control end of the third controlled NOT gate is coupled to the circuit of the previous quantum bit to form a corresponding ring entangled topology.
9. A database tuning device based on quantum computing, characterized in that: include: The data acquisition module is used to obtain the value ranges of multiple database parameters and set tuning targets; A quantum input module, configured to map the database parameter into an initial superposition state of a quantum bit based on the value range, and input the initial superposition state into a quantum strategy network; A quantum training module, configured to train and optimize built-in parameters in the quantum strategy network based on the tuning target and in combination with database state information measured in real time during training; The result output module is used to measure and decode the output quantum state of the quantum strategy network after the training is completed to obtain the optimized database parameter configuration.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program; wherein, when the computer program is run, it controls the device where the computer-readable storage medium is located to execute the database tuning method based on quantum computing according to any one of claims 1 to 8.
11. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the database tuning method based on quantum computing as described in any one of claims 1 to 8.
12. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the database tuning method based on quantum computing according to any one of claims 1 to 8 when executing the computer program.
Citation Information
Patent Citations
Method for processing graph data through quantum graph convolutional neural network
CN113159239A
Auxiliary decision-making method and device, medium and electronic device
CN116644814A
Quantum state amplitude coding method, device, equipment and medium
CN119416906A
Database parameter tuning method based on parameter type customization optimization
CN119669190A
Quantum neural network training method, data processing method, device and medium
CN120124767A
Cited By
Classic and quantum combined database system and database operation method
CN121681605A