(19)
(11)EP 3 751 410 B1

(12)EUROPEAN PATENT SPECIFICATION

(45)Mention of the grant of the patent:
26.01.2022 Bulletin 2022/04

(21)Application number: 20189059.7

(22)Date of filing:  07.03.2017
(51)International Patent Classification (IPC): 
G06F 7/58(2006.01)
(52)Cooperative Patent Classification (CPC):
G06F 7/58

(54)

RANDOM NUMBER GENERATION AND ACQUISITION METHOD AND DEVICE

VERFAHREN UND VORRICHTUNG ZUR ERZEUGUNG UND ERFASSUNG VON ZUFALLSZAHLEN UND VORRICHTUNG

PROCÉDÉ ET DISPOSITIF DE GÉNÉRATION ET D'ACQUISITION DE NOMBRES ALÉATOIRES


(84)Designated Contracting States:
AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

(30)Priority: 17.03.2016 CN 201610152995

(43)Date of publication of application:
16.12.2020 Bulletin 2020/51

(62)Application number of the earlier application in accordance with Art. 76 EPC:
17765739.2 / 3432137

(73)Proprietor: Advanced New Technologies Co., Ltd.
George Town, Grand Cayman KY1-9008 (KY)

(72)Inventor:
  • WEN, Jiaxiang
    Hangzhou, Zhejiang 311121 (CN)

(74)Representative: Fish & Richardson P.C. 
Highlight Business Towers Mies-van-der-Rohe-Straße 8
80807 München
80807 München (DE)


(56)References cited: : 
FR-A1- 2 829 643
  
  • KNUTH D E: "The art of computer programming , PASSAGE", ART OF COMPUTER PROGRAMMING, XX, XX, 1 January 1998 (1998-01-01), XP002311268,
  
Note: Within nine months from the publication of the mention of the grant of the European patent, any person may give notice to the European Patent Office of opposition to the European patent granted. Notice of opposition shall be filed in a written reasoned statement. It shall not be deemed to have been filed until the opposition fee has been paid. (Art. 99(1) European Patent Convention).


Description


[0001] The present patent claims priority to Chinese Patent Application No. 201610152995.2, filed on March 17, 2016 and entitled "RANDOM NUMBER GENERATION AND ACQUISITION METHOD AND DEVICE".

TECHNICAL FIELD



[0002] The present application relates to the field of computer technologies, and in particular, to a random number generation and retrieval method and device.

BACKGROUND



[0003] Requirements become increasingly high for random number generation as random numbers are widely applied in the computer field. Currently, there are two commonly-used random number generation methods. One is a software method in which system time is used as a seed for random number generation, and then a random number is generated based on a system function. The other is a hardware method in which a hardware device generating a random number is designed to generate a random number based on a random signal.

[0004] However, a system default random number generation method used by the software has the following disadvantage: Random numbers generated at the same time point (the same second, or the same millisecond) have a high repetition rate, resulting in imbalanced distribution of random numbers, that is, pseudorandom numbers are generated. In a computer application system, time is used as a seed for random number generation, therefore, due to the same time seeds, random numbers generated within a relatively short time such as duration including same milliseconds or seconds have a high repetition rate, resulting in imbalanced distribution of random numbers. Knuth D E: "The art of computer programming, PASSAGE," ART OF COMPUTER PROGRAMMING" describes randomizing by shuffling in relation to two sequences Xn and Yn. FR 2 829 643 describes a method for generating random numbers.

SUMMARY



[0005] The invention is defined by the appended claims. The purpose of the present application is to resolve one of the previous technical problems to a certain extent.

[0006] Thus, the first purpose of the present application is to provide a random number generation method. The method includes the following: generating a random number array that includes N storage units storing random numbers; then, performing random shuffling on the storage units in the random number array; and when receiving a random number retrieval instruction, read a random number from a corresponding storage unit in the random number array. In the implementations of the present application, a plurality of random numbers obtained in a relatively short unit time have a low repetition rate to achieve balanced distribution. Therefore, the random number generation method in the present application can achieve relatively high randomness.

[0007] The second purpose of the present application is to provide a random number generation device.

[0008] The third purpose of the present application is to provide a random number retrieval method.

[0009] The fourth purpose of the present application is to provide a random number retrieval device.

[0010] To achieve the previous purposes, a first aspect of the implementations of the present application provides a random number generation method, including the following steps: generating a random number array, where the random number array includes N storage units, each of the storage units stores a random number, and N is a positive integer; performing random shuffling on the storage units in the random number array; and when receiving a random number retrieval instruction, read, from a corresponding storage unit in the random number array based on the random number retrieval instruction, a random number stored in the storage unit.

[0011] The random number generation method in the implementations of the present application includes the following: first generating the random number array that includes the N storage units storing the random numbers; then, performing random shuffling on the storage units in the random number array; and receiving the random number retrieval instruction, and reading, from the corresponding storage unit in the random number array, the random number stored in the storage unit. Because random shuffling is performed on the storage units in the random number array, a plurality of random numbers obtained in a relatively short unit time have a low repetition rate, to achieve balanced distribution. Therefore, the random number generation method in the present application can achieve relatively high randomness.

[0012] In an implementation of the present application, the N storage units store different random numbers.

[0013] In an implementation of the present application, in the random number generation method, each of the storage units has an identifier value, and the performing random shuffling on the storage units in the random number array includes the following: generating a random value based on a random function, and generating an identifier value of a to-be-exchanged storage unit based on the random value; and exchanging a random number in the to-be-exchanged storage unit with a random number in a target storage unit based on the identifier value and a predetermined exchange rule.

[0014] In an implementation of the present application, the generating a random value based on a random function includes the following: when i is greater than 1 and less than N, generating the ith random value based on a current time and the (i-1)th random value, where i is the number of exchange times; or when i is equal to 1, generating the ith random value based on a current time.

[0015] In an implementation of the present application, the predetermined exchange rule is as follows: When the ith exchange is performed, a random number in a storage unit corresponding to the ith random value is exchanged with a random number in the (N+1-i)th storage unit.

[0016] In an implementation of the present application, the reading, from a corresponding storage unit in the random number array based on the random number retrieval instruction, a random number stored in the storage unit includes the following: obtaining an identifier value of a currently read storage unit based on the random number retrieval instruction; and reading, based on the identifier value of the currently read storage unit, a random number stored in a next storage unit.

[0017] To achieve the previous purposes, a second aspect of the implementations of the present application provides a random number generation device, including: a generation module, configured to generate a random number array, where the random number array includes N storage units, each of the storage units stores a random number, and N is a positive integer; a random shuffling module, configured to perform random shuffling on the storage units in the random number array; and a reading module, configured to receive a random number retrieval instruction, and read, from a corresponding storage unit in the random number array based on the random number retrieval instruction, a random number stored in the storage unit.

