WO2017157197A1 - 随机数的生成及获取方法和装置 - Google Patents

随机数的生成及获取方法和装置 Download PDF

Info

Publication number
WO2017157197A1
WO2017157197A1 PCT/CN2017/075828 CN2017075828W WO2017157197A1 WO 2017157197 A1 WO2017157197 A1 WO 2017157197A1 CN 2017075828 W CN2017075828 W CN 2017075828W WO 2017157197 A1 WO2017157197 A1 WO 2017157197A1
Authority
WO
WIPO (PCT)
Prior art keywords
random number
storage unit
random
storage
value
Prior art date
Application number
PCT/CN2017/075828
Other languages
English (en)
French (fr)
Inventor
文家祥
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Priority to PL17765739T priority Critical patent/PL3432137T3/pl
Priority to EP17765739.2A priority patent/EP3432137B1/en
Priority to ES17765739T priority patent/ES2847287T3/es
Priority to EP20189059.7A priority patent/EP3751410B1/en
Priority to JP2018549163A priority patent/JP6793747B2/ja
Publication of WO2017157197A1 publication Critical patent/WO2017157197A1/zh
Priority to US16/131,352 priority patent/US10691415B2/en
Priority to US16/906,840 priority patent/US10929103B2/en
Priority to US17/181,978 priority patent/US11182129B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/582Pseudo-random number generators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/588Random number generators, i.e. based on natural stochastic processes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • G06F9/30021Compare instructions, e.g. Greater-Than, Equal-To, MINMAX

