Data processing method, electronic device, storage medium and computer program product

By converting data tables into logical quantum circuits, the structured storage problem of multiple relational data tables in quantum circuits is solved, enabling fast mapping of data tables and preservation of dependencies, thus improving the flexibility and functionality of quantum computing.

CN121833304APending Publication Date: 2026-04-10CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing technologies cannot effectively realize the structured storage of multiple relational data tables in quantum circuits, cannot meet the need for rapid and complete mapping of data to quantum circuits, and cannot record the dependencies between data.

Method used

The data table is converted into a logical quantum circuit, including registers for storing the data table identifier, primary key, and data other than the primary key. By constructing a truth table and a logical quantum circuit, the data table is stored in a structured manner in the quantum circuit, preserving the dependencies between data.

Benefits of technology

It enables fast and complete mapping of data tables in quantum circuits and preservation of dependencies, improving the flexibility and functionality of quantum circuits and supporting complex database operations such as cross-table joins and conditional queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121833304A_ABST
    Figure CN121833304A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method, electronic equipment, a storage medium and a computer program product, and the method comprises the steps: obtaining one or more first data tables; converting the one or more first data tables into a first logic quantum circuit; wherein the first logic quantum circuit comprises the following one or more registers: a first register used for storing an identifier of each first data table in the one or more first data tables; the second register is used for storing a primary key of each first data table; the third register is used for storing data except the primary key in each first data table; and obtaining a physical quantum circuit according to the first logic circuit, wherein the physical quantum circuit is used for storing the first data table. By means of the quantum circuit, structured storage of the data table in the quantum circuit can be achieved, quantum calculation operation on the data table is supported, and therefore the flexibility and functionality of the quantum circuit are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data processing method, electronic device, storage medium, and computer program product. Background Technology

[0002] Quantum computing is a novel computing paradigm that follows the rules of "quantum mechanics controlling quantum information units" and relies on these rules for computation. Because quantum computing differs from classical computing by possessing unique characteristics such as quantum superposition and quantum entanglement, data requires specific rules to be stored in a structured manner within quantum circuits. This structured representation of quantum data is only applicable in specific scenarios and functions, and cannot achieve the structured storage of data tables within quantum circuits. Summary of the Invention

[0003] To address the related technical problems, embodiments of this application provide a data processing method, an electronic device, a storage medium, and a computer program product.

[0004] The technical solution of this application embodiment is implemented as follows: This application provides a data processing method, the method comprising: Retrieve one or more first data tables; The one or more first data tables are converted into a first logic quantum circuit; wherein the first logic quantum circuit includes one or more of the following registers: a first register for storing the identifier of each of the one or more first data tables; a second register for storing the primary key of each of the first data tables; and a third register for storing the data in each of the first data tables other than the primary key. A physical quantum circuit is obtained based on the first logic circuit, and the physical quantum circuit is used to store the first data table.

[0005] In the above scheme, the first logic quantum circuit further includes one or more of the following registers: A fourth register is used to store a tag for the data in the one or more first data tables; The fifth register is used to store auxiliary bits, which are used to assist in related quantum operations.

[0006] In the above scheme, converting the one or more first data tables into a first logic quantum circuit includes: Each of the one or more first data tables is converted into one or more corresponding first truth tables; The first logic quantum circuit is obtained based on the one or more first truth tables; wherein... The input to each of the one or more first truth tables is determined based on one or more of the following: the identifier of the corresponding first data table; one or more primary keys of the corresponding first data table; and the output of each first truth table is determined based on data in the corresponding first data table other than the primary key.

[0007] In the above scheme, converting each of the one or more first data tables into one or more corresponding first truth tables includes: Each primary key in each of the first data tables is converted into a corresponding first sequence value, and each data item in each of the first data tables other than the primary key is converted into a corresponding second sequence value. One or more first truth tables are constructed based on the binary string corresponding to each of the first sequence values, the binary string corresponding to the identifier of each of the first data tables, and the binary string corresponding to each of the second sequence values; wherein, The input to each of the first truth tables is the binary string corresponding to the first sequence value and the identifier of the first data table. The output of each of the first truth tables is one or more columns of bits in the binary string corresponding to the second sequence value.

[0008] In the above scheme, obtaining the first logic quantum circuit based on the one or more first truth tables includes: Delete the data of the first type from each of the first truth tables to obtain the second truth table corresponding to the first truth table; the output in the row where the data of the first type is located in the second truth table is 0; The first logic quantum circuit is obtained based on one or more of the second truth tables.

[0009] In the above scheme, obtaining the first logic quantum circuit based on one or more second truth tables includes: Convert the one or more second truth tables into a second logic quantum circuit; Each zero control cond-0 in the second logic quantum circuit is converted into the corresponding conventional control cond-1 to obtain the third logic quantum circuit. Eliminate the identical quantum gates in the third logic quantum circuit to obtain the first logic quantum circuit.

[0010] In the above scheme, the control bits in the first logic quantum circuit are determined based on the identifier of each first data table and the primary key of each first data table, and the target bits in the first logic quantum circuit are determined based on the data in each first data table other than the primary key.

[0011] This application also provides a data processing apparatus, including: The first acquisition unit is used to acquire one or more first data tables; A first conversion unit is configured to convert the one or more first data tables into a first logic quantum circuit; wherein the first logic quantum circuit includes one or more registers: a first register for storing the identifier of each of the one or more first data tables; a second register for storing the primary key of each of the first data tables; and a third register for storing data in each of the first data tables other than the primary key. A first processing unit is configured to obtain a physical quantum circuit based on the first logic circuit, wherein the physical quantum circuit is used to store the first data table.

[0012] This application also provides an electronic device, including: a processor and registers for storing a computer program capable of running on the processor. The processor is used to execute the steps of any of the above-mentioned technical solutions when running the computer program.

[0013] This application also provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above methods.

[0014] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above methods.

[0015] The embodiments of this application have the following beneficial effects: In this embodiment, one or more first data tables are obtained; the one or more first data tables are converted into a first logic quantum circuit, the first logic quantum circuit including one or more registers: a first register for storing the identifier of each of the one or more first data tables; a second register for storing the primary key of each first data table; a third register for storing the data in each first data table other than the primary key; and then a physical quantum circuit is obtained based on the first logic circuit, which can be used to store the first data tables. It can be seen that in this embodiment, by dividing the primary key, the identifier, and the data in the data table into different groups for storage in the logic quantum circuit, the association between the primary key, the identifier, and the data in the data table can be preserved, that is, the dependencies in the data table can be preserved. In this embodiment, on the one hand, the data in the data table is mapped to registers, allowing the data in the data table to be quickly and completely mapped to the quantum circuit; on the other hand, this application can preserve the dependencies between the data in the data table in the quantum circuit, thereby realizing the structured storage of the data table in the quantum circuit. This enables this embodiment to support quantum computing operations on the data table, thereby improving the flexibility and functionality of the quantum circuit. Attached Figure Description