[0018] In the random number generation device in the implementations of the present application, first, the generation module generates the random number array that includes the N storage units storing the random numbers; then, the random shuffling module performs random shuffling on the storage units in the random number array; and the reading module can receive the random number retrieval instruction, and read, from the corresponding storage unit in the random number array, the random number stored in the storage unit. Because the random shuffling module performs random shuffling on the storage units in the random number array, a plurality of random numbers obtained in a relatively short unit time have a low repetition rate to achieve balanced distribution. Therefore, the random number generation device in the present application can achieve relatively high randomness.

[0019] In an implementation of the present application, the N storage units store different random numbers.

[0020] In an implementation of the present application, in the random number generation device, each of the storage units has an identifier value, and the random shuffling module includes the following: an identifier value generation submodule, configured to generate a random value based on a random function, and generate an identifier value of a to-be-exchanged storage unit based on the random value; and an exchange submodule, configured to exchange a random number in the to-be-exchanged storage unit with a random number in a target storage unit based on the identifier value and a predetermined exchange rule.

[0021] In an implementation of the present application, in the random number generation device, when i is greater than 1 and less than N, the identifier value generation submodule generates the ith random value based on a current time and the (i-1)th random value, where i is the number of exchange times; or when i is equal to 1, the identifier value generation submodule generates the ith random value based on a current time.

[0022] In an implementation of the present application, the predetermined exchange rule is as follows: When the ith exchange is performed, a random number in a storage unit corresponding to the ith random value is exchanged with a random number in the (N+1-i)th storage unit.

[0023] In an implementation of the present application, the reading module includes the following: a retrieval submodule, configured to obtain an identifier value of a currently read storage unit based on the random number retrieval instruction; and a reading submodule, configured to read, based on the identifier value of the currently read storage unit, a random number stored in a next storage unit.

[0024] To achieve the previous purposes, a third aspect of the implementations of the present application provides a random number retrieval method, including the following steps: receiving a random number retrieval instruction, and obtaining a random number array, where the random number array includes N storage units, each of the storage units stores a random number, and locations of the N storage units in the random number array are determined through random shuffling, where N is a positive integer; and obtaining, from a corresponding storage unit in the random number array based on the random number retrieval instruction, a random number stored in the storage unit.

[0025] The random number retrieval method in the implementations of the present application includes the following: first, receiving the random number retrieval instruction; then obtaining the random number array, and determining the locations of the N storage units in the random number array through random shuffling; and reading, from the corresponding storage unit in the random number array based on the random number retrieval instruction, the random number stored in the storage unit. Because random shuffling is performed on the storage units in the random number array, a plurality of random numbers obtained in a relatively short unit time have a low repetition rate to achieve balanced distribution. Therefore, the random number retrieval method in the present application can achieve relatively high randomness.

[0026] In an implementation of the present application, the N storage units store different random numbers.

[0027] In an implementation of the present application, in the random number retrieval method, each of the storage units has an identifier value, and random shuffling is performed on the locations of the N storage units in the random number array by using the following steps: generating a random value based on a random function, and generating an identifier value of a to-be-exchanged storage unit based on the random value; and exchanging a random number in the to-be-exchanged storage unit with a random number in a target storage unit based on the identifier value and a predetermined exchange rule.

[0028] In an implementation of the present application, the obtaining, from a corresponding storage unit in the random number array based on the random number retrieval instruction, a random number stored in the storage unit includes the following: obtaining an identifier value of a currently read storage unit based on the random number retrieval instruction; and reading, based on the identifier value of the currently read storage unit, a random number stored in a next storage unit.

[0029] To achieve the previous purposes, a fourth aspect of the implementations of the present application provides a random number retrieval device, including: a receiving module, configured to receive a random number retrieval instruction; a random number array retrieval module, configured to obtain a random number array, where the random number array includes N storage units, each of the storage units stores a random number, and locations of the N storage units in the random number array are determined through random shuffling, where N is a positive integer; and a random number retrieval module, configured to obtain, from a corresponding storage unit in the random number array based on the random number retrieval instruction, a random number stored in the storage unit.

[0030] In the random number retrieval device in the implementations of the present application, first, the receiving module receives the random number retrieval instruction; then, the random number array retrieval module obtains the random number array, and the locations of the N storage units in the random number array are determined through random shuffling; and the random number retrieval module reads, from the corresponding storage unit in the random number array based on the received random number retrieval instruction, the random number stored in the storage unit. Because random shuffling is performed on the storage units in the random number array, a plurality of random numbers obtained in a relatively short unit time have a low repetition rate, to achieve balanced distribution. Therefore, the random number retrieval device in the present application can achieve relatively high randomness.

[0031] In an implementation of the present application, the N storage units store different random numbers.

[0032] In an implementation of the present application, the random number retrieval module includes: a first retrieval submodule, configured to obtain an identifier value of a currently read storage unit based on the random number retrieval instruction; and a second retrieval submodule, configured to obtain, based on the identifier value of the currently read storage unit, a random number stored in a next storage unit.

[0033] Additional aspects and advantages of the present application are partially provided in the following description. Some of them become apparent from the following description, or can be understood through the practice of the present application.

BRIEF DESCRIPTION OF DRAWINGS



[0034] The previous and/or additional aspects and advantages of the present application will become apparent and easy to understand in the description of the implementations with reference to the accompanying drawings:

FIG. 1 is a flowchart illustrating a random number generation method, according to an implementation of the present application;

FIG. 2 is a flowchart illustrating a random number retrieval process, according to an implementation of the present application;

FIG. 3 is a flowchart illustrating a process in which random shuffling is performed on storage units in a random number array, according to an implementation of the present application;

FIG. 4 is a schematic structural diagram illustrating a random number generation device, according to an implementation of the present application;

FIG. 5 is a schematic structural diagram illustrating a random number generation device, according to another implementation of the present application;

FIG. 6 is a schematic structural diagram illustrating a random number generation device, according to still another implementation of the present application;

FIG. 7 is a flowchart illustrating a random number retrieval method, according to an implementation of the present application;

FIG. 8 is a schematic structural diagram illustrating a random number retrieval device, according to an implementation of the present application; and

FIG. 9 is a schematic structural diagram illustrating a random number retrieval device, according to another implementation of the present application.


DESCRIPTION OF IMPLEMENTATIONS



[0035] The following describes in detail the implementations of the present application. Examples of the implementations are shown in the accompanying drawings. The same or similar reference numerals indicate the same or similar elements, or elements having the same or similar functions. The implementations described below with reference to the accompanying drawings are examples, and are intended to explain the present application instead of limiting the present application.