Definitions

  • the present application relates to the field of computer technology, and in particular, to a method and an apparatus for generating and acquiring a random number.
  • random numbers As random numbers become more widely used in the computer field, there is an increasing demand for random numbers generated.
  • One is the software method, which uses the system time as the seed generated by the random number, and then generates a random number according to the system function.
  • the other is a hardware method that designs a hardware device that generates random numbers and generates random numbers based on random signals.
  • the software uses the system default random number generation method, which has the following disadvantages: if at the same time point (the same second, or the same millisecond), the random number repeat probability is high, resulting in an unbalanced random number distribution, that is, a pseudo random number. Because, in computer application systems, the use time is used as a seed for random number generation, and the random number produced in a short period of time, for example, in the same millisecond or second time period, is equal in number of time seeds. Therefore, the generated random number has the disadvantages of high repetition rate and uneven distribution.
  • the purpose of the present application is to solve at least one of the above technical problems to some extent.
  • the first object of the present application is to propose a method for generating a random number by randomly generating a random number storage array including N memory cells to store random numbers, and then randomly storing the memory cells in the random number storage array.
  • the random number acquisition instruction is received, the random number is read from the corresponding storage unit in the random number storage array.
  • the random number repetition rate that can be acquired multiple times in a short unit time is low. And the distribution is balanced, so the random number generation method of the present application has better randomness.
  • a second object of the present application is to provide a device for generating a random number.
  • the third object of the present application is to propose a method for obtaining a random number.
  • a fourth object of the present application is to provide an apparatus for acquiring a random number.
  • a method for generating a random number includes The following steps: generating a random number storage array, wherein the random number storage array includes N storage units, each of the storage units storing a random number, wherein N is a positive integer; storing the array in the random number The storage unit performs random shuffling; and receives the random number obtaining instruction, and reads the random number stored by the storage unit from the corresponding storage unit in the random number storage array according to the random number obtaining instruction.
  • the random number generation method of the embodiment of the present application first generates a random number storage array including N storage units and each storage unit stores a random number, and then randomly mixes the storage units in the random number storage array, thereby Upon receiving the random number acquisition instruction, the random number stored in the storage unit is read from the corresponding storage unit in the random number storage array. Since the memory cells are randomly mixed in the random number storage array, the random number of the random number acquired in a short unit time is low, and the distribution is balanced. Therefore, the random number generation method of the present application has better randomness.
  • the random numbers stored in the N storage units are all different.
  • the method for generating a random number each of the storage units has an identification value
  • the performing the shuffling of the storage units in the random number storage array specifically includes: The random function generates a random value, and generates an identifier value of the storage unit to be swapped according to the random value; and exchanges the random number in the storage unit to be swapped with the target storage unit according to the identifier value and the preset switching rule.
  • the generating the random value according to the random function specifically includes: when i is greater than 1 and less than N, generating an ith random value according to the current time and the i-1th random value, where, i For the number of exchanges; when i is equal to 1, the ith random value is generated according to the current time.
  • the preset switching rule is: when performing the ith switching, the storage unit corresponding to the i-th random value and the random number in the (N+1-i) storage unit Exchange.
  • the reading the random number stored by the storage unit from the corresponding storage unit in the random number storage array according to the random number obtaining instruction specifically includes: acquiring according to the random number The instruction acquires an identifier value of the storage unit that has been currently read; and reads a random number stored in the next storage unit according to the identifier value of the currently read storage unit.
  • a random number generating apparatus includes: a generating module, configured to generate a random number storage array, wherein the random number storage array includes N storage units Each of the storage units stores a random number, wherein N is a positive integer; a random shuffling module for randomly shuffling the storage units in the random number storage array; and a reading module for receiving Obtaining an instruction by a random number, and reading a random number stored by the storage unit from a corresponding storage unit in the random number storage array according to the random number obtaining instruction.
  • the generating module first generates a random number storage array including N storage units and each storage unit stores a random number, and then the random shuffling module randomly performs the storage unit in the random number storage array.
  • the shuffling so that the reading module can read the random number stored in the storage unit from the corresponding storage unit in the random number storage array when receiving the random number obtaining instruction. Since the random shuffling module randomly mixes the storage units in the random number storage array, the random number repetition rate obtained in a short unit time is low and the distribution is balanced. Therefore, the random number generating device of the present application has better randomness.
  • the random numbers stored in the N storage units are all different.
  • the random number generating device each of the storage units has an identification value
  • the random shuffling module includes: an identifier value generating submodule, configured to generate according to a random function a random value, and generating an identifier value of the storage unit to be swapped according to the random value; and a sub-module for replacing the random number in the storage unit and the target storage unit according to the identifier value and the preset switching rule Exchange.
  • the generating apparatus of the random number when i is greater than 1 and less than N, the identifier value generating sub-module generates an ith random according to the current time and the i-1th random value. a value, where i is the number of swaps; when i is equal to 1, the identifier value generation sub-module generates the i-th random value according to the current time.
  • the preset switching rule is: when performing the ith switching, the storage unit corresponding to the i-th random value and the random number in the (N+1-i) storage unit Exchange.
  • the reading module specifically includes: an obtaining submodule, configured to acquire an identifier value of a currently stored storage unit according to the random number obtaining instruction; and the reading submodule is configured to: Reading a random number stored in the next storage unit according to the identification value of the storage unit that has been currently read.
  • a method for obtaining a random number includes the steps of: receiving a random number obtaining instruction, and acquiring a random number storage array, wherein the random number storage array includes N storage units, each of the storage units storing a random number, and the positions of the N storage units in the random number storage array are determined by random shuffling, wherein N is a positive integer; obtaining according to the random number
  • the instruction acquires a random number stored by the storage unit from a corresponding storage unit in the random number storage array.
  • the random number obtaining method of the embodiment of the present application first receives the random number obtaining instruction, and then acquires the random number storage array and determines the position of the N storage units in the random number storage array by random shuffling, thereby receiving the random number according to the random number
  • the fetch instruction reads the random number stored in the storage unit from the corresponding storage unit in the random number storage array. Since the memory cells are randomly mixed in the random number storage array, the random number of the random number acquired in a short unit time is low, and the distribution is balanced. Therefore, the random number acquisition method of the present application has better randomness.
  • the random numbers stored in the N storage units are all different.
  • the method for acquiring a random number each of the storage units has an identification value, wherein a location of the N storage units in the random number storage array is randomized by the following steps The arranging: generating a random value according to the random function, and generating an identifier value of the storage unit to be swapped according to the random value; and randomly selecting the storage unit to be swapped and the target storage unit according to the identifier value and the preset switching rule The number is exchanged.
  • the obtaining the random number stored by the storage unit from the corresponding storage unit in the random number storage array according to the random number obtaining instruction specifically includes: acquiring an instruction according to the random number Obtaining an identifier value of the storage unit that has been currently read; acquiring a random number stored in the next storage unit according to the identifier value of the currently read storage unit.
  • a random number obtaining apparatus includes: a receiving module, configured to receive a random number obtaining instruction; and a random number storage array acquiring module, configured to obtain a random number storage An array, wherein the random number storage array includes N storage units, each of the storage units stores a random number, and positions of the N storage units in the random number storage array are determined by random shuffling, wherein N is a positive integer; a random number obtaining module is configured to acquire, according to the random number obtaining instruction, a random number stored by the storage unit from a corresponding storage unit in the random number storage array.
  • the receiving module first receives the random number obtaining instruction, and then the random number storage array obtaining module acquires the random number storage array and determines the N storage units in the random number storage array by random shuffling. Position, so that the random number obtaining module reads the random number stored by the storage unit from the corresponding storage unit in the random number storage array according to the received random number obtaining instruction. Since the memory cells are randomly mixed in the random number storage array, the random number of the random number acquired in a short unit time is low, and the distribution is balanced. Therefore, the random number acquisition device of the present application has better randomness.
  • the random numbers stored in the N storage units are all different.
  • the random number obtaining module specifically includes: a first obtaining submodule, configured to acquire, according to the random number obtaining instruction, an identifier value of a storage unit that has been currently read; And a module, configured to acquire a random number stored by the next storage unit according to the identifier value of the currently read storage unit.
  • FIG. 1 is a flowchart of a method for generating a random number according to an embodiment of the present application
  • FIG. 3 is a flow chart of a method for randomly shuffling memory cells in a random number storage array according to an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of a device for generating a random number according to an embodiment of the present application
  • FIG. 5 is a schematic structural diagram of a device for generating a random number according to another embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a device for generating a random number according to still another embodiment of the present application.
  • FIG. 7 is a flowchart of a method for acquiring a random number according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a device for acquiring a random number according to an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an apparatus for acquiring a random number according to another embodiment of the present application.
  • the present invention randomizes the storage units in the random number storage array by random shuffling, so that the random number sequence in the random number storage array is completely random, thereby solving the problem that the random probability of the traditional random function is repeated and the distribution is unbalanced.
  • the problem When a random number needs to be obtained, the corresponding random number can be obtained from the random number storage array.
  • FIG. 1 is a flow chart of a method of generating a random number according to an embodiment of the present application.
  • the method for generating a random number in the embodiment of the present application includes the following steps:
  • the random numbers stored in the N storage units are all different.
  • the random number stored in the corresponding storage unit in the generated random number storage array is not repeated. For example, if one random number stored in one storage unit is 2, then other storage units are The stored random numbers are not 2.
  • N storage units may store 1 to N integers, respectively, so that each storage list The random number stored in the meta is different from the others.
  • the length of the random number storage array is configurable, and the length of the random number storage array is set in advance as needed.
  • S120 Perform random mixing on the storage units in the random number storage array.
  • the random shuffling in the embodiment of the present application refers to randomly changing the random numbers stored in the N storage units in the random number storage array, so that the order of the random numbers stored in the storage unit is completely random, thereby Solving the problem that the random probability of the random function in the prior art is repeated causes the distribution to be unbalanced.
  • the random numbers stored in the N storage units may be randomly exchanged in various manners, which will be described in detail in the following embodiments.
  • the random numbers stored in the random number storage array may be randomly mixed in a plurality of manners, so that the order of the random numbers is completely random, and thus is not limited to the following embodiments of the present application. Any algorithm that can achieve the above purpose should be included in the protection scope of the present application.
  • the corresponding random number may be sequentially read from the random number storage array, or may be randomly read from the random number storage array. Random number.
  • the corresponding random number can also be read from the random number storage array in other manners.
  • the identifier value of the currently read storage unit is acquired according to the random number acquisition instruction (ie, the storage unit that was last read)
  • the identification value reads the random number stored in the next storage unit according to the identification value of the storage unit that has been read.
  • step S110 After each receiving the random number acquisition instruction, it is further determined whether the storage unit that has been read is the last storage unit in the random number storage array. If it is not the last memory location in the random number storage array, continue reading the random number stored in the next memory location. If it is the last storage unit in the random number storage array, it is necessary to regenerate the new random number storage array, that is, step S110 is performed.
  • the method for generating a random number in the embodiment of the present application first generates a random number storage array including N storage units and each storage unit stores a random number, and then randomly mixes the storage units in the random number storage array, thereby Upon receiving the random number acquisition instruction, the random number stored in the storage unit is read from the corresponding storage unit in the random number storage array. Since the storage unit is randomly mixed in the random number storage array, the random number of the random number acquired in a short unit time is low, and the distribution is balanced, so the random number of the present application The method has good randomness.
  • the currently stored memory cell is the last memory cell in the random number storage array. If it is not the last memory location in the random number storage array, continue reading the random number stored in the next memory location.
  • the storage unit that has been read is the last one of the random number storage array, that is, the random number stored in all the storage units in the random number storage array has been read, and the storage array needs to be stored for the random number.
  • the random number stored by the storage unit is directly read from the corresponding storage unit in the random number storage array according to the random number acquisition instruction.
  • the location of each storage unit in the random number storage array is cyclically scrambled, so that the order of the random numbers stored in the storage unit can be completely random, thereby solving the large probability of the random function in the prior art. There is a problem that the repetition causes the distribution to be unbalanced.
  • the random numbers stored in the N storage units may be randomly exchanged in a plurality of manners, so that the order of the random numbers is completely random, and thus is not limited to the embodiment of the present application.
  • the identifier value of the storage unit that has been read (ie, the identifier value of the storage unit that was read last time) is obtained according to the random number acquisition instruction, and is read according to the identifier value of the storage unit that has been read currently.
  • a random number stored by a storage unit for example, can be read sequentially.
  • the corresponding random number can also be read from the random number storage array in other manners, and the corresponding random numbers are sequentially read from the random number storage array in sequence without being limited to the embodiment of the present application.
  • First initialize a random number storage array define the storage unit to get the identity value and the random number storage array length. After receiving the random number instruction, determining whether the current storage unit stores the last one of the random number storage array, and determining that the current storage unit is not the last one of the random number storage array, it is necessary to regenerate the random number storage array, and then loop the random number storage array. The storage units in the order are scrambled. Finally, according to the identification value of the storage unit acquired last time, the data stored in the next storage unit in the random number storage array is selected as the current random number to be acquired.
  • the method for generating the random number of the present application is not limited to being implemented based on the JAVA language, and may be implemented using other computer languages.
  • the method for generating a random number in the embodiment of the present application first generates a random number storage array including N storage units and each storage unit stores a random number, and then randomly mixes the storage units in the random number storage array, thereby Upon receiving the random number acquisition instruction, the random number stored in the storage unit is read from the corresponding storage unit in the random number storage array. Since the storage unit is randomly mixed in the random number storage array, the random number of the random number acquired in a short unit time is low, and the distribution is balanced. Therefore, the random number generation method of the present application has a comparative method. Good randomness.
  • each storage unit has an identification value.
  • the identifier value is an identifier used to distinguish the storage unit.
  • the identifier value of the storage unit may be equal to the random number stored in the storage unit in the initial state (ie, before random shuffling).
  • the random value generated in the step S310 is not the same as the concept of the random number stored in the storage unit, and the random value generated in the step is used to determine the identifier value of the storage unit to be swapped.
  • the i-th random value is generated according to the current time and the i-1th random value; and when i is equal to 1, the i-th random value is generated according to the current time, where i is the number of exchanges. That is to say, when the random value is generated for the first time, a random value is generated according to the current time, and when the random value is not generated for the first time, the i-th random value is generated according to the current time and the i-1th random value.
  • each storage unit after generating the random number storage array, each storage unit has an identification value, generates a random value according to the random function, and generates an identification value of the storage unit to be exchanged according to the random value, thereby determining the storage unit that needs to be exchanged.
  • the storage unit corresponding to the i-th random value is exchanged with the random number in the (N+1-i)th storage unit.
  • each storage unit has an identification value, and the identification value can distinguish different storage units.
  • i 1
  • the first random value is generated according to the current time
  • the identifier value of the storage unit to be exchanged is generated according to the first random value
  • the random number in the N storage unit is exchanged, 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 first random value.
  • the second random value is generated according to the current time and the first random value
  • the identification value of the storage unit to be exchanged is generated according to the second random value
  • the second random value is obtained according to the preset exchange rule.
  • the corresponding storage unit and the random number in the N-1th storage unit are exchanged, that is, the random number in the storage unit corresponding to the second random value is stored in the N-1th storage unit, and the N-1th storage unit is The random number in the storage is stored in the storage unit corresponding to the second random value. This loops until the random numbers stored in the storage locations in all random number storage arrays are swapped.
  • the storage unit of the identification value calculated by the first time is exchanged with the Nth storage unit. In other embodiments of the present application, the switching may also be started from the first storage unit.
  • the method for changing the random number in the storage unit in the embodiment of the present application is only one type of the preset switching rule, that is, the preset switching rule can be set according to actual needs, and the storage method is stored through different switching methods. The random number in the unit is swapped.
  • the identity value of the cell reads the random number stored in the next memory location.
  • the method for generating a random number in the embodiment of the present application first generates a random number storage array including N storage units and each storage unit stores a random number, and then randomly mixes the storage units in the random number storage array, thereby Upon receiving the random number acquisition instruction, the random number stored in the storage unit is read from the corresponding storage unit in the random number storage array. Since the storage unit is randomly mixed in the random number storage array, the random number of the random number acquired in a short unit time is low, and the distribution is balanced. Therefore, the random number generation method of the present application has a comparative method. Good randomness.
  • an embodiment of the present invention further provides a random number generating apparatus, which is provided by the random number generating apparatus provided by the embodiment of the present invention and the random number provided by the foregoing several embodiments.
  • the generation method has the same or similar technical features, and therefore the implementation of the foregoing random number generation method is also applicable to the random number generation apparatus provided in this embodiment, which will not be described in detail in this embodiment.
  • the random number generating device may include: a generating module 110, a random shuffling module 120, and a reading module 130.
  • the generating module 110 is configured to generate a random number storage array, wherein the random number storage array includes N storage units, and each storage unit stores a random number, where N is a positive integer.
  • the random numbers stored in the N storage units are all different.
  • the random shuffling module 120 is configured to randomly mix the storage units in the random number storage array.
  • the reading module 130 is configured to receive the random number obtaining instruction, and read the random number stored by the storage unit from the corresponding storage unit in the random number storage array according to the random number obtaining instruction.
  • FIG. 5 is a schematic structural diagram of a random number generating apparatus according to another embodiment of the present application, that is, as shown in FIG.
  • the 120 specifically includes an identifier value generating submodule 1201 and a swap submodule 1202.
  • the identifier value generating sub-module 1201 is configured to generate a random value according to a random function, and generate an identifier value of the storage unit to be swapped according to the random value.
  • the switching sub-module 1202 is configured to exchange the random number in the storage unit to be replaced with the target storage unit according to the identifier value and the preset switching rule.
  • the identifier value generation sub-module 1201 when i is greater than 1 and less than N, the identifier value generation sub-module 1201 generates an i-th random value according to the current time and the i-1th random value, where i is the number of exchanges. When i is equal to 1, the identification value generation sub-module 1201 generates an i-th random value according to the current time.
  • the preset switching rule is: when the i-th exchange is performed, the storage unit corresponding to the i-th random value is exchanged with the random number in the (N+1-i) storage unit. .
  • determining whether the current storage unit is The machine counts the last one of the arrays. If it is not the last storage unit in the random number storage array, it continues to read the random number stored in the next storage unit. If it is the last storage unit in the random number storage array, you need to regenerate the new random number storage array.
  • FIG. 6 is a schematic structural diagram of a device for generating a random number according to another embodiment of the present application.
  • the reading module 130 specifically includes: acquiring the submodule 1301. And reading sub-module 1302.
  • the obtaining submodule 1301 is configured to acquire an identifier value of a storage unit that has been currently read according to the random number obtaining instruction.
  • the reading sub-module 1302 is configured to read the random number stored in the next storage unit according to the identification value of the storage unit that has been currently read.
  • the generating module first generates a random number storage array including N storage units and each storage unit stores a random number, and then the random shuffling module randomly performs the storage unit in the random number storage array.
  • the shuffling so that the reading module can read the random number stored in the storage unit from the corresponding storage unit in the random number storage array when receiving the random number obtaining instruction. Since the random shuffling module randomly mixes the storage units in the random number storage array, the random number repetition rate obtained in a short unit time is low and the distribution is balanced. Therefore, the random number generating device of the present application has better randomness.
  • FIG. 7 is a flowchart of a method for acquiring a random number according to an embodiment of the present application.
  • the method for obtaining a random number shown in the embodiment of the present application is described from the aspect of acquisition.
  • the method for acquiring the random number includes the following steps.
  • the random numbers stored in the N storage units are all different.
  • the N storage units may respectively store 1 to N integers, so that the random numbers stored in each storage unit are different from others.
  • the length of the random number storage array is configurable, and the length of the random number storage array is set in advance as needed.
  • each storage unit after generating the random number storage array, each storage unit has an identification value, generates a random value according to the random function, and generates an identification value of the storage unit to be exchanged according to the random value, thereby determining the storage unit that needs to be exchanged.
  • the storage unit and the target storage list are to be exchanged according to the identifier value and the preset exchange rule.
  • the random number in the meta is exchanged.
  • the method for changing the random number in the storage unit in the embodiment of the present application is only one type of the preset switching rule, that is, the preset switching rule can be set according to actual needs, and the storage method is stored through different switching methods. The random number in the unit is swapped.
  • the identifier value of the currently read storage unit is acquired according to the random number acquisition instruction (ie, the storage unit that was last read)
  • the identification value reads the random number stored in the next storage unit according to the identification value of the storage unit that has been read.
  • the random number obtaining method of the embodiment of the present application first receives a random number obtaining instruction, and then acquires a random number storage array and determines a position of the N storage units in the random number storage array by random shuffling, thereby acquiring according to the received random number.
  • the instruction reads the random number stored by the storage unit from the corresponding storage unit in the random number storage array. Since the memory cells are randomly mixed in the random number storage array, the random number of the random number acquired in a short unit time is low, and the distribution is balanced. Therefore, the random number acquisition method of the present application has better randomness.
  • an embodiment of the present invention further provides a random number obtaining apparatus, which is provided by the random number obtaining apparatus provided by the embodiment of the present invention and the random number provided by the foregoing several embodiments.
  • the acquisition method has the same or similar technical features. Therefore, the implementation of the foregoing random number acquisition method is also applicable to the random number acquisition apparatus provided in this embodiment, which is not described in detail in this embodiment.
  • the acquisition device of the random number may include: a receiving module 210, a random number storage array obtaining module 220, and a random number obtaining module 230.
  • the receiving module 210 is configured to receive a random number obtaining instruction.
  • the random number storage array obtaining module 220 is configured to obtain a random number storage array, wherein the random number storage array includes N storage units, each storage unit stores a random number, and the location of the N storage units in the random number storage array passes Random mixing is determined, where N is a positive integer.
  • the random numbers stored in the N storage units are all different.
  • the random number obtaining module 230 is configured to obtain, from the corresponding storage unit in the random number storage array, the random number stored by the storage unit according to the random number obtaining instruction.
  • FIG. 9 is a schematic structural diagram of a device for acquiring a random number according to another embodiment of the present application, that is, as shown in FIG. 230 specifically includes a first obtaining submodule 2301 for acquiring an identifier value of a storage unit that has been currently read according to the random number obtaining instruction.
  • First The second obtaining sub-module 2302 is configured to acquire a random number stored by the next storage unit according to the identifier value of the storage unit that has been currently read.
  • the receiving module receives the random number obtaining instruction, and then the random number storage array obtaining module acquires the random number storage array and determines the position of the N storage units in the random number storage array by random shuffling. And the random number obtaining module reads the random number stored by the storage unit from the corresponding storage unit in the random number storage array according to the received random number obtaining instruction. Since the memory cells are randomly mixed in the random number storage array, the random number of the random number acquired in a short unit time is low, and the distribution is balanced. Therefore, the random number acquisition device of the present application has better randomness.
  • first and second are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated.
  • features defining “first” or “second” may include at least one of the features, either explicitly or implicitly.
  • the meaning of "a plurality” is at least two, such as two, three, etc., unless specifically defined otherwise.
  • portions of the application can be implemented in hardware, software, firmware, or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
  • each functional unit in each embodiment of the present application may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules, if implemented in the form of software functional modules and sold or used as stand-alone products, may also be stored in a computer readable storage medium.
  • the above mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like. While the embodiments of the present application have been shown and described above, it is understood that the above-described embodiments are illustrative and are not to be construed as limiting the scope of the present application. The embodiments are subject to variations, modifications, substitutions and variations.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Computational Mathematics (AREA)
  • Software Systems (AREA)
  • Indexing, Searching, Synchronizing, And The Amount Of Synchronization Travel Of Record Carriers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)
  • Read Only Memory (AREA)