[0016] Figure 1 A schematic diagram illustrating the row storage representation in the classic data structure provided in the embodiments of this application; Figure 2 Grover's algorithm quantum circuit is provided in the related technology for the embodiments of this application; Figure 3 A schematic diagram illustrating the storage method of relational data tables in quantum circuits in the related technologies provided in the embodiments of this application; Figure 4 A flowchart illustrating the data processing method provided in this application embodiment; Figure 5 A schematic diagram of the structured representation of quantum data provided in the embodiments of this application. Figure 6 A flowchart illustrating the data processing procedure provided for an application embodiment of this application; Figure 7 An exemplary schematic diagram illustrating the construction of a second logic quantum circuit based on a second truth table, provided for embodiments of this application; Figure 8 A schematic diagram illustrating the equivalent transformation process of the three "hollow circle" control gates provided in the embodiments of this application; Figure 9 A schematic diagram illustrating the equivalent conversion process of a "hollow circle" and two "solid circles" control gates provided in the embodiments of this application; Figure 10 A schematic diagram illustrating the transformation of the second logic quantum circuit provided in the embodiments of this application into a first logic quantum circuit; Figure 11 A quantum circuit diagram of the Employee table constructed using Qiskit, provided for embodiments of this application; Figure 12 A schematic diagram of the physical quantum circuits constructed using a third-party SDK for the Employee and Department tables provided in this application embodiment; Figure 13 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application; Figure 14 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application.

[0017] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation

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

[0019] It should be understood that the term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "one or more" in this document refers to any combination of at least two of any one or more elements from a set of A, B, and C. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set of A, B, and C.

[0020] It should also be understood that the term "instruction" mentioned in the embodiments of this application can be a direct instruction, an indirect instruction, or an indication of a relationship. For example, A instructing B can mean that A directly instructs B, such as B being able to obtain information through A; it can also mean that A indirectly instructs B, such as A instructing C, so B can obtain information through C; or it can mean that there is a relationship between A and B.

[0021] It should also be understood that the term "correspondence" mentioned in the embodiments of this application may indicate a direct or indirect correspondence between the two, or an association between the two, or a relationship of instruction and being instructed, configuration and being configured, etc.

[0022] It should be noted that terms such as "first" and "second" are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0023] Furthermore, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.

[0024] The following describes the relevant technical terms used in this application: 1. Quantum computing and quantum circuits Quantum computing is a novel computing paradigm that follows the rules of quantum mechanics to control quantum information units and relies on these rules for computation. Classical computing uses binary digital electronics for operations, where binary digits are always in a definite state of 0 or 1. Quantum computing is completely different from existing computing paradigms. It leverages the superposition property of quantum mechanics to achieve the superposition of computational states; in quantum circuits, superposition states of 0 and 1 exist simultaneously. The fundamental idea of ​​quantum computing is to use the rules and concepts of quantum mechanics to process problems and information. By utilizing the law of quantum superposition, it can achieve highly parallel computation of massive amounts of data, representing an exponential speedup and leap forward compared to traditional programs.

[0025] Because quantum computing differs from classical computing, possessing unique properties such as quantum superposition and quantum entanglement, data requires specific rules to be stored in a structured manner within quantum circuits. Quantum circuits can represent not only complete data but also the relationships between data points. High-parallel computing based on quantum computers relies on the structured storage of quantum data within quantum circuits, thereby achieving exponential performance improvements in quantum algorithms.

[0026] 2. Quantum properties used in quantum data storage Quantum computing contains two unique properties: quantum superposition and quantum entanglement. Through the superposition and entanglement of qubits, a large amount of data and the correlation between data can be represented in a quantum circuit with a finite number of qubits, thereby enabling further computation on the data in the quantum circuit.

[0027] Quantum superposition: Unlike classical computers, in quantum computers, a single quantum bit (qubit) can be in both 0 and 1 states simultaneously. For example, six qubits can simultaneously represent 64 (26) data points in a quantum circuit. Through this quantum superposition property, quantum computing can simultaneously represent or process large amounts of data in parallel, thereby significantly accelerating computational speed for certain problems.

[0028] Quantum entanglement: When two or more qubits are entangled, a change in the state of one qubit immediately affects the other, regardless of the distance between them. Quantum entanglement enables information sharing among multiple qubits, accelerating computational efficiency.

[0029] 3. Structural storage framework for quantum data In classic databases, row storage is the most common and frequently used form of data storage. A diagram of a common row storage model is shown below. Figure 1 . Figure 1 The diagram above illustrates the row storage representation of a classic data structure in the related technologies provided in this application. In the data structure shown in Figure A, A is the primary key, and the values ​​are unique and arranged in order.

[0030] In related technologies, the structured storage methods for quantum data mainly include the following: 1) Structured storage and processing of quantum data based on quantum algorithms, such as Grover's algorithm and DJ algorithm. Grover's algorithm achieves an exponential increase in the speed of searching massive amounts of quantum data, and its implementation relies on the preparation of structured quantum data in quantum circuits. Please refer to [link to relevant documentation]. Figure 2 , Figure 2 The Grover algorithm quantum circuit provided in this application embodiment includes an Oracle module and a Diffusion module. The Oracle module is used to label the data to be searched, and the Diffusion module is used to perform phase flipping on the search data. In the Oracle module, the user needs to customize the quantum data to be searched; in the Diffusion module, quantum data with a uniform superposition state needs to be prepared. Finally, the algorithm's function is achieved through continuous iterative calculations. The structured representation model of the quantum data prepared in this scheme depends on specific algorithms and requirements. This quantum structured data model has poor scalability and cannot be applied to table-structured data.

[0031] 2) In quantum computing, to enable CRUD operations on quantum data, it is necessary to first achieve structured storage of quantum data within quantum circuits to meet the requirements for rapid querying and updating of quantum data. In related technologies, relational table data can be represented as structured quantum data through special conversion methods. Please refer to [link to relevant documentation]. Figure 3 , Figure 3 This diagram illustrates how relational data tables in quantum circuits are stored, as provided in the embodiments of this application. Figure 3 The left side of the table contains relational data (DNum and A have a one-to-one mapping relationship, DName and B have a one-to-one mapping relationship). Figure 3The right side of the diagram represents the quantum circuit after data transformation from a relational table, where (a2, a1, a0) represents the information of the primary key A on the left, and (b2, b1, b0) represents the information of field B. The above scheme does not include a data storage plan for multiple relational tables within the quantum circuit.

