A method and system for generating physical true random numbers based on convolutional neural networks

CN117850740BActive Publication Date: 2026-10-20GUANGXI RES INST OF MECHANICAL IND
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410023658.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-08
Publication Date
2026-10-20
Estimated Expiration
2044-01-08

AI Technical Summary

Technical Problem

[0005]本发明的目的在于,提供一种基于卷积神经网络产生物理随机数的方法及系统,该方法具备简单快捷、抗干扰性强、完全无法预测、大并发生成等优点,解决现有随机数生成方法生成的真随机数生成效率低,无法满足部分特定业务需求的缺陷

Benefits of technology

[0055]本发明的有益效果为:本发明的方法具备简单快捷、抗干扰性强(1.设备在异地,破解者不能直接去到设备前进行操作;2.由于随机数完全由物理振动频率只能影响跳转次数,无法进行提前测算;3.由多个真随机数作为种子生成多个伪随机数,伪随机数之间不为同一个真随机数种子。)、完全无法预测、大并发生成等优点,每秒钟可创建数万甚至数十万(取决于容器的大小,以及数据矩阵的转换方式)真随机数供调用。如果采用真随机数TRNG作为伪随机数生成器(Pseudo Random Number Generator,PRNG)的初始状态“种子”,从而创建出每秒钟数十万的随机数供多个系统调用,从而大大的提升了随机数取用的并发量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117850740B_ABST
    Figure CN117850740B_ABST
Patent Text Reader

Abstract

The application provides a method and system for generating physical true random numbers based on a convolutional neural network, comprising: step S1: setting a target identification object; step S2: turning over the target identification object to change the state of the target identification object; step S3: acquiring the state of the target identification object through video recording or video; step S4: identifying the current state of the target identification object through a convolutional neural network; and step S5: generating a group of random numbers according to the feature information of the current state of the target identification object. The method has the advantages of simplicity, high speed, strong anti-interference, complete unpredictability, large concurrent generation, etc. and can create tens of thousands or even hundreds of thousands (depending on the speed of convolutional neural network identification, the size of the container, and the conversion mode of the data matrix) of true random numbers per second for calling. If the true random number TRNG is used as the initial state "seed" of the pseudo-random number generator, hundreds of thousands or even millions of random numbers can be created per second for calling by multiple systems, thereby improving the concurrent quantity of random number taking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence algorithms, and in particular relates to a method and system for generating physically true random numbers based on convolutional neural networks. Background Technology

[0002] Random numbers are the results of specific random experiments. The most important characteristics of random numbers are: (1) randomness, (2) unpredictability, and (3) non-reproducibility. Simply put, the number generated after a random number is completely unrelated to the number generated before it. Random numbers are mainly used for: 1. drawing representative samples from a statistical population; 2. assigning experimental animals to different experimental groups; 3. performing Monte Carlo simulations, etc.; 4. for banks, where bank IDs and passwords are very vulnerable. Having a random number table can prevent such incidents. A random number table refers to a unique list of numbers assigned to each customer upon application. This random number table is distributed to the customer instead of being given according to a fixed pattern, which is much safer. 5. To assess the quality of a company's milk products and select 60 bags from 800 bags, a number can be selected from the random number table, and 60 numbers can be generated using different readings (up, down, left, right). These numbers can then be tested according to the milk's label. Although cumbersome, this method is commonly used. 6. When a company needs to investigate consumer demand for a product, it needs to select a certain number of samples from a large number of consumers. 7. In blockchain, the random number K used for SHA encryption is used to prevent collisions between encrypted blocks, thus preventing the encryption from being cracked.

[0003] Currently, random numbers generated by pure computer algorithms are generally "pseudo-random numbers." Generating a truly random number is not easy. Common pseudo-random number generation uses the modulo-remainder method, roughly with the following formula: Rn = (Rn_1 * A + C) mod B, where B and C are constants, Rn is the generated random number, and Rn_1 is the random number from the previous cycle. As can be seen, the random numbers generated by this algorithm are not sufficiently random and are dependent on the initial state. Once the initial state is determined, the random sequence is also determined. Therefore, most random numbers can be cracked. For example, some electronic lottery numbers are guessed by colliding a large number of samples to determine the initial state "seed," leading to the leakage of the range of winning numbers for the next lottery draw.