[0036] In the present application, random shuffling is performed on storage units in a random number array, so that random numbers in the random number array are randomly shuffled. It resolves a problem of imbalanced distribution due to a large probability of repetition when a conventional random function is used. When a random number needs to be obtained, a corresponding random number can be obtained from the random number array.

[0037] FIG. 1 is a flowchart illustrating a random number generation method, according to an implementation of the present application.

[0038] As shown in FIG. 1, the random number generation method in the present implementation of the present application includes the following steps:

[0039] S110. Generate a random number array, where the random number array includes N storage units, each of the storage units stores a random number, and N is a positive integer.

[0040] In the present implementation of the present application, the N storage units store different random numbers.

[0041] It can be understood that in the present implementation of the present application, the storage units in the generated random number array store different corresponding random numbers. For example, if one storage unit stores a random number 2, no other storage unit stores a random number 2.

[0042] In the present implementation of the present application, the N storage units each store 1 to N integers, so that a random number stored in each storage unit is different from a random number stored in another storage unit.

[0043] In another implementation of the present application, a length of the random number array is configurable, and is set as required in advance.

[0044] S120. Perform random shuffling on the storage units in the random number array.

[0045] It is worthwhile to note that random shuffling in the present implementation of the present application indicates that random exchange is performed on random numbers stored in the N storage units in the random number array, so that the random numbers stored in the storage units are randomly shuffled. It resolves a problem of imbalanced distribution due to a large probability that repetition occurs when a random function in the existing technology is used. In the present implementation of the present application, the random numbers stored in the N storage units can be randomly exchanged using a plurality of methods. These methods are described in detail in later implementations. For a person skilled in the art, random shuffling can be performed on the random numbers stored in the random number array using a plurality of methods, so that the random numbers are randomly shuffled. Therefore, the present application is not limited to a random exchange algorithm mentioned in the following implementations of the present application. Any algorithm that can achieve the previous purpose should fall within the protection scope of the present application.

[0046] S130. Receive a random number retrieval instruction, and read, from a corresponding storage unit in the random number array based on the random number retrieval instruction, a random number stored in the storage unit.

[0047] In the present implementation of the present application, after the random number retrieval instruction is received, corresponding random numbers can be read from the random number array in sequence, or corresponding random numbers can be read from the random number array at random. Certainly, in the present implementation of the present application, the corresponding random numbers can be read from the random number array in another way.

[0048] In a specific implementation of the present application, after the random number retrieval instruction is received, an identifier value of a currently read storage unit (that is, an identifier value of a previously read storage unit) is obtained based on the random number retrieval instruction, and a random number stored in a next storage unit is read based on the identifier value of the currently read storage unit.

[0049] It is worthwhile to note that each time the random number retrieval instruction is received, whether the read storage unit is the last storage unit in the random number array is further determined. If no, the random number stored in the next storage unit is further read. If yes, a new random number array needs to be generated, that is, step S110 is performed.

[0050] The random number generation method in the present implementation of the present application includes the following: first, generating the random number array that includes the N storage units storing the random numbers; then, performing random shuffling on the storage units in the random number array; and receiving the random number retrieval instruction, and reading, from the corresponding storage unit in the random number array, the random number stored in the storage unit. Because random shuffling is performed on the storage units in the random number array, a plurality of random numbers obtained in a relatively short unit time have a low repetition rate, to achieve balanced distribution. Therefore, the random number generation method in the present application can achieve relatively high randomness.

[0051] The following describes in detail a random number retrieval process in the present application with reference to FIG. 2, so that a person skilled in the art can more clearly understand the process.

[0052] S210. Receive a random number retrieval instruction.

[0053] S220. Determine whether a currently read storage unit is the last storage unit in a random number array.

[0054] Each time the random number retrieval instruction is received, whether the currently read storage unit is the last storage unit in the random number array is further determined. If no, a random number stored in a next storage unit is further read.

[0055] S230. If yes, initialize the random number array, and generate a new random number array.

[0056] If it is determined that the currently read storage unit is the last storage unit in the random number array, that is, random numbers stored in all storage units in the random number array have been read. Therefore, the random number array needs to be initialized, and the new random number array is generated.

[0057] In the present implementation of the present application, if it is determined that the current storage unit is not the last storage unit in the random number array, a random number stored in a corresponding storage unit is directly read from the storage unit in the random number array based on the random number retrieval instruction.

[0058] S240. Perform random shuffling on storage units in the random number array, that is, cyclically shuffle locations of the storage units in the random number array.

[0059] In the present implementation of the present application, the locations of the storage units in the random number array are cyclically shuffled, so that the random numbers stored in the storage units are randomly shuffled. It resolves a problem of imbalanced distribution due to a large probability that repetition occurs when a random function in the existing technology is used. In the present implementation of the present application, random exchange can be performed on the random numbers stored in the N storage units using a plurality of methods, so that the random numbers are randomly shuffled. The present implementation of the present application is not limited thereto.

[0060] S250. Select, based on a previously obtained identifier value of a storage unit, data stored in a next storage unit in the random number array, and use the data as a currently to-be-obtained random number.

[0061] An identifier value of a currently read storage unit (that is, an identifier value of a previously read storage unit) is obtained based on the random number retrieval instruction, and a random number stored in a next storage unit is read based on the identifier value of the currently read storage unit. For example, the random numbers can be read in sequence.

[0062] It is worthwhile to note that the corresponding random numbers can further be read from the random number array in another way. The present implementation of the present application is not limited to reading the corresponding random numbers from the random number array in sequence.

[0063] The random number generation method in the present application can be specified with reference to the number of seconds for a program in the JAVA language. Details are described as follows:

[0064] First, a random number array is initialized, and a storage unit is defined to obtain an identifier value and a length of the random number array. After the random number instruction is received, whether the current storage unit is the last storage unit in the random number array is determined. If no, a new random number array needs to be generated; then the storage units in the random number array are cyclically shuffled; and eventually the data stored in the next storage unit in the random number array is selected as the currently to-be-obtained random number based on the previously obtained identifier value of the storage unit.

[0065] It is worthwhile to note that the random number generation method in the present application is not limited to implementation based on the JAVA language, and can be implemented using another computer language.

[0066] The random number generation method in the present implementation of the present application includes the following: first generating the random number array that includes N storage units storing random numbers; then, performing random shuffling on the storage units in the random number array; and receiving the random number retrieval instruction, and reading, from a corresponding storage unit in the random number array, a random number stored in the storage unit. Because random shuffling is performed on the storage units in the random number array, a plurality of random numbers obtained in a relatively short unit time have a low repetition rate to achieve balanced distribution. Therefore, the random number generation method in the present application can achieve relatively high randomness.

[0067] The following describes in detail a process in which random shuffling is performed on the storage units in the random number array in the present application with reference to FIG. 3, so that a person skilled in the art can more clearly understand the process.