[0032] Therefore, while classical quantum algorithms can prepare specific quantum data in certain scenarios, due to algorithmic limitations, the structured representation of this quantum data is only applicable to specific scenarios and functions, failing to meet the need for preparing general-purpose structured data like relational tables. Other solutions use relational table data to prepare structured quantum data, but these methods cannot achieve data storage of multiple relational tables in quantum circuits. Thus, none of the above solutions can satisfy the structured storage of multiple complex relational data tables in quantum circuits, failing to meet both the requirement of rapidly and completely mapping relational data table data to quantum circuits and the requirement of recording dependencies between data within a limited number of qubits.

[0033] Based on this, in this embodiment of the application, one or more first data tables are obtained; the one or more first data tables are converted into a first logic quantum circuit, the first logic quantum circuit including one or more registers: a first register for storing the identifier of each of the one or more first data tables; a second register for storing the primary key of each first data table; a third register for storing the data in each first data table other than the primary key; and then a physical quantum circuit is obtained according to the first logic circuit, which can be used to store the first data tables. It can be seen that in this application, by dividing the registers in the logic quantum circuit, the primary key, the identifier of the data table, and the data in the data table other than the primary key can be divided into different groups for storage. This allows the association relationship between the primary key, the identifier of the data table, and the data in the data table other than the primary key to be preserved, that is, the dependency relationship in the data table can be preserved. As can be seen, in this application, on the one hand, the data in the data table is mapped to the register, and the data in the data table can be quickly and completely mapped to the quantum circuit. On the other hand, this application can retain the dependencies between the data in the data table in the quantum circuit, thereby realizing the structured storage of the data table in the quantum circuit. This enables the embodiments of this application to support quantum computing operations on the data table, thereby improving the flexibility and functionality of the quantum circuit.

[0034] The present application will now be described in further detail with reference to the accompanying drawings and embodiments.

[0035] This application provides a data processing method, see [link to relevant documentation] Figure 4 The method includes: Step 401: Obtain one or more first data tables.

[0036] For example, a typical example of this application is that the first data table is a relational data table. For example, the first data table can be a table from a classic relational database used to store structured data. However, this application does not limit the first data table to only being a relational data table. The first data table can also be other types of data tables, such as document-type data tables.

[0037] For example, the data in the first data table can be row-stored data and / or column-stored data.

[0038] For example, a typical application scenario of this application is to convert multiple first data tables into quantum circuits for storage. However, this application is not limited to scenarios with multiple first data tables, and embodiments of this application can also be used in scenarios with only one first data table.

[0039] For example, the first data table includes a primary key and other data besides the primary key. Taking the data in the first data table as row-based data storage as an example, the primary key of the first data table is used to distinguish each row of data. Each row of data corresponds to a unique primary key, and the primary key is read-only by default. The primary key value is the primary key value of the original row of data. For example, taking the first data table as the Employee table, the fields of the Employee table include employee number (Employeenumber, ENum), employee name (Employee name, EName), department number (department number, DNum), etc., where ENum is the primary key of this table; the first data table can also be a Department table, and the fields of this table include DNum, department name (department name, DName), etc., where DNum is specified as the primary key of this table.

[0040] It should be noted that the primary key (table_key) in this embodiment is an exemplary term and can be replaced with any possible term, such as primary key value.

[0041] Step 402: Convert the one or more first data tables into a first logic quantum circuit.

[0042] The first logic quantum circuit includes one or more of the following registers: a first register for storing the identifier of each of the one or more first data tables; a second register for storing the primary key of each of the first data tables; and a third register for storing data in each of the first data tables other than the primary key.

[0043] For example, this application does not limit the first data table to be directly converted into the first logic quantum circuit. The first data table can be converted into the second logic quantum circuit first, and then the second logic quantum circuit can be converted into the first logic quantum circuit.

[0044] For example, the first logic quantum circuit is a quantum circuit model designed based on the contents of the first data table.

[0045] For example, this application does not limit the first logical quantum circuit to being divided into first registers, second registers, third registers, etc. This application can also divide the qubits in the logical quantum circuit into first qubit sets, second qubit sets, and third qubit sets, etc. Accordingly, the statement "The first logical quantum circuit includes one or more of the following registers: a first register for storing the identifier of each of the one or more first data tables; a second register for storing the primary key of each of the first data tables; and a third register for storing data other than the primary key in each of the first data tables" can be replaced with "The first logical quantum circuit includes one or more of the following qubit sets: a first qubit set for storing the identifier of each of the one or more first data tables; a second qubit set for storing the primary key of each of the first data tables; and a third qubit set for storing data other than the primary key in each of the first data tables." That is, this application does not limit the way the logical quantum circuit is divided; in addition to register division, other grouping methods can be used so that the primary key, table identifier, and other data can be mapped to different groups in the logical quantum circuit respectively.

[0046] For example, embodiments of this application may also achieve structured storage of one or more first data tables by splitting the quantum registers corresponding to the primary keys of different first data tables, and / or splitting the quantum registers corresponding to the data tables other than the primary keys of different first data tables.

[0047] For example, the identifier (table_id) of each first data table can be used to distinguish it from other data tables. For instance, the identifier of each first data table can be its sequence number. Each first data table inserted into the quantum circuit can be numbered to obtain its sequence number, which can be represented by a natural number greater than or equal to 0. Each first data table corresponds one-to-one with its sequence number. Within the same quantum circuit, the sequence number of the first data table is determined sequentially by the insertion order of the first data tables.

[0048] For example, the number of qubits in the first register is For example, It refers to the maximum value in one or more identifiers of the first data table.

[0049] For example, the number of qubits in the second register is For example, It is the maximum value of the first sequence value corresponding to the primary key in one or more first data tables.

[0050] For example, taking the data in the first data table as row-stored data, the third register is used for data other than the primary key in the row-stored data. The data other than the primary key can be converted into binary and recorded in the quantum circuit.

[0051] For example, the number of qubits in the third register is ;in, This indicates the longest binary string corresponding to the field col.

[0052] In practical applications, the first logic quantum circuit also includes one or more of the following registers: A fourth register is used to store a tag for the data in the one or more first data tables; The fifth register is used to store auxiliary bits, which are used to assist in related quantum operations.

[0053] In this embodiment of the application, by introducing a fourth register and a fifth register into the first logic quantum circuit, which are used to store data tags and auxiliary bits respectively, the validity and operation of quantum data can be supported, thereby improving the flexibility and functionality of the quantum circuit and enabling it to better adapt to various quantum algorithms and application scenarios.