[0004] In the field of computer science, "true random numbers" are primarily based on naturally occurring random numbers, such as thermal noise, keyboard input, and mouse position. These are all random, but directly using these random signals to generate random numbers doesn't guarantee true randomness. For example, thermal noise isn't white noise in the spectrum; it might be colored noise. Mouse positions are correlated, potentially residing in a certain area over a period of time. Therefore, these random signals cannot be directly used as random numbers and require processing. Some systems, such as UNIX, have a built-in True Random Number Generator (TRNG). This TRNG generates random numbers by amplifying the fluctuations of various unpredictable microvariables in the computation, but the generation speed is very slow. This is because noise amplifier circuits have low-pass characteristics, filtering out high-frequency noise, while amplifying low-frequency noise requires a long time, limiting the TRNG's operating frequency. Secondly, there are many different types of noise in circuit systems, but not all noise is random. For example, a large portion of power supply noise is strongly correlated with the system clock. A TRNG (Transparent Random Number Generator) is a circuit that amplifies extremely small signals, making it highly sensitive to external interference. To avoid interference from non-random external signals, the TRNG must consume considerable power and area for shielding. Furthermore, due to area and power consumption limitations, a CPU cannot integrate many TRNGs; and due to frequency limitations, the number of random numbers output by a single TRNG is limited, making the number of random numbers generated by TRNGs alone insufficient to meet system requirements. In summary, generating truly random numbers requires the introduction of a physical variable from an external system. Moreover, the efficiency of built-in truly random number generation is low and cannot meet the needs of certain specific business operations. Summary of the Invention

[0005] The purpose of this invention is to provide a method and system for generating physical random numbers based on convolutional neural networks. This method has the advantages of being simple and fast, having strong anti-interference capabilities, being completely unpredictable, and generating large concurrency. It solves the defects of existing random number generation methods, which have low efficiency in generating true random numbers and cannot meet some specific business needs.

[0006] To address or improve the above problems, this invention provides a method for generating physical random numbers based on a convolutional neural network, comprising the following steps:

[0007] Step S1: Set a target identification object, wherein the target identification object is a polyhedron, and each face of the polyhedron contains one or more feature information, wherein the feature information is at least one of numbers, symbols, and graphics;

[0008] Step S2: The target object is flipped over by physical means to change its state;

[0009] Step S3: Obtain the status of the target object through video recording or video;

[0010] Step S4: Identify the current state of the target object using a convolutional neural network;

[0011] Step S5: Generate a set of random numbers based on the feature information of the current state of the target object.

[0012] Preferably, the randomly generated random numbers are stored in a cache database for use by other systems. Specifically, it provides multiple interfaces such as WebAPI, TCP / IP packets, dynamic libraries, and RS232 / 485.

[0013] Preferably, in step S2, the target object is flipped over by vibration, blowing, or rotation.

[0014] Preferably, in step S3, if the state of the target object is obtained by recording video, key frame images from the video need to be extracted.

[0015] Preferably, step S4 specifically includes the following steps:

[0016] Step S41: Collect multiple images of the target object captured by video recording or video, and label them according to the collected content;

[0017] Step S42: Establish a convolutional neural network classification model, and feed the image and label information into the convolutional neural network model for learning and training;

[0018] Step S43: Using the learned and trained convolutional neural network model, the actual photograph is identified, and a large amount of information in the photograph is identified.

[0019] Preferably, in step S5, based on the recognition results of the feature information, a specific sampling algorithm is used to sample and finally generate random numbers. The specific sampling algorithm includes:

[0020] (1) Each face of the target object is distinguished by a different pattern and assigned a corresponding number;

[0021] (2) The entire container recognition surface is divided into n*n cells. Each cell can accurately place one target object. Therefore, to fill the entire surface, n*n target objects are needed. To fill a cube recognition container of length n, if the container has 6 faces, 6*n*n target objects are needed.

[0022] (3) Create a two-dimensional array of length array[n][n] that corresponds one-to-one with the cells on the recognition surface, and assign a uniform value of 0;

[0023] (4) Starting from the origin (n / 2, n / 2), if n / 2 is not an integer, round it down. The coordinates of each target object are represented by the variable (x, y). The recursive algorithm for a single recognition surface is as follows:

[0024] A. If the image of the target object on the recognition surface corresponds to an odd number, then the coordinates of the next target object are (y-1, x).

[0025] B. If the image of the target object on the recognition surface corresponds to an even number, then the coordinates of the next target object are (y+1, x).

