Distributed quantum random ID generation method and system

Through the distributed quantum random ID generation method, the hash table and feature code combination ensures the uniqueness of quantum random numbers, solves the problem of memory waste and uniqueness in the existing technology, and achieves efficient ID generation rate and uniqueness Sexual protection.

CN118897666APending Publication Date: 2024-11-05ANHUI QASKY QUANTUM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410959366.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

The existing ID generation method based on quantum random numbers is in information systems, especially in distributed database systems, and there is a difficulty in ensuring the uniqueness of quantum random numbers, which cannot meet the needs of massive ID generation.

Method used

Using a distributed quantum random ID generation method, quantum random numbers are generated through the quantum random number generator on the service node, and hash table and feature code combinations are used to detect and ensure the uniqueness of quantum random numbers, and combined with service node number generation Feature code, reducing the possibility of repetition.

Benefits of technology

It effectively reduces the possibility of repetition of quantum random IDs, meets the needs of high-speed ID generation in the information system, and improves the system's memory utilization and uniqueness guarantee.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118897666A_ABST
    Figure CN118897666A_ABST
Patent Text Reader

Abstract

The invention discloses a distributed quantum random ID generation method, which comprises the following steps: a quantum random number generator on a service node generates a quantum random number Q, and detects whether the quantum random number Q currently generated by each quantum random number generator previously generates T non-repeated quantum random number repetitions; if not, determining a feature code S of the quantum random number Q; the quantum random number Q and the feature code S are combined into a random number Q1, and the random number Q1 is taken as a quantum random ID. A quantum random number generator is deployed at each node in a distributed mode, a quantum random number Q and a feature code S are combined, the repetition possibility of a quantum random ID is greatly reduced, the quantum random number has the characteristics of quantum intrinsic true random characteristic, unpredictability, non-repeatability and the like, the single-node generation rate can reach 7Gbps or above, and the quantum random number generation rate can reach 7Gbps or above. And after multi-node distributed deployment is adopted, the ID generation rate requirement of the sub-information system can be well met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of quantum communication technology, and more specifically, the present invention relates to a distributed quantum random ID generation method and system. Background Art

[0002] Information systems, especially distributed database systems, will have a large number of ID generation service requirements. Information systems will continuously generate or record events, such as messages, form records, etc., and each event or record requires a unique ID to ensure that the system does not generate duplication when processing each event or record.

[0003] The quantum random number generator can generate quantum random numbers based on quantum processes such as vacuum fluctuations, amplified spontaneous radiation, and quantum tunneling effects, with a generation rate of more than 7Gbps. Quantum random numbers have the intrinsic true random characteristics of quantum, and have good unpredictability, non-repeatability, and unbiasedness.

[0004] The existing ID generation method based on quantum random numbers uses a double hash table to achieve non-repetition of T quantum random numbers. The design of the double hash table wastes memory space and is limited by the device memory size. In addition, the uniqueness of quantum random numbers exceeding the hash table size cannot be guaranteed. Therefore, it cannot meet the massive ID generation needs in information systems (such as distributed database systems). Summary of the invention

[0005] The present invention provides a distributed quantum random ID generation method, aiming to improve the above problems.

[0006] The present invention is implemented as follows: a distributed quantum random ID generation method, the method is as follows:

[0007] (1) The quantum random number generator on the service node generates a quantum random number Q, and detects whether the quantum random number Q currently generated by each quantum random number generator is a repeat of the T non-repeating quantum random numbers generated previously;

[0008] (2) If the detection result is negative, then determine the characteristic code S of the quantum random number Q, and the characteristic code S of different quantum random number generators is different;

[0009] (3) The quantum random number Q and its characteristic code S are combined into a random number Q1, and the random number Q1 is used as the quantum random ID.

[0010] Furthermore, the feature code S is generated based on the quantum random number Q and the service node number NodeID;

[0011] Among them, the service node number NodeID is used to identify the quantum random number generator on the service node.

