Multi-strategy combined key search method and device based on Grover's algorithm
Through a multi-strategy combination method based on the Grover algorithm, including key space grouping, probability distribution initial state construction and multiple rounds of search, combined with the particle swarm optimization algorithm, the problems of excessive computing resources and low efficiency in key search are solved, and the key search efficiency is significantly improved.
Patent Information
- Application Number
- CN202310374585.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-10
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2043-04-10
AI Technical Summary
The prior art has problems such as excessive computing resources and low search efficiency in key searches. Especially when the key space is massive and the probability distribution is uneven, it is difficult to directly apply the improved method of Umut Cal1ky1lmaz.
Using a multi-strategy combination method based on the Grover algorithm, the number of iterations is optimized to improve search efficiency by grouping key spaces and constructing initial states based on probability distribution, multiple rounds of search and particle swarm optimization algorithms.
It reduces the number of iterations of key search, reduces the demand for computing resources, and significantly improves the efficiency of key search.
Smart Images

Figure CN116389124B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of key search, and particularly relates to a multi-strategy combined key search method and device based on the Grover algorithm. Background Art
[0002] Key search is a cryptanalysis technique that attempts to crack encrypted data by exhaustively trying all possible keys. In symmetric-key encryption, key search is a very effective attack method because once the correct key is found, the protected data can be easily decrypted. However, in practice, due to the extremely large possible key space, key search is usually very difficult unless the attacker has extremely powerful computing capabilities and time resources.
[0003] The task of key search is to attempt to crack encrypted data by exhaustively trying all possible keys. In symmetric-key encryption, this generally means enumerating the entire key space, that is, decrypting with all possible keys and verifying which key can successfully decrypt the protected data. It is extremely difficult to find a key that meets certain requirements from a key set containing a vast number of elements because these keys are not arranged in an orderly manner as required and the quantity is large. If a classical algorithm is used for key search, it can only try one key by one, and the complexity required for the search is O(N).
[0004] In 1996, Lov Grover proposed the Grover algorithm to reduce the time complexity of solving the random database search problem to The logic of the Grover algorithm for searching for a target object is generally to find the target X in an unordered data set. First, prepare a superposition state of all quantum states, and then perform Grover iteration operations on the quantum state in a loop; after several iteration operations are executed, the quantum state is rotated to the target state; finally, measure the obtained result probability and find that the probability of the target X appearing approaches 1. At this time, the target X can be found through the Grover algorithm. Generally, if you want to find the corresponding information among N pieces of information, perform operations, and the probability obtained by measurement approaches 1. Therefore, the main steps of the Grover algorithm for unordered search are three: preparing the quantum state, Grover iteration, and measurement.
[0005] The classical Grover's algorithm is applicable to search problems in all cases. However, in the key search problem, the key space is often not completely disordered. On this premise, the time complexity of solving the key search problem can be further reduced. In 2011, Ashley Montanaro proposed an idea of grouping and searching a data set with non-uniform probability distribution, which reduced the time complexity of solving the search problem by a constant level compared with the classical Grover's algorithm, and even achieved exponential acceleration in specific cases. In 2022, Umut Cal1ky1lmaz also proposed two new ideas for data sets with non-uniform probability distribution: one is to prepare the initial quantum state of Grover's algorithm according to the original probability of the data set, that is, in this algorithm, the initial state of key search is not of equal amplitude; the other is that the algorithm adopts a multi-round search technique, and after setting the initial number of rounds, calculate the optimal number of iterations for each round. This algorithm improves the classical Grover's algorithm using the above two ideas, making the time complexity of the search problem decrease by a constant level, and the improvement effect is different for different probability distributions. The more uneven the probability distribution is, the more obvious the improvement effect is.
[0006] However, there is still a problem in the idea proposed by Umut Cal1ky1lmaz, that is, the difficulty of preparing the initial quantum state is relatively large. Since the data in the key space in the key search problem is huge, the computing resources required to calculate the optimal probability amplitude of the initial quantum state are too large. Therefore, the idea proposed by Umut Cal1ky1lmaz cannot be directly applied to the key search problem. In order to further solve the key search problem, we combined the ideas of Ashley Montanaro and Umut Cal1ky1lmaz, and proposed a key search method combining multiple strategies based on the classical Grover's algorithm. Summary of the Invention
[0007] Aiming at the problems existing in the prior art, the present invention proposes a key search method and device combining multiple strategies based on Grover's algorithm. Based on Grover's algorithm and adopting the idea of combining multiple strategies, the key search efficiency is effectively improved.
[0008] In order to achieve the above purpose, the present invention adopts the following technical solutions:
[0009] The present invention provides a key search method combining multiple strategies based on Grover's algorithm, which includes the following steps:
[0010] Sort the given key space in descending order according to the probability that the key is the target key, and then divide it into several intervals according to the grouping strategy;
[0011] Construct new initial states respectively according to the probability distribution of each key being the target key in each interval;
[0012] Conduct multiple rounds of searches for each interval, and set the number of rounds of key searches for each interval;
[0013] If the target key exists in a certain interval, obtain the expected number of iterations to search for the target key in this interval through mathematical derivation;
[0014] Derive the total expected number of iterations required to obtain the target key according to the expected number of iterations of a single interval;
[0015] Aim at the minimum total expected number of iterations, and use the particle swarm optimization algorithm to obtain the optimal parameter values;
[0016] Conduct multiple rounds of searches for the key space according to the optimal parameter values obtained above.
[0017] According to the multi-strategy combined key search method based on the Grover algorithm of the present invention, preferably, group and divide into several intervals according to the grouping strategy, where the grouping strategy is average grouping, linear grouping or power grouping; the average grouping is to divide the key space into several intervals of equal length, the interval length of the grouping in the linear grouping increases linearly, and the interval length of the power grouping shows a power increase.
[0018] According to the multi-strategy combined key search method based on the Grover algorithm of the present invention, preferably, the process of dividing intervals according to power grouping is as follows:
[0019] Suppose there is a positive integer c, the size of the key space is N, and the key space is divided into parts, then the intervals are respectively
[0020] According to the multi-strategy combined key search method based on the Grover algorithm of the present invention, preferably, the initial state of each interval is reconstructed by using an equal probability amplitude initial state construction or an initial state construction according to the target key probability distribution.
[0021] According to the multi-strategy combined key search method based on the Grover algorithm of the present invention, preferably, the initial state construction according to the target key probability distribution includes:
[0022] Suppose the probability that the i-th key is the target key is p i , set the probability amplitude of the initial state according to the probability that the key is the target key as After the key space is divided into power groups, the initial states of each interval are reconstructed as follows;
[0023] Among them, the construction of the initial state of the first interval is:
[0024] The initial state of the k-th interval is constructed as:
[0025] The initial state of the last interval is constructed as:
[0026] The probability amplitude of the new initial state is defined as where j represents the interval to which it belongs, and i represents the i-th key search.
[0027] According to the multi-strategy combined key search method based on the Grover algorithm of the present invention, preferably, the number of rounds of key search for each interval is set to n.
[0028] According to the multi-strategy combined key search method based on the Grover algorithm of the present invention, preferably, when the target key exists in a certain interval, the expected number of iterations for searching the target key in this interval is obtained through mathematical derivation, and the formula is as follows:
[0029]
[0030] In the formula, represents the probability amplitude of the i-th key after reconstructing the initial state, represents the expected number of iterations of the j-th interval when the i-th key is the target key, represents the number of iterations required for a single round of the Grover algorithm, where d represents which round of key search is being performed, represents the number of iterations of the l-th round of key search in the j-th interval.
[0031] According to the multi-strategy combined key search method based on the Grover algorithm of the present invention, preferably, based on the expected number of iterations of a single interval, the total expected number of iterations required to obtain the target key is derived, and the formula is as follows:
[0032]
[0033] With the goal of the minimum total expected number of iterations, the particle swarm optimization algorithm is used to calculate and the optimal values of c.
[0034] According to the multi-strategy combined key search method based on the Grover algorithm of the present invention, preferably, multiple rounds of search are performed on the key space according to the obtained optimal parameter values, including:
[0035] The key space is divided according to the optimal value of c calculated, and the search starts from the first interval, and the number of iterations is according to the calculated Perform the search for the optimal value. If the target key is found, directly output the target key and end the program. If the target key is not found when the search reaches the set number of search rounds n for this interval, continue to search the next interval. If the target key is still not found after searching all the intervals, the search fails this time.
[0036] The present invention also provides a multi-strategy combined key search device based on the Grover algorithm, including:
[0037] A key space partitioning module, configured to sort the given key space in descending order according to the probability that a key is the target key, and then group and partition it into several intervals according to the grouping strategy;
[0038] An interval initial state reconstruction module, configured to respectively construct a new initial state according to the probability distribution of each key being the target key in each interval;
[0039] A search round setting module, configured to perform multiple rounds of search on each interval and set the number of rounds for key search in each interval;
[0040] A single interval expected iteration number calculation module, configured to, when the target key exists in a certain interval, mathematically deduce the expected iteration number for finding the target key in this interval;
[0041] A total expected iteration number calculation module, configured to deduce the total expected iteration number required to obtain the target key according to the expected iteration number of a single interval;
[0042] A parameter optimal value obtaining module, configured to aim at the minimum total expected iteration number and use the particle swarm optimization algorithm to obtain the optimal value of the parameter;
[0043] A search module, configured to perform multiple rounds of search on the key space according to the obtained optimal value of the parameter.
[0044] Compared with the prior art, the present invention has the following advantages:
[0045] 1. The multi-strategy combined key search method based on the Grover algorithm of the present invention is a multi-strategy combined method for solving the key search problem in cryptography. Based on the Grover algorithm, when the probabilities of each key in the key space to be searched being the target key are not equal, the idea of combining three strategies is adopted. The first strategy is to perform interval search on the key space, the second strategy is to perform multiple rounds of search on each interval, and the third strategy is to adopt different initial states for each interval according to the probability distribution of each key being the target key. The effective combination of these three strategies reduces the number of iterations required for key search and improves the key search efficiency.
[0046] 2. The present invention uses the particle swarm optimization algorithm to find the optimal values of the initial parameters, which can significantly reduce the computing resources required for calculating the initial parameters.
[0047] In summary, compared with the existing key search methods, the present invention reduces the time complexity of the key search problem and the resources required for parameter calculation, greatly improving the key search efficiency, and has important applications in cryptanalysis and big data search. Brief Description of the Drawings
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for describing the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0049] Figure 1 It is a schematic flowchart of the multi-strategy combined key search method based on the Grover algorithm in the first embodiment of the present invention;
[0050] Figure 2 It is a schematic diagram of dividing intervals according to power grouping in the first embodiment of the present invention;
[0051] Figure 3 It is a schematic flowchart of the multi-round search stage in the first embodiment of the present invention;
[0052] Figure 4 It is a structural block diagram of the multi-strategy combined key search device based on the Grover algorithm in the first embodiment of the present invention; in the figure, 41 represents the key space division module, 42 represents the interval initial state reconstruction module, 43 represents the search round number setting module, 44 represents the expected iteration number calculation module for a single interval, 45 represents the total expected iteration number calculation module, 46 represents the optimal parameter value obtaining module, and 47 represents the search module. Detailed Embodiments
[0053] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0054] Such as Figure 1As shown, the multi-strategy combined key search method based on the Grover algorithm in this embodiment is divided into two stages: parameter calculation and multi-round search to improve the key search efficiency. The parameter calculation stage includes steps S101 - S106, and the multi-round search stage is step S107.
[0055] Step S101: Sort the given key space in descending order according to the probability that a key is the target key, and then divide it into several intervals according to the grouping strategy.
[0056] For a key space of size N, first sort the keys in the key space in descending order according to the probability that a key is the target key, and then group the data set according to the grouping strategy. The grouping strategy can adopt equal grouping, linear grouping, or power grouping, etc. Equal grouping divides the key space into several intervals of equal length. In linear grouping, the length of the grouping intervals increases linearly. Power grouping is that the length of the grouping intervals increases exponentially.
[0057] Taking power grouping as an example, the following details how to divide the intervals. Suppose there is a positive integer c, and the key space is divided into parts, then the intervals are As Figure 2 shown.
[0058] Step S102: Construct new initial states respectively according to the probability distribution that each key in each interval is the target key.
[0059] According to the probability distribution that a key is the target key, reconstruct the initial state for each interval. There are also different strategies for constructing the initial state of a single interval. For example, constructing an initial state with equal probability amplitudes or constructing an initial state according to the probability distribution of the target key, as long as the normalization constraint of the quantum state is satisfied. The following takes constructing an initial state according to the probability distribution of the target key as an example to illustrate. The process of constructing the initial state is as follows.
[0060] Suppose the probability that the i-th key is the target key is p i , and set the probability amplitude of the initial state according to the probability that the key is the target key as Here, taking power grouping as an example to illustrate the construction of the initial state, after power grouping the key space, the reconstruction of the initial state for each interval is as follows.
[0061] The construction of the initial state of the first interval is:
[0062]
[0063] The construction of the initial state of the k-th interval is:
[0064]
[0065] The initial state of the last interval is constructed as follows:
[0066]
[0067] For the sake of convenience of explanation, taking the initial state constructed by the j-th interval as an example, the probability amplitude of the new initial state is defined as where j represents the interval to which it belongs, and i represents the i-th key search.
[0068] Step S103: Set the number of rounds of key search for each interval to n, and n can be freely set according to different probability distributions.
[0069] Step S104: If the target key exists in a certain interval, the expected number of iterations to search for the target key in this interval is obtained through mathematical derivation, and the formula is as follows:
[0070]
[0071] The specific derivation process is as follows:
[0072] 1. For the j-th interval, according to the definition in step S102, here represents the probability amplitude of the i-th key after reconstructing the initial state, represents the expected number of iterations of the j-th interval when the i-th key is the target key. After squaring the probability amplitude , the probability that the i-th key is the target key when the target key is in the j-th interval is obtained, and the expected formula for the corresponding number of iterations can be obtained as
[0073] 2. Next, the derivation of how to obtain this formula is carried out. First, two conditions are explained: one is that each interval in this embodiment conducts 10 rounds of search; the other is is the expected number of iterations of the j-th interval when the i-th key is the target key. represents the number of iterations required for a single round of Grover's algorithm, where d represents which round of key search is being carried out. If the target key is not obtained after the first round of search, then the second round of search needs to be continued, and the probability of needing to conduct the second round of search is p1. If the target key is still not obtained in the second round, then the third round of search needs to be carried out, that is, the third round is carried out on the premise that the target key has not been obtained in the first and second rounds, and the probability of needing to conduct the third round of search is p1p2, and so on. Here, the following formula can be obtained:
[0074]
[0075] where
[0076] According to the conclusion of the classical Grover's algorithm, after iterations in the j-th interval, the probability of not finding the target solution is Substituting this result step by step backward, we obtain the expected number of iterations to obtain the target key in the j-th interval when the target key is located in the j-th interval.
[0077] Step S105: Derive the total expected number of iterations required to obtain the target key based on the expected number of iterations in a single interval.
[0078] In step S104, the expected number of iterations to search for the target key when the target key is located in the j-th interval has been obtained. Then, the formula for the total expected number of iterations can be derived. First, search the first interval and perform the expected E (1) iterations. The probability that the target key exists in the first interval is If the target key is not found in the first interval, search the second interval. That is, the probability of searching the second interval is The probability that the target key is still not found in the search of the second interval is And so on. It is easy to obtain the expected formula for the total number of iterations as follows:
[0079]
[0080] Step S106: Taking the minimum total expected number of iterations as the goal, use the Particle Swarm Optimization (PSO) algorithm to calculate and the optimal values of c.
[0081] Step S107: Perform multiple rounds of searches on the key space according to the optimal parameter values obtained in step S106.
[0082] Specifically, as Figure 3 shown, divide the key space according to the c value obtained in step S106, start multiple rounds of searches from the first interval, and the specific number of iterations in each round is according to the obtained in step S106. If the target key is found, directly output the target key and end the program. If the target key is still not found when the set number of search rounds n is reached in this interval, continue to search the next interval, and the steps are still the same as those of the first interval. If the target key is still not found until the last interval is searched, this search fails.
[0083] Corresponding to the above multi-strategy combined key search method based on Grover's algorithm, this embodiment also proposes a multi-strategy combined key search device based on Grover's algorithm, as Figure 4 shown, including:
[0084] The key space partitioning module 41 is used to sort the given key space in descending order according to the probability that a key is the target key, and then group and divide it into several intervals according to the grouping strategy.
[0085] The interval initial state reconstruction module 42 is used to respectively construct a new initial state according to the probability distribution that each key in each interval is the target key.
[0086] The search round number setting module 43 is used to perform multiple rounds of search on each interval and set the number of rounds of key search for each interval.
[0087] The expected iteration number calculation module 44 for a single interval is used to, when the target key exists in a certain interval, obtain the expected iteration number for searching the target key in this interval through mathematical derivation.
[0088] The total expected iteration number calculation module 45 is used to derive the total expected iteration number required to obtain the target key according to the expected iteration number of a single interval.
[0089] The optimal parameter value obtaining module 46 is used to aim at the minimum total expected iteration number and obtain the optimal parameter value by using the particle swarm optimization algorithm.
[0090] The search module 47 is used to perform multiple rounds of search on the key space according to the obtained optimal parameter value.
[0091] Embodiment 2
[0092] This embodiment uses a key space of size 1,000,000 as an example for illustration. In order to further demonstrate the effect of the present invention in improving the key search efficiency, a probability distribution mentioned in the paper "Umut Cal1ky1lmaz" is used for illustration to reflect the practical application value of the present invention. The probability calculation formula in the paper "Umut Cal1ky1lmaz" is The following takes f(x) = 3x 2 as an example for illustration.
[0093] First, calculate the probability p that all keys in the key space are the target key i , and then enter the parameter calculation stage.
[0094] Step S201: Sort the keys in the key space in descending order according to the probability that a key is the target key, and then group them according to the grouping strategy. Here, the grouping strategy can adopt average grouping, linear grouping or power grouping. Linear grouping: Assume a positive integer c. Linear grouping divides the key space into intervals of length c, 2c, 3c... until the entire key space is divided. Power grouping divides the key space into intervals of length c, c 2 -c, c 3 -c2 ... until the division ends. Equal-sized grouping divides the key space into several groups of equal size and does not involve solving for the optimal value of parameter c.
[0095] Step S202: For each individual interval, construct a new initial state. Taking power grouping as an example, the initial state of the k-th interval is constructed as:
[0096]
[0097] Step S203: Set the number of rounds n for key search in each interval.
[0098] Step S204: Substitute the initial state and probability distribution constructed in Step S202 into the calculation formula for the expected number of iterations in a single interval.
[0099] Step S205: Substitute the result of Step S204 into the formula for the total expected number of iterations.
[0100] Step S206: Solve with the goal of obtaining the minimum total expected number of iterations for the target key and the optimal value of c. The optimal c values for linear grouping and power grouping, the improvement effect on the key search efficiency compared with the classical Grover algorithm, and the number of iterations required to obtain the target key are shown in Table 1.
[0101] Table 1 f(x) = 3x 2 Number of iterations required for key search in linear grouping and power grouping when
[0102]
[0103] For equal-sized grouping, since it does not involve solving for the optimal c value, here the key space is divided into 1, 2, …, 10 groups respectively, and the number of iterations required to obtain the target key is solved as shown in Table 2.
[0104] Table 2 f(x) = 3x 2 Number of iterations for different numbers of equal-sized grouping when
[0105]
[0106]
[0107] Find the group with the fewest number of iterations as the final result. For the result given this time, when the key space is divided into 3 groups, the number of iterations to obtain the target key is the fewest, which is 535.9782, and the improvement degree of the key search efficiency compared with the classical Grover algorithm is 31.76%.
[0108] Comparing the results of three different grouping strategies, in the case of average grouping, the number of iterations required to solve the key search problem in a key space of size 1,000,000 is the least, only 535.9782 times. When conducting the search, the initial state is constructed and the number of iterations for each round of key search is set with the optimal parameters obtained under the average grouping situation.
[0109] In this embodiment, the number of iterations required for the three grouping strategies to obtain the target key is improved compared to the key search efficiency of the method proposed in the paper by Umut Cal1ky1lmaz. The specific improvement effects and comparisons are shown in Table 3.
[0110] Table 3 f(x) = 3x 2 Comparison of the improvement effects between three different grouping schemes and the paper by Umut Cal1ky1lmaz
[0111]
[0112] In step S207, the optimal parameters obtained by the average grouping with the best improvement effect among the three grouping strategies are used to construct the initial state and set the number of iterations, and then the search is carried out according to the process of multi-round search.
[0113] The present invention not only has a good improvement effect under the probability distribution of f(x) = 3x 2 but also the number of iterations is reduced under other probability distributions. The comparison of the improvement effects of the key search efficiency between the present invention and the paper by Umut Cal1ky1lmaz under other probability distributions is shown in Table 4.
[0114] Table 4 Comparison results of the improvement effects between the present invention and the paper by Umut Cal1ky1lmaz under different probability distributions
[0115]
[0116] Those skilled in the art should understand that the embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention can be implemented in various computer languages, for example, object-oriented programming languages such as Java and interpreted scripting languages such as JavaScript.
[0117] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device generate means for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.
[0118] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including instruction means that implement the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.
[0119] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.
[0120] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0121] Obviously, those skilled in the art can make various changes and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.
Claims
1. A multi-strategy combined key search method based on Grover's algorithm, characterized in that, It includes the following steps: Sort the given key space in descending order of the probability that a key is the target key, and then divide it into several intervals according to the grouping strategy; Construct new initial states respectively according to the probability distribution of each key being the target key in each interval; Conduct multiple rounds of search for each interval, and set the number of rounds of key search for each interval; If the target key exists in a certain interval, derive the expected number of iterations to search for the target key in this interval through mathematical derivation; Derive the total expected number of iterations required to obtain the target key based on the expected number of iterations in a single interval; Take the minimum total expected number of iterations as the goal, and use the particle swarm optimization algorithm to obtain the optimal parameter values; Conduct multiple rounds of search for the key space according to the obtained optimal parameter values above.
2. The multi-strategy combined key search method based on the Grover algorithm according to claim 1, wherein Divide it into several intervals according to the grouping strategy, where the grouping strategy is average grouping, linear grouping or power grouping; the average grouping divides the key space into several intervals of equal length, the interval length in the linear grouping increases linearly, and the interval length in the power grouping increases exponentially.
3. The multi-strategy combined key search method based on the Grover algorithm according to claim 2, wherein, The process of dividing intervals according to power grouping is as follows: Suppose there exists a positive integer c, the key space size is N, and the key space is divided into parts, then the intervals are respectively 4. The multi-strategy combined key search method based on Grover's algorithm according to claim 3, wherein, When reconstructing the initial state for each interval, use an initial state with equal probability amplitude or an initial state constructed according to the probability distribution of the target key.
5. The multi-strategy combined key search method based on the Grover algorithm according to claim 4, wherein, Constructing the initial state according to the probability distribution of the target key includes: Suppose the probability that the $i$-th key is the target key is $p$. i , set the probability amplitude of the initial state according to the probability that the key is the target key as After power grouping the key space, reconstruct the initial state for each interval as follows; The initial state of the first interval is constructed as follows: The initial state of the k-th interval is constructed as follows: The initial state of the last interval is constructed as follows: The probability amplitude of the new initial state is defined as where j represents the interval to which it belongs, and i represents the i-th key search.
6. The multi-strategy combined key search method based on the Grover algorithm according to claim 5, characterized in that Set the number of rounds of key search for each interval to n.
7. The multi-strategy combined key search method based on the Grover algorithm according to claim 6, characterized in that If the target key exists in a certain interval, derive the expected number of iterations to search for the target key in this interval through mathematical derivation. The formula is as follows: Wherein, represents the probability amplitude of the i-th key after reconstructing the initial state, represents the expected number of iterations of the j-th interval when the i-th key is the target key, represents the number of iterations required for a single-round Grover algorithm, where d represents which round of key search is being performed, represents the number of iterations of the l-th round of key search in the j-th interval.
8. The multi-strategy combined key search method based on the Grover algorithm according to claim 7, characterized in that Derive the total expected number of iterations required to obtain the target key based on the expected number of iterations in a single interval. The formula is as follows: Aiming at the minimum total expected number of iterations, the particle swarm optimization algorithm is used to calculate and the optimal values of c.
9. The multi-strategy combined key search method based on the Grover algorithm according to claim 8, wherein Conduct multiple rounds of search for the key space according to the obtained optimal parameter values, including: Divide the key space according to the calculated optimal value of c, start searching from the first interval, and the number of iterations is carried out according to the calculated optimal value. If the target key is found, directly output the target key and end the program. If the target key is not found when the search round number n set for this interval is reached, continue to search the next interval; if the target key is still not found until the last interval is searched, the search fails this time.
10. A multi-strategy combined key search device based on Grover's algorithm, characterized in that, Include: A key space division module, which is used to sort the given key space in descending order of the probability that a key is the target key, and then divide it into several intervals according to the grouping strategy; An interval initial state reconstruction module, which is used to construct new initial states respectively according to the probability distribution of each key being the target key in each interval; A search round number setting module, which is used to conduct multiple rounds of search for each interval and set the number of rounds of key search for each interval; A single interval expected iteration number calculation module, which is used to derive the expected number of iterations to search for the target key in this interval through mathematical derivation if the target key exists in a certain interval; A total expected iteration number calculation module, which is used to derive the total expected number of iterations required to obtain the target key based on the expected number of iterations in a single interval; An optimal parameter value obtaining module, which is used to take the minimum total expected number of iterations as the goal and use the particle swarm optimization algorithm to obtain the optimal parameter values; A search module, which is used to conduct multiple rounds of search for the key space according to the obtained optimal parameter values above.
Citation Information
Patent Citations
Cloud manufacturing scheduling method based on Grover quantum search algorithm
CN110309921A
Big data set searching method based on Grover algorithm and quantum computer
CN111598245A