[0026] C. If the images of the target object appearing on the recognition surface in two consecutive instances have odd numbers, then the coordinates of the next target object are (y, x+1).

[0027] D. If the images of the target object appearing on the recognition surface in two consecutive instances have even numbers, then the coordinates of the next target object are (y, x-1).

[0028] E. If x-1 < 0, then the coordinate is y+1; if x+1 > n, then the coordinate is y-1.

[0029] F. If y-1 < 0, then the coordinate is x+1; if y+1 > n, then the coordinate is x-1.

[0030] The Gx value cannot be less than 0 or greater than n, the y value cannot be less than 0 or greater than n, where n is the container length of the target recognition surface, and n target recognition objects correspond to this side;

[0031] H. After each calculation of cell coordinates, a value is assigned to array[x][y], which is the number corresponding to the new coordinate target identification pattern. If the value in array[x][y] is not 0, it means that the cell content has been used.

[0032] I. If the calculated coordinates contain non-zero values ​​in the corresponding array[x][y], then find the smallest unused cell in the array as the starting coordinate and repeat steps A to G above.

[0033] (5) If X cameras are used for identification, X groups of physical random numbers of length n*n can be identified at the same time, that is, random numbers of length X*n*n are obtained, where n and X are both integers;

[0034] Random numbers are typically longer than 16 bits. The longer the random number, the lower the probability of collisions during cracking and the better the robustness. Currently, the most commonly used random number lengths range from 64 to 512 bits. Taking a 512-bit random number as an example, a generated random number of length X*n*n can be truncated into 512 bits, resulting in X*n*n / 512 sets of usable physical random numbers. These X*n*n / 512 physical random numbers are used as random number seeds. Each seed can generate any number m (m has nothing to do with anything else; m is simply the number of pseudo-random numbers generated using a true random number as a seed. An infinite number of pseudo-random numbers can be generated using m. Because the seed is a true random number, pseudo-random numbers generated using that seed are generally considered true random numbers even without knowing the specific content of the seed) of pseudo-random numbers. These pseudo-random numbers are stored in a cache, and X*n*n / 512 sets of 512-bit physical random numbers are simultaneously provided through multiple interfaces and methods, such as WebAPI, TCP / IP, MQTT, or RPC.

[0035] For a simple example, consider a cube with 6 faces, each 128 units long and 128 units wide. Each face can hold just one target object. The original physical random number length is 6 * 128 * 128 = 98304. Dividing this number into 512-bit groups yields 192 groups of 512-bit random numbers.

[0036] (6) To ensure that the m sets of pseudo-random numbers generated from a single seed are not predicted in advance by a cracking program due to the continuous use of truly random numbers as the seed for pseudo-random number generation, a simple obfuscation algorithm should be used to generate the pseudo-random numbers. Taking the above 192 sets of 512-bit random numbers as an example:

[0037] A. Store 192 sets of truly random numbers into an array seedArray. Retrieve the first set of random numbers modulo 192.

[0038] (The reason for modulo 192 is that the total number of random numbers is 192. After modulo 192, the remainder is between 0 and 191, and the index is the one that falls within the seedArray.) This generates a remainder s. This remainder is used as the index for storing data.

[0039] B. Create a random number cache pool (cacheArray);

[0040] C. Create a loop where m (m is the total number of pseudo-random numbers to be generated) starts from 0 and ends at m-1. Using the remainder calculated in step A as the index, take the number with index s from seedArray, such as seedArray[s], as the seed, generate a pseudo-random number, and store it in cacheArray.

[0041] The remainder s2 after D.seedArray[s] modulo 192 is used as the index of the stored data and assigned to s. Step C is executed repeatedly. To avoid the seed of the pseudo-random number generated twice being the same, if s2 = s, then s = s2 + 1. After adding 1, if s is greater than 191, then s = 0.

[0042] (The purpose of the above algorithm is to prevent consecutively generated pseudo-random numbers from having the same seed, and instead randomly select the corresponding true random number from 192 sets of true random numbers based on the remainder to generate pseudo-random numbers.)

[0043] E. By changing the length of m, even millions of sets of random numbers that are not related in order can be generated;

[0044] (7) Steps (1) to (4) can be performed according to actual needs, with the device vibrating / blowing / flipping once every k seconds and updated in the manner of step (6), which can meet the demand for calling a large number of physical random numbers.

