Method and device for generating random number
Patent Information
- Application Number
- CN202380010357.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-29
- Publication Date
- 2025-05-06
AI Technical Summary
When generating random numbers in the prior art, the security of pseudo-random numbers is not high, while the generation method of true random numbers is technically demanding and costly.
By extracting the physical information of the screen displayed on the display screen, a random number matrix is generated, and a random number is generated based on the matrix. This method utilizes the physical random phenomenon of the display screen to improve the security of random numbers and reduces the dependence on high-precision measurement devices.
It realizes the generation of random numbers with high security without the need for additional high-precision measurement equipment, and is cheaper.
Smart Images

Figure CN119948455A_ABST
Abstract
Description
Method and device for generating random numbers Technical Field
[0001] The present disclosure relates to a method and device for generating random numbers. Background Art
[0002] Smart devices have now penetrated into every aspect of people's lives, bringing great convenience to people's lives and work. However, at the same time, they also pose a great threat to users' data, privacy, and even property security.
[0003] Currently, the core of providing secure application services to users is cryptographic technology, and random numbers are the trust root of cryptographic technology, and their generation method is the guarantee of the entire secure application service.
[0004] Summary of the Invention
[0005] Embodiments of the present disclosure provide a method and apparatus for generating random numbers.
[0006] In one disclosed aspect, a method for generating random numbers is provided, comprising: receiving a random number generation instruction; extracting physical information of an image displayed on a display screen; generating a random number matrix based on the physical information; and generating a random number based on the random number matrix. In one or more embodiments, the physical information of the displayed image includes one or more of grayscale, brightness, voltage, or color attributes of pixels of the displayed image.
[0007] In one or more embodiments involving the method, extracting the physical information of the picture displayed by the display screen includes: extracting the physical information of the picture being displayed by the display screen when the random number generation instruction is received.
[0008] In one or more embodiments involving the method, extracting physical information of a picture displayed on a display screen includes: detecting whether the time for which the picture displayed on the display screen stays is greater than a predetermined time threshold when a random number generation instruction is received; and in response to detecting that the displayed picture stays for more than the predetermined time threshold, extracting physical information of another picture displayed before the picture currently being displayed on the display screen, wherein the time for which the other picture stays on the display screen is not greater than the predetermined time threshold; or in response to detecting that the displayed picture stays for less than the predetermined time threshold, extracting physical information of the picture currently being displayed on the display screen.
[0009] In one or more embodiments relating to the method, the predetermined time threshold is greater than 1 minute.
[0010] In one or more embodiments of the method, extracting physical information of the screen displayed on the display screen includes: detecting whether the display screen is on a random number operation interface when a random number generation instruction is received; and in response to detecting that the display screen is on the random number operation interface, extracting the physical information of the last frame of the screen displayed on the non-random number operation interface before the display screen switches to the random number operation interface, or in response to detecting that the display screen is on the non-random number operation interface, extracting the physical information of the screen currently being displayed on the display screen.
[0011] In one or more embodiments of the method, the display screen includes m x n pixels arranged in an array, where m and n are positive integers. Generating a random number matrix based on the physical information includes: determining the matrix elements of the random number matrix based on the physical information of the m x n pixels.
[0012] In one or more embodiments of the method, the random number matrix includes an m x n matrix. Determining the physical information of the m x n pixels as the matrix elements of the m x n matrix.
[0013] In one or more embodiments of the method, the method further includes: determining whether the random number matrix is a square matrix, and in response to determining that the random number matrix is not a square matrix, creating a square matrix by cropping or adding matrix elements to the m x n matrix formed by the physical information of the m x n pixels.
[0014] In one or more embodiments of the method, when m > n, cropping the matrix elements of the m x n matrix by removing m - n rows of matrix elements from the m x n matrix to form an n x n square matrix, or adding matrix elements to the m x n matrix by inserting m - n columns of matrix elements into the m x n matrix to form an m x m square matrix. The inserted m - n columns of matrix elements are calculated based on the known matrix elements in the rows where the inserted matrix elements are located. When m < n, cropping the matrix elements of the m x n matrix by removing n - m columns of matrix elements from the m x n matrix to form an m x m square matrix, or adding matrix elements to the m x n matrix by inserting n - m rows of matrix elements into the m x n matrix to form an n x n square matrix. The inserted n - m rows of matrix elements are calculated based on the known matrix elements in the columns where the inserted matrix elements are located.
[0015] In one or more embodiments related to a method, when m > n, remove the matrix elements from the (n + 1)-th row to the m-th row in the m x n matrix to form an n x n square matrix, or insert matrix elements from the (n + 1)-th column to the m-th column in the m x n matrix to form an m x m square matrix. In this case, the inserted matrix elements are calculated by one of the following methods:
[0016] The average value of all known elements in the row where the inserted matrix element is located,
[0017] The root mean square of all known elements in the row where the inserted matrix element is located, or
[0018] The square root of the sum of the squares of all known elements in the row where the inserted matrix element is located divided by the number of known elements.
[0019] When m < n, remove the matrix elements from the (m + 1)-th column to the n-th column in the m x n matrix to form an m x m square matrix, or insert matrix elements from the (m + 1)-th row to the n-th row in the m x n matrix to form an n x n square matrix. In this case, the inserted matrix elements are calculated by one of the following methods:
[0020] The average value of all known elements in the column where the inserted matrix element is located,
[0021] The root mean square of all known elements in the column where the inserted matrix element is located, or
[0022] The square root of the sum of the squares of all known elements in the column where the inserted matrix element is located divided by the number of known elements.
[0023] In one or more embodiments related to a method, generating a random number based on the random number matrix includes: calculating the eigenvalues of the random number matrix based on the matrix elements of the random number matrix; performing a rounding operation on the calculated eigenvalues; determining whether the number of digits of the rounded eigenvalue is odd or even; and in response to determining that the number of digits of the rounded eigenvalue is even, taking the middle even-numbered digits of the rounded eigenvalue as the random number; or in response to determining that the number of digits of the rounded eigenvalue is odd, taking the middle odd-numbered digits of the rounded eigenvalue as the random number.
[0024] In one or more embodiments of the method, generating a random number based on the random number matrix further includes: determining whether the number of digits of the rounded eigenvalue is less than a predetermined digit threshold; and in response to the determination that the number of digits of the rounded eigenvalue is less than the predetermined digit threshold: performing at least one secondary operation on the rounded eigenvalue until the number of digits of the eigenvalue after the secondary operation is not less than the predetermined digit threshold, determining whether the number of digits of the eigenvalue after the secondary operation is odd or even, and in response to the determination that the number of digits of the eigenvalue after the secondary operation is even, using the middle even digits of the eigenvalue after the secondary operation as the random number, or in response to the determination that the number of digits of the eigenvalue after the secondary operation is odd, using the middle odd digits of the eigenvalue after the secondary operation as the random number. The step of determining whether the number of digits of the rounded eigenvalue is odd or even is performed in response to the determination that the number of digits of the rounded eigenvalue is not less than the predetermined digit threshold.
[0025] In one or more embodiments of the method, performing at least one quadratic operation on the rounded eigenvalue includes performing at least one N-th power operation or multiple operation on the rounded eigenvalue, where N≥2.
[0026] In one or more embodiments of the method, the eigenvalues of the random number matrix are calculated by one of the following methods:
[0027] Determining the sum of all matrix elements of the random number matrix;
[0028] Determining the sum of squares of all matrix elements of the random number matrix;
[0029] Determining the square root of the sum of the squares of all matrix elements of the random number matrix;
[0030] determining the sum of the square roots of all matrix elements of the random number matrix; or
[0031] The square of the sum of all matrix elements of the random number matrix is determined.
[0032] In one or more embodiments of the method, the random number matrix comprises a square matrix, and wherein the eigenvalues of the random number matrix are calculated by one of the following means:
[0033] Determining the sum of all matrix elements of the random number matrix;
[0034] Determining the sum of squares of all matrix elements of the random number matrix;
[0035] Determining the square root of the sum of the squares of all matrix elements of the random number matrix;
[0036] Determining the sum of the square roots of all matrix elements of the random number matrix;
[0037] determining the square of the sum of all matrix elements of the random number matrix; or
[0038] The trace or norm of the square matrix is determined.
[0039] In another aspect of the present disclosure, a device for generating random numbers is provided, comprising: an instruction receiving component configured to receive a random number generation instruction; a physical information extraction component configured to extract physical information of a picture displayed on a display screen; a random number matrix generation component configured to generate a random number matrix based on the physical information; and a random number generation component configured to generate a random number based on the random number matrix. In one or more embodiments, the physical information of the displayed picture includes one or more of grayscale, brightness, voltage, or color attributes of pixels of the displayed picture.
[0040] In an embodiment of the present disclosure relating to the device, the physical information extraction component is configured to extract physical information of a picture currently being displayed on the display screen when the random number generation instruction is received.
[0041] In an embodiment of the present disclosure relating to an apparatus, the display screen comprises mxn pixels arranged in an array, wherein m and n are positive integers.
[0042] In an embodiment of the present disclosure relating to an apparatus, the random number matrix comprises an mxn matrix, and wherein the physical information of the mxn pixels is determined as matrix elements of the mxn matrix.
[0043] In an embodiment of the present disclosure related to the apparatus, the random number matrix comprises a square matrix, and the random matrix generation component is configured to create the square matrix by trimming or adding matrix elements to an mxn matrix formed by physical information of the mxn pixels.
[0044] In an embodiment of the present disclosure involving an apparatus, the random number generating component is configured to:
[0045] Calculate the eigenvalues of the random number matrix based on the matrix elements of the random number matrix; perform a rounding operation on the calculated eigenvalues; determine whether the number of digits of the rounded eigenvalues is an odd number or an even number; and in response to the determination that the number of digits of the rounded eigenvalues is an even number, use the middle even number of digits of the rounded eigenvalues as the random number; or in response to the determination that the number of digits of the rounded eigenvalues is an odd number, use the middle odd number of digits of the rounded eigenvalues as the random number.
[0046] In an embodiment of the present disclosure involving a device, the random number generating component calculates the eigenvalues of the random number matrix by one of the following methods:
[0047] Determining the sum of all matrix elements of the random number matrix;
[0048] Determining the sum of squares of all matrix elements of the random number matrix;
[0049] Determining the square root of the sum of the squares of all matrix elements of the random number matrix;
[0050] determining the sum of the square roots of all matrix elements of the random number matrix; or
[0051] The square of the sum of all matrix elements of the random number matrix is determined.
[0052] In an embodiment of the present disclosure involving the apparatus, the random number matrix comprises a square matrix. The random number generating component calculates the eigenvalues of the random number matrix by one of the following methods:
[0053] Determining the sum of all matrix elements of the random number matrix;
[0054] Determining the sum of squares of all matrix elements of the random number matrix;
[0055] Determining the square root of the sum of the squares of all matrix elements of the random number matrix;
[0056] Determining the sum of the square roots of all matrix elements of the random number matrix;
[0057] determining the square of the sum of all matrix elements of the random number matrix; or
[0058] The trace or norm of the square matrix is determined.
[0059] In yet another aspect of the present disclosure, a device for generating a random number includes: at least one processor; and at least one memory, which includes computer program code, which, when executed by the at least one processor, causes the device to perform the method described in detail in any embodiment of the present disclosure involving the method.
[0060] Further aspects and scope of adaptability become apparent from the description provided herein. It should be understood that various aspects of the present application can be implemented individually or in combination with one or more other aspects. It should also be understood that the description and specific embodiments herein are intended for illustrative purposes only and are not intended to limit the scope of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The drawings described herein are for illustrative purposes only of selected embodiments and not all possible implementations, and are not intended to limit the scope of the present disclosure. In the drawings:
[0062] FIG. 1 is a schematic diagram of the generation of pseudo-random numbers;
[0063] FIG. 2 is a schematic diagram of the generation of true random numbers;
[0064] FIG. 3 schematically shows a flowchart of a method for generating random numbers in an embodiment of the present disclosure;
[0065] FIG. 4 schematically shows a pixel array of a display screen;
[0066] FIG. 5 schematically shows a flowchart of generating random numbers based on a random number matrix in one or more embodiments of the present disclosure;
[0067] FIG. 6 schematically shows a flowchart of a method for generating random numbers in another embodiment of the present disclosure;
[0068] FIG. 7 schematically shows a flowchart of a method for generating random numbers in yet another embodiment of the present disclosure;
[0069] FIG. 8 schematically shows a flowchart of a method for generating random numbers according to yet another embodiment of the present disclosure;
[0070] FIG. 9A shows a schematic diagram of constructing a square matrix by cropping matrix elements when m>n in some embodiments of the present disclosure;
[0071] FIG. 9B shows a schematic diagram of constructing a square matrix by cropping matrix elements when m<n in some embodiments of the present disclosure;
[0072] FIG. 9C shows a schematic diagram of constructing a square matrix by adding matrix elements when m>n in some embodiments of the present disclosure;
[0073] FIG. 9D shows a schematic diagram of constructing a square matrix by adding matrix elements when m<n in some embodiments of the present disclosure;
[0074] FIG. 10 is a block diagram of an apparatus for generating random numbers in one or more embodiments of the present disclosure;
[0075] FIG. 11 is a block diagram of another apparatus for generating random numbers in one or more embodiments of the present disclosure; and
[0076] FIG. 12 is a schematic diagram of a device for generating random numbers in one or more embodiments of the present disclosure.
[0077] Throughout the various views of these drawings, corresponding reference numerals indicate corresponding components or features. Detailed Description of the Invention
[0078] Various embodiments will now be described in detail with reference to the accompanying drawings, which are provided as exemplary embodiments of the present disclosure, so that those skilled in the art can realize the present disclosure. It should be noted that the following figures and embodiments are not intended to limit the scope of the present disclosure. In the case where a particular element of the present disclosure can be partially or entirely realized using known components (or methods or processes), only those parts of this known component (or method or process) required for understanding the present disclosure will be described, and the detailed description of the other parts of this known component (or method or process) will be omitted so as not to confuse the present disclosure. Further, various embodiments include the present and future known equivalents that are equivalent to the components (or methods or processes) involved herein by way of illustration.
[0079] The flowchart depicted in this disclosure is merely an example. Many variations of the flowchart or the steps described therein are possible without departing from the spirit of this disclosure. For example, the steps may be performed in a different order, or steps may be added, deleted, or modified. Such variations are considered part of the claimed aspects.
[0080] As used herein, the terms "having," "including," and "comprising" and their grammatical variations are used in a non-exclusive manner. Thus, the expression "A has B," as well as the expressions "A includes B," or "A comprises B," may refer to the fact that A includes one or more other components and / or members in addition to B, as well as the fact that no other components, members, or elements are present in A in addition to B. The terms "a," "the," "said," and "at least one" are used to indicate the presence of one or more elements / components / etc.
[0081] In the related art, there are two common types of random numbers, one is a pseudo-random number and the other is a true random number.
[0082] Pseudorandom numbers are typically generated using software. Specifically, pseudorandom numbers can be generated using a specific algorithm that generates a random sequence and performs identity verification. Figure 1 is a schematic diagram of pseudorandom number generation. As shown in Figure 1, the software in the smart terminal can generate pseudorandom numbers using a specific algorithm and then generate a random password based on the pseudorandom numbers. However, these pseudorandom numbers generated by a specific algorithm can be cracked through repeated attempts to identify patterns. Therefore, the security of these pseudorandom numbers is not high.
[0083] True random numbers are usually generated by utilizing the inherent and unclonable physical characteristics of an object. For example, physical noise in nature, such as device noise, nuclear decay noise, Brownian motion noise, thermal noise, etc., is used to generate true random numbers by amplifying, extracting, and post-processing these noises. Figure 2 is a schematic diagram of the generation of true random numbers. As shown in Figure 2, the physical hardware on the smart terminal extracts the difference in physical quantities, generates true random numbers based on the difference in physical quantities (physical unclonable function (PUF)), and then generates a random password based on the true random numbers. Although this method of generating true random numbers based on physical unclonability has a high level of security, it has the disadvantage of high technical requirements. For example, high-precision measurement equipment is required and it is seriously affected by circuit process, voltage, and temperature.
[0084] The embodiments of the present disclosure provide a method and apparatus for generating random numbers, which generate a random number array based on the physical information displayed on the display screen, and then generate random numbers based on the random number array. Since the images displayed on the display screen of a smart device usually change randomly, the physical properties of each pixel also change randomly, and therefore, the display screen forms an obvious physical random phenomenon. The method for generating random numbers based on the images displayed on the display plane in the embodiments of the present disclosure utilizes this physical random phenomenon, and therefore has higher security. In addition, the generation of random numbers described in the embodiments of the present disclosure does not require additional high-precision measurement equipment, and therefore has lower cost.
[0085] As used herein, a "display screen" may be a display screen of a smart terminal, such as a mobile terminal, a personal computer, etc. A mobile terminal may be a mobile phone, a tablet computer, a personal digital assistant, an e-book, or other hardware device with various operating systems.
[0086] Figure 3 schematically shows a flow chart of a method for generating a random number in one embodiment of the present disclosure. As shown in Figure 3 , the method for generating a random number may include the following steps S102 , S104 , S106 and S108 .
[0087] In step S102, a random number generation instruction is received.
[0088] In some exemplary embodiments of the present disclosure, a user may issue a random number generation instruction via an input / output interface of a smart terminal. The input / output interface may include, for example, a mouse, keyboard, touch screen, etc. In other embodiments, the random number generation instruction may be issued by software on the smart terminal as needed.
[0089] In step S104, physical information of the picture displayed on the display screen is extracted.
[0090] In some embodiments, physical information of the image being displayed on the display screen when the random number generation instruction is received may be extracted.
[0091] In some embodiments, the physical information of the display screen may include physical information of pixels of the display screen. As an example, the physical information of the pixels may include the grayscale of the pixels. In alternative embodiments, the physical information of the pixels may also include brightness, voltage, or color attributes of the pixels.
[0092] Typically, the images displayed on smart terminal screens change rapidly, and the physical characteristics of each pixel (such as grayscale, brightness, voltage, or color attributes) also change randomly. Therefore, the physical information extracted from the image currently displayed on the display screen can have a high degree of randomness. Therefore, the random number generated based on this extracted physical information also has better security.
[0093] The display screen may be composed of a pixel array. FIG4 schematically shows a pixel array of a display screen. As shown in FIG4 , the display screen may include m×n pixels 401 arranged in an array, wherein m and n are positive integers. By way of example, whenever the display screen displays a picture, the light emitted by each pixel 401 has a specific brightness, which can also be represented by grayscale, which represents different brightness levels from darkest to brightest. The more brightness levels, the more refined the picture effect that can be presented. Taking an 8-bit display panel as an example, 2 8 = 256 grayscales. Typically, the image displayed on the display screen may be updated frame by frame, so the grayscale of the pixel 401 corresponding to the image may also randomly change frame by frame. Therefore, the grayscale information of the pixel 401 of the image currently displayed on the display screen can be extracted to generate a random number.
[0094] In step S106, a random number matrix is generated based on the extracted physical information.
[0095] As used herein, a “random number matrix” may refer to a digital array generated from physical information extracted from a picture displayed on a display screen, which may be used to generate random numbers.
[0096] In an exemplary embodiment, a random number matrix may be generated based on the grayscale information of the pixel 401 extracted in step S104. As an example, an mxn matrix may be generated as the random number matrix. In this case, the physical information (e.g., grayscale) of the mxn pixels 401 of the display screen may be determined as matrix elements of the mxn matrix. The generated random number matrix may be expressed as:
[0097] where a ij is a matrix element represented by the physical information of the pixel (such as grayscale), i, j is a natural number, and 0≤a ij ≤255, 1≤i≤m, 1≤j≤n.
[0098] In some other embodiments, instead of constructing the physical information of all pixels 401 of the display screen as matrix elements of the random number matrix, the physical information of a portion of the pixels 401 on the display screen may be constructed as matrix elements of the random number matrix. As an example, a rectangular area of the image displayed on the display screen may be selected, and the physical information of the pixels 401 corresponding to the rectangular area may be used to construct the random number matrix. As another example, some discrete pixels 401 of the displayed image may be randomly selected, and the physical information of the selected discrete pixels 401 may be used to construct the random number matrix. In the latter case, the randomness of the random matrix can be further increased, thereby increasing the security of the random number.
[0099] In step S108 , random numbers are generated based on the random number matrix.
[0100] In this step, eigenvalues of the random number matrix may be calculated based on the matrix elements of the random number matrix generated in step S107 , and then random numbers may be obtained based on the eigenvalues.
[0101] Figure 5 schematically illustrates a flow chart of generating random numbers based on a random number matrix in one or more embodiments of the present disclosure. As shown in Figure 5, generating random numbers based on a random number matrix may include the following steps S42, S44, S46, S48, S50, S52, S54, S56, S58, and S60.
[0102] In step S42, eigenvalues of the random number matrix are calculated based on the matrix elements of the random number matrix.
[0103] In this step, the eigenvalues of the random number matrix can be calculated by one of the following methods:
[0104] a) Determine the sum of all matrix elements of the random number matrix
[0105] b) Determine the sum of the squares of all matrix elements of the random number matrix
[0106] c) Determine the square root of the sum of the squares of all matrix elements of the random number matrix
[0107] d) Determine the sum of the square roots of all matrix elements of the random number matrix or
[0108] e) Determine the square of the sum of all matrix elements of the random number matrix
[0109] In step S44, the calculated eigenvalue may be rounded to an integer. As described above, in the calculation of the eigenvalue, some operations (e.g., square root operations) may result in the calculated eigenvalue having a decimal portion. In this case, the calculated eigenvalue may be rounded to an integer to remove the decimal portion.
[0110] In step S46, it is optionally determined whether the number of digits of the rounded eigenvalue is less than a predetermined digit threshold. If the number of digits of the rounded eigenvalue is less than the predetermined digit threshold, step S48 is executed, otherwise step S56 is executed.
[0111] In this step, the predetermined digit threshold may be no less than 10.
[0112] When the values of the matrix elements of the random number matrix are relatively small, the number of digits of the calculated eigenvalue is relatively small, and the security of the generated random number is not high. In order to improve security, a predetermined digit threshold can be set to ensure the security of the random number.
[0113] In step S48, at least one secondary operation is performed on the rounded eigenvalue until the number of digits of the eigenvalue after the secondary operation is not less than a predetermined threshold value of digits.
[0114] As an example, if the eigenvalue calculated in step S44 is 625876 and the number of bits of the eigenvalue is 6, which is less than the predetermined number of bits threshold, the eigenvalue can be calculated twice so that the number of bits of the eigenvalue after the second calculation is not less than the predetermined number of bits threshold.
[0115] The quadratic operation may include performing N-th power operation or multiple operation on the rounded eigenvalue, where N is greater than or equal to 2. As an example, the eigenvalue 625876 may be squared, i.e., 625876 x 625876 = 391720767376. The number of digits of the eigenvalue after the square operation is greater than 10, thus meeting the requirement.
[0116] In step S50, it is determined whether the number of digits of the eigenvalue after the secondary operation is an odd number or an even number. If the number of digits of the eigenvalue after the secondary operation is an even number, step S52 is executed. If the number of digits of the eigenvalue after the secondary operation is an odd number, step S54 is executed.
[0117] In step S52, the middle even-numbered digits of the eigenvalue after the secondary operation are selected as random numbers.
[0118] As an example, the eigenvalue 391720767376 after the above secondary calculation has 12 digits, and therefore is an even number of digits. In this case, the even digits in 391720767376 can be selected as the random number. In this step, the number of even digits selected as the random number can be determined based on security requirements. For example, a six-digit number can be selected from 391720767376 as the random number, such as 720767.
[0119] In step S54, the middle odd numbers of the eigenvalues after the secondary operation are selected as random numbers.
[0120] In this step, the number of odd bits selected as the random number can be determined according to security requirements.
[0121] In step S56, it is determined whether the number of digits of the rounded eigenvalue is odd or even. If the number of digits of the rounded eigenvalue is even, step S58 is executed. If the number of digits of the rounded eigenvalue is odd, step S60 is executed.
[0122] In step S58, an even number of digits in the rounded eigenvalue is selected as a random number.
[0123] In step S60, an odd number of digits in the rounded eigenvalue is selected as a random number.
[0124] As mentioned above, due to the randomness of the display screen, physical information of the current display screen can be extracted, and a random number can be generated based on this physical information. The random number generated in this way is highly secure and does not require high-precision measuring instruments, which is relatively low in cost.
[0125] However, if the image displayed on the display screen hasn't been updated for a long time, for example, if the user hasn't operated the display screen for a long time, the randomness of the image will be relatively low. Generating a random number by extracting physical information from the image currently displayed on the display screen may be less secure. Therefore, to improve the randomness of the random number, it is possible to detect whether the displayed image has been displayed for longer than a predetermined time threshold.
[0126] Figure 6 schematically shows a flow chart of a method for generating random numbers in another embodiment of the present disclosure. The flow chart shown in Figure 6 shares some similarities with the flow chart shown in Figure 3, and the description provided with respect to Figure 3 is applicable to the flow chart shown in Figure 6 as appropriate.
[0127] As shown in FIG6 , the method for generating a random number may include the following steps S102, S104′, S106, and S108. In the embodiment shown in FIG6 , steps S102, S106, and S108 are the same as those in the embodiment shown in FIG3 . Therefore, the detailed description of steps S102, S106, and S108 in FIG3 is also applicable to steps S102, S106, and S108 in the flowchart shown in FIG6 . Here, only step S104′, which differs from the embodiment shown in FIG3 , is described in detail, namely, the step of extracting physical information of the image displayed on the display screen.
[0128] As shown in FIG6 , extracting the physical information of the picture displayed on the display screen may include the following sub-steps.
[0129] In sub-step S1042', it is detected whether the duration of the image displayed on the display screen when the random number generation instruction is received is greater than a predetermined time threshold. If it is detected that the duration of the displayed image is greater than the predetermined time threshold, sub-step S1044' is executed. If it is detected that the duration of the displayed image is not greater than the predetermined time threshold, sub-step S1046' is executed.
[0130] In an exemplary embodiment, the predetermined time threshold may be expressed in frames or time. As an example, the predetermined time threshold may be set to no less than 1 minute.
[0131] In sub-step S1044', physical information of another picture before the picture currently displayed on the display screen is extracted, wherein the time for which the other picture stays on the display screen is not greater than a predetermined time threshold.
[0132] In this sub-step, if the duration of the currently displayed image on the display screen exceeds a predetermined time threshold, the duration of the image immediately preceding the currently displayed image on the display screen may be detected. If the duration of the previous image on the display screen is still greater than the predetermined time threshold, the duration of the image immediately preceding the previous image is continuously detected until a image whose duration is not greater than the predetermined time threshold is found. In this step, physical information of the image whose duration is not greater than the predetermined time threshold may be extracted.
[0133] In sub-step S1046', the physical information of the picture currently displayed on the display screen is extracted.
[0134] In this sub-step, when the time for which the picture currently displayed on the display screen stays is not greater than a predetermined time threshold, the physical information of the picture currently displayed on the display screen can be directly extracted.
[0135] In application scenarios where a random number interface needs to be opened for random password input, the random number interface is usually not a random interface. If a random password is generated based on the image displayed on the random number interface, the security of the random password may not be high. In this case, the physical information of the last frame displayed in the non-random number interface before switching to the random number interface can be extracted.
[0136] As used herein, the term "random number operation interface" may refer to an interface displayed on a display screen for generating, displaying, or logging in random numbers or random passwords. The term "non-random number operation interface" may refer to an interface other than the random number operation interface of the display screen, on which a normal screen can be displayed.
[0137] Figure 7 schematically shows a flow chart of a method for generating random numbers in another embodiment of the present disclosure. The flow chart shown in Figure 7 shares some similarities with the flow chart shown in Figure 3 , and the description provided with respect to Figure 3 is applicable to the flow chart shown in Figure 7 as appropriate.
[0138] As shown in Figure 7, the method for generating a random number may include the following steps S102, S104", S106 and S108. In the embodiment shown in Figure 7, steps S102, S106 and S108 are the same as the embodiment shown in Figure 3. Therefore, the detailed description of steps S102, S106 and S108 in Figure 3 is also applicable to steps S102, S106 and S108 in the flowchart shown in Figure 7. Here, only step S104" that is different from the embodiment shown in Figure 3 is described in detail, that is, the step of extracting physical information of the picture displayed on the display screen.
[0139] As shown in FIG. 7 , the physical information of the image displayed on the display screen can be extracted through the following sub-steps.
[0140] In sub-step S1042", it is detected whether the display screen is in the random number operation interface when the random number generation instruction is received. If it is detected that the display screen is in the random number operation interface, sub-step S1044" is executed. If it is detected that the display screen is in the non-random number operation interface, sub-step S1046" is executed.
[0141] In sub-step S1044 ″, physical information of the last frame displayed on the non-random number operation interface before the display screen switches to the random number operation interface is extracted.
[0142] In this sub-step, when the display screen is in the random number operation interface, the random number operation interface is usually not a random interface, so the security may not be high. In order to improve security, the physical information of the last frame displayed by the non-random number operation interface before the random number operation interface can be extracted.
[0143] In sub-step S1046 ″, the physical information of the picture currently displayed on the display screen is extracted.
[0144] In this sub-step, when it is detected that the display screen is in a non-random number operation interface, that is, the display screen is in the interface of the normal display picture, the randomness of the display screen display picture is relatively high, so the physical information of the picture currently displayed on the display screen can be directly extracted to generate a random number based on the physical information.
[0145] As described above, an m x n matrix can be generated as a random number matrix based on the physical information of the m x n pixels 401 of the display screen, wherein the physical information of the m x n pixels 401 serves as the matrix elements of the random matrix. Typically, the matrix composed of the pixels 401 of the display screen is a rectangular matrix, that is, m is not equal to n. Therefore, the generated random matrix is also a rectangular matrix.
[0146] Typically, square matrices have a richer set of eigenvalues. For example, in addition to the sum, square sum, square root of the square sum, sum of square roots, and square of the sum of all matrix elements described above, the trace or norm of the square matrix can also be calculated, such as the matrix 1-norm or the matrix 2-norm.
[0147] In one or more embodiments of the present disclosure, random numbers can be generated based on a square-order matrix. FIG8 schematically illustrates a flow chart of a method for generating random numbers according to yet another embodiment of the present disclosure. The flow chart shown in FIG8 shares some similarities with the flow chart shown in FIG3 , and the description provided with respect to FIG3 applies to the flow chart shown in FIG8 as appropriate.
[0148] As shown in FIG8 , the method for generating random numbers includes steps S102 , S104 , and S106 in the flowchart shown in FIG3 , and further includes steps S108 ′, S110 ′, and S112 ′ which are different from the flowchart shown in FIG3 .
[0149] Regarding steps S102, S104, and S106 in the flowchart shown in Figure 8, reference may be made to the detailed description of the flowchart shown in Figure 3. The following details the differences between the embodiment shown in Figure 8 and the embodiment shown in Figure 3.
[0150] As shown in FIG8 , after generating the random number matrix at step S106 , it is possible to detect whether the random number matrix is a square matrix at step S108 ′. If the generated random number matrix is not a square matrix, a square matrix may be created based on the physical information of the m×n pixels 401 at step S110 ′.
[0151] In some embodiments of the present disclosure, a square matrix can be created by cropping or adding matrix elements to an m x n matrix formed by the physical information of m x n pixels 401.
[0152] Matrix element cropping
[0153] i) m > n
[0154] FIG. 9A shows a schematic diagram of constructing a square matrix by matrix element cropping in the case of m > n in some embodiments of the present disclosure. As shown in FIG. 9A, in the case of m > n, an n x n square matrix can be formed by removing the matrix elements of the (n + 1)-th row to the m-th row in the m x n matrix. For example, for a 120 x 100 matrix, the matrix elements of the 101-th row to the 120-th row in the 120 x 100 matrix can be removed to form a 100 x 100 square matrix.
[0155] In an alternative embodiment, any m - n rows of matrix elements can be removed from the m x n matrix to form an n x n square matrix. For example, any 20 rows of matrix elements can be removed from a 120 x 100 matrix, not limited to the last 20 rows of matrix elements of the 120 x 100 matrix.
[0156] ii) m < n
[0157] FIG. 9B shows a schematic diagram of constructing a square matrix by matrix element cropping in the case of m < n in some embodiments of the present disclosure. As shown in FIG. 9B, in the case of m < n, an m x m square matrix can be formed by removing the matrix elements of the (m + 1)-th column to the n-th column in the m x n matrix. For example, for a 100 x 120 matrix, the matrix elements of the 101-th column to the 120-th column in the 100 x 120 matrix can be removed to form a 100 x 100 square matrix.
[0158] In an alternative embodiment, any n - m columns of matrix elements can be removed from the m x n matrix to form an m x m square matrix. For example, any 20 columns of matrix elements can be removed from a 100 x 120 matrix, not limited to the last 20 columns of matrix elements of the 100 x 120 matrix.
[0159] b) Matrix element addition
[0160] i) m > n
[0161] FIG9C shows a schematic diagram of constructing a square matrix by adding matrix elements when m>n in some embodiments of the present disclosure. As shown in FIG9C , when m>n, an mxm square matrix can be formed by inserting matrix elements from the n+1th column to the mth column into an mxn matrix. In some embodiments, the value of the inserted matrix element can be calculated by the average value of the known elements in the row where the inserted matrix element is located.
[0162] For example, for a 5x3 matrix, the matrix elements from the 4th column to the 5th column can be inserted into the 5x3 matrix to form a 5x5 square matrix.
[0163] Inserted matrix element a 14 It can be calculated by the average value of other known matrix elements in the row where the matrix element is located, that is,
[0164] a 14 =(a 11 +a 12 +a 13 ) / 3, a 15 =(a 11 +a 12 +a 13 +a 14 ) / 4.
[0165] Similarly, a 24 =(a 21 +a 22 +a 23 ) / 3, a 25 =(a 21 +a 22 +a 23 +a 24 ) / 4;
[0166] a 54 =(a 51 +a 52 +a 53 ) / 3, a 55 =(a 51 +a 52 +a 53 +a 54 ) / 4.
[0167] In other embodiments, the value of the inserted matrix element may be calculated by dividing the square root of the mean square or the square root of the sum of squares of other known elements in the row where the inserted matrix element is located by the number of known elements.
[0168] In an alternative embodiment, m - n column matrix elements can be randomly inserted into an m x n matrix to form an m x m square matrix. For example, 2 column matrix elements can be randomly inserted into a 5x3 matrix, and it is not limited to inserting the fourth and fifth column matrix elements after the third column of the 5x3 matrix. As an example, two column matrix elements can be inserted between the first column and the second column, and between the second column and the third column of the 5x3 matrix respectively. The value of the matrix element can also be calculated by the average value, root mean square, or the square root of the sum of squares of other known elements in the row where the inserted matrix element is located, divided by the number of known elements.
[0169] ii) m < n
[0170] FIG. 9D shows a schematic diagram of constructing a square matrix by adding matrix elements in the case of m < n in some embodiments of the present disclosure. In the case of m < n, an n x n square matrix can be formed by inserting matrix elements of the (m + 1)-th row to the n-th row into the m x n matrix. In some embodiments, the value of the inserted matrix element can be calculated by the average value of other known elements in the column where the inserted matrix element is located.
[0171] For example, for a 3 x 5 matrix, matrix elements of the 4th row to the 5th row can be inserted into the 3 x 5 matrix to form a 5x5 square matrix.
[0172] The inserted matrix element a 41 can be calculated by the average value of other known matrix elements in the column where this matrix element is located, that is,
[0173] a 41 =(a 11 +a 21 +a 31 ) / 3, a 51 =(a 11 +a 21 +a 31 +a 41 ) / 4.
[0174] Similarly, a 42 =(a 12 +a 22 +a 32 ) / 3, a 52 =(a 12 +a 22 +a 32 +a 42 ) / 4;
[0175] A 45 =(a 15 +a 25 +a35 ) / 3, a 55 =(a 15 +a 25 +a 35 +a 45 ) / 4.
[0176] In other embodiments, the value of the inserted matrix element may be calculated by dividing the square root of the mean square or the square root of the sum of squares of other known elements in the column where the inserted matrix element is located by the number of known elements.
[0177] In an alternative embodiment, nm rows of matrix elements can be randomly inserted into an mxn matrix to form an nxn square matrix. For example, two rows of matrix elements can be randomly inserted into a 3x5 matrix, without being limited to inserting the fourth and fifth rows of matrix elements after the third row of the 3x5 matrix. As an example, two rows of matrix elements can be inserted between the first and second rows and between the second and third rows of the 3x5 matrix, respectively. The value of a matrix element can also be calculated by dividing the average value, root mean square, or square root of the sum of squares of the other known elements in the column where the inserted matrix element is located by the number of known elements.
[0178] Returning to FIG8 , in step S112 ′, random numbers are generated based on a square-order matrix. Details regarding the generation of random numbers based on a square-order matrix may be determined by reference to the process for generating random numbers based on a random number matrix described in detail in the embodiment shown in FIG3 . Unlike the generation of random numbers based on a random number matrix in the embodiment shown in FIG3 , in the embodiment shown in FIG8 , the eigenvalues of a square-order matrix may be calculated by the trace or norm of the square-order matrix in addition to the sum, square sum, square root of the square sum, sum of square roots, and square of the sum of all matrix elements.
[0179] In order to implement the method for generating random numbers in the above embodiment, the present disclosure also provides a device for generating random numbers.
[0180] FIG10 is a block diagram of an apparatus for generating random numbers in one or more embodiments of the present disclosure. The apparatus 10 shown in FIG10 can be used to perform the method for generating random numbers in the embodiments shown in FIG3 , FIG6 , FIG7 , or FIG8 . Therefore, the description provided with respect to FIG3 , FIG6 , FIG7 , or FIG8 applies to the apparatus shown in FIG10 as appropriate. As shown in FIG10 , the apparatus may include an instruction receiving component 1, a physical information extraction component 2, a random number matrix generation component 3, and a random number generation component 4.
[0181] The instruction receiving component 1 is configured to receive a random number generation instruction. A user can issue a random number generation instruction through the input / output interface of the smart terminal.
[0182] The physical information extraction section 2 is configured to extract physical information of a picture displayed on the display screen.
[0183] The physical information of the displayed image may include physical information of the pixels 401 of the displayed image, such as the grayscale, brightness, voltage, and color attributes of the pixels 401. In one or more embodiments, the physical information extraction component 2 may be specifically configured to extract the physical information of the image currently being displayed on the display screen when the random number generation instruction is received.
[0184] The random number matrix generating section 3 is configured to generate a random number matrix based on the physical information.
[0185] In one or more embodiments, the display screen may include mxn pixels 401 arranged in an array, where m and n are positive integers. In this case, the random number matrix may include an mxn matrix. In this embodiment, the physical information of the mxn pixels 401 may be determined as matrix elements of the mxn matrix.
[0186] In some embodiments, the random number matrix may include a square matrix. In these embodiments, the random number generation component may be configured to create the square matrix based on the physical information of the mxn pixels 401 in one of the following ways:
[0187] a) performing matrix element clipping on an mxn matrix formed by the physical information of the mxn pixels 401; or
[0188] b) Adding matrix elements to the mxn matrix formed by the physical information of the mxn pixels 401 .
[0189] For details about matrix element clipping and matrix element addition, reference may be made to the detailed description about matrix element clipping and matrix element addition in one or more embodiments of the method for generating random numbers above.
[0190] The random number generating component 4 is configured to generate random numbers based on the random number matrix. For details on how the random number generating component generates random numbers based on the random number matrix, reference can be made to the detailed description of generating random numbers based on the random number matrix in one or more embodiments of the method for generating random numbers above.
[0191] In a further aspect of the present disclosure, another apparatus for generating random numbers is also provided. Figure 11 is a block diagram of another apparatus for generating random numbers in one or more embodiments of the present disclosure. As shown in Figure 11, the apparatus 11 may include at least one processor 12 and at least one memory 13. The memory 13 includes computer program code that, when executed by the at least one processor 12, causes the apparatus 11 to perform the method steps of one or more embodiments of the method for generating random numbers disclosed herein. Therefore, the description provided herein with respect to the method for generating random numbers applies to the apparatus shown in Figure 11 as appropriate.
[0192] In a further aspect of the present disclosure, a device for generating random numbers is also provided. FIG12 is a schematic diagram of a device for generating random numbers in one or more embodiments of the present disclosure. As shown in FIG12 , the device 12 for generating random numbers may include: a display unit 121, a computing unit 122, a central processing unit 123, a storage unit 124, a communication unit 125, and a power module 126. The power module 126 is used to supply power to each unit or module of the device. The display unit 121 is used to display a screen and optionally receive random number generation instructions. The display unit 121 may include a display module, a driver module, and an optional touch module. The storage unit 124 is used to store executable program code and physical information of the screen displayed by the display unit 121 (e.g., pixel grayscale, voltage, brightness, color attributes, etc.). The computing unit 122 reads the physical information of the display screen and the executable program stored in the storage unit to execute the executable program to generate a random number matrix based on the physical information of the screen displayed by the display unit and generate random numbers based on the random number matrix. The central processing unit 123 is used to receive requests from various functional modules and send instructions to each functional unit or module. The communication unit 125 is used for the device to communicate with the outside world to obtain or send information.
[0193] As will be apparent from the discussion herein, unless specifically stated otherwise, it should be understood that throughout this specification, discussions using terms such as "operate," "compute," "generate," or similar terms refer to the actions and / or processes of a computer or computing system or similar electronic computing device that manipulate data represented as physical (e.g., electronic) quantities within the computing system's registers and / or memories and / or transform them into other data similarly represented as physical quantities within the computing system's memories, registers, or other such information storage, transmission, or display devices.
[0194] Embodiments of the present disclosure may include an apparatus for performing the operations described herein. This apparatus may be specially constructed for the desired purpose, or this apparatus may include a general-purpose computer or a field programmable gate array ("FPGA") or a digital signal processor ("DSP") selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a computer-readable storage medium, such as, but not limited to, any type of disk, including a floppy disk, an optical disk, a CD-ROM, a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an electrically programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic or optical card, or any other type of medium suitable for storing electronic instructions and capable of being coupled to a computer system bus.
[0195] The method proposed herein is not originally relevant to any specific computer or other equipment. Different general-purpose systems can be used together with the program according to the teaching content herein, or it can prove very convenient to build more special-purpose devices to perform the desired method. The desired structure of various these systems will be understood from the following description. In addition, the embodiments of the present disclosure are not described with reference to any specific programming language. It will be appreciated that various programming languages can be used to realize the teaching content of the present disclosure as described herein.
[0196] The foregoing description of the embodiments is provided above for the purpose of illustration and description. It is not intended to be exhaustive or to limit the present application. The individual elements or features of a particular embodiment are generally not limited to a particular embodiment, but, where appropriate, these elements and features are interchangeable and can be used in selected embodiments, even if not specifically shown or described. Also, it is possible to change in many ways. This change cannot be considered to be out of the present application, and all such modifications are included within the scope of the present application.
Claims
1. A method for generating a random number, comprising: Receive random number generation instructions; Extracting physical information of a picture displayed on the display screen, wherein the physical information of the displayed picture includes one or more of grayscale, brightness, voltage, or color attributes of pixels of the displayed picture; generating a random number matrix based on the physical information; as well as Random numbers are generated based on the random number matrix.
2. The method according to claim 1, wherein: The physical information of the image displayed on the display screen includes: The physical information of the picture being displayed on the display screen when the random number generation instruction is received is extracted.
3. The method according to claim 1, wherein: The physical information of the image displayed on the display screen includes: Detecting whether the time for which the picture displayed on the display screen stays is greater than a predetermined time threshold when receiving the random number generation instruction; and In response to detecting that the displayed picture stays for a time greater than the predetermined time threshold, extracting physical information of another picture displayed before the picture currently being displayed on the display screen, wherein the time that the other picture stays on the display screen is not greater than the predetermined time threshold, or In response to detecting that the displayed picture stays for a time not greater than the predetermined time threshold, physical information of the picture currently being displayed on the display screen is extracted.
4. The method according to claim 3, wherein: The predetermined time threshold is greater than 1 minute.
5. The method according to claim 1, wherein: The physical information of the image displayed on the display screen includes: detecting whether the display screen is in a random number operation interface when receiving a random number generation instruction; and In response to detecting that the display screen is in the random number operation interface, extracting physical information of the last frame displayed in the non-random number operation interface before the display screen switches to the random number operation interface, or In response to detecting that the display screen is in a non-random number operation interface, physical information of a picture currently being displayed on the display screen is extracted.
6. The method according to any one of claims 1 to 5, wherein: The display screen comprises m×n pixels arranged in an array, wherein m and n are positive integers, Wherein, generating a random number matrix based on the physical information comprises: Matrix elements of the random number matrix are determined based on physical information of the m×n pixels.
7. The method according to claim 6, wherein: The random number matrix comprises an mxn matrix, and wherein the physical information of the mxn pixels is determined as matrix elements of the mxn matrix.
8. The method according to claim 6, further comprising: Determine whether the random number matrix is a square matrix, and In response to a determination that the random number matrix is not a square-order matrix, a square-order matrix is created by performing matrix element pruning or matrix element addition on an mxn matrix formed by physical information of the mxn pixels.
9. The method according to claim 8, wherein: In the case of m>n, pruning the mxn matrix by removing mn rows of matrix elements in the mxn matrix to form an nxn square matrix, or Adding matrix elements to the mxn matrix by inserting mn-column matrix elements into the mxn matrix to form an mxm square matrix, wherein the inserted mn-column matrix elements are calculated based on known matrix elements in the row where the inserted matrix elements are located; In the case of m < n, matrix element clipping is performed on the m x n matrix by removing n - m column matrix elements to form an m x m square matrix, or matrix element addition is performed on the m x n matrix by inserting n - m row matrix elements to form an n x n square matrix, where the inserted n - m row matrix elements are calculated based on the known matrix elements in the column where the inserted matrix elements are located.
10. The method according to claim 9, wherein: In the case of m > n, the matrix elements from the (n + 1)-th row to the m-th row in the m x n matrix are removed to form an n x n square matrix, or the matrix elements from the (n + 1)-th column to the m-th column are inserted into the m x n matrix to form an m x m square matrix, where the inserted matrix elements are calculated by one of the following methods: the average of all known elements in the row where the inserted matrix element is located, the root mean square of all known elements in the row where the inserted matrix element is located, or the square root of the sum of the squares of all known elements in the row where the inserted matrix element is located divided by the number of known elements; In the case of m < n, the matrix elements from the (m + 1)-th column to the n-th column in the m x n matrix are removed to form an m x m square matrix, or the matrix elements from the (m + 1)-th row to the n-th row are inserted into the m x n matrix to form an n x n square matrix, where the inserted matrix elements are calculated by one of the following methods: the average of all known elements in the column where the inserted matrix element is located, the root mean square of all known elements in the column where the inserted matrix element is located, or the square root of the sum of the squares of all known elements in the column where the inserted matrix element is located divided by the number of known elements.
11. The method according to claim 6, wherein: Generating a random number based on the random number matrix includes: calculating the eigenvalues of the random number matrix based on the matrix elements of the random number matrix; performing a rounding operation on the calculated eigenvalues; determining whether the number of digits of the rounded eigenvalue is odd or even; and in response to the determination that the number of digits of the rounded eigenvalue is even, using the middle even number of digits of the rounded eigenvalue as the random number; or in response to the determination that the number of digits of the rounded eigenvalue is odd, using the middle odd number of digits of the rounded eigenvalue as the random number.
12. The method according to claim 11, wherein: Generating a random number based on the random number matrix further includes: determining whether the number of digits of the rounded eigenvalue is less than a predetermined digit threshold; and in response to the determination that the number of digits of the rounded eigenvalue is less than the predetermined digit threshold: performing at least one secondary operation on the rounded eigenvalue until the number of digits of the eigenvalue after the secondary operation is not less than the predetermined digit threshold, determining whether the number of digits of the eigenvalue after the secondary operation is odd or even, and in response to the determination that the number of digits of the eigenvalue after the secondary operation is even, using the middle even number of digits of the eigenvalue after the secondary operation as the random number, or in response to the determination that the number of digits of the eigenvalue after the secondary operation is odd, using the middle odd number of digits of the eigenvalue after the secondary operation as the random number, And wherein, the step of determining whether the number of bits of the rounded eigenvalue is an odd number or an even number is performed in response to the number of bits of the rounded eigenvalue being not less than the predetermined number of bits threshold.
13. The method according to claim 12, wherein: Performing at least one quadratic operation on the rounded eigenvalue includes performing at least one Nth power operation or multiple operation on the rounded eigenvalue, where N≥2.
14. The method according to any one of claims 11 to 13, wherein: The eigenvalues of the random number matrix are calculated by one of the following methods: Determine the sum of all matrix elements of the random number matrix; Determining the sum of squares of all matrix elements of the random number matrix; Determining the square root of the sum of squares of all matrix elements of the random number matrix; determining the sum of the square roots of all matrix elements of the random number matrix; or The square of the sum of all matrix elements of the random number matrix is determined.
15. The method according to any one of claims 11 to 13, wherein: The random number matrix comprises a square-order matrix, and wherein the eigenvalues of the random number matrix are calculated by one of the following methods: Determine the sum of all matrix elements of the random number matrix; Determining the sum of squares of all matrix elements of the random number matrix; Determining the square root of the sum of squares of all matrix elements of the random number matrix; Determining the sum of square roots of all matrix elements of the random number matrix; Determine the square of the sum of all matrix elements of the random number matrix; or The trace or norm of the square-order matrix is determined.
16. A device for generating a random number, comprising: An instruction receiving component configured to receive a random number generation instruction; A physical information extraction component configured to extract physical information of a picture displayed on the display screen, wherein the physical information of the displayed picture includes one or more of grayscale, brightness, voltage, or color attributes of pixels of the displayed picture; a random number matrix generating component configured to generate a random number matrix based on the physical information; and A random number generating component is configured to generate random numbers based on the random number matrix.
17. The device according to claim 16, wherein: The physical information extraction component is configured to extract physical information of a picture currently being displayed on the display screen when the random number generation instruction is received.
18. The device according to claim 16 or 17, wherein: The display screen includes mxn pixels arranged in an array, where m and n are positive integers.
19. The device according to claim 18, wherein: The random number matrix comprises an mxn matrix, and wherein the physical information of the mxn pixels is determined as matrix elements of the mxn matrix.
20. The device according to claim 18, wherein The random number matrix comprises a square-order matrix, and wherein the random matrix generation component is configured to create the square-order matrix by performing matrix element pruning or matrix element addition on an mxn matrix formed by physical information of the mxn pixels.
21. The device according to claim 19, wherein The random number generation component is configured as follows: Calculate eigenvalues of the random number matrix based on matrix elements of the random number matrix; Performing a rounding operation on the calculated eigenvalues; Determine whether the number of digits of the rounded eigenvalue is odd or even; as well as In response to determining that the number of digits of the rounded eigenvalue is an even number, taking the middle even number of digits of the rounded eigenvalue as the random number; or In response to determining that the number of digits of the rounded eigenvalue is an odd number, the middle odd digits of the rounded eigenvalue are used as the random number.
22. The device according to claim 21, wherein The random number generation component calculates the eigenvalues of the random number matrix by one of the following methods: Determine the sum of all matrix elements of the random number matrix; Determining the sum of squares of all matrix elements of the random number matrix; Determining the square root of the sum of squares of all matrix elements of the random number matrix; determining the sum of the square roots of all matrix elements of the random number matrix; or The square of the sum of all matrix elements of the random number matrix is determined.
23. The device according to claim 21, wherein The random number matrix comprises a square-order matrix, and wherein the random number generation component calculates the eigenvalues of the random number matrix by one of the following methods: Determine the sum of all matrix elements of the random number matrix; Determining the sum of squares of all matrix elements of the random number matrix; Determining the square root of the sum of squares of all matrix elements of the random number matrix; Determining the sum of square roots of all matrix elements of the random number matrix; Determine the square of the sum of all matrix elements of the random number matrix; or The trace or norm of the square-order matrix is determined.
24. A device for generating a random number, comprising: at least one processor; as well as At least one memory comprising computer program code which, when executed by the at least one processor, causes the apparatus to perform the method of any one of claims 1 to 15.