[0012] Furthermore, the method for checking the duplication of quantum random number Q is as follows:

[0013] (11) The first n bytes of the currently generated quantum random number Q are used as the hash index value, and the remaining (Nn) bytes of the quantum random number Q are hashed to obtain the hash key value;

[0014] (12) Based on the hash index value of the currently generated quantum random number Q, with the hash index value as the index index, find out whether the hash key value of the quantum random number Q exists in the hash bucket under the index index. If it exists, the quantum random number Q may be repeated with the quantum random number recorded in the hash table. If not, it means that the quantum random number Q is not repeated with the quantum random number recorded in the hash table.

[0015] The capacity of the hash table is set to T, and the hash table is used to record non-repeating quantum random numbers.

[0016] Furthermore, when it is detected that the quantum random number Q is not repeated with the quantum random number recorded in the hash table, the current quantum random number Q is inserted into the hash table. The update process of the hash table is as follows:

[0017] (13) Check whether the hash table is currently full. If the test result is yes, execute step (14); if the test result is no, execute step (15)

[0018] (14) Read the hash index value and hash key value of position C in the cache BUF, and delete the quantum random number corresponding to the hash index value and hash key value in the hash table, where position C records the serial number of the quantum random number inserted earliest in the hash table;

[0019] (15) Save the hash index value and hash key value of the currently generated quantum random number Q to the position C of the cache BUF, and update the position C to C = (C + 1)% T;

[0020] (16) The quantum random number Q is stored in the corresponding position of the hash table, and the hash key value of the quantum random number Q is saved in the hash bucket under the index index.

[0021] Furthermore, after the currently generated quantum random number Q does not repeat with the T previously generated non-repeating quantum random numbers, the following steps are also included:

[0022] (4) Generate the characteristic code V of the current quantum random number;

[0023] Among them, the characteristic code V is generated based on the numbering Roundi of the node quantum random numbers and the quantum random numbers. The number Roundi is used to identify each group of quantum random numbers generated by each quantum random number generator. Each group of quantum random numbers includes T quantum random numbers, and the characteristic code V of each group of quantum random numbers is different.

[0024] Furthermore, the update method of the quantum random number number Roundi is as follows:

[0025] Check whether position C is equal to T. If the result is yes, update the number Roundi of the current quantum random number Q, and set the number Roundi=(Roundi+1)%256;

[0026] The length of the number Roundi is one byte.

[0027] Furthermore, the feature code S is generated by calculating the quantum random number Q2 and the service node number NodeID, wherein the random number Q2 is composed of the quantum random number Q and the feature code V.

[0028] Furthermore, the quantum random number Q, the characteristic code V and the characteristic code S are combined into a random number Q3, and the random number Q3 is used as a quantum random ID.

[0029] The present invention is implemented as follows: a distributed quantum random ID generation system, the system comprising:

[0030] Multiple service nodes, each of which is equipped with a quantum random number generator.

[0031] The service node that receives the ID generation request generates a quantum random ID based on the above-mentioned distributed quantum random ID generation method and returns it to the request object.

[0032] The present invention designs a distributed ID generation method based on quantum random numbers. By distributing the quantum random number generator at each node, and combining the quantum random number Q, the feature code S and the feature code V, the possibility of duplication of the quantum random ID is greatly reduced. In addition, the quantum random number has the characteristics of quantum intrinsic true randomness, unpredictability, non-repeatability and unbiasedness. The single-node generation rate can reach more than 7Gbps. After adopting multi-node distributed deployment, it can well meet the ID generation rate requirements of the distributed information system. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A flowchart of a distributed quantum random ID generation method provided by an embodiment of the present invention;

[0034] Figure 2A schematic diagram of the structure of a distributed quantum random ID generation system provided by an embodiment of the present invention;

[0035] Figure 3 A schematic diagram of the storage structure of the buffer BUF provided in an embodiment of the present invention;

[0036] Figure 4 A schematic diagram of the structure of a random number Q3 provided in an embodiment of the present invention. Implementation