[0045] Taking the current Nvidia RTX 2080Ti as an example, it takes about 70ms to recognize an image using a convolutional neural network. It takes about 4ms for an 11th generation Intel i7 to generate the original data based on the recognition results. Using 192 sets of true random numbers after the original data is segmented as seeds, it takes about 240ms to generate a total of 1.92 million random numbers with multi-threading. That is, about 6.2 million random numbers can be generated per second.

[0046] Another technical solution of the present invention: a system for generating physically true random numbers based on a convolutional neural network, comprising:

[0047] The target identification object is a polyhedron, and each face of the polyhedron contains one or more feature information.

[0048] A target identification container for placing the identification target, wherein the target identification object is placed in the target identification container in one or more layers;

[0049] A power unit that physically causes the target object to flip.

[0050] A video recording and snapshot device is disposed above and / or on the side and / or at the bottom of the target identification container, for recording or capturing images of the target identification object and extracting keyframes from the recorded video.

[0051] The recognition module based on convolutional neural networks is used to identify the content displayed by the target object, and to sample the recognition results through computer algorithms to generate random numbers.

[0052] Preferably, there are multiple target identifiers, and the polyhedron is a tetrahedron or a hexagonal polyhedron.

[0053] Preferably, the power device is a vibration device, a stirring device, or a pneumatic device.

[0054] Preferably, the target identification container is transparent, and multiple video recording and capture devices are provided.

[0055] The beneficial effects of this invention are as follows: The method of this invention is simple and fast, has strong anti-interference capabilities (1. The device is located in a different location, so the attacker cannot directly go to the device to operate; 2. Since the random number is entirely determined by the physical vibration frequency, it can only affect the number of jumps and cannot be calculated in advance; 3. Multiple pseudo-random numbers are generated by using multiple true random numbers as seeds, and the pseudo-random numbers are not from the same true random number seed.), is completely unpredictable, and can generate large concurrency. It can create tens of thousands or even hundreds of thousands of true random numbers per second (depending on the size of the container and the transformation method of the data matrix) for use. If a true random number TRNG is used as the initial state "seed" of the pseudo random number generator (PRNG), hundreds of thousands of random numbers can be created per second for multiple systems to use, thereby greatly improving the concurrency of random number retrieval. Attached Figure Description

[0056] Figure 1 This is a system flowchart based on the present invention;

[0057] Figure 2 The graph is generated using the random algorithm according to the present invention. Detailed Implementation

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

[0059] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0060] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0061] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0062] Example

[0063] Combination such as Figure 1 A system for generating physically true random numbers based on a convolutional neural network includes: a target identification object, a target identification object container, a power unit, a video capture device, and a recognition module based on a convolutional neural network.

[0064] The target identifier is a polyhedron, such as a tetrahedron or a hexagon. Each face of the polyhedron contains one or more feature information. The feature information includes numbers, symbols, graphics, etc. One or more target identifiers can be set.

[0065] The target identification container is used to hold the target object, and the target object can be placed in one or more layers within the container. When multiple layers are set, multiple sets of random numbers can be generated simultaneously, and the randomness increases with the number of target objects. Preferably, the target identification container is transparent, allowing the state of the target object to be identified from multiple angles, such as the front and sides of the container.

[0066] The power device physically flips the target object, thereby changing its state. The power device can be a vibration device, a stirring device, a pneumatic device, etc. The power device can directly contact the target object container, such as a vibration device or a stirring device, or it can use a non-contact pneumatic device to flip the target object.

[0067] The video recording and snapshot device is disposed above and / or on the side and / or at the bottom of the target identification container, and is used to record or capture images of the target identification object to obtain its state. Specifically, when using video recording to obtain the target identification object's state, keyframe images from the video stream need to be extracted and then transmitted to the convolutional neural network-based recognition module.

[0068] The convolutional neural network-based recognition module is used to recognize the content displayed by the target object, and to sample the recognition results using a computer algorithm to generate random numbers.

[0069] The generated random numbers are stored in a cache database for use by other systems. Specifically, it provides multiple interfaces including WebAPI, TCP / IP packets, dynamic libraries, and RS232 / 485.

[0070] Combination Figure 1-2 The operation method of the above-mentioned system for generating physically true random numbers based on convolutional neural networks includes the following steps:

[0071] (i) The target identification object is flipped over by the vibration, blowing or rotation of the power device to change the state of the target identification object.