[0054] It is understandable that due to the unique properties of quantum superposition and quantum entanglement in quantum computing, the representation of data in quantum circuits differs significantly from that in classical computers. This application proposes a structured storage scheme for quantum data in quantum computing, drawing inspiration from the row-based storage table structure of classical relational databases (i.e., data is stored row-by-row, with each row distinguished by a primary key), transforming the row-based storage format of relational tables into structured storage in quantum circuits. The data structure storage method in quantum circuits can be referenced... Figure 5 , Figure 5 This is a schematic diagram of the structured representation of quantum data. Figure 5 The structured representation in the code is used to represent storage. Figure 3 The row of data with a primary key of 1. Figure 5In the table, the sequence number of the first data table, the primary key of the first data table, the other data in the first data table (i.e., data other than the primary key), the label of the table data, and the auxiliary bits correspond to the first register, the second register, the third register, the fourth register, and the fifth register, respectively. For example, the tags for data in one or more first data tables include one or more of the following: tags indicating whether the data has been deleted; tags indicating whether the data has been used; tags indicating whether the data has been updated; and tags indicating the status of the data.

[0055] For example, the labeling of data in one or more first data tables is similar to the labeling method in classical databases. Taking the labeling of data in one or more first data tables as a marker to indicate whether data has been deleted as an example, update and delete data operations involve marking the old data with a deletion marker to distinguish between undeleted and deleted data. Taking the labeling of data in one or more first data tables as a marker to indicate whether data has been used as an example, in a quantum circuit, the labeling of data in one or more first data tables can be a flag. flag=0 indicates that the data has been used, flag=1 indicates that the data has not been used, and correspondingly, the number of qubits in the fourth register is 1.

[0056] For example, the relevant quantum operations include one or more of the following: searching the first quantum data, deleting a portion of the first quantum data, merging the first quantum data, modifying the first quantum data, adding the first quantum data, performing computations on the first quantum data, phase flipping in Grover's algorithm, and constructing superposition states using Hadamard gates. For instance, when performing a search on a large amount of quantum data (such as using Grover's algorithm), additional auxiliary bits are required in this process.

[0057] For example, the first quantum data can be quantum data in a physical quantum circuit, which is obtained by converting data in a first data table and / or the identifier of the first data table.

[0058] For example, the number of qubits in the fifth register is 1 by default.

[0059] For example, auxiliary bits are typically composed of additional qubits that are used as temporary variables during computation to ensure that the main qubit is not disturbed.

[0060] In practical applications, the control bits in the first logic quantum circuit are determined based on the identifier of each first data table and the primary key of each first data table, and the target bits in the first logic quantum circuit are determined based on the data in each first data table other than the primary key.

[0061] In this embodiment, a structured quantum circuit is constructed by using the identifier and primary key of each first data table as control bits and the data in each first data table other than the primary key as target bits. This method enables ordered storage of data from one or more first data tables within the quantum circuit, ensuring that dependencies between data are maintained. This allows for more complex database operations, such as cross-table joins and conditional queries, thereby enhancing the application capabilities of quantum computing in the field of data processing.

[0062] In practical applications, converting the one or more first data tables into a first logic quantum circuit includes: Each of the one or more first data tables is converted into one or more corresponding first truth tables; The first logic quantum circuit is obtained based on the one or more first truth tables; wherein... The input to each of the one or more first truth tables is determined based on one or more of the following: the identifier of the corresponding first data table; one or more primary keys of the corresponding first data table; and the output of each first truth table is determined based on data in the corresponding first data table other than the primary key.

[0063] In this embodiment of the application, by converting the classical data table into a first truth table and further constructing it into a logic quantum circuit, it can be ensured that each first data table and its data can be completely represented with a limited number of qubits, thereby improving the utilization rate of quantum computing resources. Furthermore, by mapping the primary key, table identifier, etc., to the input of the truth table, and mapping the output to the data other than the primary key, the dependency relationship of the data in the first data table can be preserved, thereby realizing the structured storage of the data table.

[0064] For example, in an embodiment of this application, a first data table can be converted into one or more first truth tables.

[0065] For example, the first truth table is a classic logical expression tool used to describe the mapping relationship between inputs and outputs. In this application, the input of the first truth table is determined by the table's identifier and primary key, while the output is determined by data other than the primary key. Each first data table is mapped to one or more first truth tables, and the primary key is extracted to obtain the input variables. Other non-primary key fields are used to transform the output variables, ensuring that each row of data can find a corresponding representation on the qubit, thereby achieving structured data storage.

[0066] For example, when constructing a logic quantum circuit, the input and output relationships in the first truth table are first used to convert them into combinations of corresponding control bits and target bits. If the primary key of a row is 001, then this row represents a specific control condition in the quantum circuit, and the output field of this row represents the desired state of the target bit.

[0067] For example, converting each of the one or more first data tables into one or more corresponding first truth tables includes: constructing one or more first truth tables using the identifiers of one or more first data tables and the primary keys of one or more first data tables as the keys for quantum data.

[0068] For example, obtaining the first logic quantum circuit based on the one or more first truth tables includes: obtaining the control bit of the first logic quantum circuit based on the input of the first truth table, and obtaining the target bit of the first logic quantum circuit based on the output of the first truth table.

[0069] In practical applications, converting each of the one or more first data tables into one or more corresponding first truth tables includes: Each primary key in each of the first data tables is converted into a corresponding first sequence value, and each data item in each of the first data tables other than the primary key is converted into a corresponding second sequence value. One or more first truth tables are constructed based on the binary string corresponding to each of the first sequence values, the binary string corresponding to the identifier of each of the first data tables, and the binary string corresponding to each of the second sequence values; wherein, The input to each of the first truth tables is the binary string corresponding to the first sequence value and the identifier of the first data table. The output of each of the first truth tables is one or more columns of bits in the binary string corresponding to the second sequence value.

[0070] In this embodiment, the data structure of a traditional database can be transformed into a form suitable for quantum computing. Specifically, firstly, the primary key and non-primary key fields are compressed through serialization; then, the serialization is converted into binary format; and finally, a truth table is constructed by combining the data table identifier. This data structure transformation process not only reduces the number of qubits used but also improves the execution efficiency of quantum circuits, enabling classical data to be efficiently represented and processed in a quantum environment.

[0071] Understandably, in order to reduce the number of qubits, this application requires mapping classical field values ​​(such as primary keys) to sequence values.

[0072] For example, the first sequence value maps the value of the primary key field to a continuous sequence of integers according to certain rules. This mapping method can reduce storage space and improve processing efficiency in quantum circuits. For instance, records with primary key values ​​of 123, 119, and 128 can be mapped to sequence values ​​0, 1, and 2 respectively, thereby simplifying subsequent processing logic.

[0073] For example, the second sequence value is the result of a similar mapping of the data in the non-primary key field.

[0074] For example, converting each data item in each of the first data tables, excluding the primary key, into a corresponding second sequence value includes: converting the data into a corresponding second sequence value according to the actual value range and distribution of each data item other than the primary key.

[0075] For example, the binary string corresponding to the sequence value (e.g., the binary string corresponding to the first sequence value, the binary string corresponding to the second sequence value) is a representation of the sequence value converted into binary form.