[0068] S310. Generate a random value based on a current time and a random function, where each storage unit has an identifier value. The identifier value is used to distinguish between identifiers of storage units. In the present implementation of the present application, an identifier value of a storage unit in an initial state (that is, before the random shuffling) can be equal to a random number stored in the storage unit.

[0069] It is worthwhile to note that the random value generated in step S310 is conceptually different from the random number stored in the storage unit. The random value generated in the present step is used to determine an identifier value of a to-be-exchanged storage unit.

[0070] When i is greater than 1 and less than N, the ith random value is generated based on a current time and the (i-1)th random value; or when i is equal to 1, the ith random value is generated based on a current time, where i is the number of exchange times. In other words, when the random value is generated for the first time, the random value is generated based on the current time. When the random value is not generated for the first time, the ith random value is generated based on the current time and the (i-1)th random value.

[0071] In the present implementation of the present application, after a random number array is generated, each storage unit has an identifier value. The random value is generated based on the random function, and the identifier value of the to-be-exchanged storage unit is generated based on the random value, to determine the to-be-exchanged storage unit.

[0072] S320. Exchange a random number in a to-be-exchanged storage unit with a random number in a target storage unit based on the identifier value and a predetermined exchange rule.

[0073] When the ith exchange is performed, a random number in a storage unit corresponding to the ith random value is exchanged with a random number in the (N+1-i)th storage unit.

[0074] For example, after the random number array is generated, each storage unit has an identifier value, and storage units can be distinguished based on the identifier values. When i is 1, the first random value is generated based on the current time, and an identifier value of a to-be-exchanged storage unit is generated based on the first random value. A random number in a storage unit corresponding to the first random value is exchanged with a random number in the Nth storage unit according to the predetermined exchange rule, that is, the random number in the storage unit corresponding to the first random value is stored in the Nth storage unit, and the random number in the Nth storage unit is stored in the storage unit corresponding to the first random value. When i is 2, the second random value is generated based on the current time and the first random value, and an identifier value of a to-be-exchanged storage unit is generated based on the second random value. A random number in a storage unit corresponding to the second random value is exchanged with a random number in the (N-1)th storage unit based on a predetermined exchange rule, that is, the random number in the storage unit corresponding to the second random value is stored in the (N-1)th storage unit, and the random number in the (N-1)th storage unit is stored in the storage unit corresponding to the second random value. By analogy, similar operations are performed until exchange is completed for the random numbers stored in all the storage units in the random number array. In the previous implementation, exchange is first performed between the storage unit corresponding to the identifier value in the first exchange calculation and the Nth storage unit. Alternatively, in another implementation of the present application, exchange can be first performed on the first storage unit.

[0075] For example, a random number array randArry[] is initialized. A natural number is assigned to each storage unit in the random number array. For example, randArry[0]=1, randArry[1]=2, ..., and randArry[n-1]=n. Locations of the storage units in the random number array are cyclically shuffled. For example, a value stored in each storage unit in the random number array can be exchanged with a value stored in the ith to last storage unit, and i progressively decreases from n-1, for example, exchange is performed between randArry[1]=2 and randArry[n-1]=n.

[0076] It is worthwhile to note that the method for exchanging random numbers in storage units in the present implementation of the present application is only one type of the predetermined exchange rule. To be specific, the predetermined exchange rule can be set based on an actual requirement, and exchange is performed on random numbers in storage units by using different exchange methods.

[0077] S330. Determine whether exchange has been performed on all storage units in a random number array.

[0078] S340. If yes, determine that the random numbers stored in the storage units are randomly shuffled. Therefore, the random number array is available for use.

[0079] It is determined that exchange has been performed on all the random numbers stored in the N storage units in the random number array. The identifier value of the currently read storage unit is obtained based on the random number retrieval instruction, and a random number stored in a next storage unit is read based on the identifier value of the currently read storage unit.

[0080] It is worthwhile to note that the corresponding random numbers can be read from the random number array in another way. The present implementation of the present application is not limited to reading the corresponding random numbers from the random number array in sequence.

[0081] The random number generation method in the present implementation of the present application includes the following: first generating the random number array that includes the N storage units storing the random numbers; then, performing random shuffling on the storage units in the random number array; and receiving the random number retrieval instruction, and reading, from the corresponding storage unit in the random number array, the random number stored in the storage unit. Because random shuffling is performed on the storage units in the random number array, a plurality of random numbers obtained in a relatively short unit time have a low repetition rate, to achieve balanced distribution. Therefore, the random number generation method in the present application can achieve relatively high randomness.

[0082] An implementation of the present disclosure further provides a random number generation device corresponding to the random number generation method provided in the previous implementations. Because the random number generation device provided in the present implementation of the present disclosure has the same or similar technical features with the random number generation method provided in the previous implementations, the previous implementations of the random number generation method are also applicable to the random number generation device provided in the present implementation, and are not described in detail in the present implementation. As shown in FIG. 4, the random number generation device can include a generation module 110, a random shuffling module 120, and a reading module 130.

[0083] The generation module 110 is configured to generate a random number array, where the random number array includes N storage units, each of the storage units stores a random number, and N is a positive integer.

[0084] In an implementation of the present application, the N storage units store different random numbers.

[0085] The random shuffling module 120 is configured to perform random shuffling on the storage units in the random number array.

[0086] The reading module 130 is configured to receive a random number retrieval instruction, and read, from a corresponding storage unit in the random number array based on the random number retrieval instruction, a random number stored in the storage unit.

[0087] In an implementation of the present application, FIG. 5 is a schematic structural diagram illustrating a random number generation device, according to another implementation of the present application. That is, based on FIG. 4, as shown in FIG. 5, the random shuffling module 120 includes an identifier value generation submodule 1201 and an exchange submodule 1202. In an implementation of the present application, the identifier value generation submodule 1201 is configured to generate a random value based on a random function, and generate an identifier value of a to-be-exchanged storage unit based on the random value. The exchange submodule 1202 is configured to exchange a random number in the to-be-exchanged storage unit with a random number in a target storage unit based on the identifier value and a predetermined exchange rule.

[0088] In an implementation of the present application, when i is greater than 1 and less than N, the identifier value generation submodule 1201 generates the ith random value based on a current time and the (i-1)th random value, where i is the number of exchange times; or when i is equal to 1, the identifier value generation submodule 1201 generates the ith random value based on a current time.

[0089] In an implementation of the present application, the predetermined exchange rule is as follows: When the ith exchange is performed, a random number in a storage unit corresponding to the ith random value is exchanged with a random number in the (N+1-i)th storage unit.

[0090] In an implementation of the present application, after the random number retrieval instruction is received, whether the current storage unit is the last storage unit in the random number array is determined. If no, a random number stored in a next storage unit is read; or if yes, a new random number array needs to be generated.