Abstract

一种随机数的生成及获取方法和装置,其中,该生成方法包括:生成随机数存储数组,其中,随机数存储数组包括N个存储单元,每个存储单元存储一个随机数,其中,N为正整数(S110);对随机数存储数组中的存储单元进行随机混排(S120);以及接收随机数获取指令,并根据随机数获取指令从随机数存储数组中对应的存储单元中读取存储单元存储的随机数(S130)。通过该方法,在较短的单位时间内多次获取的随机数重复率低,且分布均衡。

Description

随机数的生成及获取方法和装置
本申请要求2016年03月17日递交的申请号为201610152995.2、发明名称为“随机数的生成及获取方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种随机数的生成及获取方法和装置。
背景技术
随着随机数在计算机领域应用越来越广,对产生的随机数有越来越高的要求。目前,常用随机数产生的方法有两种,一种是软件方式,用系统时间作为随机数产生的种子,再根据系统函数产生随机数。另一种是硬件方式,设计产生随机数的硬件设备,根据随机信号产生随机数。
但是,软件使用系统默认的随机数生成方法存在以下缺点:如果在同一时间点(同一秒,或者同一毫秒)下,产生的随机数重复概率很高,从而导致随机数分布不均衡,即产生伪随机数。因为,在计算机应用系统中,使用时间做为随机数产生的种子,在较短时间内,例如在相同毫秒或秒数的时间段内生产的随机数,因时间种子数相等。因此生成的随机数会存在重复率高,且分布不均衡的缺点。
发明内容
本申请的目的旨在至少在一定程度上解决上述的技术问题之一。
为此,本申请的第一个目的在于提出一种随机数的生成方法,该方法通过生成包括N个存储单元存储随机数的随机数存储数组,接着对随机数存储数组中的存储单元进行随机混排,当接收随机数获取指令时,从随机数存储数组中对应的存储单元读取随机数,通过该申请实施例,可以在较短的单位时间内多次获取的随机数重复率低,且分布均衡,因此本申请的随机数生成方法具有较好的随机性。
本申请的第二个目的在于提出了一种随机数的生成装置。
本申请的第三个目的在于提出了一种随机数的获取方法。
本申请的第四个目的在于提出了一种随机数的获取装置。
为达上述目的,根据本申请第一方面实施例提出的一种随机数的生成方法,包括以 下步骤:生成随机数存储数组,其中,所述随机数存储数组包括N个存储单元,每个所述存储单元存储一个随机数,其中,N为正整数;对所述随机数存储数组中的存储单元进行随机混排;以及接收随机数获取指令,并根据所述随机数获取指令从所述随机数存储数组中对应的存储单元中读取所述存储单元存储的随机数。
通过本申请实施例的随机数生成方法,首先生成包括N个存储单元且每个存储单元存储一个随机数的随机数存储数组,接着对随机数存储数组中的存储单元进行随机混排,从而可以在接收到随机数获取指令时,从随机数存储数组中对应的存储单元中读取存储单元存储的随机数。由于在随机数存储数组中对存储单元进行了随机混排,从而实现了在较短的单位时间内多次获取的随机数重复率低,且分布均衡。因此本申请的随机数生成方法具有较好的随机性。
在本申请的一个实施例中,所述N个存储单元中存储的随机数均不相同。
在本申请的一个实施例中,所述的随机数的生成方法,每个所述存储单元具有标识值,其中,所述对所述随机数存储数组中的存储单元进行混排具体包括:根据随机函数生成随机值,并根据所述随机值生成待调换存储单元的标识值;以及根据所述标识值和预设调换规则将所述待调换存储单元与目标存储单元中的随机数进行调换。
在本申请的一个实施例中,所述根据随机函数生成随机值具体包括:当i大于1且小于N时,根据当前时间和第i-1次随机值生成第i次随机值,其中,i为调换次数;当i等于1时,根据当前时间生成所述第i次随机值。
在本申请的一个实施例中,所述预设调换规则为:当进行第i次调换时,将第i次随机值对应的存储单元与第(N+1-i)存储单元中的随机数进行调换。
在本申请的一个实施例中,所述根据所述随机数获取指令从所述随机数存储数组中对应的存储单元中读取所述存储单元存储的随机数具体包括:根据所述随机数获取指令获取当前已被读取的存储单元的标识值;根据所述当前已被读取的存储单元的标识值读取下一个存储单元存储的随机数。
为达上述目的,根据本申请的第二方面实施例提出的一种随机数的生成装置,包括:生成模块,用于生成随机数存储数组,其中,所述随机数存储数组包括N个存储单元,每个所述存储单元存储一个随机数,其中,N为正整数;随机混排模块,用于对所述随机数存储数组中的存储单元进行随机混排;以及读取模块,用于接收随机数获取指令,并根据所述随机数获取指令从所述随机数存储数组中对应的存储单元中读取所述存储单元存储的随机数。
本申请实施例的随机数生成装置,首先生成模块生成包括N个存储单元且每个存储单元存储一个随机数的随机数存储数组,接着随机混排模块对随机数存储数组中的存储单元进行随机混排,从而读取模块可以在在接收到随机数获取指令时,从随机数存储数组中对应的存储单元中读取存储单元存储的随机数。由于随机混排模块对随机数存储数组中的存储单元进行了随机混排,从而实现了在较短的单位时间内多次获取的随机数重复率低,且分布均衡。因此本申请的随机数生成装置具有较好的随机性。
在本申请的一个实施例中,所述N个存储单元中存储的随机数均不相同。
在本申请的一个实施例中,所述的随机数的生成装置,每个所述存储单元具有标识值,其中,所述随机混排模块包括:标识值生成子模块,用于根据随机函数生成随机值,并根据所述随机值生成待调换存储单元的标识值;以及调换子模块,用于根据所述标识值和预设调换规则将所述待调换存储单元与目标存储单元中的随机数进行调换。
在本申请的一个实施例中,所述的随机数的生成装置,当i大于1且小于N时,所述标识值生成子模块根据当前时间和第i-1次随机值生成第i次随机值,其中,i为调换次数;当i等于1时,所述标识值生成子模块根据当前时间生成所述第i次随机值。
在本申请的一个实施例中,所述预设调换规则为:当进行第i次调换时,将第i次随机值对应的存储单元与第(N+1-i)存储单元中的随机数进行调换。
在本申请的一个实施例中,所述读取模块具体包括:获取子模块,用于根据所述随机数获取指令获取当前已被读取的存储单元的标识值;读取子模块,用于根据所述当前已被读取的存储单元的标识值读取下一个存储单元存储的随机数。
为达上述目的,根据本申请的第三方面实施例提出的一种随机数的获取方法,包括以下步骤:接收随机数获取指令,并获取随机数存储数组,其中,所述随机数存储数组包括N个存储单元,每个所述存储单元存储一个随机数,且所述随机数存储数组中的N个存储单元的位置通过随机混排确定,其中,N为正整数;根据所述随机数获取指令从所述随机数存储数组中对应的存储单元中获取所述存储单元存储的随机数。
通过本申请实施例的随机数获取方法,首先接收到随机数获取指令,接着获取随机数存储数组并通过随机混排确定随机数存储数组中的N个存储单元的位置,从而根据接收到随机数获取指令从随机数存储数组中对应的存储单元中读取存储单元存储的随机数。由于在随机数存储数组中对存储单元进行了随机混排,从而实现了在较短的单位时间内多次获取的随机数重复率低,且分布均衡。因此本申请的随机数获取方法具有较好的随机性。
在本申请的一个实施例中,所述N个存储单元中存储的随机数均不相同。
在本申请的一个实施例中,所述的随机数的获取方法,每个所述存储单元具有标识值,其中,通过以下步骤对所述随机数存储数组中的N个存储单元的位置通过随机混排:根据随机函数生成随机值,并根据所述随机值生成待调换存储单元的标识值;以及根据所述标识值和预设调换规则将所述待调换存储单元与目标存储单元中的随机数进行调换。
在本申请的一个实施例中,所述根据所述随机数获取指令从所述随机数存储数组中对应的存储单元中获取所述存储单元存储的随机数具体包括:根据所述随机数获取指令获取当前已被读取的存储单元的标识值;根据所述当前已被读取的存储单元的标识值获取下一个存储单元存储的随机数。
为达上述目的,根据本申请的第四方面实施例提出的一种随机数的获取装置,包括:接收模块,用于接收随机数获取指令;随机数存储数组获取模块,用于获取随机数存储数组,其中,所述随机数存储数组包括N个存储单元,每个所述存储单元存储一个随机数,且所述随机数存储数组中的N个存储单元的位置通过随机混排确定,其中,N为正整数;随机数获取模块,用于根据所述随机数获取指令从所述随机数存储数组中对应的存储单元中获取所述存储单元存储的随机数。
通过本申请实施例的随机数获取装置,首先接收模块接收到随机数获取指令,接着随机数存储数组获取模块获取随机数存储数组并通过随机混排确定随机数存储数组中的N个存储单元的位置,从而随机数获取模块根据接收到随机数获取指令从随机数存储数组中对应的存储单元中读取存储单元存储的随机数。由于在随机数存储数组中对存储单元进行了随机混排,从而实现了在较短的单位时间内多次获取的随机数重复率低,且分布均衡。因此本申请的随机数获取装置具有较好的随机性。
在本申请的一个实施例中,所述N个存储单元中存储的随机数均不相同。
在本申请的一个实施例中,所述随机数获取模块具体包括:第一获取子模块,用于根据所述随机数获取指令获取当前已被读取的存储单元的标识值;第二获取子模块,用于根据所述当前已被读取的存储单元的标识值获取下一个存储单元存储的随机数。
本申请附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本申请的实践了解到。
附图说明
本申请的上述和/或附加的方面和优点从结合下面附图对实施例的描述中将变得明显和容易理解,其中:
图1是根据本申请一个实施例的随机数的生成方法的流程图;
图2是根据本申请一个实施例的获取随机数的流程图;
图3是根据本申请一个实施例对随机数存储数组中的存储单元进行随机混排的方法流程图;
图4是本申请一个实施例的随机数的生成装置的结构示意图;
图5是根据本申请另一个实施例的随机数的生成装置的结构示意图;以及
图6是根据本申请又一个实施例的随机数的生成装置的结构示意图;
图7是根据本申请一个实施例的随机数的获取方法的流程图;
图8根据本申请一个实施例的随机数的获取装置的结构示意图;
图9是根据本申请另一个实施例的随机数的获取装置的结构示意图。
具体实施方式
下面详细描述本申请的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本申请,而不能理解为对本申请的限制。
本申请通过随机混排的方式对随机数存储数组里的存储单元进行随机混排,使得随机数存储数组中的随机数顺序完全随机,从而解决了传统随机函数较大概率出现重复导致分布不平衡的问题。在需要获取随机数时,可以从该随机数存储数组中获取对应的随机数。
图1是根据本申请一个实施例的随机数的生成方法的流程图。
如图1所示,本申请实施例的随机数的生成方法包括以下步骤:
S110,生成随机数存储数组,其中,随机数存储数组包括N个存储单元,每个存储单元存储一个随机数,其中,N为正整数。
在本申请的实施例中,N个存储单元中存储的随机数均不相同。
可以理解的是,在本申请的实施例中,生成的随机数存储数组中对应的存储单元存储的随机数是不重复的,例如,一个存储单元存储的一个随机数是2,那么其它存储单元存储的随机数都不是2。
在本申请的实施例中,N个存储单元可以分别存储1至N个整数,从而每个存储单 元存储的随机数与其他的均不同。
在本申请的另一个实施例中,随机数存储数组的长度是可以配置的,根据需要对随机数存储数组的长度提前进行设置。
S120,对随机数存储数组中的存储单元进行随机混排。
需要说明的是,本申请实施例所述的随机混排是指对随机数存储数组中N个存储单元存储的随机数进行随机调换,从而使得存储单元中存储的随机数的顺序完全随机,从而解决现有技术中随机函数较大概率出现重复导致分布不平衡的问题。在本申请的实施例中,可以采用多种方式对N个存储单元存储的随机数进行随机调换,在后续的实施例中将对这些方式进行详细介绍。对于本领域技术人员而言,可采用多种方式对随机数存储数组中存储的随机数进行随机混排,从而达到随机数的顺序完全随机的目的,因此并不限于本申请以下实施例所提到的随机调换的算法,任何能够达到上述目的的算法均应包含在本申请的保护范围之内。
S130,接收随机数获取指令,并根据随机数获取指令从随机数存储数组中对应的存储单元中读取存储单元存储的随机数。
具体而言,在本申请的实施例中,接收随机数获取指令之后,可以顺序地从随机数存储数组中依次读取对应的随机数,也可以随机地从随机数存储数组中依次读取对应的随机数。当然在本申请的实施例中,还可以采用其他的方式从随机数存储数组中读取对应的随机数。
具体地,在本申请的一个具体实施例中,在接收到随机数获取指令之后,根据随机数获取指令获取当前已被读取的存储单元的标识值(即上一次被读取的存储单元的标识值),根据当前已被读取的存储单元的标识值读取下一个存储单元存储的随机数。
需要说明的是,在每一次接收到随机数获取指令之后,进一步判断已被读取的存储单元是否为随机数存储数组中的最后一个存储单元。如果不是随机数存储数组中的最后一个存储单元,则继续读取下一个存储单元存储的随机数。如果是随机数存储数组中的最后一个存储单元,则需要重新生成新的随机数存储数组,即执行步骤S110。
本申请实施例的随机数的生成方法,首先生成包括N个存储单元且每个存储单元存储一个随机数的随机数存储数组,接着对随机数存储数组中的存储单元进行随机混排,从而可以在接收到随机数获取指令时,从随机数存储数组中对应的存储单元中读取存储单元存储的随机数。由于在随机数存储数组中对存储单元进行了随机混排,从而实现了在较短的单位时间内多次获取的随机数重复率低,且分布均衡,因此本申请的随机数生 成方法具有较好的随机性。
为了使得本领域的技术人员能够更加清楚地了解本申请的获取随机数流程,下面结合图2具体说明。如图2所示:
S210,接收随机数获取指令。
S220,判断当前已被读取的存储单元是否为随机数存储数组的最后一个。
具体而言,在每一次接收到随机数获取指令之后,进一步判断当前已被读取的存储单元是否为随机数存储数组中的最后一个存储单元。如果不是随机数存储数组中的最后一个存储单元,则继续读取下一个存储单元存储的随机数。
S230,如果判断当前已被读取的存储单元是随机数存储数组的最后一个,初始化随机数存储数组,需要重新生成新的随机数存储数组。
具体而言,确定当前已被读取的存储单元是随机数存储数组的最后一个,即随机数存储数组中的所有存储单元存储的随机数都已经被读取过,则需要对随机数存储数组进行初始化,从而重新生成新的随机数存储数组。
在本申请的实施例中,如果确定当前的存储单元不是随机数存储数组的最后一个,则直接根据随机数获取指令从随机数存储数组中对应的存储单元中读取存储单元存储的随机数。
S240,对随机数存储数组中的存储单元进行随机混排,即循环打乱随机数存储数组中的每个存储单元的位置。
在本申请的实施例中,循环打乱随机数存储数组中的每个存储单元的位置,从而可以使得存储单元中存储的随机数的顺序完全随机,进而解决现有技术中随机函数较大概率出现重复导致分布不平衡的问题。在本申请的实施例中,可以采用多种方式对N个存储单元存储的随机数进行随机调换,从而达到随机数的顺序完全随机的目的,因此并不限于本申请实施例。
S250,根据上次获取的存储单元的标识值,选择随机数存储数组中下一个存储单元存储的数据作为当前要获取随机数。
具体地,根据随机数获取指令获取当前已被读取的存储单元的标识值(即上一次被读取的存储单元的标识值),根据当前已被读取的存储单元的标识值读取下一个存储单元存储的随机数,例如可以顺序地读取。
需要说明的是,还可以采用其他的方式从随机数存储数组中读取对应的随机数,不限于本申请实施例的顺序地从随机数存储数组中依次读取对应的随机数。
为了使得本申请中对随机数的生成方法的描述更加的具体化,可以结合JAVA语言的程序秒数进行说明,具体如下:
首先初始化一个随机数存储数组,定义存储单元获取标识值和随机数存储数组长度。接收随机数指令后,判断当前的存储单元是否随机数存储数组的最后一个,判断当前的存储单元不是随机数存储数组的最后一个时,需要重新生成随机数存储数组,进而循环将随机数存储数组中的存储单元顺序打乱,最后根据上次获取的存储单元的标识值,选择随机数存储数组中下一个存储单元存储的数据作为当前要获取随机数。
需要说明的是,本申请的随机数的生成方法不限于基于JAVA语言实现,可以使用其他计算机语言实现。
本申请实施例的随机数的生成方法,首先生成包括N个存储单元且每个存储单元存储一个随机数的随机数存储数组,接着对随机数存储数组中的存储单元进行随机混排,从而可以在接收到随机数获取指令时,从随机数存储数组中对应的存储单元中读取存储单元存储的随机数。由于在随机数存储数组中对存储单元进行了随机混排,从而实现了在较短的单位时间内多次获取的随机数重复率低,且分布均衡,因此本申请的随机数生成方法具有较好的随机性。
为了使得本领域的技术人员能够更加清楚地了解本申请中对随机数存储数组中的存储单元进行随机混排的方法,下面结合图3进行具体说明。如图3所示:
S310,根据当前时间和随机函数生成随机值,其中,每个存储单元具有标识值。该标识值是用于区分存储单元的标识,在本申请的实施例中,在初始状态(即随机混排之前)存储单元的标识值可以与存储单元中存储的随机数可以相等。
需要说明的是,在该步骤S310中生成的随机值与存储单元中存储的随机数的概念并不相同,该步骤生成的随机值用于确定待调换存储单元的标识值。
具体而言,当i大于1且小于N时,根据当前时间和第i-1次随机值生成第i次随机值;而当i等于1时,根据当前时间生成第i次随机值,其中,i为调换次数。也就是说,当第一次生成随机值时,根据当前时间生成随机值,当不是第一次生成随机值时,根据当前时间和第i-1次随机值生成第i次随机值。
在本申请的实施例中,生成随机数存储数组后,每个存储单元具有标识值,根据随机函数生成随机值,并根据随机值生成待调换存储单元的标识值,从而确定需要调换的存储单元。
S320,根据标识值和预设调换规则将待调换存储单元与目标存储单元中的随机数进 行调换。
当进行第i次调换时,将第i次随机值对应的存储单元与第(N+1-i)存储单元中的随机数进行调换。
举例而言,生成随机数存储数组后,每个存储单元具有标识值,标识值能够区别不同的存储单元。当i为1时,根据当前时间生成第1次随机值,并根据第1次随机值生成待调换存储单元的标识值,根据预设调换规则,把第1次随机值对应的存储单元和第N存储单元中的随机数进行调换,即将第1次随机值对应的存储单元中的随机数存储于第N存储单元中,并将第N存储单元中的随机数存储于第1次随机值对应的存储单元中。当i为2时,根据当前时间和第1次随机值生成第2次随机值,并根据第2次随机值生成待调换存储单元的标识值,根据预设调换规则,把第2次随机值对应的存储单元和第N-1存储单元中的随机数进行调换,即将第2次随机值对应的存储单元中的随机数存储于第N-1存储单元中,并将第N-1存储单元中的随机数存储于第2次随机值对应的存储单元中。以此循环,直到所有随机数存储数组中的存储单元存储的随机数完成调换。在上述实施例中,将第1次调换计算的标识值的存储单元与第N存储单元先进行调换。在本申请的其他实施例中,也可以从第一存储单元先开始进行调换。
举例而言,初始化一个随机数存储数组randArry[]。对随机数存储数组中的每个存储单元用自然数赋值。例如,randArry[0]=1,randArry[1]=2…randArry[n-1]=n。循环打乱随机数存储数组中的每个存储单元的位置。例如,可以采用每次随机数存储数组中的每个存储单元存储的值与倒数第i个存储单元存储的值交换,i从n-1递减,例如randArry[1]=2与randArry[n-1]=n替换。
需要说明的是,本申请实施例的将存储单元中的随机数进行调换的方法只是预设调换规则的一种,即可以根据实际需要对预设调换规则进行设置,通过不同的调换方法对存储单元中的随机数进行调换。
S330,判断随机数存储数组中的存储单元是否全部被调换过。
S340,如果随机数存储数组中的存储单元全部被调换过,则确定存储单元中存储的随机数的顺序完全随机,因此,该随机数存储数组可供使用。
具体而言,确定随机数存储数组中N个存储单元中存储的随机数已经全部进行调换,根据随机数获取指令获取当前已被读取的存储单元的标识值;根据当前已被读取的存储单元的标识值读取下一个存储单元存储的随机数。
需要说明的是,可以采用其他的方式从随机数存储数组中读取对应的随机数,不限 于本申请实施例的顺序地从随机数存储数组中依次读取对应的随机数。
本申请实施例的随机数的生成方法,首先生成包括N个存储单元且每个存储单元存储一个随机数的随机数存储数组,接着对随机数存储数组中的存储单元进行随机混排,从而可以在接收到随机数获取指令时,从随机数存储数组中对应的存储单元中读取存储单元存储的随机数。由于在随机数存储数组中对存储单元进行了随机混排,从而实现了在较短的单位时间内多次获取的随机数重复率低,且分布均衡,因此本申请的随机数生成方法具有较好的随机性。
与上述实施例提供的随机数生成方法相对应,本发明的一种实施例还提供一种随机数生成装置,由于本发明实施例提供的随机数生成装置与上述几种实施例提供的随机数生成方法具有相同或相似的技术特征,因此在前述随机数生成方法的实施方式也适用于本实施例提供的随机数生成装置,在本实施例中不再详细描述。如图4所示,该随机数的生成装置可包括:生成模块110、随机混排模块120、读取模块130。
其中,生成模块110用于生成随机数存储数组,其中,随机数存储数组包括N个存储单元,每个存储单元存储一个随机数,其中,N为正整数。
在本申请的一个实施例中,N个存储单元中存储的随机数均不相同。
随机混排模块120用于对随机数存储数组中的存储单元进行随机混排。
读取模块130用于接收随机数获取指令,并根据随机数获取指令从随机数存储数组中对应的存储单元中读取存储单元存储的随机数。
在本申请的一个实施例中,图5是根据本申请另一个实施例的随机数的生成装置的结构示意图,即在如图4所示的基础上,如图5所示,随机混排模块120具体包括标识值生成子模块1201和调换子模块1202。具体地,在本申请的一个实施例中,标识值生成子模块1201用于根据随机函数生成随机值,并根据随机值生成待调换存储单元的标识值。调换子模块1202用于根据标识值和预设调换规则将待调换存储单元与目标存储单元中的随机数进行调换。
在本申请的一个实施例中,当i大于1且小于N时,标识值生成子模块1201根据当前时间和第i-1次随机值生成第i次随机值,其中,i为调换次数。当i等于1时,标识值生成子模块1201根据当前时间生成第i次随机值。
在本申请的一个实施例中,预设调换规则为:当进行第i次调换时,将第i次随机值对应的存储单元与第(N+1-i)存储单元中的随机数进行调换。
在本申请的一个实施例中,接收随机数获取指令后,判断当前的存储单元是否为随 机数存储数组的最后一个,如果不是随机数存储数组中的最后一个存储单元,则继续读取下一个存储单元存储的随机数。如果是随机数存储数组中的最后一个存储单元,则需要重新生成新的随机数存储数组。
在本申请的一个实施例中,图6是根据本申请又一个实施例的随机数的生成装置的结构示意图,在如图4所示的基础上,读取模块130具体包括:获取子模块1301和读取子模块1302。
具体地,获取子模块1301用于根据随机数获取指令获取当前已被读取的存储单元的标识值。读取子模块1302用于根据当前已被读取的存储单元的标识值读取下一个存储单元存储的随机数。
本申请实施例的随机数生成装置,首先生成模块生成包括N个存储单元且每个存储单元存储一个随机数的随机数存储数组,接着随机混排模块对随机数存储数组中的存储单元进行随机混排,从而读取模块可以在在接收到随机数获取指令时,从随机数存储数组中对应的存储单元中读取存储单元存储的随机数。由于随机混排模块对随机数存储数组中的存储单元进行了随机混排,从而实现了在较短的单位时间内多次获取的随机数重复率低,且分布均衡。因此本申请的随机数生成装置具有较好的随机性。
图7是根据本申请一个实施例的随机数的获取方法的流程图,本申请实施例示出的随机数的获取方法从获取方面进行描述。如图7所示,该随机数的获取方法包括以下步骤。
S710,接收随机数获取指令,并获取随机数存储数组,其中,随机数存储数组包括N个存储单元,每个存储单元存储一个随机数,且随机数存储数组中的N个存储单元的位置通过随机混排确定,其中,N为正整数。
在本申请的实施例中,N个存储单元中存储的随机数均不相同。
在本申请的实施例中,N个存储单元可以分别存储1至N个整数,从而每个存储单元存储的随机数与其他的均不同。
在本申请的另一个实施例中,随机数存储数组的长度是可以配置的,根据需要对随机数存储数组的长度提前进行设置。
在本申请的实施例中,生成随机数存储数组后,每个存储单元具有标识值,根据随机函数生成随机值,并根据随机值生成待调换存储单元的标识值,从而确定需要调换的存储单元。
在本申请的实施例中,根据标识值和预设调换规则将待调换存储单元与目标存储单 元中的随机数进行调换。
需要说明的是,本申请实施例的将存储单元中的随机数进行调换的方法只是预设调换规则的一种,即可以根据实际需要对预设调换规则进行设置,通过不同的调换方法对存储单元中的随机数进行调换。
S720,根据随机数获取指令从随机数存储数组中对应的存储单元中获取存储单元存储的随机数。
具体地,在本申请的一个具体实施例中,在接收到随机数获取指令之后,根据随机数获取指令获取当前已被读取的存储单元的标识值(即上一次被读取的存储单元的标识值),根据当前已被读取的存储单元的标识值读取下一个存储单元存储的随机数。
本申请实施例的随机数获取方法,首先接收到随机数获取指令,接着获取随机数存储数组并通过随机混排确定随机数存储数组中的N个存储单元的位置,从而根据接收到随机数获取指令从随机数存储数组中对应的存储单元中读取存储单元存储的随机数。由于在随机数存储数组中对存储单元进行了随机混排,从而实现了在较短的单位时间内多次获取的随机数重复率低,且分布均衡。因此本申请的随机数获取方法具有较好的随机性。
与上述实施例提供的随机数获取方法相对应,本发明的一种实施例还提供一种随机数获取装置,由于本发明实施例提供的随机数获取装置与上述几种实施例提供的随机数获取方法具有相同或相似的技术特征,因此在前述随机数获取方法的实施方式也适用于本实施例提供的随机数获取装置,在本实施例中不再详细描述。如图8所示,该随机数的获取装置可包括:接收模块210、随机数存储数组获取模块220、随机数获取模块230。
其中,接收模块210用于接收随机数获取指令。
随机数存储数组获取模块220用于获取随机数存储数组,其中,随机数存储数组包括N个存储单元,每个存储单元存储一个随机数,且随机数存储数组中的N个存储单元的位置通过随机混排确定,其中,N为正整数。
在本申请的一个实施例中,N个存储单元中存储的随机数均不相同。
随机数获取模块230用于根据随机数获取指令从随机数存储数组中对应的存储单元中获取存储单元存储的随机数。
在本申请的一个实施例中,图9是根据本申请另一个实施例的随机数的获取装置的结构示意图,即在如图8所示的基础上,如图9所示,随机数获取模块230具体包括第一获取子模块2301用于根据随机数获取指令获取当前已被读取的存储单元的标识值。第 二获取子模块2302用于根据当前已被读取的存储单元的标识值获取下一个存储单元存储的随机数。
本申请实施例的随机数获取装置,首先接收模块接收到随机数获取指令,接着随机数存储数组获取模块获取随机数存储数组并通过随机混排确定随机数存储数组中的N个存储单元的位置,从而随机数获取模块根据接收到随机数获取指令从随机数存储数组中对应的存储单元中读取存储单元存储的随机数。由于在随机数存储数组中对存储单元进行了随机混排,从而实现了在较短的单位时间内多次获取的随机数重复率低,且分布均衡。因此本申请的随机数获取装置具有较好的随机性。
在本申请的描述中,需要理解的是,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。在本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本申请的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本申请的实施例所属技术领域的技术人员所理解。
应当理解,本申请的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。
本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。
此外,在本申请各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。
上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本申请的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本申请的限制,本领域的普通技术人员在本申请的范围内可以对上述实施例进行变化、修改、替换和变型。