[0038] The specific implementation modes of the present invention are further explained in detail below by describing the embodiments with reference to the accompanying drawings, so as to help those skilled in the art to have a more complete, accurate and in-depth understanding of the inventive concept and technical solution of the present invention.

[0039] Figure 1 A flowchart of a distributed quantum random ID generation method provided by an embodiment of the present invention, the method comprising:

[0040] (0) The bit width of the quantum random ID is a quantum random number of N bytes and a characteristic code of one word, and the initialization number Roundi is 0; and the ID hash table size, where the ID hash table is set to n bytes. Considering the convenience of calculation and the limitation of storage space, it can generally be set to 2, where n <N;

[0041] (1) The quantum random number generator on the service node generates a quantum random number Q, and detects whether the quantum random number Q currently generated by each quantum random number generator is a repeat of the T non-repeating quantum random numbers generated previously. If the detection result is no, step (2) is executed; if the detection result is yes, the currently generated quantum random number is deleted;

[0042] (2) Determine the characteristic code S of the quantum random number Q, and the characteristic code S of different quantum random number generators is different;

[0043] (3) The quantum random number Q and its characteristic code S are combined into a quantum random number Q1, and the quantum random number Q1 is used as a quantum random ID.

[0044] In the embodiment of the present invention, the feature code S is generated based on the quantum random number Q and the service node number NodeID. The service node number NodeID is used to identify the quantum random number generator on the service node. The service node numbers NodeID of different quantum random number generators are different.

[0045] In the embodiment of the present invention, the length of the service node number NodeID is one byte. Therefore, 256 service nodes are allowed to be distributed in the system, and the T quantum random numbers currently generated by the quantum random number generator on each service node are not repeated.

[0046] In an embodiment of the present invention, the method for checking duplicate quantum random numbers is as follows:

[0047] (11) The first n bytes of the currently generated quantum random number Q (i.e., Byte(1), .., Byte(n)) are used as the hash index value, and the remaining (Nn) bytes of the quantum random number Q (i.e., Byte(n+1), .., Byte(N)) are hashed to obtain the hash key value;

[0048] Since quantum random numbers have good uniform distribution characteristics, a simple XOR method is used here. If the remaining (Nn) bytes of the quantum random number Q are less than or equal to 2 bytes, the (Nn) bytes of data (i.e., Byte(n+1), .., Byte(N)) are directly taken as the hash key value. If the remaining (Nn) bytes of the quantum random number Q are greater than 2 bytes, the remaining (Nn) bytes of data (i.e., Byte(n+1), .., Byte(N)) are XORed to obtain a 2-byte hash key value.

[0049] (12) Based on the hash index value of the currently generated quantum random number Q, with the hash index value as the index index, find out whether the hash key value of the quantum random number Q exists in the hash bucket under the index index. If it exists, the quantum random number Q may be repeated with the quantum random number recorded in the hash table, and the quantum random number Q is discarded. If it does not exist, it means that the quantum random number Q is not repeated with the quantum random number recorded in the hash table;

[0050] Among them, the capacity of the hash table is set to T, and the hash table is used to record non-repeating quantum random numbers, with a maximum of T records; a hash index corresponds to a hash bucket, and the hash bucket is used to store the hash key value under the index.

[0051] When it is detected that the quantum random number Q is not repeated with the quantum random number recorded in the hash table, the current quantum random number Q is inserted into the hash table. The update process of the hash table is as follows:

[0052] (13) Check whether the hash table is currently full. If the test result is yes, execute step (14); if the test result is no, execute step (15)

[0053] (14) Read the hash index value and hash key value of position C in the cache BUF, delete the quantum random number corresponding to the hash index value and hash key value in the hash table, and position C records the serial number of the quantum random number inserted earliest in the hash table;

[0054] (15) The hash index value and hash key value of the currently generated quantum random number Q are saved to the position C of the cache BUF, and the position C is updated to C = (C + 1) % T, such as Figure 3 As shown;