[0091] In an implementation of the present application, FIG. 6 is a schematic structural diagram illustrating a random number generation device, according to another implementation of the present application. Based on FIG. 4, the reading module 130 includes the following: a retrieval submodule 1301 and a reading submodule 1302.

[0092] The retrieval submodule 1301 is configured to obtain an identifier value of a currently read storage unit based on a random number retrieval instruction. The reading submodule 1302 is configured to read, based on the identifier value of the currently read storage unit, a random number stored in a next storage unit.

[0093] In the random number generation device in the present implementation of the present application, first, a generation module generates a random number array that includes N storage units storing random numbers; then, a random shuffling module performs random shuffling on the storage units in the random number array; and the reading module can receive the random number retrieval instruction, and read, from a corresponding storage unit in the random number array, a random number stored in the storage unit. Because the random shuffling module performs random shuffling on the storage units in the random number array, a plurality of random numbers obtained in a relatively short unit time have a low repetition rate, to achieve balanced distribution. Therefore, the random number generation device in the present application can achieve relatively high randomness.

[0094] FIG. 7 is a flowchart illustrating a random number retrieval method, according to an implementation of the present application. The random number retrieval method shown in the present implementation of the present application is described from a retrieval perspective. As shown in FIG. 7, the random number retrieval method includes the following steps:

[0095] S710. Receive a random number retrieval instruction, and obtain a random number array, where the random number array includes N storage units, each of the storage units stores a random number, locations of the N storage units in the random number array are determined through random shuffling, and N is a positive integer.

[0096] In the present implementation of the present application, the N storage units store different random numbers.

[0097] In the present implementation of the present application, the N storage units each can store 1 to N integers, so that a random number stored in each storage unit is different from a random number stored in another storage unit.

[0098] In another implementation of the present application, a length of the random number array is configurable, and is set as required in advance.

[0099] In the present implementation of the present application, after the random number array is generated, each storage unit has an identifier value. A random value is generated based on a random function, and an identifier value of a to-be-exchanged storage unit is generated based on the random value, to determine the to-be-exchanged storage unit.

[0100] In the present implementation of the present application, a random number in the to-be-exchanged storage unit is exchanged with a random number in a target storage unit based on the identifier value and a predetermined exchange rule.

[0101] It is worthwhile to note that the method for exchanging random numbers in storage units in the present implementation of the present application is only one type of the predetermined exchange rule. That is, the predetermined exchange rule can be set based on an actual requirement, and exchange is performed on random numbers in storage units by using different exchange methods.

[0102] S720. Obtain, from a corresponding storage unit in the random number array based on the random number retrieval instruction, a random number stored in the storage unit.

[0103] In a specific implementation of the present application, after the random number retrieval instruction is received, an identifier value of a currently read storage unit (that is, an identifier value of a previously read storage unit) is obtained based on the random number retrieval instruction, and a random number stored in a next storage unit is read based on the identifier value of the currently read storage unit.

[0104] The random number retrieval method in the present implementation of the present application includes the following: first, receiving the random number retrieval instruction; then obtaining the random number array, and determining locations of the N storage units in the random number array through random shuffling; and reading, from the corresponding storage unit in the random number array based on the received random number retrieval instruction, the random number stored in the storage unit. Because random shuffling is performed on the storage units in the random number array, a plurality of random numbers obtained in a relatively short unit time have a low repetition rate, to achieve balanced distribution. Therefore, the random number retrieval method in the present application can achieve relatively high randomness.

[0105] An implementation of the present disclosure further provides a random number retrieval device corresponding to the random number retrieval method provided in the previous implementations. The random number retrieval device provided in the present implementation of the present disclosure has the same or similar technical features with the random number retrieval method provided in the previous implementations. Therefore, the implementations of the random number retrieval method are also applicable to the random number retrieval device provided in the present implementation. Details are not described in the present implementation. As shown in FIG. 8, the random number retrieval device can include: a receiving module 210, a random number array retrieval module 220, and a random number retrieval module 230.

[0106] The receiving module 210 is configured to receive a random number retrieval instruction.

[0107] The random number array retrieval module 220 is configured to obtain a random number array, where the random number array includes N storage units, each of the storage units stores a random number, locations of the N storage units in the random number array are determined through random shuffling, and N is a positive integer.

[0108] In an implementation of the present application, the N storage units store different random numbers.

[0109] The random number retrieval module 230 is configured to obtain, from a corresponding storage unit in the random number array based on the random number retrieval instruction, a random number stored in the storage unit.

[0110] In an implementation of the present application, FIG. 9 is a schematic structural diagram illustrating a random number retrieval device, according to another implementation of the present application. Based on FIG. 8, the random number retrieval module 230 shown in FIG. 9 includes the following: a first retrieval submodule 2301, configured to obtain an identifier value of a currently read storage unit based on the random number retrieval instruction; and a second retrieval submodule 2302, configured to obtain, based on the identifier value of the currently read storage unit, a random number stored in a next storage unit.

[0111] In the random number retrieval device in the present implementation of the present application, first, a receiving module receives a random number retrieval instruction; then, a random number array retrieval module obtains a random number array, and locations of N storage units in the random number array are determined through random shuffling; and a random number retrieval module reads, from a corresponding storage unit in the random number array based on the received random number retrieval instruction, the random number stored in the storage unit. Because random shuffling is performed on the storage units in the random number array, a plurality of random numbers obtained in a relatively short unit time have a low repetition rate, to achieve balanced distribution. Therefore, the random number retrieval device in the present application can achieve relatively high randomness.

[0112] In the description of the present application, it should be understood that terms "first" and "second" are merely used to description, and cannot be understood as an indication or implication of relative importance or implicit indication of the number of indicated technical features. Therefore, a characteristic modified by "first" or "second" can explicitly or implicitly include one or more features. In the description of the present application, "a plurality of" means at least two, for example, two or three, unless otherwise stated.

[0113] In the description of the present specification, reference terms such as "an implementation", "some implementations", "an example", "a specific example", and "some examples" mean that specific features, structures, materials, or characteristics described with reference to the implementation or the example are included in one or more implementations or examples in the present application. In the present specification, the previous terms are described not necessarily for the same implementation or example. In addition, the described specific features, structures, materials, or characteristics can be combined in a proper way in any one or more implementations or examples. Further, a person skilled in the art can combine uncontradicted features of different implementations or examples described in the present specification.

[0114] Any process or method description described in the flowchart or in another way can be understood as a module, a segment, or a part of code of an executable instruction that includes one or more steps to implement a specific logical function or process, and the implementations of the present application include another implementation in which functions can be performed in a sequence different from the shown or discussed sequence, for example, the related functions are performed simultaneously or in a reverse sequence. It should be understood by a person skilled in the art related to the implementations of the present application.