[0076] For example, converting each of the one or more first data tables into one or more corresponding first truth tables includes: constructing a quantum data table based on each of the one or more first data tables; and constructing one or more first truth tables based on the quantum data tables. Taking a row-store data table as an example, a quantum data table can be constructed based on the row-store data table.

[0077] In practical applications, obtaining the first logic quantum circuit based on the one or more first truth tables includes: Delete the data of the first type from each of the first truth tables to obtain the second truth table corresponding to the first truth table; the output in the row where the data of the first type is located in the second truth table is 0; The first logic quantum circuit is obtained based on one or more of the second truth tables.

[0078] In this embodiment, by deleting the first type of data, the system retains all valid rows and only keeps rows with an output of 1 in the second truth table. Deleting the first type of data and keeping only rows with an output of 0 in the second truth table reduces unnecessary control conditions in subsequent quantum circuit construction, thereby reducing the number and complexity of quantum gates, improving the efficiency of quantum circuits, and reducing redundant operations.

[0079] In practical applications, obtaining the first logic quantum circuit based on one or more second truth tables includes: Convert the one or more second truth tables into a second logic quantum circuit; Each zero control cond-0 in the second logic quantum circuit is converted into the corresponding conventional control cond-1 to obtain the third logic quantum circuit. Eliminate the identical quantum gates in the third logic quantum circuit to obtain the first logic quantum circuit.

[0080] In this embodiment, the second truth table is first converted into a second logic quantum circuit, then the control type of the second logic quantum circuit is unified to conventional control cond-1, then redundant identical quantum gates are eliminated, and finally a first logic quantum circuit with optimized structure is constructed, thereby improving the efficiency and accuracy of quantum data storage.

[0081] It is understandable that converting cond-0 to cond-1 in the second logic quantum circuit is equivalent to converting the hollow circle in the second logic quantum circuit into a solid circle in the second logic quantum circuit.

[0082] For example, converting each zero-control cond-0 in the second logic quantum circuit into a corresponding conventional control cond-1 includes: converting each zero-control cond-0 in the second logic quantum circuit into a corresponding conventional control cond-1 using a first formula. For example, the first formula can be the following formula:

[0083] in, To control bits, For the target bit, Let i = 1, 2, 3, ..., n-1, and cond-0 represent... cond-1 is represented as That is, the control bits can be represented as .

[0084] Step 403: Obtain a physical quantum circuit based on the first logic circuit, wherein the physical quantum circuit is used to store the first data table.

[0085] For example, obtaining the physical quantum circuit based on the first logic circuit includes: obtaining the physical quantum circuit through a third-party SDK using the first logic circuit.

[0086] The present application will be further described in detail below with reference to application examples.

[0087] This application provides a data processing method through its application embodiments; see [link to relevant documentation]. Figure 6 This data processing method can mainly include the following steps: S601: Retrieve one or more first data tables.

[0088] Taking the first data table as a classic row-based data table as an example, we will prepare the classic row-based data table to be converted. Taking the first data table as Empoyee as an example, this table has three fields, including ENum, EName and DNum, where ENum is the primary key of the table.

[0089] Table 1-Employee

[0090] S602: Construct a quantum data table based on each of one or more first data tables; Taking Table 2 as an example, Table 2 is the quantum data table corresponding to Table 1 (i.e., Table Employee), containing classical data and its corresponding quantum data. In Table 2, the classical data in the first data table of Table Employee is mapped to quantum data (C, D, E), where ENum is mapped to quantum data C, EName is mapped to quantum data D, and DNum is mapped to quantum data E. The (table_id) of Table Employee is mapped to the sequence number 0, and a quantum data table is constructed using table_id, C, D, and E.

[0091] Table 2 - Quantum data table corresponding to Employee.

[0092] S603: Construct one or more first truth tables based on quantum data tables.

[0093] For example, one or more truth tables are constructed based on the quantum data table. The first truth table takes binary bits consisting of (table_id, C) as input and outputs binary bits consisting of (D, E), where the binary bit character lengths of table_id, C, D, and E are [missing information]. Where n is the field value, the binary lengths of table_id, C, D, and E in the Employee table are 1, 2, 2, and 3 respectively. From this, the input and output of the quantum data table can be obtained, as detailed in Table 3: Table 3 - Inputs and Outputs of Quantum Data Tables

[0094] Using the binary string (table_id, C) in Table 3 as input and the bits of each of D and E as output, construct multiple first truth tables. Please refer to Table 4 below, which takes the first truth table constructed with the bits of the first column of D as output as an example.

[0095] Table 4 - First Truth Table Corresponding to the First Column of Bits Output

[0096] S604: Obtain the first logic quantum circuit based on one or more first truth tables.

[0097] When constructing a logic quantum circuit, optimization is required. This necessitates identifying the data with an output of 1 in the first truth table. Using Table 4 as an example, we identify the data with an output bit of 1, specifically rows 1 and 4, to form the data in Table 5. Table 5 is the second truth table corresponding to Table 4. In this example, the first type of data is represented by rows 2 and 3 of Table 4.

[0098] Table 5 - Second Truth Table Corresponding to the First Truth Table

[0099] Using the input qubits (table_id, table_key) in Table 5 as control bits and the output bits as target bits, construct the first logic quantum circuit. For details, please refer to [reference needed]. Figure 7 , Figure 7 This is an exemplary schematic diagram illustrating the construction of a second logic quantum circuit based on a second truth table, as provided in an embodiment of this application. Figure 7 In the diagram, "hollow circle" is cond-0, and "solid circle" is cond-1.

[0100] Each zero-control cond-0 in the second logic quantum circuit can be converted into its corresponding conventional control cond-1 using the first formula. The first formula is as follows:

[0101] in, To control bits, For the target bit, i=1,2,3,...,n-1 To control bits, For the target bit, Let i = 1, 2, 3, ..., n-1, and cond-0 represent... cond-1 is represented as That is, the control bits can be represented as .

[0102] by Figure 7 Taking the second logic quantum circuit in the example, Figure 7 The two quantum gates in the above formula can be used to perform calculations and obtain the following results: Figure 8 The right side and Figure 9 The quantum circuit with intermediate valence on the right side of the middle section. Figure 8 Describes the Figure 7The equivalent transformation process of the three "hollow circle" control gates in the text. Figure 9 Describes the Figure 7 The equivalent conversion between the control gate of one "hollow circle" and two "solid circles".

[0103] eliminate Figure 8 and Figure 9 By combining quantum circuits in the circuit, the same quantum gates in the circuit can be obtained, thus obtaining... Figure 10 The quantum circuit on the right side of the middle, Figure 10 The left side is Figure 7 The second logic quantum circuit in Figure 10 The right side shows the first logic quantum circuit obtained by converting the second logic quantum circuit.