[0055] (16) The quantum random number Q is stored in the corresponding position of the hash table, and the hash key value of the quantum random number Q is saved in the hash bucket under the index index. There is at least one hash key value in a hash bucket.

[0056] In the embodiment of the present invention, the characteristic code S calculation process is specifically as follows:

[0057] S=HASH2(Byte(1),..,Byte(N),Roundi,Nodei);

[0058] Since quantum random numbers have good uniform distribution characteristics, the hash function HASH2 uses an exclusive OR operation, that is, HASH2(b1,b2,...,bm)=b1^b2^...^bm, which can maintain a certain randomness and unpredictability of the feature code.

[0059] In an embodiment of the present invention, in order to reduce the possibility of duplication between the quantum random number generated by each quantum random number generator and the previously generated quantum random number, the present invention further includes the following steps after determining that the currently generated quantum random number and the previously generated T quantum random numbers are not repeated:

[0060] (4) Generate the characteristic code V of the current quantum random number;

[0061] Among them, the characteristic code V is generated based on the numbering Roundi of the node quantum random numbers and the quantum random numbers, wherein the number Roundi is used to identify each group of quantum random numbers generated by each quantum random number generator, each group of quantum random numbers includes T quantum random numbers, and the characteristic code V of each group of quantum random numbers is different.

[0062] In the embodiment of the present invention, the feature code S is generated based on the quantum random number Q2 and the service node number NodeID, wherein the random number Q2 is composed of the quantum random number Q and the feature code V.

[0063] If the length of the number Roundi is one byte, the value of the number Roundi is 0 to 255, the number Roundi of the first group of quantum random numbers is 00000000, the number Roundi of the second group of quantum random numbers is 00000001, and so on, the number Roundi of the 256th group of quantum random numbers is 11111111, and the number Roundi of the 257th group of quantum random numbers is 00000000, which can ensure that the 256 unique numbers Roundi generated by this node are not repeated, so each node can ensure that 256*T quantum random numbers are not repeated. Therefore, after generating T quantum random numbers, the number Roundi of the current quantum random number is updated, and the number Roundi = (Roundi+1)%256, that is, the method for determining the number Roundi of the current quantum random number is as follows:

[0064] Check whether the position C is equal to T. If the test result is yes, update the number Roundi of the current quantum random number Q, number Roundi = (Roundi + 1) % 256, and then calculate the feature code V. If the test result is no, there is no need to update the number Roundi, and directly calculate the feature code V.

[0065] In the embodiment of the present invention, the characteristic code V calculation process is specifically as follows:

[0066] V=HASH1(Byte(1),..,Byte(N),Roundi);

[0067] Since quantum random numbers have good uniform distribution characteristics, the hash function HASH1 uses an exclusive OR operation, that is, HASH1(b1,b2,...,bm)=b1^b2^...^bm, which can maintain a certain randomness and unpredictability of the feature code.

[0068] After obtaining the characteristic code V based on the above method, the quantum random number Q, the characteristic code V and the characteristic code S are combined into a random number Q3, such as Figure 4 As shown, the random number Q3 is used as the quantum random ID.

[0069] Figure 2 The embodiment of the present invention provides Figure 1 The schematic diagram of the structure of the distributed quantum random ID generation system provided in the embodiment of the present invention only shows the part related to the embodiment of the present invention for the convenience of explanation. The system includes:

[0070] Multiple service nodes, each of which is equipped with a quantum random number generator.

[0071] The service node that receives the ID generation request generates a quantum random ID based on the above-mentioned distributed quantum random ID generation method and returns it to the request object, which is a distributed database system.

[0072] The present invention has been described exemplarily. Obviously, the specific implementation of the present invention is not limited to the above-mentioned method. As long as various non-substantial improvements are made using the method concept and technical solution of the present invention, or the concept and technical solution of the present invention are directly applied to other occasions without improvement, they are all within the protection scope of the present invention.

Claims