[0115] It should be understood that parts of the present application can be implemented by hardware, software, firmware, or a combination thereof. In the previous implementations, a plurality of steps or methods can be implemented by using software that is stored in a memory and executed by an appropriate instruction execution system or firmware. For example, if the steps or the methods are implemented by using hardware that can be implemented by using any one or a combination of the following technologies in the art: a discrete logic circuit including a logic gate circuit for implementing logical functions of a data signal, an application-specific integrated circuit having a proper combinational logic gate circuit, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0116] A person of ordinary skill in the art can understand that all or some of the steps in the method implementations can be implemented by a program instructing relevant hardware. The program can be stored in a computer readable storage medium. When the program runs, one of or a combination of the steps in the method implementations is performed.

[0117] In addition, functional units in the implementations of the present application can be integrated into one processing module, or each of the units can exist alone physically, or two or more units are integrated into one module. The integrated module can be implemented in a form of hardware, or can be implemented in a form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, the integrated module can be stored in a computer-readable storage medium.

[0118] The previous storage medium can be a read-only memory, a magnetic disk, an optical disk, etc. Although the implementations of the present application have been shown and described above, it can be understood that the previous implementations are examples and cannot be understood as a limitation on the present application. A person of ordinary skill in the art can make change, modification, replacement, and modification to the previous implementations within the scope of the present application.


Claims

1. A random number generation method, comprising:

generating a random number array, wherein the random number array comprises N storage units, each of the storage units stores a random number, and N is a positive integer (S110);

performing random shuffling of the random numbers stored at the storage units in the random number array (S120); and

receiving (S130) a random number retrieval instruction, and reading, from a corresponding storage unit in the random number array based on the random number retrieval instruction, a random number stored in the corresponding storage unit, wherein reading the random number retrieval instruction comprises

determining whether a read storage unit is the last storage unit in the random number array; and

in response to determining that the read storage unit is not the last storage unit in the random number array, reading a random number stored in the next storage unit; or

in response to determining that the read storage unit is the last storage unit in the random number array, generating a new random number array.


 
2. The random number generation method according to claim 1, wherein the N storage units store different random numbers, and wherein a random number stored in each storage unit is different from a random number stored in another storage unit.
 
3. The random number generation method according to claim 1, wherein the random shuffling is performed on the N storage units in the random number array.
 
4. The random number generation method according to claim 1, further comprising:
after receiving the random number retrieval instruction, reading random numbers from the random number array in sequence.
 
5. The random number generation method according to claim 1, wherein each of the storage units has an identifier value, and performing the random shuffling on the random numbers stored in the storage units in the random number array comprises:

generating a random value based on a random function, and determining an identifier value of a to-be-exchanged storage unit based on the random value (310); and

exchanging a random number in the to-be-exchanged storage unit with a random number in a target storage unit based on the identifier value and a predetermined exchange rule (320).


 
6. The random number generation method according to claim 5, wherein generating the random value based on the random function comprises:

when i is greater than 1 and less than N, generating the ith random value based on a current time and the (i-1)th random value, wherein i is the number of exchange times; or

when i is equal to 1, generating the ith random value based on a current time.


 
7. The random number generation method according to claim 5, wherein the predetermined exchange rule is as follows:
when the ith exchange is performed, a random number in a storage unit corresponding to the ith random value is exchanged with a random number in the (N+1-i)th storage unit.
 
8. The random number generation method according to claim 5, further comprising:

determining whether an exchange has been performed on all storage units in a random number array (S330); and

in response to determining that the exchange has been performed on all storage units in a random number array, determining that the random numbers stored in the storage units are randomly shuffled (S340).


 
9. The random number generation method according to claim 8, further comprising, in response to determining that exchange has not been performed on all storage units in the random number array:

generating (310) a random value based on a random function, and determining an identifier value of a to-be-exchanged storage unit based on the random value; and

exchanging (320) a random number in the to-be-exchanged storage unit with a random number in a target storage unit based on the identifier value and a predetermined exchange rule.


 
10. The random number generation method according to claim 1, wherein reading, from the corresponding storage unit in the random number array based on the random number retrieval instruction comprises:

obtaining an identifier value of a currently read storage unit based on the random number retrieval instruction, wherein the read storage unit is a previously read storage unit; and

reading, based on the identifier value of the currently read storage unit, the random number stored in a next storage unit, wherein the reading of the storage units in the random number array is performed in sequence.


 
11. The random number generation method according to claim 1, wherein receiving the random number retrieval instruction, and reading, from the corresponding storage unit in the random number array the random number further comprises:

receiving (S210) the random number retrieval instruction;

determining (S220) whether a currently read storage unit is the last storage unit in the random number array;

in response to determining that the currently read storage unit is the last storage unit in the random number array,

initializing (S230) a random number array and generating a new random number array; and

performing (S240) random shuffling on storage units in the random number array by cyclically shuffling locations of the storage units in the random number array; and

selecting (S250), based on a previously obtained identifier value of the currently read storage unit, data stored in a next storage unit in the random number array, and using the data as a currently to-be-obtained random number.


 
12. A random number generation device storing executable instructions in a memory of the device, which when executed by the device cause the device to perform the method according to any one of claims 1 to 11.
 


Ansprüche

1. Verfahren zum Erzeugen von Zufallszahlen, das Folgendes umfasst:

Erzeugen einer Zufallszahlanordnung, wobei die Zufallszahlanordnung N Speichereinheiten enthält, wobei jede der Speichereinheiten eine Zufallszahl speichert und wobei N eine positive ganze Zahl ist (S110);

Ausführen einer Zufallsverschiebung der Zufallszahlen, die in den Speichereinheiten in der Zufallszahlanordnung gespeichert sind (S120); und

Empfangen (S130) eines Zufallszahl-Wiedergewinnungsbefehls und Lesen aus einer entsprechenden Speichereinheit in der Zufallszahlanordnung auf der Grundlage des Zufallszahl-Wiedergewinnungsbefehls einer in der entsprechenden Speichereinheit gespeicherten Zufallszahl, wobei das Lesen des Zufallszahl-Wiedergewinnungsbefehls Folgendes umfasst:

Bestimmen, ob eine gelesene Speichereinheit die letzte Speichereinheit in der Zufallszahlanordnung ist; und

in Reaktion auf das Bestimmen, dass die gelesene Speichereinheit nicht die letzte Speichereinheit in der Zufallszahlanordnung ist, Lesen einer Zufallszahl, die in der nächsten Speichereinheit gespeichert ist; oder