[0104] As can be seen from the above, in this embodiment, a truth table is constructed for each single bit of the output column one by one. Through the mapping relationship between the truth table and the quantum circuit, a relatively complete second logic quantum circuit can be obtained. Then, the second logic quantum circuit is equivalently transformed and optimized through formula calculations, and finally, the optimized and simplified first logic quantum circuit is obtained.

[0105] S605: Obtain the physical quantum circuit based on the first logic circuit.

[0106] For example, a physical quantum circuit is a real quantum circuit. Figure 11 A quantum circuit diagram of the Employee table constructed using Qiskit, provided for embodiments of this application. Figure 11 The control bits of the quantum circuit in physics are obtained based on the identifier and primary key of the first data table. Figure 11 The target bit of the quantum circuit is obtained based on the data in the first data table excluding the primary key. The control bit and the target bit form an interdependent relationship, ultimately realizing the structured storage of the first data table in the quantum circuit.

[0107] The above examples all use Table 1 (Table Employee) as an example. To illustrate how multiple tables are stored in this application embodiment, this application embodiment takes Table 6 (Table Department) as an example, based on Table 1. Please refer to Table 6 below: Table 6 - Table of Department

[0108] Among them, the fields DNum and DName are classical data, and A and B are the quantum state data after mapping the fields DNum and DName, respectively, that is, the sequence values ​​corresponding to the fields DNum and DName.

[0109] Following the method described in the practical application above, a truth table is first constructed based on one or more first data tables. Then, a logical quantum circuit is constructed, and quantum circuit optimization is performed to construct the physical quantum circuit. Using multiple first data tables as Table 1 and Table 6, i.e., Table Department and Table Employee, the number of qubits in each register of the quantum circuit is updated as follows: Number of qubits in the first register:

[0110] Number of qubits in the second register:

[0111] Number of qubits in the third register:

[0112] The number of qubits in the fourth and fifth registers remains unchanged.

[0113] Please see Figure 12 , Figure 12 A schematic diagram of the physical quantum circuits constructed using a third-party SDK for the Employee and Department tables provided in this application embodiment.

[0114] The cost of the method provided in the embodiments of this application is analyzed below.

[0115] The overhead of a qubit can be calculated as follows: The overhead of the qubits corresponding to the identifiers of one or more first data tables is Where table_num is the number of first data tables in one or more first data tables.

[0116] The overhead of the qubits corresponding to the primary key of one or more first data tables is table_key: max(keys) represents the maximum primary key value.

[0117] The overhead of the qubits corresponding to data other than the primary key in one or more first data tables is , This indicates the longest binary string corresponding to the field 'col', and finally, the largest binary string of all data in all tables is obtained.

[0118] One or more tags in the first data table occupy one qubit, and auxiliary bits occupy one qubit.

[0119] As can be seen from the above analysis, the total number of qubits in the scheme provided by the embodiments of this application is: + + +2 The size of a quantum bit can be expressed as

[0120] The overhead of a quantum gate can be calculated using the following formula:

[0121] From the above formula, we can see that the size of a qubit can be expressed as: The number of first data tables in one or more first data tables. The data size of one or more first data tables. This is the average number of qubits used in one or more data tables.

[0122] As shown above, this application proposes an effective structured storage scheme for quantum data. This scheme mainly consists of two parts: 1) the conversion relationship between relational table data and truth tables; and 2) the quantum circuit storage design for multiple complex relational tables. This scheme enables the complete storage of multiple complex relational table data in a quantum circuit, while the qubits retain the dependencies between data in the classical relational table. After storing quantum data in a quantum circuit using this scheme, common database operations, such as adding, deleting, modifying, and querying, can be performed on the stored quantum data based on these dependencies.

[0123] Furthermore, this application proposes a structured storage scheme for converting row-level data from classical databases to quantum data. This application proposes the following: 1) A storage structure for classical row-level data in a logical quantum circuit. This scheme uses `table_id`, `table_key`, and `data` (data other than the primary key) to uniquely identify row data. It also adds a flag qubit to mark whether the data is valid and adds an ancilla qubit to support other quantum algorithm operations; 2) Representing row-level data as quantum state data using as few qubits and quantum gates as possible. This application constructs a truth table and, through the mapping relationship between the truth table and quantum gates, constructs a logical quantum circuit. Then, by optimizing the quantum gates in the logical quantum circuit, a final simplified complete quantum circuit is obtained.

[0124] This application proposes a scheme for mapping classical row-level data to structured quantum state data. In this quantum circuit, row-level data from multiple complex tables can be represented simultaneously. In this structured storage scheme, `table_id` and the table's primary key are used as control bits of the quantum circuit, while the remaining data are used as target bits. This allows for the categorized storage of multiple table data within the quantum circuit and supports subsequent quantum computation operations between these multiple tables.

[0125] Furthermore, this application incorporates an optimization scheme for quantum circuits. This scheme uses a truth table as a medium, converts the truth table into a logic quantum circuit, transforms the quantum circuit using formulas, and simplifies the quantum circuit by removing duplicates, thus achieving optimized quantum circuit operations. This application supports multi-table storage and operations, saving the additional overhead of qubits by sharing registers, thereby reducing quantum computing costs. This application solves the complex process of converting large amounts of row-stored data into structured quantum data, which can be implemented through code, saving developers the cost of converting between classical and quantum data.

[0126] Based on the embodiments described above, this application also provides a data processing apparatus, see [link to previous document]. Figure 13 The data processing device includes: The first acquisition unit 1301 is used to acquire one or more first data tables; The first conversion unit 1302 is configured to convert the one or more first data tables into a first logic quantum circuit; wherein the first logic quantum circuit includes one or more registers: a first register for storing the identifier of each of the one or more first data tables; a second register for storing the primary key of each of the first data tables; and a third register for storing data in each of the first data tables other than the primary key. The first processing unit 1303 is used to obtain a physical quantum circuit based on the first logic circuit, wherein the physical quantum circuit is used to store the first data table.

[0127] In one embodiment, the first logic quantum circuit further includes one or more of the following registers: A fourth register is used to store a tag for the data in the one or more first data tables; The fifth register is used to store auxiliary bits, which are used to assist in related quantum operations.

[0128] In one embodiment, the first conversion unit 1302 converts the one or more first data tables into a first logic quantum circuit, including: Each of the one or more first data tables is converted into one or more corresponding first truth tables; The first logic quantum circuit is obtained based on the one or more first truth tables; wherein... The input to each of the one or more first truth tables is determined based on one or more of the following: the identifier of the corresponding first data table; one or more primary keys of the corresponding first data table; and the output of each first truth table is determined based on data in the corresponding first data table other than the primary key.