[0072] (ii) The target object is photographed or recorded using one or more video capture devices to obtain its state. When using video recording to obtain the target object's state, keyframe images from the video stream are extracted and then transmitted to the convolutional neural network-based recognition module.

[0073] (iii) Identify the current state of the target object through a convolutional neural network.

[0074] Specifically, the steps include the following:

[0075] 1) Collect multiple images of the target object captured by video recordings or videos, and number and label them according to the collected content; for example, if the target object is a 6-sided cube, each face is printed with a different pattern and is numbered.

[0076] 2) Establish a convolutional neural network classification model, and feed the images and label information into the convolutional neural network model for learning and training;

[0077] 3) Using the learned and trained convolutional neural network model, the actual photographs are identified to identify the patterns corresponding to the target objects in the photographs.

[0078] (iv) Based on the feature information of the current state of the target object, a specific algorithm is used to sample and finally generate a set of random numbers for use by the RNG algorithm.

[0079] The specific algorithm flow is as follows:

[0080] (1) Each face of the target object is distinguished by a different pattern and assigned a corresponding number;

[0081] (2) The entire container recognition surface is divided into n*n cells. Each cell can accurately place one target object. Therefore, to fill the entire surface, n*n target objects are needed. To fill a cube recognition container of length n, if the container has 6 faces, 6*n*n target objects are needed.

[0082] (3) Create a two-dimensional array of length array[n][n] that corresponds one-to-one with the cells on the recognition surface, and assign a uniform value of 0;

[0083] (4) Starting from the origin (n / 2, n / 2), if n / 2 is not an integer, round it down. The coordinates of each target object are represented by the variable (x, y). The recursive algorithm for a single recognition surface is as follows:

[0084] A. If the image of the target object presented on the recognition surface corresponds to an odd number, then the next...

[0085] The coordinates of each target object are (y-1, x);

[0086] B. If the image of the target object presented on the recognition surface corresponds to an even number, then the next...

[0087] The coordinates of the target object are (y+1, x);

[0088] C. If the images of the target object appearing on the recognition surface in two consecutive instances have odd numbers, then the coordinates of the next target object are (y, x+1).

[0089] D. If the images of the target object appearing on the recognition surface in two consecutive instances have even numbers, then the coordinates of the next target object are (y, x-1).

[0090] E. If x-1 < 0, then the coordinate is y+1; if x+1 > n, then the coordinate is y-1.

[0091] F. If y-1 < 0, then the coordinate is x+1; if y+1 > n, then the coordinate is x-1.

[0092] The Gx value cannot be less than 0 or greater than n, the y value cannot be less than 0 or greater than n, where n is the container length of the target recognition surface, and n target recognition objects correspond to this side;

[0093] H. After each calculation of cell coordinates, a value is assigned to array[x][y], which is the number corresponding to the new coordinate target identification pattern. If the value in array[x][y] is not 0, it means that the cell content has been used.

[0094] I. If the calculated coordinates contain non-zero values ​​in the corresponding array[x][y], then find the smallest unused cell in the array as the starting coordinate and repeat steps A to G above.

[0095] (5) If X cameras are used for identification, X groups of physical random numbers of length n*n can be identified at the same time, that is, random numbers of length X*n*n are obtained, where n and X are both integers;

[0096] Random numbers are typically longer than 16 bits. The longer the random number, the lower the probability of collisions during cracking and the better the robustness. Currently, the most commonly used random number lengths range from 64 to 512 bits. Taking a 512-bit random number as an example, a generated random number of length X*n*n can be truncated into 512 bits, resulting in X*n*n / 512 sets of usable physical random numbers. These X*n*n / 512 physical random numbers are used as random number seeds. Each seed can generate any number m (m has nothing to do with anything else; m is simply the number of pseudo-random numbers generated using a true random number as a seed. An infinite number of pseudo-random numbers can be generated using m. Because the seed is a true random number, pseudo-random numbers generated using that seed are generally considered true random numbers even without knowing the specific content of the seed) of pseudo-random numbers. These pseudo-random numbers are stored in a cache, and X*n*n / 512 sets of 512-bit physical random numbers are simultaneously provided through multiple interfaces and methods, such as WebAPI, TCP / IP, MQTT, or RPC.