Claims (19)

  1. 一种随机数的生成方法,其特征在于,包括以下步骤:
    生成随机数存储数组,其中,所述随机数存储数组包括N个存储单元,每个所述存储单元存储一个随机数,其中,N为正整数;
    对所述随机数存储数组中的存储单元进行随机混排;以及
    接收随机数获取指令,并根据所述随机数获取指令从所述随机数存储数组中对应的存储单元中读取所述存储单元存储的随机数。
  2. 如权利要求1所述的随机数的生成方法,其特征在于,所述N个存储单元中存储的随机数均不相同。
  3. 如权利要求1所述的随机数的生成方法,其特征在于,每个所述存储单元具有标识值,其中,所述对所述随机数存储数组中的存储单元进行随机混排具体包括:
    根据随机函数生成随机值,并根据所述随机值生成待调换存储单元的标识值;以及
    根据所述标识值和预设调换规则将所述待调换存储单元与目标存储单元中的随机数进行调换。
  4. 如权利要求3所述的随机数的生成方法,其特征在于,所述根据随机函数生成随机值具体包括:
    当i大于1且小于N时,根据当前时间和第i-1次随机值生成第i次随机值,其中,i为调换次数;
    当i等于1时,根据当前时间生成所述第i次随机值。
  5. 如权利要求3所述的随机数的生成方法,其特征在于,所述预设调换规则为:
    当进行第i次调换时,将第i次随机值对应的存储单元与第(N+1-i)存储单元中的随机数进行调换。
  6. 如权利要求1所述的随机数的生成方法,其特征在于,所述根据所述随机数获取指令从所述随机数存储数组中对应的存储单元中读取所述存储单元存储的随机数具体包括:
    根据所述随机数获取指令获取当前已被读取的存储单元的标识值;
    根据所述当前已被读取的存储单元的标识值读取下一个存储单元存储的随机数。
  7. 一种随机数的生成装置,其特征在于,包括:
    生成模块,用于生成随机数存储数组,其中,所述随机数存储数组包括N个存储单元,每个所述存储单元存储一个随机数,其中,N为正整数;
    随机混排模块,用于对所述随机数存储数组中的存储单元进行随机混排;以及
    读取模块,用于接收随机数获取指令,并根据所述随机数获取指令从所述随机数存储数组中对应的存储单元中读取所述存储单元存储的随机数。
  8. 如权利要求7所述的随机数的生成装置,其特征在于,所述N个存储单元中存储的随机数均不相同。
  9. 如权利要求7所述的随机数的生成装置,其特征在于,每个所述存储单元具有标识值,其中,所述随机混排模块包括:
    标识值生成子模块,用于根据随机函数生成随机值,并根据所述随机值生成待调换存储单元的标识值;以及
    调换子模块,用于根据所述标识值和预设调换规则将所述待调换存储单元与目标存储单元中的随机数进行调换。
  10. 如权利要求9所述的随机数的生成装置,其特征在于,
    当i大于1且小于N时,所述标识值生成子模块根据当前时间和第i-1次随机值生成第i次随机值,其中,i为调换次数;
    当i等于1时,所述标识值生成子模块根据当前时间生成所述第i次随机值。
  11. 如权利要求9所述的随机数的生成装置,其特征在于,所述预设调换规则为:
    当进行第i次调换时,将第i次随机值对应的存储单元与第(N+1-i)存储单元中的随机数进行调换。
  12. 如权利要求7所述的随机数的生成装置,其特征在于,所述读取模块具体包括:
    获取子模块,用于根据所述随机数获取指令获取当前已被读取的存储单元的标识值;
    读取子模块,用于根据所述当前已被读取的存储单元的标识值读取下一个存储单元存储的随机数。
  13. 一种随机数的获取方法,其特征在于,包括以下步骤:
    接收随机数获取指令,并获取随机数存储数组,其中,所述随机数存储数组包括N个存储单元,每个所述存储单元存储一个随机数,且所述随机数存储数组中的N个存储单元的位置通过随机混排确定,其中,N为正整数;
    根据所述随机数获取指令从所述随机数存储数组中对应的存储单元中获取所述存储单元存储的随机数。
  14. 如权利要求13所述的随机数的获取方法,其特征在于,所述N个存储单元中存储的随机数均不相同。
  15. 如权利要求13所述的随机数的获取方法,其特征在于,每个所述存储单元具 有标识值,其中,通过以下步骤对所述随机数存储数组中的N个存储单元的位置通过随机混排:
    根据随机函数生成随机值,并根据所述随机值生成待调换存储单元的标识值;以及
    根据所述标识值和预设调换规则将所述待调换存储单元与目标存储单元中的随机数进行调换。
  16. 如权利要求13所述的随机数的获取方法,其特征在于,所述根据所述随机数获取指令从所述随机数存储数组中对应的存储单元中获取所述存储单元存储的随机数具体包括:
    根据所述随机数获取指令获取当前已被读取的存储单元的标识值;
    根据所述当前已被读取的存储单元的标识值获取下一个存储单元存储的随机数。
  17. 一种随机数的获取装置,其特征在于,包括:
    接收模块,用于接收随机数获取指令;
    随机数存储数组获取模块,用于获取随机数存储数组,其中,所述随机数存储数组包括N个存储单元,每个所述存储单元存储一个随机数,且所述随机数存储数组中的N个存储单元的位置通过随机混排确定,其中,N为正整数;
    随机数获取模块,用于根据所述随机数获取指令从所述随机数存储数组中对应的存储单元中获取所述存储单元存储的随机数。
  18. 如权利要求17所述的随机数的获取装置,其特征在于,所述N个存储单元中存储的随机数均不相同。
  19. 如权利要求17所述的随机数的获取装置,其特征在于,所述随机数获取模块具体包括:
    第一获取子模块,用于根据所述随机数获取指令获取当前已被读取的存储单元的标识值;
    第二获取子模块,用于根据所述当前已被读取的存储单元的标识值获取下一个存储单元存储的随机数。