[0129] In one embodiment, the first conversion unit 1302 converts each of the one or more first data tables into one or more corresponding first truth tables, including: Each primary key in each of the first data tables is converted into a corresponding first sequence value, and each data item in each of the first data tables other than the primary key is converted into a corresponding second sequence value. One or more first truth tables are constructed based on the binary string corresponding to each of the first sequence values, the binary string corresponding to the identifier of each of the first data tables, and the binary string corresponding to each of the second sequence values; wherein, The input to each of the first truth tables is the binary string corresponding to the first sequence value and the identifier of the first data table. The output of each of the first truth tables is one or more columns of bits in the binary string corresponding to the second sequence value.

[0130] In one embodiment, the first conversion unit 1302 obtains the first logic quantum circuit based on the one or more first truth tables, including: Delete the data of the first type from each of the first truth tables to obtain the second truth table corresponding to the first truth table; the output in the row where the data of the first type is located in the second truth table is 0; The first logic quantum circuit is obtained based on one or more of the second truth tables.

[0131] In one embodiment, the first conversion unit 1302 obtains the first logic quantum circuit based on one or more of the second truth tables, including: Convert the one or more second truth tables into a second logic quantum circuit; Each zero control cond-0 in the second logic quantum circuit is converted into the corresponding conventional control cond-1 to obtain the third logic quantum circuit. Eliminate the identical quantum gates in the third logic quantum circuit to obtain the first logic quantum circuit.

[0132] In one embodiment, the control bits in the first logic quantum circuit are determined based on the identifier of each first data table and the primary key of each first data table, and the target bits in the first logic quantum circuit are determined based on the data in each first data table other than the primary key.

[0133] In practical applications, the first acquisition unit 1301, the first conversion unit 1302, and the first processing unit 1303 can be implemented by a processor in a data processing device.

[0134] It should be noted that the data processing apparatus provided in the above embodiments is only illustrated by the division of the above program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the apparatus can be divided into different program modules to complete all or part of the processing described above. In addition, the data processing apparatus and data processing method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0135] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiments of this application, this application also provides an electronic device, see [link to relevant documentation]. Figure 14 The electronic device includes: The first communication interface 1 is capable of exchanging information with other devices; A first processor 2 is configured to acquire one or more first data tables; convert the one or more first data tables into a first logic quantum circuit; wherein the first logic quantum circuit includes one or more registers: a first register for storing the identifier of each of the one or more first data tables; a second register for storing the primary key of each of the first data tables; a third register for storing data in each of the first data tables other than the primary key; and obtain a physical quantum circuit based on the first logic circuit, wherein the physical quantum circuit is used to store the first data tables.

[0136] In one embodiment, the first logic quantum circuit further includes one or more of the following registers: A fourth register is used to store a tag for the data in the one or more first data tables; The fifth register is used to store auxiliary bits, which are used to assist in related quantum operations.

[0137] In one embodiment, the first processor 2 converts the one or more first data tables into a first logic quantum circuit, including: Each of the one or more first data tables is converted into one or more corresponding first truth tables; The first logic quantum circuit is obtained based on the one or more first truth tables; wherein... The input to each of the one or more first truth tables is determined based on one or more of the following: the identifier of the corresponding first data table; one or more primary keys of the corresponding first data table; and the output of each first truth table is determined based on data in the corresponding first data table other than the primary key.

[0138] In one embodiment, the first processor 2 converts each of the one or more first data tables into one or more corresponding first truth tables, including: Each primary key in each of the first data tables is converted into a corresponding first sequence value, and each data item in each of the first data tables other than the primary key is converted into a corresponding second sequence value. One or more first truth tables are constructed based on the binary string corresponding to each of the first sequence values, the binary string corresponding to the identifier of each of the first data tables, and the binary string corresponding to each of the second sequence values; wherein, The input to each of the first truth tables is the binary string corresponding to the first sequence value and the identifier of the first data table. The output of each of the first truth tables is one or more columns of bits in the binary string corresponding to the second sequence value.

[0139] In one embodiment, the first processor 2 obtains the first logic quantum circuit based on the one or more first truth tables, including: Delete the data of the first type from each of the first truth tables to obtain the second truth table corresponding to the first truth table; the output in the row where the data of the first type is located in the second truth table is 0; The first logic quantum circuit is obtained based on one or more of the second truth tables.

[0140] In one embodiment, the first processor 2 obtains the first logic quantum circuit based on one or more of the second truth tables, including: Convert the one or more second truth tables into a second logic quantum circuit; Each zero control cond-0 in the second logic quantum circuit is converted into the corresponding conventional control cond-1 to obtain the third logic quantum circuit. Eliminate the identical quantum gates in the third logic quantum circuit to obtain the first logic quantum circuit.

[0141] In one embodiment, the control bits in the first logic quantum circuit are determined based on the identifier of each first data table and the primary key of each first data table, and the target bits in the first logic quantum circuit are determined based on the data in each first data table other than the primary key.

[0142] In practical applications, the first acquisition unit 1301, the first conversion unit 1302, and the first processing unit 1303 can be implemented by a processor in a data processing device.

[0143] It should be noted that the data processing apparatus provided in the above embodiments is only illustrated by the division of the above program modules. In practical applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the apparatus can be divided into different program modules to complete all or part of the processing described above. In addition, the data processing apparatus and data processing method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0144] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiments of this application, this application also provides an electronic device, see [link to relevant documentation]. Figure 14 The electronic device includes: The first communication interface 1 is capable of exchanging information with other devices; A first processor 2 is configured to acquire one or more first data tables; convert the one or more first data tables into a first logic quantum circuit; wherein the first logic quantum circuit includes one or more registers: a first register for storing the identifier of each of the one or more first data tables; a second register for storing the primary key of each of the first data tables; a third register for storing data in each of the first data tables other than the primary key; and obtain a physical quantum circuit based on the first logic circuit, wherein the physical quantum circuit is used to store the first data tables.

[0145] In one embodiment, the first logic quantum circuit further includes one or more of the following registers: A fourth register is used to store a tag for the data in the one or more first data tables; The fifth register is used to store auxiliary bits, which are used to assist in related quantum operations.

[0146] In one embodiment, the first processor 2 converts the one or more first data tables into a first logic quantum circuit, including: Each of the one or more first data tables is converted into one or more corresponding first truth tables; The first logic quantum circuit is obtained based on the one or more first truth tables; wherein... The input to each of the one or more first truth tables is determined based on one or more of the following: the identifier of the corresponding first data table; one or more primary keys of the corresponding first data table; and the output of each first truth table is determined based on data in the corresponding first data table other than the primary key.