[0097] For a simple example, consider a cube with 6 faces, each 128 units long and 128 units wide. Each face can hold just one target object. The original physical random number length is 6 * 128 * 128 = 98304. Dividing this number into 512-bit groups yields 192 groups of 512-bit random numbers.

[0098] (6) To ensure that the m sets of pseudo-random numbers generated from a single seed are not predicted in advance by a cracking program due to the continuous use of truly random numbers as the seed for pseudo-random number generation, a simple obfuscation algorithm should be used to generate the pseudo-random numbers. Taking the above 192 sets of 512-bit random numbers as an example:

[0099] A. Store 192 sets of truly random numbers into the seedArray array. Take the first set of random numbers, modulo 192 (the reason for modulo 192 is that the total number of random numbers is 192, and after modulo 192, the remainder is between 0 and 191, with the index falling within the seedArray), and generate a remainder s. This remainder is used as the index for storing the data;

[0100] D. Create a random number cache pool (cacheArray);

[0101] E. Create a loop where m (m is the total number of pseudo-random numbers to be generated) starts from 0 and ends at m-1. Using the remainder calculated in step A as the index, take the number with index s from seedArray, such as seedArray[s], as the seed, generate a pseudo-random number, and store it in cacheArray.

[0102] The remainder s2 after D.seedArray[s] modulo 192 is used as the index of the stored data and assigned to s. Step C is executed repeatedly. To avoid the seed of the pseudo-random number generated twice being the same, if s2 = s, then s = s2 + 1. After adding 1, if s is greater than 191, then s = 0.

[0103] (The purpose of the above algorithm is to prevent consecutively generated pseudo-random numbers from having the same seed, and instead randomly select the corresponding true random number from 192 sets of true random numbers based on the remainder to generate pseudo-random numbers.)

[0104] E. By changing the length of m, even millions of sets of random numbers that are not related in order can be generated;

[0105] (7) Steps (1) to (4) can be performed according to actual needs, with the device vibrating / blowing / flipping once every k seconds and updated in the manner of step (6), which can meet the demand for calling a large number of physical random numbers.

[0106] This method can create tens of thousands or even hundreds of thousands of truly random numbers per second (depending on the size of the container and the transformation method of the data matrix) for use. If a truly random number generator (TRNG) is used as the initial state "seed" of a pseudo random number generator (PRNG), hundreds of thousands of random numbers can be created per second for multiple systems to use, thus greatly improving the concurrency of random number retrieval. Taking the current Nvidia RTX 2080Ti as an example, the time for a convolutional network to recognize an image is about 70ms, and the time for an 11th generation Intel i7 to generate the original data based on the recognition results is about 4ms. Using 192 sets of truly random numbers after the original data is segmented as seeds, the time to generate a total of 1.92 million random numbers with multi-threading is about 240ms, which means that about 6.2 million random numbers can be generated per second.