in Reaktion auf das Bestimmen, dass die gelesene Speichereinheit die letzte Speichereinheit in der Zufallszahlanordnung ist, Erzeugen einer neuen Zufallszahlanordnung.


 
2. Verfahren zum Erzeugen von Zufallszahlen nach Anspruch 1, wobei die N Speichereinheiten unterschiedliche Zufallszahlen speichern und wobei eine in jeder Speichereinheit gespeicherte Zufallszahl von einer in einer weiteren Speichereinheit gespeicherten Zufallszahl verschieden ist.
 
3. Verfahren zum Erzeugen von Zufallszahlen nach Anspruch 1, wobei das zufällige Verschieben an den N Speichereinheiten in der Zufallszahlanordnung ausgeführt wird.
 
4. Verfahren zum Erzeugen von Zufallszahlen nach Anspruch 1, das ferner Folgendes umfasst:
nach dem Empfangen des Zufallszahl-Wiedergewinnungsbefehls nacheinander Lesen von Zufallszahlen aus der Zufallszahlanordnung.
 
5. Verfahren zum Erzeugen von Zufallszahlen nach Anspruch 1, wobei jede der Speichereinheiten einen Kennungswert besitzt und das Ausführen des zufälligen Verschiebens an den in den Speichereinheiten in der Zufallszahlanordnung gespeicherten Zufallszahlen Folgendes umfasst:

Erzeugen eines Zufallswertes auf der Grundlage einer Zufallsfunktion und Bestimmen eines Kennungswertes einer auszutauschenden Speichereinheit auf der Grundlage des Zufallswertes (310); und

Austauschen einer Zufallszahl in der auszutauschenden Speichereinheit durch eine Zufallszahl in einer Zielspeichereinheit auf der Grundlage des Kennungswerts und einer vorgegebenen Austauschregel (320).


 
6. Verfahren zum Erzeugen von Zufallszahlen nach Anspruch 5, wobei das Erzeugen des Zufallswertes auf der Grundlage der Zufallsfunktion Folgendes umfasst:

wenn i größer 1 ist und kleiner als N ist, Erzeugen des i-ten Zufallswertes auf der Grundlage einer aktuellen Zeit und des (i - 1)-ten Zufallswertes, wobei i die Anzahl von Austauschen ist; oder

wenn i gleich 1 ist, Erzeugen des i-ten Zufallswerts auf der Grundlage einer aktuellen Zeit.


 
7. Verfahren zum Erzeugen von Zufallszahlen nach Anspruch 5, wobei die vorgegebene Austauschregel die Folgende ist:
wenn der i-te Austausch ausgeführt wird, wird eine Zufallszahl in einer Speichereinheit, die dem i-ten Zufallswert entspricht, durch eine Zufallszahl in der (N + 1 - i)-ten Speichereinheit ausgetauscht.
 
8. Verfahren zum Erzeugen von Zufallszahlen nach Anspruch 5, das ferner Folgendes umfasst:

Bestimmen, ob ein Austausch an allen Speichereinheiten in einer Zufallszahlanordnung ausgeführt worden ist (S330); und

in Reaktion auf das Bestimmen, dass der Austausch an allen Speichereinheiten in einer Zufallszahlanordnung ausgeführt worden ist, Bestimmen, dass die in den Speichereinheiten gespeicherten Zufallszahlen zufällig verschoben worden sind (S340).


 
9. Verfahren zum Erzeugen von Zufallszahlen nach Anspruch 8, das ferner in Reaktion auf das Bestimmen, dass ein Austausch nicht an allen Speichereinheiten in der Zufallszahlanordnung ausgeführt worden ist, Folgendes umfasst:

Erzeugen (310) eines Zufallswertes auf der Grundlage einer Zufallsfunktion und Bestimmen eines Kennungswertes einer auszutauschenden Speichereinheit auf der Grundlage des Zufallswertes; und

Austauschen (320) einer Zufallszahl in der auszutauschenden Speichereinheit durch eine Zufallszahl in einer Zielspeichereinheit auf der Grundlage des Kennungswertes und einer vorgegebenen Austauschregel.


 
10. Verfahren zum Erzeugen von Zufallszahlen nach Anspruch 1, wobei das Lesen aus der entsprechenden Speichereinheit in der Zufallszahlanordnung auf der Grundlage des Zufallszahl-Wiedererkennungsbefehls Folgendes umfasst:

Erhalten eines Kennungswertes einer aktuell gelesenen Speichereinheit auf der Grundlage des Zufallszahl-Wiedergewinnungsbefehls, wobei die gelesene Speichereinheit eine früher gelesene Speichereinheit ist; und

Lesen auf der Grundlage des Kennungswertes der aktuell gelesenen Speichereinheit der in einer nächsten Speichereinheit gespeicherten Zufallszahl, wobei das Lesen der Speichereinheiten in der Zufallszahlanordnung nacheinander ausgeführt wird.


 
11. Verfahren zum Erzeugen von Zufallszahlen nach Anspruch 1, wobei das Empfangen des Zufallszahl-Wiedergewinnungsbefehls und das Lesen der Zufallszahl aus der entsprechenden Speichereinheit in der Zufallszahlanordnung ferner Folgendes umfasst:

Empfangen (S210) des Zufallszahl-Wiedergewinnungsbefehls;

Bestimmen (S220), ob eine aktuell gelesene Speichereinheit die letzte Speichereinheit in der Zufallszahlanordnung ist;

in Reaktion auf das Bestimmen, dass die aktuell gelesene Speichereinheit die letzte Speichereinheit in der Zufallszahlanordnung ist,

Initialisieren (S230) einer Zufallszahlanordnung und Erzeugen einer neuen Zufallszahlanordnung; und

Ausführen (S240) eines zufälligen Verschiebens an Speichereinheiten in der Zufallszahlanordnung durch zyklisches Verschieben von Orten der Speichereinheiten in der Zufallszahlanordnung; und

Auswählen (S250) auf der Grundlage eines früher erhaltenen Kennungswertes der aktuell gelesenen Speichereinheiten von Daten, die in der nächsten Speichereinheit in der Zufallszahlanordnung gespeichert sind, und Verwenden der Daten als aktuell zu erhaltende Zufallszahl.


 
12. Vorrichtung zum Erzeugen von Zufallszahlen, die in einem Speicher der Vorrichtung ausführbare Befehle speichert, die dann, wenn sie durch die Vorrichtung ausgeführt werden, die Vorrichtung veranlassen, das Verfahren nach einem der Ansprüche 1 bis 11 auszuführen.
 


Revendications

1. Procédé de génération de nombres aléatoires, comprenant :

la génération d'un tableau de nombres aléatoires, le tableau de nombres aléatoires comprenant N unités de stockage, chacune des unités de stockage stockant un nombre aléatoire et N étant un entier positif (S110) ;

la réalisation d'un brassage aléatoire des nombres aléatoires stockés au niveau des unités de stockage dans le tableau de nombres aléatoires (S 120) ; et