PCT/CN2017/075828 2016-03-17 2017-03-07 随机数的生成及获取方法和装置 WO2017157197A1 (zh)

Priority Applications (8)

Application Number Priority Date Filing Date Title
PL17765739T PL3432137T3 (pl) 2016-03-17 2017-03-07 Sposób i urządzenie do generowania i pozyskiwania liczb losowych
EP17765739.2A EP3432137B1 (en) 2016-03-17 2017-03-07 Random number generation and acquisition method and device
ES17765739T ES2847287T3 (es) 2016-03-17 2017-03-07 Método y dispositivo de generación y adquisición de números aleatorios
EP20189059.7A EP3751410B1 (en) 2016-03-17 2017-03-07 Random number generation and acquisition method and device
JP2018549163A JP6793747B2 (ja) 2016-03-17 2017-03-07 乱数生成及び取得の方法及びデバイス
US16/131,352 US10691415B2 (en) 2016-03-17 2018-09-14 Random number generation and acquisition method and device
US16/906,840 US10929103B2 (en) 2016-03-17 2020-06-19 Random number generation and acquisition method and device
US17/181,978 US11182129B2 (en) 2016-03-17 2021-02-22 Random number generation and acquisition method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610152995.2A CN107203365B (zh) 2016-03-17 2016-03-17 随机数的生成及获取方法和装置
CN201610152995.2 2016-03-17

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/131,352 Continuation US10691415B2 (en) 2016-03-17 2018-09-14 Random number generation and acquisition method and device