1. A distributed quantum random ID generation method, It is characterized in that The method is specifically as follows: (1) The quantum random number generator on the service node generates a quantum random number Q, and detects whether the quantum random number Q currently generated by each quantum random number generator is a repeat of the T non-repeating quantum random numbers generated previously; (2) If the detection result is negative, then determine the characteristic code S of the quantum random number Q, and the characteristic code S of different quantum random number generators is different; (3) The quantum random number Q and its characteristic code S are combined into a random number Q1, and the random number Q1 is used as the quantum random ID.

2. The distributed quantum random ID generation method as claimed in claim 1, It is characterized in that The signature code S is generated based on the quantum random number Q and the service node ID NodeID; Among them, the service node number NodeID is used to identify the quantum random number generator on the service node.

3. The distributed quantum random ID generation method as claimed in claim 1, It is characterized in that The specific method of checking the duplication of quantum random number Q is as follows: (11) The first n bytes of the currently generated quantum random number Q are used as the hash index value, and the remaining (Nn) bytes of the quantum random number Q are hashed to obtain the hash key value; (12) Based on the hash index value of the currently generated quantum random number Q, with the hash index value as the index index, find out whether the hash key value of the quantum random number Q exists in the hash bucket under the index index. If it exists, the quantum random number Q may be repeated with the quantum random number recorded in the hash table. If not, it means that the quantum random number Q is not repeated with the quantum random number recorded in the hash table. The capacity of the hash table is set to T, and the hash table is used to record non-repeating quantum random numbers.

4. The distributed quantum random ID generation method as claimed in claim 3, It is characterized in that When it is detected that the quantum random number Q is not repeated with the quantum random number recorded in the hash table, the current quantum random number Q is inserted into the hash table. The update process of the hash table is as follows: (13) Check whether the hash table is currently full. If the test result is yes, execute step (14); if the test result is no, execute step (15) (14) Read the hash index value and hash key value of position C in the cache BUF, and delete the quantum random number corresponding to the hash index value and hash key value in the hash table, where position C records the serial number of the quantum random number inserted earliest in the hash table; (15) Save the hash index value and hash key value of the currently generated quantum random number Q to the position C of the cache BUF, and update the position C to C = (C + 1)% T; (16) The quantum random number Q is stored in the corresponding position of the hash table, and the hash key value of the quantum random number Q is saved in the hash bucket under the index index.

5. The distributed quantum random ID generation method as claimed in claim 1, It is characterized in that After the currently generated quantum random number Q does not repeat with the T previously generated non-repeating quantum random numbers, the following steps are also included: (4) Generate the characteristic code V of the current quantum random number; Among them, the characteristic code V is generated based on the numbering Roundi of the node quantum random numbers and the quantum random numbers. The number Roundi is used to identify each group of quantum random numbers generated by each quantum random number generator. Each group of quantum random numbers includes T quantum random numbers, and the characteristic code V of each group of quantum random numbers is different.

6. The distributed quantum random ID generation method as claimed in claim 5, It is characterized in that The update method of the quantum random number number Roundi is as follows: Check whether position C is equal to T. If the result is yes, update the number Roundi of the current quantum random number Q, and set the number Roundi=(Roundi+1)%256; The length of the number Roundi is one byte.

7. The distributed quantum random ID generation method as claimed in claim 5, It is characterized in that The characteristic code S is generated by calculating the quantum random number Q2 and the service node number NodeID, wherein the random number Q2 is composed of the quantum random number Q and the characteristic code V.

8. The distributed quantum random ID generation method as claimed in claim 7, It is characterized in that The quantum random number Q, the characteristic code V and the characteristic code S are combined into a random number Q3, and the random number Q3 is used as a quantum random ID.

9. A distributed quantum random ID generation system, It is characterized in that The system comprises: Multiple service nodes, each of which is equipped with a quantum random number generator. The service node that receives the ID generation request generates a quantum random ID based on the distributed quantum random ID generation method according to any one of claims 1 to 8, and returns it to the request object.