[0147] In one embodiment, the first processor 2 converts each of the one or more first data tables into one or more corresponding first truth tables, including: Each primary key in each of the first data tables is converted into a corresponding first sequence value, and each data item in each of the first data tables other than the primary key is converted into a corresponding second sequence value. One or more first truth tables are constructed based on the binary string corresponding to each of the first sequence values, the binary string corresponding to the identifier of each of the first data tables, and the binary string corresponding to each of the second sequence values; wherein, The input to each of the first truth tables is the binary string corresponding to the first sequence value and the identifier of the first data table. The output of each of the first truth tables is one or more columns of bits in the binary string corresponding to the second sequence value.

[0148] In one embodiment, the first processor 2 obtains the first logic quantum circuit based on the one or more first truth tables, including: Delete the data of the first type from each of the first truth tables to obtain the second truth table corresponding to the first truth table; the output in the row where the data of the first type is located in the second truth table is 0; The first logic quantum circuit is obtained based on one or more of the second truth tables.

[0149] In one embodiment, the first processor 2 obtains the first logic quantum circuit based on one or more of the second truth tables, including: Convert the one or more second truth tables into a second logic quantum circuit; Each zero control cond-0 in the second logic quantum circuit is converted into the corresponding conventional control cond-1 to obtain the third logic quantum circuit. Eliminate the identical quantum gates in the third logic quantum circuit to obtain the first logic quantum circuit.

[0150] In one embodiment, the control bits in the first logic quantum circuit are determined based on the identifier of each first data table and the primary key of each first data table, and the target bits in the first logic quantum circuit are determined based on the data in each first data table other than the primary key.

[0151] It should be noted that the specific processing procedure of the first communication interface 1 can be understood by referring to the above method.

[0152] Of course, in practical applications, the various components in an electronic device are coupled together through bus system 4. It can be understood that bus system 4 is used to achieve communication and connection between these components. In addition to the data bus, bus system 4 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 14 The general will label all buses as Bus System 4.

[0153] In this embodiment, the first register 3 is used to store various types of data to support operations in the electronic device. Examples of such data include any computer program used to operate on the electronic device.

[0154] The methods disclosed in the embodiments of this application can be applied to the first processor 2, or implemented by the first processor 2. The first processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware or by instructions in the form of software in the first processor 2. The first processor 2 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The first processor 2 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the first register 3. The first processor 2 reads the information in the first register 3 and combines its hardware to complete the steps of the aforementioned method.

[0155] In an exemplary embodiment, the electronic device may be implemented by one or more ASICs, DSPs, PLDs, CPLDs, FPGAs, general-purpose processors, controllers, MCUs, microprocessors, or other electronic components to perform the aforementioned method.

[0156] It is understood that the first register 3 in the embodiments of this application can be a volatile register or a non-volatile register, or both. The non-volatile register can be a read-only register (ROM), a programmable read-only register (PROM), an erasable programmable read-only register (EPROM), an electrically erasable programmable read-only register (EEPROM), a ferromagnetic random access memory (FRAM), a flash memory, a magnetic surface register, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface register can be a disk register or a magnetic tape register. The volatile register can be a random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The registers described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of registers.

[0157] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a first register 3 storing a computer program, which can be executed by a first processor 2 to complete the steps described in the aforementioned method.

[0158] In an exemplary embodiment, this application also provides a computer program product, including a computer program that can be executed by a first processor 2 to perform the steps described in the foregoing method.

[0159] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application.

Claims

1. A data processing method, characterized in that, The method includes: Retrieve one or more first data tables; The one or more first data tables are converted into a first logic quantum circuit; wherein the first logic quantum circuit includes one or more of the following registers: a first register for storing the identifier of each of the one or more first data tables; a second register for storing the primary key of each of the first data tables; and a third register for storing the data in each of the first data tables other than the primary key. A physical quantum circuit is obtained based on the first logic circuit, and the physical quantum circuit is used to store the first data table.

2. The method according to claim 1, characterized in that, The first logic quantum circuit also includes one or more of the following registers: A fourth register is used to store a tag for the data in the one or more first data tables; The fifth register is used to store auxiliary bits, which are used to assist in related quantum operations.

3. The method according to claim 1, characterized in that, The step of converting the one or more first data tables into a first logic quantum circuit includes: Each of the one or more first data tables is converted into one or more corresponding first truth tables; The first logic quantum circuit is obtained based on the one or more first truth tables; wherein... The input to each of the one or more first truth tables is determined based on one or more of the following: the identifier of the corresponding first data table; one or more primary keys of the corresponding first data table; and the output of each first truth table is determined based on data in the corresponding first data table other than the primary key.

4. The method according to claim 1, characterized in that, The control bits in the first logic quantum circuit are determined based on the identifier of each first data table and the primary key of each first data table, and the target bits in the first logic quantum circuit are determined based on the data in each first data table other than the primary key.

5. The method according to claim 3, characterized in that, The step of converting each of the one or more first data tables into a corresponding one or more first truth tables includes: Each primary key in each of the first data tables is converted into a corresponding first sequence value, and each data item in each of the first data tables other than the primary key is converted into a corresponding second sequence value. One or more first truth tables are constructed based on the binary string corresponding to each of the first sequence values, the binary string corresponding to the identifier of each of the first data tables, and the binary string corresponding to each of the second sequence values; wherein, The input to each of the first truth tables is the binary string corresponding to the first sequence value and the identifier of the first data table. The output of each of the first truth tables is one or more columns of bits in the binary string corresponding to the second sequence value.

6. The method according to claim 3, characterized in that, The process of obtaining the first logic quantum circuit based on the one or more first truth tables includes: Delete the data of the first type from each of the first truth tables to obtain the second truth table corresponding to the first truth table; the output in the row where the data of the first type is located in the second truth table is 0; The first logic quantum circuit is obtained based on one or more of the second truth tables.

7. The method according to claim 6, characterized in that, The process of obtaining the first logic quantum circuit based on one or more second truth tables includes: Convert the one or more second truth tables into a second logic quantum circuit; Each zero control cond-0 in the second logic quantum circuit is converted into the corresponding conventional control cond-1 to obtain the third logic quantum circuit. Eliminate the identical quantum gates in the third logic quantum circuit to obtain the first logic quantum circuit.

8. A data processing apparatus, characterized in that, include: The first acquisition unit is used to acquire one or more first data tables; A first conversion unit is configured to convert the one or more first data tables into a first logic quantum circuit; wherein the first logic quantum circuit includes one or more registers: a first register for storing the identifier of each of the one or more first data tables; a second register for storing the primary key of each of the first data tables; and a third register for storing data in each of the first data tables other than the primary key. A first processing unit is configured to obtain a physical quantum circuit based on the first logic circuit, wherein the physical quantum circuit is used to store the first data table.

9. An electronic device, characterized in that, include: The processor and the memory used to store computer programs that can run on the processor. When the processor is used to run the computer program, it performs the steps of the method according to any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.