Publications (1)

Publication Number Publication Date
WO2017157197A1 true WO2017157197A1 (zh) 2017-09-21

Family

ID=59850088

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/075828 WO2017157197A1 (zh) 2016-03-17 2017-03-07 随机数的生成及获取方法和装置

Country Status (8)

Country Link
US (3) US10691415B2 (zh)
EP (2) EP3432137B1 (zh)
JP (1) JP6793747B2 (zh)
CN (1) CN107203365B (zh)
ES (1) ES2847287T3 (zh)
PL (1) PL3432137T3 (zh)
TW (1) TWI671645B (zh)
WO (1) WO2017157197A1 (zh)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203365B (zh) 2016-03-17 2020-09-08 阿里巴巴集团控股有限公司 随机数的生成及获取方法和装置
CN110390855A (zh) * 2018-04-16 2019-10-29 王金环 一种基于双重随机算法的课堂提问与计分系统
CN110647287A (zh) * 2018-06-26 2020-01-03 北京兆易创新科技股份有限公司 存储器的数据存储方法、装置、电子设备和存储介质
CN110069242A (zh) * 2019-04-26 2019-07-30 迅付信息科技有限公司 一种随机数发生器及电子券、动态支付码的生成方法
CN110505523B (zh) * 2019-09-24 2020-06-30 广州优视云集科技有限公司 一种视频转码优先级顺序控制方法及处理终端
CN113138751B (zh) * 2020-01-17 2023-06-09 北京新能源汽车股份有限公司 一种随机数的处理方法、装置及汽车
JP7446923B2 (ja) * 2020-06-02 2024-03-11 キオクシア株式会社 半導体装置及び半導体記憶装置
CN111966844B (zh) * 2020-08-17 2023-09-26 北京像素软件科技股份有限公司 一种对象的加载方法、装置及存储介质
CN113157249B (zh) * 2021-04-22 2023-09-08 北京奇艺世纪科技有限公司 标识号生成方法、装置、电子设备及存储介质
CN113485676A (zh) * 2021-07-08 2021-10-08 上海通联金融服务有限公司 随机生成信用卡号的方法及系统
US20230205531A1 (en) * 2021-12-23 2023-06-29 Intel Corporation Random data usage
CN117827148A (zh) * 2023-12-30 2024-04-05 北京海泰方圆科技股份有限公司 一种随机数生成方法、装置及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006155168A (ja) * 2004-11-29 2006-06-15 Hitachi Ltd 乱数生成方法及びシステム
CN101105742A (zh) * 2006-07-10 2008-01-16 致伸科技股份有限公司 随机数产生器及随机数产生方法
CN101636714A (zh) * 2007-11-20 2010-01-27 董际国 随机数产生装置和方法
CN102541508A (zh) * 2010-12-29 2012-07-04 鸿富锦精密工业(深圳)有限公司 真随机数产生系统及方法
CN103034471A (zh) * 2012-12-10 2013-04-10 杜海洋 一种随机数的生成方法及系统
CN103645882A (zh) * 2013-12-09 2014-03-19 中颖电子股份有限公司 基于单片机的批量乱序随机数的生成方法

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1153173A (ja) 1997-08-07 1999-02-26 Nec Corp 擬似乱数発生方法及び装置
US6760739B2 (en) * 2001-03-01 2004-07-06 Corrent Corporation Pipelined digital randomizer based on permutation and substitution using data sampling with variable frequency and non-coherent clock sources
US7197142B2 (en) * 2001-08-24 2007-03-27 Alten Alexander I System and methods for a vernam stream cipher
FR2829643A1 (fr) * 2001-09-12 2003-03-14 Everbee Wireless Ltd Procede pour generer des nombres aleatoires
US7236996B2 (en) * 2003-12-05 2007-06-26 John McCann Methods for generating random numbers
JP2005228169A (ja) 2004-02-16 2005-08-25 Bittech Inc 乱数生成装置
US8510359B2 (en) * 2006-10-31 2013-08-13 Kiyoto Yui Pseudo-random number generation device, pseudo-random number generation program, and medium containing pseudo-random number generation program
US20100005133A1 (en) * 2008-07-04 2010-01-07 Samsung Electronics Co. Ltd. Apparatus and method for generating permutation sequence in a broadband wireless communication system
JP5813380B2 (ja) * 2011-06-03 2015-11-17 株式会社東芝 半導体記憶装置
US8843539B2 (en) * 2012-05-08 2014-09-23 Caringo, Inc. Generation of seed value for pseudo random number generator
CN104506319B (zh) * 2014-12-15 2017-11-28 飞天诚信科技股份有限公司 一种多种子动态令牌的工作方法
CN107203365B (zh) 2016-03-17 2020-09-08 阿里巴巴集团控股有限公司 随机数的生成及获取方法和装置
JP7299740B2 (ja) 2019-04-08 2023-06-28 キヤノン株式会社 シート撮像装置、シート判別装置および画像形成装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006155168A (ja) * 2004-11-29 2006-06-15 Hitachi Ltd 乱数生成方法及びシステム
CN101105742A (zh) * 2006-07-10 2008-01-16 致伸科技股份有限公司 随机数产生器及随机数产生方法
CN101636714A (zh) * 2007-11-20 2010-01-27 董际国 随机数产生装置和方法
CN102541508A (zh) * 2010-12-29 2012-07-04 鸿富锦精密工业(深圳)有限公司 真随机数产生系统及方法
CN103034471A (zh) * 2012-12-10 2013-04-10 杜海洋 一种随机数的生成方法及系统
CN103645882A (zh) * 2013-12-09 2014-03-19 中颖电子股份有限公司 基于单片机的批量乱序随机数的生成方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3432137A4 *