[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.

Claims

1. A method for generating physical random numbers based on a convolutional neural network, characterized in that, Includes the following steps: Step S1: Set a target identification object, wherein the target identification object is a polyhedron, and each face of the polyhedron contains one or more feature information, wherein the feature information is at least one of numbers, symbols, and graphics; Step S2: Physically flip the target object to change its state; Step S3: Obtain the status of the target object through video recording or video; Step S4: Identify the current state of the target object using a convolutional neural network; Step S5: Based on the feature information of the current state of the target object, a specific sampling algorithm is used to sample and finally generate random numbers. The specific sampling algorithm includes: (1) Each face of the target object is distinguished by a different pattern and assigned a corresponding number; (2) The entire container recognition surface is divided into n There are n cells, each of which can accurately place one target object. Therefore, filling the entire face requires n cells. There are n target objects to be identified, filling a cubic identification container of length n. The container has N faces and requires N... n There are n target identifiers, where N is an integer; (3) Create a two-dimensional array of length array[n][n] that corresponds one-to-one with the cells on the recognition surface, and assign a uniform value of 0; (4) Starting from the origin (n / 2, n / 2), if n / 2 is not an integer, it is rounded down. The coordinates of each target object are represented by variables (x, y). The recursive algorithm for a single recognition surface is as follows: A. If the image of the target object on the recognition surface has an odd number, then the coordinates of the next target object are (y-1, x). B. If the image of the target object on the recognition surface has an even number, then the coordinates of the next target object are (y+1, x). C. If the images of the target object appearing on the recognition surface in two consecutive instances have odd numbers, then the coordinates of the next target object are (y, x+1). D. If the images of the target object appearing on the recognition surface in two consecutive instances have even numbers, then the coordinates of the next target object are (y, x-1). E. If x-1 < 0, then the coordinate is y+1; if x+1 > n, then the coordinate is y-1. F. If y-1 < 0, then the coordinate is x+1; if y+1 > n, then the coordinate is x-1. The Gx value cannot be less than 0 or greater than n, and the y value cannot be less than 0 or greater than n, where n is the container length of the target recognition surface; H. After each calculation of cell coordinates, a value is assigned to array[x][y], which is the number corresponding to the new coordinate target identification pattern. If the value in array[x][y] is not 0, it means that the cell content has been used. I. If the calculated coordinates contain non-zero values ​​in the corresponding array[x][y], then find the smallest unused cell in the array as the starting coordinate and repeat steps A~G above. (5) If X cameras are used for identification, X groups of n can be identified simultaneously. Obtain a physical random number of length n, i.e., obtain X. n A random number of length n, where n and X are both integers; The generated X n If a random number of length n is truncated to every L bits, then X can be obtained. n n / L groups of available physical random numbers, and using this X n n / L physical random numbers are used as random number seeds. Each seed can generate any number of m sets of pseudo-random numbers, which are stored in a cache. X is provided simultaneously through multiple interfaces and methods, including WebAPI, TCP / IP, MQTT, and RPC. n n / L groups of physical random numbers with a length of L bits; L is any single-digit number between 64 and 512; (6) In order to ensure that the m sets of pseudo-random numbers generated by a single seed are not predicted by the cracking program in advance because true random numbers are used continuously as the seed for pseudo-random number generation, a simple obfuscation algorithm should be used for the generated pseudo-random numbers: A. X n n / L sets of truly random numbers are stored in the array seedArray; the first set of random numbers modulo X is retrieved. n n / L produces a remainder s, which is used as an index for storing data; B. Create a random number cache pool (cacheArray); C. Create a loop where m is the total number of pseudo-random numbers to be generated, starting from 0 and ending at m-1. Using the remainder calculated in step A as the index, take the number with index s from seedArray as the seed, generate a pseudo-random number, and store it in cacheArray. D.seedArray[s] modulo X n The remainder s2 after n / L is used as the index for storing data and assigned to s. Step C is repeated. To avoid duplicate seeds for the two generated pseudo-random numbers, if s2 = s, then s = s2 + 1. After adding 1, if s is greater than X... n If n / L-1, then s=0; E. By changing the length of m, even millions of sets of random numbers that are not related in order can be generated; (7) Steps (1) to (4) According to actual needs, the target object is flipped once every k seconds and updated in the manner of step (6) to meet the demand for calling a large number of physical random numbers.

2. The method for generating physical random numbers based on a convolutional neural network according to claim 1, characterized in that, The random numbers are stored in a cache database for use by other systems.

3. The method for generating physical random numbers based on a convolutional neural network according to claim 1, characterized in that, In step S2, the target object is flipped over by vibration, blowing, or rotation.

4. The method for generating physical random numbers based on a convolutional neural network according to claim 1, characterized in that, In step S3, if the state of the target object is obtained by recording video, key frame images need to be extracted from the video.

5. The method for generating physical random numbers based on a convolutional neural network according to claim 1, characterized in that, Step S4 specifically includes the following steps: Step S41: Collect multiple images of the target object captured by video recording or video, and label them according to the collected content; Step S42: Establish a convolutional neural network classification model, and feed the image and label information into the convolutional neural network model for learning and training; Step S43: Using the learned and trained convolutional neural network model, the actual photograph is identified, and the image information on the corresponding surface is obtained after each target object in the photograph is identified.

6. A system for generating physically true random numbers based on a convolutional neural network, characterized in that, include: The target identification object is a polyhedron, and each face of the polyhedron contains one or more feature information. A target identification container for placing the identification target, wherein the target identification object is placed in the target identification container in one or more layers; A power unit that physically causes the target object to flip. A video recording and snapshot device is disposed on multiple surfaces such as the top, bottom, left, right, front, and back of the target identification container, for recording or capturing images of the target identification object and extracting key frames from the recorded video. The recognition module based on a convolutional neural network is used to identify the content displayed by the target object, and to sample the recognition results using a computer algorithm to generate random numbers; specifically as follows: (1) Each face of the target object is distinguished by a different pattern and assigned a corresponding number; (2) The entire container recognition surface is divided into n There are n cells, each of which can accurately place one target object. Therefore, filling the entire face requires n cells. There are n target objects to be identified, filling a cubic identification container of length n. The container has N faces and requires N... n There are n target identifiers, where N is an integer; (3) Create a two-dimensional array of length array[n][n] that corresponds one-to-one with the cells on the recognition surface, and assign a uniform value of 0; (4) Starting from the origin (n / 2, n / 2), if n / 2 is not an integer, it is rounded down. The coordinates of each target object are represented by variables (x, y). The recursive algorithm for a single recognition surface is as follows: A. If the image of the target object on the recognition surface has an odd number, then the coordinates of the next target object are (y-1, x). B. If the image of the target object on the recognition surface has an even number, then the coordinates of the next target object are (y+1, x). C. If the images of the target object appearing on the recognition surface in two consecutive instances have odd numbers, then the coordinates of the next target object are (y, x+1). D. If the images of the target object appearing on the recognition surface in two consecutive instances have even numbers, then the coordinates of the next target object are (y, x-1). E. If x-1 < 0, then the coordinate is y+1; if x+1 > n, then the coordinate is y-1. F. If y-1 < 0, then the coordinate is x+1; if y+1 > n, then the coordinate is x-1. The Gx value cannot be less than 0 or greater than n, and the y value cannot be less than 0 or greater than n, where n is the container length of the target recognition surface; H. After each calculation of cell coordinates, a value is assigned to array[x][y], which is the number corresponding to the new coordinate target identification pattern. If the value in array[x][y] is not 0, it means that the cell content has been used. I. If the calculated coordinates contain non-zero values ​​in the corresponding array[x][y], then find the smallest unused cell in the array as the starting coordinate and repeat steps A~G above. (5) By using X cameras for identification, X groups of n can be identified simultaneously. Obtain a physical random number of length n, i.e., obtain X. n A random number of length n, where n and X are both integers; The generated X n If a random number of length n is truncated to every L bits, then X can be obtained. n n / L groups of available physical random numbers, and using this X n n / L physical random numbers are used as random number seeds. Each seed can generate any number of m sets of pseudo-random numbers, which are stored in a cache. X is provided simultaneously through multiple interfaces and methods, including WebAPI, TCP / IP, MQTT, and RPC. n n / L groups of physical random numbers with a length of L bits; L is any single-digit number between 64 and 512; (6) To ensure that the m sets of pseudo-random numbers generated by a single seed are not predicted in advance by the cracking program due to the continuous use of true random numbers as the seed for pseudo-random number generation, a simple obfuscation algorithm should be used for the generated pseudo-random numbers: A. X n n / L sets of truly random numbers are stored in the seedArray array; Take the first set of random numbers modulo X n n / L produces a remainder s, which is used as an index for storing data; D. Create a random number cache pool (cacheArray); E. Create a loop where m is the total number of pseudo-random numbers to be generated, starting from 0 and ending at m-1. Using the remainder calculated in step A as the index, take the number with index s from seedArray as the seed, generate a pseudo-random number, and store it in cacheArray. D.seedArray[s] modulo X n The remainder s2 after n / L is used as the index for storing data and assigned to s. Step C is repeated. To avoid duplicate seeds for the two generated pseudo-random numbers, if s2 = s, then s = s2 + 1. After adding 1, if s is greater than X... n If n / L-1, then s=0; E. By changing the length of m, even millions of sets of random numbers that are not related in order can be generated; (7) Steps (1) to (4) According to actual needs, the target object is flipped once every k seconds and updated in the manner of step (6) to meet the demand for calling a large number of physical random numbers.

7. The system for generating physically true random numbers based on a convolutional neural network according to claim 6, characterized in that, There are multiple target identifiers, and the polyhedrons are either tetragonal or hexagonal.

8. The method for generating physical random numbers based on a convolutional neural network according to claim 6, characterized in that, The power device is a vibration device, a stirring device, or a pneumatic device.

9. The method for generating physical random numbers based on a convolutional neural network according to claim 6, characterized in that, The target identification container is transparent, and multiple video recording and capture devices are provided.

Citation Information

Patent Citations

  • Random number generation control method and device, computer equipment and storage medium

    CN110083386A

  • Anti-noise interference convolutional neural network target recognition training method and device

    CN116543251A