Resource data processing method and device based on quantum coding and server
Through the resource data processing method based on quantum encoding, the preset resource data configuration model is used to determine the allocation amount of resource data, which solves the problems of investment proportion segmentation and total investment limitation in the prior art, and improves the efficiency and accuracy of resource data allocation.
Patent Information
- Application Number
- CN202411574618.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-28
AI Technical Summary
In the optimization of resource data combination, the existing technology has the problem that the investment ratio cannot be infinitely subdivided and cannot meet the total investment restrictions, resulting in inefficient allocation of investment ratios.
The resource data processing method based on quantum encoding is adopted, and the configuration amount of the resource data amount corresponding to each resource data is determined through the preset resource data configuration model, and the target combination strategy is determined to ensure that the configuration amount is within the specified range.
The scope of search solution space is effectively reduced, the efficiency and accuracy of resource data allocation is improved, and the allocation of investment proportion meets the requirements.
Smart Images

Figure CN119539109A_ABST
Abstract
Description
Technical Field
[0001] This specification belongs to the field of quantum computing, and in particular, relates to a resource data processing method, device and server based on quantum coding. Background Art
[0002] Resource data portfolio optimization refers to finding the best balance between benefits and risks among a variety of interrelated resource data. However, the current application of resource data portfolio optimization in the actual investment process often faces the reality that the investment ratio cannot be infinitely subdivided and cannot meet the total investment limit, resulting in the configuration of the investment ratio not meeting the requirements and being inefficient.
[0003] To address the above problems, no effective solution has been proposed yet. Summary of the invention
[0004] The present specification provides a resource data processing method, device and server based on quantum coding, which uses a preset resource data configuration model to determine the configuration amount of the resource data volume corresponding to each resource data, and then determines the target combination strategy of the resource data for multiple resource data, so that the configuration amount of the resource data volume corresponding to each resource data can meet the resource data volume configuration range, thereby effectively reducing the scope of the search solution space and improving the efficiency and accuracy of resource data configuration.
[0005] This specification provides a resource data processing method based on quantum coding, the method comprising:
[0006] Receiving a target processing request for a plurality of resource data; wherein the target processing request at least includes a configuration range of a resource data volume corresponding to each of the resource data;
[0007] In response to the target processing request, quantum coding is performed according to a first upper limit value corresponding to each of the resource data, and an integer bit for quantum coding corresponding to the resource data amount of each of the resource data is determined, wherein the first upper limit value is a difference between an upper limit value and a lower limit value of a configuration range of the resource data amount corresponding to each of the resource data;
[0008] Determine the configuration amount of the resource data amount corresponding to each resource data according to the integer bits corresponding to each resource data by using a preset resource data configuration model; wherein the preset resource data configuration model at least includes a mixing circuit, the mixing circuit is used to perform mixing processing on the quantum bits in the intermediate solution corresponding to the resource data amount through a preset quantum gate, the preset quantum gate includes a first quantum gate for performing mixing processing on the quantum bits corresponding to the same integer bits, and a second quantum gate for performing mixing processing on the quantum bits in a quantum bit combination, the quantum bit combination including quantum bits having a preset numerical relationship between the integer bits;
[0009] According to the configuration amount of the resource data amount corresponding to each resource data, a target combination processing strategy for the multiple resource data is determined; and according to the target combination processing strategy, the multiple resource data are processed accordingly.
[0010] In one embodiment, the using of a preset resource data configuration model to determine the configuration amount of the resource data amount corresponding to each resource data according to the integer digit corresponding to each resource data includes:
[0011] Using the initial state circuit in the resource data configuration model, and according to the integer bits corresponding to each resource data, determining an initial solution including the quantum bits corresponding to each resource data;
[0012] Processing the initial solution using the phase separation circuit in the resource data configuration model to obtain the intermediate solution;
[0013] Processing the intermediate solution using a hybrid circuit in the resource data configuration model to obtain a candidate solution;
[0014] According to the candidate solutions, a configuration amount of the resource data amount corresponding to each resource data is determined.
[0015] In one embodiment, the step of processing the intermediate solution using the hybrid circuit in the resource data configuration model to obtain a candidate solution includes:
[0016] Determine whether there are any two quantum bits with the same integer bits in the intermediate solution, and if there are two quantum bits with the same integer bits in the intermediate solution, mix the two quantum bits through the first quantum gate to obtain the candidate solution.
[0017] In one embodiment, the step of processing the intermediate solution using the hybrid circuit in the resource data configuration model to obtain a candidate solution includes:
[0018] Determine whether there are multiple quantum bits in the intermediate solution whose sum of the first integer digits is the same as the second integer digit, where the first integer digit and the second integer digit are any integer digits in the intermediate solution;
[0019] When there are multiple qubits in the intermediate solution whose sum of the first integer digits is the same as the second integer digit, constructing the qubit combination according to the qubits corresponding to the multiple first integer digits and the qubits corresponding to the second integer digit;
[0020] The candidate solution is obtained by performing partial mixing processing on the quantum bits in the quantum bit combination through the second quantum gate.
[0021] In one embodiment, determining whether there are multiple quantum bits in the intermediate solution whose sum of the first integer bits is the same as the second integer bit includes:
[0022] Determine whether there is an integer digit of a power of two in the first resource data in the intermediate solution, the first resource data being any one of the plurality of resource data;
[0023] In the case where the integer digit of the power of two exists in the first resource data, the integer digit of the power of two is determined as the second integer digit, and the integer digit preceding the second integer digit in the first resource data and the integer digit identical to the integer digit preceding the second integer digit in the adjacent resource data of the first resource data are determined as the first integer digit.
[0024] In one embodiment, determining whether there are multiple quantum bits in the intermediate solution whose sum of the first integer bits is the same as the second integer bit includes:
[0025] Determine whether the last integer digit of the first resource data in the intermediate solution is the same as the last integer digit of the second resource data, the first resource data being any one of the plurality of resource data, and the second resource data being resource data adjacent to the first resource data among the plurality of resource data;
[0026] In the case where the last integer digit of the first resource data and the last integer digit of the second resource data in the intermediate solution are different, obtaining a difference between the last integer digit of the first resource data and the last integer digit of the second resource data, and a maximum value between the last integer digit of the first resource data and the last integer digit of the second resource data;
[0027] Determine the target resource data in the first resource data and the second resource data according to the maximum value, and determine the last integer digit of the target resource data as the second integer digit;
[0028] The first integer bit is determined from the integer bits of the target resource data according to the difference, and the last integer bit of resource data other than the target resource data in the first resource data and the second resource data is determined as the first integer bit.
[0029] In one embodiment, the step of performing quantum coding according to the first upper limit value corresponding to each resource data and determining the integer bits for performing quantum coding corresponding to the resource data amount of each resource data includes:
[0030] Determine a target binary digit corresponding to the first upper limit value, and determine a first numerical value according to the target binary digit;
[0031] determining an auxiliary binary bit according to a difference between the first upper limit value and the first value;
[0032] According to the target binary bit and the auxiliary binary bit, an integer bit for quantum coding corresponding to the resource data amount of each resource data is determined.
[0033] In one embodiment, determining whether there are multiple quantum bits in the intermediate solution whose sum of the first integer bits is the same as the second integer bit includes:
[0034] Determine whether there is an integer digit that is not a power of two among the integer digits of the first resource data in the intermediate solution, the first resource data being any one of the plurality of resource data;
[0035] In the case that there are integer digits that are not powers of two among the integer digits of the first resource data, determining the integer digits that are not powers of two among the integer digits of the first resource data as the second integer digits;
[0036] The integer digits whose sum of integer digits in the first resource data is the same as the second integer digits are determined as the first integer digits.
[0037] This specification provides a resource data processing device based on quantum coding, including:
[0038] A request receiving module, used for receiving a target processing request for a plurality of resource data; wherein the target processing request at least includes a configuration range of a resource data volume corresponding to each of the resource data;
[0039] a request response module, configured to respond to the target processing request, perform quantum coding according to a first upper limit value corresponding to each of the resource data, and determine an integer bit for quantum coding corresponding to the resource data amount of each of the resource data, wherein the first upper limit value is a difference between an upper limit value and a lower limit value of a configuration range of the resource data amount corresponding to each of the resource data;
[0040] a resource data configuration determination module, configured to determine the configuration amount of the resource data amount corresponding to each resource data according to the integer bits corresponding to each resource data by using a preset resource data configuration model, wherein the preset resource data configuration model at least includes a mixing circuit, wherein the mixing circuit is used to perform mixing processing on the quantum bits in the intermediate solution corresponding to the resource data amount through a preset quantum gate, wherein the preset quantum gate includes a first quantum gate for performing mixing processing on the quantum bits corresponding to the same integer bits, and a second quantum gate for performing mixing processing on the quantum bits in a quantum bit combination, wherein the quantum bit combination includes quantum bits having a preset numerical relationship between the integer bits;
[0041] The combination strategy determination module is used to determine the resource data configuration combination strategy for the multiple resource data according to the configuration amount of the resource data amount corresponding to each resource data.
[0042] In one embodiment, the resource data configuration determination module is used to:
[0043] Using the initial state circuit in the resource data configuration model, and according to the integer bits corresponding to each resource data, determining an initial solution including the quantum bits corresponding to each resource data;
[0044] Processing the initial solution using the phase separation circuit in the resource data configuration model to obtain the intermediate solution;
[0045] Processing the intermediate solution using a hybrid circuit in the resource data configuration model to obtain a candidate solution;
[0046] According to the candidate solutions, a configuration amount of the resource data amount corresponding to each resource data is determined.
[0047] In one embodiment, the resource data configuration determination module is used to:
[0048] Determine whether there are any two quantum bits with the same integer bits in the intermediate solution, and if there are two quantum bits with the same integer bits in the intermediate solution, mix the two quantum bits through the first quantum gate to obtain the candidate solution.
[0049] In one embodiment, the request response module is used to:
[0050] Determine a target binary digit corresponding to the first upper limit value, and determine a first numerical value according to the target binary digit;
[0051] determining an auxiliary binary bit according to a difference between the first upper limit value and the first value;
[0052] According to the target binary bit and the auxiliary binary bit, an integer bit for quantum coding corresponding to the resource data amount of each resource data is determined.
[0053] This specification also provides a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed, a resource data processing method based on quantum coding is implemented.
[0054] This specification also provides a computer program product, including a computer program, which implements a resource data processing method based on quantum coding when executed by a processor.
[0055] A resource data processing method based on quantum coding provided in this specification receives a target processing request for multiple resource data; wherein the target processing request at least includes a configuration range of a resource data amount corresponding to each resource data; in response to the target processing request, quantum coding is performed according to a first upper limit value corresponding to each resource data, and an integer digit for quantum coding corresponding to the resource data amount of each resource data is determined, wherein the first upper limit value is a difference between an upper limit value and a lower limit value of the resource data amount configuration range corresponding to each resource data; using a preset resource data configuration model, the resource data amount corresponding to each resource data is determined according to the integer digit corresponding to each resource data. The preset resource data configuration model at least includes a hybrid circuit, the hybrid circuit is used to perform hybrid processing on quantum bits in the intermediate solution corresponding to the resource data through a preset quantum gate, the preset quantum gate includes a first quantum gate used to perform hybrid processing on quantum bits corresponding to the same integer bit, and a second quantum gate used to perform hybrid processing on quantum bits in a quantum bit combination, the quantum bit combination includes quantum bits with a preset numerical relationship between integer bits; according to the configuration amount of the resource data amount corresponding to each of the resource data, a target combination processing strategy for the multiple resource data is determined; and according to the target combination processing strategy, the multiple resource data are processed accordingly. In this way, on the one hand, since the integer bits for quantum coding corresponding to the resource data amount of each resource data are determined according to the configuration range of the resource data amount corresponding to each resource data, the solution generated by the resource data configuration model during the data processing process can be restricted by the integer bits to be within the configuration range of the resource data amount corresponding to each resource data. On the other hand, during the data processing process, the resource data configuration model can perform mixed processing on the corresponding quantum bits through the first quantum gate and the second quantum gate in the hybrid circuit, so as to effectively expand the solution space during the data processing process, avoid generating more invalid solutions in the absence of constraints, that is, the solution direction can be focused on the effective solution space, effectively reducing the scope of searching the solution space, further reducing the processing amount, and improving the efficiency and accuracy of resource data amount configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of this specification, the drawings required for use in the embodiments will be briefly introduced below. The drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 It is a flowchart of a resource data processing method based on quantum coding provided by an embodiment of this specification;
[0058] Figure 2 It is a schematic diagram of the server structure provided by an embodiment of this specification;
[0059] Figure 3 It is a schematic diagram of the structure of a resource data processing device based on quantum coding provided by an embodiment of this specification;
[0060] Figure 4 It is a schematic diagram of a preparation mixing line process provided by an embodiment of this specification;
[0061] Figure 5 This is a schematic diagram of a quantum gate process for quantum bits with the same integer provided by an embodiment of this specification;
[0062] Figure 6 It is a schematic diagram of a quantum gate flow chart of an inter-qubit interaction of a power-of-two integer provided by an embodiment of the present specification;
[0063] Figure 7 It is a schematic diagram of a quantum gate process of a quantum bit representing a non-power-of-two integer and a quantum bit representing a power-of-two integer provided by an embodiment of the present specification;
[0064] Figure 8 This is a schematic diagram of a quantum gate flow chart of the last quantum bit interaction provided by an embodiment of this specification;
[0065] Fig. 9 It is a schematic diagram of a quantum circuit diagram of a quantum approximate optimization algorithm provided by an embodiment of this specification. DETAILED DESCRIPTION
[0066] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0067] It should be noted that the user-related information and data involved in the embodiments of this specification are all information and data authorized by the user or fully authorized by relevant parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users or relevant parties to choose to authorize or refuse.
[0068] It should also be noted that in the embodiments of this specification, certain software, components, models and other existing solutions in the industry may be mentioned. They should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.
[0069] See also Figure 1 As shown, the embodiment of this specification provides a resource data processing method based on quantum coding. In specific implementation, the method may include the following contents:
[0070] S101: receiving a target processing request for a plurality of resource data; wherein the target processing request at least includes a configuration range of a resource data volume corresponding to each of the resource data;
[0071] S102: In response to the target processing request, quantum coding is performed according to a first upper limit value corresponding to each resource data, and an integer bit for quantum coding corresponding to the resource data amount of each resource data is determined, wherein the first upper limit value is a difference between an upper limit value and a lower limit value of a configuration range of the resource data amount corresponding to each resource data;
[0072] S103: using a preset resource data configuration model, according to the integer bits corresponding to each of the resource data, determining the configuration amount of the resource data amount corresponding to each of the resource data; wherein the preset resource data configuration model at least includes a mixing circuit, the mixing circuit is used to perform mixing processing on the quantum bits in the intermediate solution corresponding to the resource data amount through a preset quantum gate, the preset quantum gate includes a first quantum gate for performing mixing processing on the quantum bits corresponding to the same integer bits, and a second quantum gate for performing mixing processing on the quantum bits in a quantum bit combination, the quantum bit combination including quantum bits having a preset numerical relationship between the integer bits;
[0073] S104: Determine a target combination processing strategy for the plurality of resource data according to the configuration amount of the resource data amount corresponding to each of the resource data; and perform corresponding processing on the plurality of resource data according to the target combination processing strategy.
[0074] The resource data may be any asset such as stocks, financial products, etc., for which the resource data volume is to be configured. The configuration range of the resource data volume corresponding to the resource data may be determined based on the historical resource data configuration volume or expert experience. For example, taking the resource data including stock 1 and stock 2 as an example, the configuration range of the resource data volume corresponding to stock 1 may be [0, 6], and the configuration range of the resource data volume corresponding to stock 2 may be [2, 10].
[0075] Among them, the above-mentioned preset resource data configuration model can be a model containing hybrid lines constructed according to a quantum approximate optimization algorithm.
[0076] Specifically, an initial model may be constructed according to a quantum approximate optimization algorithm, and a hybrid circuit model may be introduced into the initial model to iteratively optimize quantum circuit parameters to obtain a resource data configuration model.
[0077] Among them, the above-mentioned quantum approximate optimization algorithm (Quantum Approximate Optimization Algorithm, QAOA) can be a hybrid classical-quantum algorithm, which is mainly used to solve complex combinatorial optimization problems.
[0078] The above-mentioned preset quantum gate can be a basic unit for operating a quantum bit, and can be used to change the state of a quantum bit through a linear transformation. The combination of quantum gates can form a quantum circuit for performing complex calculations. The above-mentioned hybrid circuit refers to a computing model that combines classical computing and quantum computing. Quantum bits and quantum gates can be used to process quantum information, and the parameters of the quantum circuit can be adjusted through feedback from classical computing, thereby enhancing the overall computing efficiency and performance.
[0079] Among them, the above-mentioned quantum bit can be the basic unit of quantum computing. A quantum bit can be in any linear superposition state of the states |0 and |1. It can not only be 0 or 1, but also a combination of these two states at the same time. This phenomenon is superposition.
[0080] Among them, the intermediate solution corresponding to the above-mentioned resource data volume can be the result generated after processing the resource data volume during the iterative process of quantum computing, that is, the intermediate solution can be a temporary solution generated in the process of gradual optimization.
[0081] Based on the above embodiments, on the one hand, since the integer bits for quantum coding corresponding to the resource data amount of each resource data are determined according to the configuration range of the resource data amount corresponding to each resource data, the solution generated by the resource data configuration model during the data processing process can be restricted by the integer bits to be within the configuration range of the resource data amount corresponding to each resource data. On the other hand, during the data processing process, the resource data configuration model can perform mixed processing on the corresponding quantum bits through the first quantum gate and the second quantum gate in the hybrid circuit, so as to effectively expand the solution space during the data processing process, avoid generating more invalid solutions in the absence of constraints, that is, the solution direction can be focused on the effective solution space, effectively reducing the scope of searching the solution space, further reducing the processing amount, and improving the efficiency and accuracy of resource data amount configuration.
[0082] In some embodiments, the method may further include the following contents when the preset resource data configuration model is used to determine the configuration amount of the resource data amount corresponding to each resource data according to the integer digit corresponding to each resource data:
[0083] S1: using the initial state circuit in the resource data configuration model, and determining an initial solution including the quantum bits corresponding to each resource data according to the integer bits corresponding to each resource data;
[0084] S2: using the phase separation circuit in the resource data configuration model, processing the initial solution to obtain the intermediate solution;
[0085] S3: using the hybrid circuit in the resource data configuration model, processing the intermediate solution to obtain a candidate solution;
[0086] S4: Determine the configuration amount of the resource data amount corresponding to each resource data according to the candidate solution.
[0087] The above-mentioned initial state circuit may refer to the first part of the quantum circuit, the purpose of which is to prepare the initial state of the quantum bit. Usually, the initial state may be a uniform superposition state.
[0088] The phase separation circuit can be part of a quantum circuit, and a specific phase gate can be applied to the quantum bit through the phase separation circuit to change the phase of the quantum state. Specifically, by adjusting the phase of the quantum state, the probability amplitude of some initial solutions can be increased, while the probability amplitude of other initial solutions can be reduced. In this way, the algorithm can be "guided" to search in the quantum state space to approach the potential optimal solution through the phase adjustment.
[0089] Based on the above embodiments, the quantum bits can be processed according to the integer bits according to the initial state circuit, the phase separation circuit and the hybrid circuit to quickly and accurately determine the configuration amount of the resource data amount corresponding to each of the resource data.
[0090] In some embodiments, the method of using the hybrid circuit in the resource data configuration model to process the intermediate solution to obtain a candidate solution may further include the following when the method is specifically implemented:
[0091] Determine whether there are any two quantum bits with the same integer bits in the intermediate solution, and if there are two quantum bits with the same integer bits in the intermediate solution, mix the two quantum bits through the first quantum gate to obtain the candidate solution.
[0092] Specifically, for example, taking the resource data as the investment share of stocks, assuming that in the intermediate solution, the investment share corresponding to stock 1 is 5, and the investment share corresponding to stock 2 is 7, wherein the configuration range of the resource data volume of stock 1 can be [0, 6], the configuration range of the resource data volume of stock 2 can be [0, 9], and the integer digits corresponding to stock 1 can be [1, 2, 3], and the integer digits corresponding to stock 2 can be [1, 2, 4, 2]. Then, in the intermediate solution, the quantum bits corresponding to the investment share 5 of stock 1 can be 011, and the quantum bits corresponding to the investment share 7 of stock 2 can be 1110.
[0093] Since the second integer digit of the integer digits of the investment share 5 of stock 1 is respectively the same as the second integer digit and the fourth integer digit of the integer digits of the investment share 7 of stock 2, the quantum bit corresponding to the second integer digit of the integer digits of the investment share 5 of stock 1 (i.e., "1") and the quantum bit corresponding to the second integer digit of the integer digits of the investment share 7 of stock 2 (i.e., "1") can be further mixed through the first quantum gate to obtain candidate solution 1. Among them, since the two quantum bits of the mixed processing are the same, candidate solution 1 can be the same as the intermediate solution, that is, candidate solution 1 can be "011" and "1110".
[0094] It can also be seen that the quantum bit corresponding to the second integer bit of the integer bit of the investment share 5 of stock 1 (i.e., "1") and the quantum bit corresponding to the fourth integer bit of the integer bit of the investment share 7 of stock 2 (i.e., "0") can be further mixed through the first quantum gate to obtain candidate solution 2. That is, candidate solution 2 can be "001" and "1111", so that the investment share of stock 1 in candidate solution 2 is 3, and the investment share of stock 2 is 9, which can ensure that the total investment share of the stocks in candidate solution 2 is the same as the total investment share of the stocks in the intermediate solution, that is, it can generate multiple valid candidate solutions while ensuring that the total investment share meets the configuration range of the total resource data volume unchanged.
[0095] In some embodiments, the method of using the hybrid circuit in the resource data configuration model to process the intermediate solution to obtain a candidate solution may further include the following when the method is specifically implemented:
[0096] S1: Determine whether there are multiple quantum bits in the intermediate solution whose sum of first integer bits is the same as that of second integer bits, where the first integer bit and the second integer bit are any integer bits in the intermediate solution;
[0097] S2: when there are multiple qubits in the intermediate solution whose sum of the first integer digits is the same as the second integer digit, construct the qubit combination according to the qubits corresponding to the multiple first integer digits and the qubits corresponding to the second integer digit;
[0098] S3: Performing partial mixing processing on the quantum bits in the quantum bit combination through the second quantum gate to obtain the candidate solution.
[0099] Specifically, for example, taking the resource data as the investment share of stocks, assuming that in the intermediate solution, the investment share corresponding to stock 1 is 5, and the investment share corresponding to stock 2 is 7, the integer digits corresponding to stock 1 can be [1, 2, 3], and the integer digits corresponding to stock 2 can be [1, 2, 4, 2]. Then, in the intermediate solution, the quantum bits corresponding to the investment share 5 of stock 1 can be 011, and the quantum bits corresponding to the investment share 7 of stock 2 can be 1110. For the integer digits corresponding to stock 1 and the integer digits corresponding to stock 2, there are multiple first integer digits [1, 1] whose sum is equal to the second integer digit [2]. The constructed quantum bit combination is 001, and the corresponding integer digits are [1, 1, 2].
[0100] Based on the above embodiments, the hybrid processing rule of the second quantum gate can be accurately summarized based on the sum value relationship between the integer bits corresponding to the resource data.
[0101] In some embodiments, the method for determining whether there are multiple qubits in the intermediate solution whose sum of the first integer digits is the same as the second integer digits may further include the following when implemented:
[0102] S1: Determine whether there is an integer digit of a power of two in the first resource data in the intermediate solution, the first resource data being any one of the plurality of resource data;
[0103] S2: In the case where the integer digit that is a power of two exists in the first resource data, the integer digit that is a power of two is determined as the second integer digit, and the integer digit preceding the second integer digit in the first resource data and the integer digit that is the same as the integer digit preceding the second integer digit in the adjacent resource data of the first resource data are determined as the first integer digit.
[0104] Specifically, for example, taking the resource data as the investment share of stocks, assuming that in the intermediate solution, the investment share corresponding to stock 1 is 5 (stock 1 can be the first resource), and the investment share corresponding to stock 2 is 7 (stock 2 can be the second resource), wherein the configuration range of the resource data volume of stock 1 can be [0, 6], the configuration range of the resource data volume of stock 2 can be [0, 9], and the integer digits corresponding to stock 1 can be [1, 2, 3], and the integer digits corresponding to stock 2 can be [1, 2, 4, 2]. Then, in the intermediate solution, the quantum bits corresponding to the investment share 5 of stock 1 can be 011, and the quantum bits corresponding to the investment share 7 of stock 2 can be 1110.
[0105] Since the second integer digit in the integer digits of the investment share 7 of stock 2 (i.e., the second resource) is 2, which is an integer digit raised to the power of two, the integer digit before the second integer digit in the first resource data (i.e., integer digit 1) and the integer digit that is the same as the integer digit before the second integer digit in the adjacent resource data of the first resource data (i.e., integer digit 1) are taken, and the final first integer digit can be [1,1].
[0106] Based on the above embodiments, quantum gates acting between quantum bits representing integers that are powers of two can be processed quickly and accurately.
[0107] In some embodiments, the method for determining whether there are multiple qubits in the intermediate solution whose sum of the first integer digits is the same as the second integer digits may further include the following when implemented:
[0108] S1: Determine whether the last integer digit of the first resource data in the intermediate solution is the same as the last integer digit of the second resource data, the first resource data being any one of the plurality of resource data, and the second resource data being resource data adjacent to the first resource data among the plurality of resource data;
[0109] S2: when the last integer digit of the first resource data and the last integer digit of the second resource data in the intermediate solution are different, obtain the difference between the last integer digit of the first resource data and the last integer digit of the second resource data, and the maximum value of the last integer digit of the first resource data and the last integer digit of the second resource data;
[0110] S3: determining target resource data in the first resource data and the second resource data according to the maximum value, and determining the last integer digit of the target resource data as the second integer digit;
[0111] S4: Determine the first integer bit from the integer bits of the target resource data according to the difference, and determine the last integer bit of the resource data other than the target resource data in the first resource data and the second resource data as the first integer bit.
[0112] Specifically, for example, the last integer bit corresponding to the first resource data in the intermediate solution is 3, and the last integer bit corresponding to the second resource data is 8. The difference between the last integer bit of the first resource data and the last integer bit of the second resource data is 8-3=5. Because the last integer bit corresponding to the second resource data is 8, which is greater than the last integer bit corresponding to the first resource data, which is 3, the target resource data is the second resource data. The first integer bit, i.e., 1 and 4, is determined from the integer bits of the target resource data according to the difference 5. That is, the first integer bit can be [3, 1, 4], and the second integer bit can be 8.
[0113] In some embodiments, corresponding integer digits can be found from multiple resources. For example, if the difference between the last integer digit of the first resource data and the last integer digit of the second resource data is 8-3=5, the data digits whose integer digits and value are 5 can be found from the third resource data. If they are not found in the third resource data, they can be found in the fourth resource data, and so on, until the corresponding integer digits and values meet the requirements.
[0114] Based on the above embodiment, the circuit of the quantum gate acting between the last quantum bits can be effectively processed.
[0115] In some embodiments, the quantum coding is performed according to the first upper limit value corresponding to each resource data, and the integer bits for quantum coding corresponding to the resource data amount of each resource data are determined. When the method is specifically implemented, the method may further include the following contents:
[0116] S1: Determine a target binary digit corresponding to the first upper limit value, and determine a first value according to the target binary digit;
[0117] S2: determining an auxiliary binary bit according to a difference between the first upper limit value and the first value;
[0118] S3: Determine, according to the target binary bit and the auxiliary binary bit, the integer bit for quantum coding corresponding to the resource data amount of each resource data.
[0119] Specifically, for example, assuming that the first upper limit value is 6, the target binary bit corresponding to the first upper limit value is [1, 2], and the first numerical value determined according to the target binary bit may be 1+2*2=3, then the difference between the first upper limit value and the first numerical value is 6-3=3, and then the auxiliary binary bit corresponding to the first upper limit value may be 3. Therefore, according to the target binary bit and the auxiliary binary bit, the integer bit determined may be [1, 2, 3].
[0120] Based on the above embodiments, any resource data can be quantum encoded to determine the integer bits.
[0121] In some embodiments, the method for determining whether there are multiple qubits in the intermediate solution whose sum of the first integer digits is the same as the second integer digits may further include the following when implemented:
[0122] S1: Determine whether there is an integer digit that is not a power of two among the integer digits of the first resource data in the intermediate solution, the first resource data being any one of the plurality of resource data;
[0123] S2: when there are integer digits that are not powers of two among the integer digits of the first resource data, determine the integer digits that are not powers of two among the integer digits of the first resource data as the second integer digits;
[0124] S3: Determine the integer digit in the first resource data whose sum of integer digits is the same as the second integer digit as the first integer digit.
[0125] Specifically, for example, taking the resource data as the investment share of stocks, assuming that in the intermediate solution, the investment share corresponding to stock 1 is 5, wherein the configuration range of the resource data amount of stock 1 can be [0, 6], and the integer digit corresponding to stock 1 can be [1, 2, 3], the integer digit that is not a power of two (i.e. 3) in the integer digits of the first resource data is determined as the second integer digit, and the integer digit (i.e. 3) that is the same as the second integer digit as the sum of the integer digits in the first resource data (i.e. 1+2) is determined as the first integer digit, that is, the first integer digit is [1, 2].
[0126] Based on the above embodiments, quantum bits representing integers that are not powers of two can be effectively processed.
[0127] As can be seen from the above, a resource data processing method based on quantum coding provided in an embodiment of the present specification receives a target processing request for multiple resource data; wherein the target processing request at least includes a configuration range of a resource data amount corresponding to each of the resource data; in response to the target processing request, quantum coding is performed according to a first upper limit value corresponding to each of the resource data, and an integer digit for quantum coding corresponding to the resource data amount of each of the resource data is determined, wherein the first upper limit value is a difference between an upper limit value and a lower limit value of the resource data amount configuration range corresponding to each of the resource data; using a preset resource data configuration model, according to the integer digit corresponding to each of the resource data, the integer digit corresponding to each of the resource data is determined. The configuration amount of resource data amount; wherein the preset resource data configuration model at least includes a mixing circuit, the mixing circuit is used to perform mixing processing on the quantum bits in the intermediate solution corresponding to the resource data amount through a preset quantum gate, the preset quantum gate includes a first quantum gate used to perform mixing processing on the quantum bits corresponding to the same integer bit, and a second quantum gate used to perform mixing processing on the quantum bits in a quantum bit combination, the quantum bit combination includes quantum bits with a preset numerical relationship between the integer bits; according to the configuration amount of the resource data amount corresponding to each of the resource data, determine the target combination processing strategy for the multiple resource data; and according to the target combination processing strategy, perform corresponding processing on the multiple resource data. In this way, on the one hand, since the integer bits for quantum coding corresponding to the resource data amount of each resource data are determined according to the configuration range of the resource data amount corresponding to each resource data, the solution generated by the resource data configuration model during the data processing process can be restricted by the integer bits to be within the configuration range of the resource data amount corresponding to each resource data. On the other hand, during the data processing process, the resource data configuration model can perform mixed processing on the corresponding quantum bits through the first quantum gate and the second quantum gate in the hybrid circuit, so as to effectively expand the solution space during the data processing process, avoid generating more invalid solutions in the absence of constraints, that is, the solution direction can be focused on the effective solution space, effectively reducing the scope of searching the solution space, further reducing the processing amount, and improving the efficiency and accuracy of resource data amount configuration.
[0128] See also Figure 2 As shown, the embodiment of this specification also provides a specific server, wherein the server includes a network communication port 201, a processor 202 and a memory 203, and the above structures are connected through internal cables so that each structure can perform specific data interaction.
[0129] The network communication port 201 may be specifically used to receive a target processing request for a plurality of resource data; wherein the target processing request at least includes a configuration range of a resource data volume corresponding to each of the resource data.
[0130] The processor 202 may be specifically configured to respond to the target processing request, perform quantum coding according to a first upper limit value corresponding to each of the resource data, and determine integer bits for quantum coding corresponding to the resource data amount of each of the resource data, wherein the first upper limit value is a difference between an upper limit value and a lower limit value of a configuration range of the resource data amount corresponding to each of the resource data; determine the configuration amount of the resource data amount corresponding to each of the resource data according to the integer bits corresponding to each of the resource data using a preset resource data configuration model; wherein the preset resource data configuration model at least includes a hybrid circuit, the hybrid circuit is used to perform hybrid processing on quantum bits in an intermediate solution corresponding to the resource data amount through a preset quantum gate, the preset quantum gate includes a first quantum gate for performing hybrid processing on quantum bits corresponding to the same integer bit, and a second quantum gate for performing hybrid processing on quantum bits in a quantum bit combination, the quantum bit combination including quantum bits having a preset numerical relationship between integer bits; determine a target combination processing strategy for the multiple resource data according to the configuration amount of the resource data amount corresponding to each of the resource data; and perform corresponding processing on the multiple resource data according to the target combination processing strategy.
[0131] The memory 203 may be specifically used to store corresponding instruction programs.
[0132] Based on the above method, the relevant structural performance of the server can be effectively utilized, the data processing speed of the server can be improved, and the resource data processing method based on quantum coding can be efficiently implemented.
[0133] In this embodiment, the network communication port 201 can be a virtual port that is bound to different communication protocols so that different data can be sent or received. For example, the network communication port can be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for email data communication. In addition, the network communication port can also be a physical communication interface or communication chip. For example, it can be a wireless mobile network communication chip, such as GSM, CDMA, etc.; it can also be a Wifi chip; it can also be a Bluetooth chip.
[0134] In this embodiment, the processor 202 may be implemented in any appropriate manner. For example, the processor may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, etc. This specification does not limit this.
[0135] In this embodiment, the memory 203 may include multiple levels. In a digital system, anything that can store binary data can be a memory; in an integrated circuit, a circuit with a storage function that has no physical form is also called a memory, such as RAM, FIFO, etc.; in a system, a storage device with a physical form is also called a memory, such as a memory stick, TF card, etc.
[0136] The embodiment of the present specification also provides a computer-readable storage medium based on the above-mentioned resource data processing method based on quantum coding, wherein the computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed, the following are implemented: receiving a target processing request for multiple resource data; wherein the target processing request at least includes a configuration range of the resource data volume corresponding to each of the resource data; in response to the target processing request, performing quantum coding according to a first upper limit value corresponding to each of the resource data, and determining an integer bit for quantum coding corresponding to the resource data volume of each of the resource data, wherein the first upper limit value is the difference between the upper limit value and the lower limit value of the resource data volume configuration range corresponding to each of the resource data; using a preset resource data configuration model, according to each of the resource data The preset resource data configuration model at least includes a hybrid circuit, and the hybrid circuit is used to perform hybrid processing on quantum bits in the intermediate solution corresponding to the resource data through a preset quantum gate, and the preset quantum gate includes a first quantum gate used to perform hybrid processing on quantum bits corresponding to the same integer bit, and a second quantum gate used to perform hybrid processing on quantum bits in a quantum bit combination, and the quantum bit combination includes quantum bits with a preset numerical relationship between integer bits; according to the configuration amount of the resource data amount corresponding to each resource data, a target combination processing strategy for the multiple resource data is determined; and according to the target combination processing strategy, the multiple resource data are processed accordingly.
[0137] In this embodiment, the storage medium includes, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a cache, a hard disk (HDD), or a memory card. The memory may be used to store computer program instructions. The network communication unit may be an interface for network connection communication set in accordance with the standard specified by the communication protocol.
[0138] In this embodiment, the functions and effects specifically implemented by the program instructions stored in the computer-readable storage medium can be explained in comparison with other implementations and will not be described in detail here.
[0139] The embodiment of the present specification also provides a computer program product, which at least includes a computer program. When the computer program is executed by a processor, the following method steps are implemented: receiving a target processing request for multiple resource data; wherein the target processing request at least includes a configuration range of the resource data volume corresponding to each of the resource data; in response to the target processing request, performing quantum coding according to a first upper limit value corresponding to each of the resource data, and determining an integer bit for quantum coding corresponding to the resource data volume of each of the resource data, wherein the first upper limit value is a difference between an upper limit value and a lower limit value of the resource data volume configuration range corresponding to each of the resource data; using a preset resource data configuration model, determining, according to the integer bit corresponding to each of the resource data a configuration amount of resource data volume corresponding to each resource data; wherein the preset resource data configuration model at least includes a mixing circuit, the mixing circuit is used to perform mixing processing on quantum bits in the intermediate solution corresponding to the resource data volume through a preset quantum gate, the preset quantum gate includes a first quantum gate used to perform mixing processing on quantum bits corresponding to the same integer bit, and a second quantum gate used to perform mixing processing on quantum bits in a quantum bit combination, the quantum bit combination including quantum bits with a preset numerical relationship between integer bits; according to the configuration amount of resource data volume corresponding to each resource data, a target combination processing strategy for the multiple resource data is determined; and according to the target combination processing strategy, the multiple resource data are processed accordingly.
[0140] See also Figure 3 At the software level, the embodiment of this specification also provides a resource data processing device based on quantum coding, which may specifically include the following structural modules:
[0141] The request receiving module 301 is used to receive a target processing request for multiple resource data; wherein the target processing request at least includes a configuration range of the resource data volume corresponding to each resource data;
[0142] A request response module 302 is used to respond to the target processing request, perform quantum coding according to a first upper limit value corresponding to each resource data, and determine an integer bit for quantum coding corresponding to the resource data amount of each resource data, wherein the first upper limit value is a difference between an upper limit value and a lower limit value of a configuration range of the resource data amount corresponding to each resource data;
[0143] A resource data configuration determination module 303 is used to determine the configuration amount of the resource data amount corresponding to each resource data according to the integer bits corresponding to each resource data by using a preset resource data configuration model, wherein the preset resource data configuration model at least includes a mixing circuit, and the mixing circuit is used to perform mixing processing on the quantum bits in the intermediate solution corresponding to the resource data amount through a preset quantum gate, and the preset quantum gate includes a first quantum gate for performing mixing processing on the quantum bits corresponding to the same integer bits, and a second quantum gate for performing mixing processing on the quantum bits in a quantum bit combination, wherein the quantum bit combination includes quantum bits having a preset numerical relationship between the integer bits;
[0144] The combination strategy determination module 304 is used to determine the resource data configuration combination strategy for the plurality of resource data according to the configuration amount of the resource data amount corresponding to each of the resource data.
[0145] In some embodiments, the above-mentioned resource data configuration determination module 303, when implemented specifically, utilizes the initial state circuit in the resource data configuration model to determine the initial solution containing the quantum bits corresponding to each of the resource data according to the integer bits corresponding to each of the resource data; utilizes the phase separation circuit in the resource data configuration model to process the initial solution to obtain the intermediate solution; a candidate solution determination module is used to utilize the hybrid circuit in the resource data configuration model to process the intermediate solution to obtain a candidate solution; and determines the configuration amount of the resource data amount corresponding to each of the resource data according to the candidate solution.
[0146] In some embodiments, the candidate solution determination module, when implemented, determines whether there are any two quantum bits with the same integer bits in the intermediate solution, and if there are any two quantum bits with the same integer bits in the intermediate solution, mixes the two quantum bits through the first quantum gate to obtain the candidate solution.
[0147] In some embodiments, the above-mentioned candidate solution determination module, when specifically implemented, is an integer digit sum determination module, used to determine whether there are multiple quantum bits in the intermediate solution whose sum values of multiple first integer digits are the same as those of the second integer digits, and the first integer digits and the second integer digits are any integer digits in the intermediate solution; when there are multiple quantum bits in the intermediate solution whose sum values of multiple first integer digits are the same as those of the second integer digits, construct the quantum bit combination according to the quantum bits corresponding to the multiple first integer digits and the quantum bits corresponding to the second integer digits; and through the second quantum gate, partially mix the quantum bits in the quantum bit combination to obtain the candidate solution.
[0148] In some embodiments, the above-mentioned integer digit and value determination module, when specifically implemented, determines whether there is an integer digit that is a power of two in the first resource data in the intermediate solution, and the first resource data is any one of the multiple resource data; in the case that the integer digit that is a power of two exists in the first resource data, the integer digit that is a power of two is determined as the second integer digit, and the integer digit preceding the second integer digit in the first resource data, and the integer digit in the adjacent resource data of the first resource data that is the same as the integer digit preceding the second integer digit are determined as the first integer digit.
[0149] In some embodiments, the above-mentioned integer digit and value determination module, when specifically implemented, determines whether the last integer digit of the first resource data in the intermediate solution is the same as the last integer digit of the second resource data, the first resource data being any one of the multiple resource data, and the second resource data being resource data adjacent to the first resource data among the multiple resource data; when the last integer digit of the first resource data in the intermediate solution is different from the last integer digit of the second resource data, obtains the difference between the last integer digit of the first resource data and the last integer digit of the second resource data, and the maximum value between the last integer digit of the first resource data and the last integer digit of the second resource data; determines the target resource data in the first resource data and the second resource data according to the maximum value, and determines the last integer digit of the target resource data as the second integer digit; determines the first integer digit from the integer digits of the target resource data according to the difference, and determines the last integer digit of the resource data other than the target resource data in the first resource data and the second resource data as the first integer digit.
[0150] In some embodiments, the above-mentioned integer bit determination module, when specifically implemented, determines a target binary bit corresponding to the first upper limit value, and determines a first numerical value according to the target binary bit; determines an auxiliary binary bit according to a difference between the first upper limit value and the first numerical value; and determines an integer bit for quantum coding corresponding to the resource data amount of each resource data according to the target binary bit and the auxiliary binary bit.
[0151] In some embodiments, the above-mentioned integer digit sum value determination module, when specifically implemented, determines whether there are integer digits that are not a power of two among the integer digits of the first resource data in the intermediate solution, the first resource data being any one of the multiple resource data; in the case that there are integer digits that are not a power of two among the integer digits of the first resource data, the integer digits that are not a power of two among the integer digits of the first resource data are determined as the second integer digits; and the integer digit whose sum of the integer digits in the first resource data is the same as the second integer digit is determined as the first integer digit.
[0152] As can be seen from the above, based on the resource data processing device based on quantum coding provided by the embodiment of this specification, on the one hand, since the integer bits for quantum coding corresponding to the resource data amount of each resource data are determined according to the configuration range of the resource data amount corresponding to each resource data, the solution generated by the resource data configuration model during the data processing process can be restricted by the integer bits to be within the configuration range of the resource data amount corresponding to each resource data. On the other hand, during the data processing process, the resource data configuration model can perform mixed processing on the corresponding quantum bits through the first quantum gate and the second quantum gate in the hybrid circuit, so as to effectively expand the solution space during the data processing process, avoid generating more invalid solutions in the absence of constraints, that is, the solution direction can be focused on the effective solution space, effectively reducing the scope of searching the solution space, further reducing the processing amount, and improving the efficiency and accuracy of resource data amount configuration.
[0153] It should be noted that the units, devices or modules described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described separately by functions divided into various modules. Of course, when implementing this specification, the functions of each module can be implemented in the same or more software and / or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0154] In a specific scenario example, a resource data processing method based on quantum coding provided in this specification can be applied, and a preset resource data configuration model is used to determine the configuration amount of resource data corresponding to each resource data, and then determine the target combination strategy of resource data for multiple resource data, so that the configuration amount of resource data corresponding to each resource data can meet the resource data amount configuration range, thereby effectively reducing the scope of the search solution space and improving the efficiency and accuracy of resource data configuration. The specific implementation process may include the following content.
[0155] A hard-constrained Ansatz operator is designed around the published Palmer code, and a quantum approximate optimization algorithm (QAOA) is constructed around the operator.
[0156] Resource data combination optimization can be classified into the following mathematical models:
[0157]
[0158] in, is an n-dimensional vector whose every element is 1; is the share vector of the decision maker's investment in each asset. It is the desired solution to the problem, and its dimension is equal to the number of assets n. An element x of x i Represents the decision maker holding a share x of asset i i , in particular, x i = 0 means that the decision maker does not hold asset i; Obviously, we need the total investment share to be 1, so we need This constraint. ; is the covariance matrix of the returns of each asset; is the expected return rate vector of each asset; η∈[0,1] is the coefficient that measures the risk preference of investment decision makers. The smaller η is, the more willing the decision maker is to take higher risks to obtain higher expected returns; l and u are the lower and upper bound constraints of the investment share vector, respectively, satisfying the condition 0≤l i ≤x i ≤u i ≤1,1≤i≤n,i is an integer. It is worth mentioning that, considering the constraint of the minimum investment share, the value range of the investment share vector x in the model will no longer be continuous, but a discrete subspace of the real space related to the minimum investment share m In applications, we generally only consider For example, continuing with the above asset A, assuming it is the kth of all assets, and the minimum investment share m = 0.01, then 0.05 = l k ≤x k ≤u k =0.15,x k ∈{0.05,0.06,0.07,…,0.15}. That is, the xth solution of the mathematical model k The elements of need to be between {0.05,0.06,0.07,…,0.15}.
[0159] Quantum computing can only solve the optimization model of binary variables of 0 / 1. Therefore, a coding scheme is needed to convert the problem variable x i and binary variables is associated with n i +1 qubit to encode variable x i The Palmer coding scheme is as follows:
[0160]
[0161] Among them, m represents the minimum investment share, is a binary encoding vector whose elements are either 0 or 1. The value of M is equal to Therefore, Palmer coding is i,j =0 when the minimum value l is taken i , in all b i,j =1 when u takes the maximum value i . And its precision is separated by m.
[0162] When the variable x i The number of quantum bits is determined by the above formula, and x can be limited i The upper and lower bounds of x iDiscretization does not require any changes to the quantum circuit. Therefore, substituting (2) into (1) the optimization model becomes the following form:
[0163]
[0164] Among them, σ i,j , e i and t are known constants that can be calculated by η, Σ, μ, l, u. The above equation is a constrained quadratic programming problem.
[0165] When the input quantum state satisfies When , each basis state in the output quantum state (which may be a superposition state) satisfies
[0166] In some embodiments, before preparing the hybrid circuit, the method may include:
[0167] S1: prepare quantum bits and encode them;
[0168] Pre-encode, for the i-th asset, prepare n i +1 qubit, where the jth qubit of the ith asset is denoted by b i,j . By the constraints The previous coefficients can be considered as: <n i Quantum bit b i,j Represents the integer 2 j ;and Indicates M i .
[0169] S2: preparing the initial state circuit and the phase separation circuit;
[0170] Use the traditional QAOA algorithm to prepare the initial state circuit and the phase separation circuit. The preparation of the initial circuit requires that the initial quantum state satisfies the following formula:
[0171]
[0172] S3: preparing a mixed circuit;
[0173] See also Figure 4 As shown, the hybrid circuit includes: quantum gates between quantum bits of the same integer, quantum gates between quantum bits representing integers that are powers of two, quantum gates between quantum bits representing integers that are not powers of two and quantum bits representing integers that are powers of two, and the last quantum gate between quantum bits.
[0174] Among them, the quantum gates acting between the quantum bits of the same integer are specifically implemented as follows: Figure 5 As shown:
[0175] a. Let the set of all qubits representing 1 be A1. For each odd-numbered qubit in A1 and the next qubit, apply circ-1; then for each even-numbered qubit in A1 and the next qubit, apply circ-1; finally, for the last qubit and the first qubit in A1, apply circ-1.
[0176] b. Let the set of all qubits representing 2 be A2. For each odd-numbered qubit in A2 and the next qubit, apply circ-1; then for each even-numbered qubit in A2 and the next qubit, apply circ-1; finally, for the last qubit and the first qubit in A2, apply circ-1.
[0177] c. Continue this process to represent 4, 8, 16, and even the largest integer that is a power of 2 in the first step. As long as there are more than two integers in the set, perform operations similar to those in 1.b.
[0178] Among them, the quantum gate representing the inter-qubit interaction of the integer of the power of two is specifically implemented as follows: Figure 6 As shown:
[0179] a. For each asset i and its previous asset i-1 (if the asset is the first asset, then its previous asset is considered to be the last asset), examine b i,1 Does it mean 2? If circ-2 is executed on b i,0 , b i-1,0 , b i,1 Otherwise, it will not be executed.
[0180] b. For each asset i and its previous asset i-1 (if the asset is the first asset, then its previous asset is considered to be the last asset), examine b i,2 Is it the last qubit of the asset? If so, skip the asset; if not, determine b i,2 Does it mean 4: If not, skip the asset; if yes, then proceed to b i-1,1 Does it exist and represent 2; if so, execute circ-2 at b i,1 , b i-1,1 , b i,2 ; If not, execute circ-3 at b i,1 , b i,0 , b i-1,0 , b i,2 .
[0181] c. Similarly, for all j = 3, 4, ..., as long as 2 jFor each asset i and its previous asset i-1 (if the asset is the first asset, then its previous asset is considered to be the last asset), we examine b i,j Is it the last qubit of the asset? If so, skip the asset; if not, determine b i,j Does it mean 2? j : If not, skip the asset; if yes, then proceed to judge b i-1,j-1 Does it exist and indicates 2 j-1 : If yes, execute circ-2 at b i,j-1 , b i-1,j-1 , b i,j If not, record h i-1 =n i-1 -1, then execute circ-(jh i-1 +1) in b i,j-1 , …, b i,j .
[0182] The quantum bit representing a non-power-of-two integer and the quantum bit representing a power-of-two integer act as a quantum gate. When specifically implemented, refer to Figure 7 As shown:
[0183] a. For each asset i, if its last quantum bit M i If it is not a power of two, after binarization, it can be calculated as the sum of integers that are powers of two. For example, 6 = 2 + 4, 9 = 8 + 1. The quantum bits representing these integers that are powers of two are A total of i Then the effect circ-r i At and
[0184] Among them, the above-mentioned last quantum bit interaction quantum gate, when specifically implemented, refers to Figure 8 As shown:
[0185] For each asset i, the last qubit M i and the last qubit of its previous asset i-1 M i-1 If M i >M i-1 , then we must find an integer representing a power of two in the quantum bit of the i-th asset so that its sum equals M i -M i-1 These quantum bits are denoted as A total of iThen the effect circ-r i +1 on and If M i <M i-1 , then we must find an integer representing a power of two in the quantum bit of the i-1th asset so that its sum equals M i-1 -M i These quantum bits are denoted as A total of i-1 Then the effect circ-r i-1 +1 on and
[0186] S4: Synthesize QAOA lines and determine optimal parameters by classical methods;
[0187] See also Fig. 9 As shown, the initial state line, phase separation line and hybrid line are spliced into a QAOA line. The optimal parameters are obtained by presetting the classical algorithm. Finally, the QAOA line is measured to obtain the optimal solution.
[0188] Based on the above embodiments, it can be ensured that the calculation process of the quantum approximate optimization algorithm always complies with the total investment limit and the upper and lower bound limits, effectively reducing the scope of the search solution space.
[0189] Although the present specification provides method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent a unique execution order. When the device or client product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. The first, second, etc. words are used to represent the name, and do not represent any particular order.
[0190] Those skilled in the art also know that, in addition to implementing the controller in a purely computer-readable program code, the controller can be made to implement the same function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered as a hardware component, and the devices for implementing various functions included therein can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules for implementing the method and structures within the hardware component.
[0191] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer-readable storage media including storage devices.
[0192] Through the description of the above embodiments, it can be known that those skilled in the art can clearly understand that the present specification can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present specification can essentially be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in each embodiment of the present specification or some parts of the embodiments.
[0193] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. This specification can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable servers, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0194] Although the present specification is described through embodiments, those skilled in the art will appreciate that there are many modifications and changes to the present specification without departing from the spirit of the present specification, and it is intended that the appended claims include these modifications and changes without departing from the spirit of the present specification.
Claims
1. A resource data processing method based on quantum coding, characterized in that: The method comprises: Receiving a target processing request for a plurality of resource data; wherein the target processing request at least includes a configuration range of a resource data volume corresponding to each of the resource data; In response to the target processing request, quantum coding is performed according to a first upper limit value corresponding to each of the resource data, and an integer bit for quantum coding corresponding to the resource data amount of each of the resource data is determined, wherein the first upper limit value is a difference between an upper limit value and a lower limit value of a configuration range of the resource data amount corresponding to each of the resource data; Determine the configuration amount of the resource data amount corresponding to each resource data according to the integer bits corresponding to each resource data by using a preset resource data configuration model; wherein the preset resource data configuration model at least includes a mixing circuit, the mixing circuit is used to perform mixing processing on the quantum bits in the intermediate solution corresponding to the resource data amount through a preset quantum gate, the preset quantum gate includes a first quantum gate for performing mixing processing on the quantum bits corresponding to the same integer bits, and a second quantum gate for performing mixing processing on the quantum bits in a quantum bit combination, the quantum bit combination including quantum bits having a preset numerical relationship between the integer bits; According to the configuration amount of the resource data amount corresponding to each resource data, a target combination processing strategy for the multiple resource data is determined; and according to the target combination processing strategy, the multiple resource data are processed accordingly.
2. The method according to claim 1, characterized in that The using of the preset resource data configuration model to determine the configuration amount of the resource data amount corresponding to each resource data according to the integer digit corresponding to each resource data includes: Using the initial state circuit in the resource data configuration model, and according to the integer bits corresponding to each resource data, determining an initial solution including the quantum bits corresponding to each resource data; Processing the initial solution using the phase separation circuit in the resource data configuration model to obtain the intermediate solution; Processing the intermediate solution using a hybrid circuit in the resource data configuration model to obtain a candidate solution; According to the candidate solutions, a configuration amount of the resource data amount corresponding to each resource data is determined.
3. The method according to claim 2, characterized in that The step of utilizing the hybrid circuit in the resource data configuration model to process the intermediate solution to obtain a candidate solution includes: Determine whether there are any two quantum bits with the same integer bits in the intermediate solution, and if there are two quantum bits with the same integer bits in the intermediate solution, mix the two quantum bits through the first quantum gate to obtain the candidate solution.
4. The method according to claim 3, characterized in that: The step of utilizing the hybrid circuit in the resource data configuration model to process the intermediate solution to obtain a candidate solution includes: Determine whether there are multiple quantum bits in the intermediate solution whose sum of the first integer digits is the same as the second integer digit, where the first integer digit and the second integer digit are any integer digits in the intermediate solution; When there are multiple qubits in the intermediate solution whose sum of the first integer digits is the same as the second integer digit, constructing the qubit combination according to the qubits corresponding to the multiple first integer digits and the qubits corresponding to the second integer digit; The candidate solution is obtained by performing partial mixing processing on the quantum bits in the quantum bit combination through the second quantum gate.
5. The method according to claim 4, characterized in that The determining whether there are a plurality of quantum bits in the intermediate solution whose sum of the first integer bits is the same as the second integer bit comprises: Determine whether there is an integer digit of a power of two in the first resource data in the intermediate solution, the first resource data being any one of the plurality of resource data; In the case where the integer digit of the power of two exists in the first resource data, the integer digit of the power of two is determined as the second integer digit, and the integer digit preceding the second integer digit in the first resource data and the integer digit identical to the integer digit preceding the second integer digit in the adjacent resource data of the first resource data are determined as the first integer digit.
6. The method according to claim 4, characterized in that The determining whether there are a plurality of quantum bits in the intermediate solution whose sum of the first integer bits is the same as the second integer bit comprises: Determine whether the last integer digit of the first resource data in the intermediate solution is the same as the last integer digit of the second resource data, the first resource data being any one of the plurality of resource data, and the second resource data being resource data adjacent to the first resource data among the plurality of resource data; In the case where the last integer digit of the first resource data and the last integer digit of the second resource data in the intermediate solution are different, obtaining a difference between the last integer digit of the first resource data and the last integer digit of the second resource data, and a maximum value between the last integer digit of the first resource data and the last integer digit of the second resource data; Determine the target resource data in the first resource data and the second resource data according to the maximum value, and determine the last integer digit of the target resource data as the second integer digit; The first integer bit is determined from the integer bits of the target resource data according to the difference, and the last integer bit of resource data other than the target resource data in the first resource data and the second resource data is determined as the first integer bit.
7. The method according to claim 1, characterized in that The step of performing quantum coding according to the first upper limit value corresponding to each resource data, and determining the integer bits for quantum coding corresponding to the resource data amount of each resource data, comprises: Determine a target binary digit corresponding to the first upper limit value, and determine a first numerical value according to the target binary digit; determining an auxiliary binary bit according to a difference between the first upper limit value and the first value; According to the target binary bit and the auxiliary binary bit, an integer bit for quantum coding corresponding to the resource data amount of each resource data is determined.
8. The method according to claim 4, characterized in that The determining whether there are a plurality of quantum bits in the intermediate solution whose sum of the first integer bits is the same as the second integer bit comprises: Determine whether there is an integer digit that is not a power of two among the integer digits of the first resource data in the intermediate solution, the first resource data being any one of the plurality of resource data; In the case that there are integer digits that are not powers of two among the integer digits of the first resource data, determining the integer digits that are not powers of two among the integer digits of the first resource data as the second integer digits; The integer digits whose sum of integer digits in the first resource data is the same as the second integer digits are determined as the first integer digits.
9. A resource data processing device based on quantum coding, characterized in that: include: A request receiving module, used for receiving a target processing request for a plurality of resource data; wherein the target processing request at least includes a configuration range of a resource data volume corresponding to each of the resource data; a request response module, configured to respond to the target processing request, perform quantum coding according to a first upper limit value corresponding to each of the resource data, and determine an integer bit for quantum coding corresponding to the resource data amount of each of the resource data, wherein the first upper limit value is a difference between an upper limit value and a lower limit value of a configuration range of the resource data amount corresponding to each of the resource data; a resource data configuration determination module, configured to determine the configuration amount of the resource data amount corresponding to each resource data according to the integer bits corresponding to each resource data by using a preset resource data configuration model, wherein the preset resource data configuration model at least includes a mixing circuit, wherein the mixing circuit is used to perform mixing processing on the quantum bits in the intermediate solution corresponding to the resource data amount through a preset quantum gate, wherein the preset quantum gate includes a first quantum gate for performing mixing processing on the quantum bits corresponding to the same integer bits, and a second quantum gate for performing mixing processing on the quantum bits in a quantum bit combination, wherein the quantum bit combination includes quantum bits having a preset numerical relationship between the integer bits; The combination strategy determination module is used to determine the resource data configuration combination strategy for the multiple resource data according to the configuration amount of the resource data amount corresponding to each of the resource data.
10. The device according to claim 9, characterized in that The resource data configuration determination module is used to: Using the initial state circuit in the resource data configuration model, and according to the integer bits corresponding to each resource data, determining an initial solution including the quantum bits corresponding to each resource data; Processing the initial solution using the phase separation circuit in the resource data configuration model to obtain the intermediate solution; Processing the intermediate solution using a hybrid circuit in the resource data configuration model to obtain a candidate solution; According to the candidate solutions, a configuration amount of the resource data amount corresponding to each resource data is determined.
11. The device according to claim 10, characterized in that The resource data configuration determination module is used to: Determine whether there are any two quantum bits with the same integer bits in the intermediate solution, and if there are two quantum bits with the same integer bits in the intermediate solution, mix the two quantum bits through the first quantum gate to obtain the candidate solution.
12. The device according to claim 11, characterized in that The request response module is used to: Determine a target binary digit corresponding to the first upper limit value, and determine a first numerical value according to the target binary digit; determining an auxiliary binary bit according to a difference between the first upper limit value and the first value; According to the target binary bit and the auxiliary binary bit, an integer bit for quantum coding corresponding to the resource data amount of each resource data is determined.
13. A server, characterized in that: The method comprises a processor and a memory for storing processor-executable instructions, wherein the processor implements the steps of the method according to any one of claims 1 to 8 when executing the instructions.
14. A computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and when the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
15. A computer program product, characterized in that The invention comprises a computer program, which implements the steps of the method according to any one of claims 1 to 8 when being executed by a processor.