Also Published As

Publication number Publication date
ES2847287T3 (es) 2021-08-02
US10929103B2 (en) 2021-02-23
JP6793747B2 (ja) 2020-12-02
JP2019512805A (ja) 2019-05-16
CN107203365A (zh) 2017-09-26
EP3432137B1 (en) 2020-10-14
PL3432137T3 (pl) 2021-08-02
CN107203365B (zh) 2020-09-08
EP3751410B1 (en) 2022-01-26
EP3751410A1 (en) 2020-12-16
TWI671645B (zh) 2019-09-11
US20190012147A1 (en) 2019-01-10
US20200319854A1 (en) 2020-10-08
US20210216285A1 (en) 2021-07-15
EP3432137A1 (en) 2019-01-23
TW201734836A (zh) 2017-10-01
US11182129B2 (en) 2021-11-23
US10691415B2 (en) 2020-06-23
EP3432137A4 (en) 2019-11-13

Similar Documents

Publication Publication Date Title
WO2017157197A1 (zh) 随机数的生成及获取方法和装置
US8539009B2 (en) Parallel true random number generator architecture
EP1354444B1 (en) Method for tracing traitor receivers in a broadcast encryption system
US9529684B2 (en) Method and system for hardware implementation of uniform random shuffling
US11876899B2 (en) Random number generator and method of generating output random number
JP2018509833A (ja) サイドチャネル解析抵抗アーキテクチャ
US9172537B1 (en) Array encryption core
JP2019512805A5 (zh)
EP3503463A1 (en) Systems and methods implementing countermeasures to phase tracking attacks on ring oscillator based entropy sources
EP3234845A1 (en) Model anti-collusion watermark
FR3078464A1 (fr) Procede et circuit de mise en oeuvre d'une table de substitution
CN109254913A (zh) 设备共享方法、装置、电子设备及计算机存储介质
CN116488794A (zh) 基于fpga的高速sm4密码模组实现方法及装置
CN108872902B (zh) 波形输出方法和装置
US9519807B1 (en) Hash generation circuitry and methods for multi-channel, multi-lane encryption and authentication
CN106034010B (zh) 一种Serdes信号的传输特性参数筛选方法及装置
US20060256962A1 (en) Systems and methods for producing random number distributions in devices having limited processing and storage capabilities
CN111355972A (zh) 视频流处理方法、服务器、客户端及介质
US12056463B2 (en) Optimization apparatus and method of controlling optimization apparatus
US11347706B2 (en) Rotor movement control and rotor wiring for rotor-based encryption machines and electronic equivalents
US9519597B2 (en) Communication apparatus and method based on shared memory
JP2014222394A (ja) 半導体記憶装置および乱数発生器
CN103023594A (zh) 获取扰码比特流的方法、同步比特扰码器及通信设备
CN115296843B (zh) 区块链系统中的交易执行方法、第一节点和第二节点
WO2018120537A1 (zh) 一种队列轮询选择方法及装置、计算机存储介质

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2018549163

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2017765739

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2017765739

Country of ref document: EP

Effective date: 20181017

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17765739

Country of ref document: EP

Kind code of ref document: A1