la réception (S130) d'une instruction de récupération de nombre aléatoire, et la lecture, dans une unité de stockage correspondante dans le tableau de nombres aléatoires sur la base de l'instruction de récupération de nombre aléatoire, d'un nombre aléatoire stocké dans l'unité de stockage correspondante, la lecture de l'instruction de récupération de nombre aléatoire comprenant

la détermination si une unité de stockage lue est ou non la dernière unité de stockage dans le tableau de nombres aléatoires ; et

en réponse à la détermination que l'unité de stockage lue n'est pas la dernière unité de stockage dans le tableau de nombres aléatoires, la lecture d'un nombre aléatoire stocké dans l'unité de stockage suivante ; ou

en réponse à la détermination que l'unité de stockage lue est la dernière unité de stockage dans le tableau de nombres aléatoires, la génération d'un nouveau tableau de nombres aléatoires.


 
2. Procédé de génération de nombres aléatoires selon la revendication 1, dans lequel les N unités de stockage stockent des nombres aléatoires différents, et dans lequel un nombre aléatoire stocké dans chaque unité de stockage est différent d'un nombre aléatoire stocké dans une autre unité de stockage.
 
3. Procédé de génération de nombres aléatoires selon la revendication 1, dans lequel le brassage aléatoire est réalisé sur les N unités de stockage dans le tableau de nombres aléatoires.
 
4. Procédé de génération de nombres aléatoires selon la revendication 1, comprenant en outre :
suite à la réception de l'instruction de récupération de nombre aléatoire, la lecture séquentielle de nombres aléatoires dans le tableau de nombres aléatoires.
 
5. Procédé de génération de nombres aléatoires selon la revendication 1, dans lequel chacune des unités de stockage possède une valeur d'identifiant, et la réalisation du brassage aléatoire sur les nombres aléatoires stockés dans les unités de stockage dans le tableau de nombres aléatoires comprend :

la génération d'une valeur aléatoire sur la base d'une fonction aléatoire, et la détermination d'une valeur d'identifiant d'une unité de stockage à échanger sur la base de la valeur aléatoire (310) ; et

l'échange d'un nombre aléatoire dans l'unité de stockage à échanger pour un nombre aléatoire dans une unité de stockage cible sur la base de la valeur d'identifiant et d'une règle d'échange prédéterminée (320).


 
6. Procédé de génération de nombres aléatoires selon la revendication 5, dans lequel la génération de la valeur aléatoire sur la base de la fonction aléatoire comprend :

lorsque i est supérieur à 1 et inférieur à N, la génération de la i-ème valeur aléatoire sur la base d'une heure actuelle et de la (i-1)-ième valeur aléatoire, i étant le nombre d'occasions d'échange ; ou

lorsque i est égal à 1, la génération de la i-ème valeur aléatoire sur la base d'une heure actuelle.


 
7. Procédé de génération de nombres aléatoires selon la revendication 5, dans lequel la règle d'échange prédéterminée s'établit comme suit :
lorsque le i-ème échange est réalisé, un nombre aléatoire dans une unité de stockage correspondant à la i-ème valeur aléatoire est échangé pour un nombre aléatoire dans la (N+1i)-ème unité de stockage.
 
8. Procédé de génération de nombres aléatoires selon la revendication 5, comprenant en outre :

la détermination si un échange a été ou non réalisé sur toutes les unités de stockage dans un tableau de nombres aléatoires (S330) ; et

en réponse à la détermination que l'échange a été réalisé sur toutes les unités de stockage dans un tableau de nombres aléatoires, la détermination que les nombres aléatoires stockés dans les unités de stockage sont brassés aléatoirement (S340).


 
9. Procédé de génération de nombres aléatoires selon la revendication 8, comprenant en outre, en réponse à la détermination qu'un échange n'a pas été réalisé sur toutes les unités de stockage dans le tableau de nombres aléatoires :

la génération (310) d'une valeur aléatoire sur la base d'une fonction aléatoire, et la détermination d'une valeur d'identifiant d'une unité de stockage à échanger sur la base de la valeur aléatoire ; et

l'échange (320) d'un nombre aléatoire dans l'unité de stockage à échanger pour un nombre aléatoire dans une unité de stockage cible sur la base de la valeur d'identifiant et d'une règle d'échange prédéterminée.


 
10. Procédé de génération de nombres aléatoires selon la revendication 1, dans lequel la lecture, dans l'unité de stockage correspondante dans le tableau de nombres aléatoires sur la base de l'instruction de récupération de nombre aléatoire, comprend :

l'obtention d'une valeur d'identifiant d'une unité de stockage lue actuellement sur la base de l'instruction de récupération de nombre aléatoire, l'unité de stockage lue étant une unité de stockage lue précédemment ; et

la lecture, sur la base de la valeur d'identifiant de l'unité de stockage lue actuellement, du nombre aléatoire stocké dans une unité de stockage suivante, la lecture des unités de stockage dans le tableau de nombres aléatoires étant réalisée de manière séquentielle.


 
11. Procédé de génération de nombres aléatoires selon la revendication 1, dans lequel la réception de l'instruction de récupération de nombre aléatoire et la lecture, dans l'unité de stockage correspondante dans le tableau de nombres aléatoires, du nombre aléatoire comprennent en outre :

la réception (S210) de l'instruction de récupération de nombre aléatoire ;

la détermination (S220) si une unité de stockage lue actuellement est ou non la dernière unité de stockage dans le tableau de nombres aléatoires ;

en réponse à la détermination que l'unité de stockage lue actuellement est la dernière unité de stockage dans le tableau de nombres aléatoires,

l'initialisation (S230) d'un tableau de nombres aléatoires et la génération d'un nouveau tableau de nombres aléatoires ; et

la réalisation (S240) d'un brassage aléatoire sur des unités de stockage dans le tableau de nombres aléatoires par brassage cyclique d'emplacements des unités de stockage dans le tableau de nombres aléatoires ; et

la sélection (S250), sur la base d'une valeur d'identifiant obtenue précédemment de l'unité de stockage lue actuellement, de données stockées dans une unité de stockage suivante dans le tableau de nombres aléatoires, et l'utilisation des données comme un nombre aléatoire à obtenir actuellement.


 
12. Dispositif de génération de nombres aléatoires stockant, dans une mémoire du dispositif, des instructions exécutables qui, lorsqu'elles sont exécutées par le dispositif, amènent le dispositif à réaliser le procédé selon l'une quelconque des revendications 1 à 11.
 




Drawing























Cited references

REFERENCES CITED IN THE DESCRIPTION



This list of references cited by the applicant is for the reader's convenience only. It does not form part of the European patent document. Even though great care has been taken in compiling the references, errors or omissions cannot be excluded and the EPO disclaims all liability in this regard.

Patent documents cited in the description