CN103645882A - Batch out-of-order random number generation method based on single-chip microcomputer - Google Patents

Batch out-of-order random number generation method based on single-chip microcomputer Download PDF

Info

Publication number
CN103645882A
CN103645882A CN201310659515.8A CN201310659515A CN103645882A CN 103645882 A CN103645882 A CN 103645882A CN 201310659515 A CN201310659515 A CN 201310659515A CN 103645882 A CN103645882 A CN 103645882A
Authority
CN
China
Prior art keywords
data
order
random number
random
generation method
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201310659515.8A
Other languages
Chinese (zh)
Inventor
汪正峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SINO WEALTH ELECTRONIC CO Ltd
Original Assignee
SINO WEALTH ELECTRONIC CO Ltd
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 SINO WEALTH ELECTRONIC CO Ltd filed Critical SINO WEALTH ELECTRONIC CO Ltd
Priority to CN201310659515.8A priority Critical patent/CN103645882A/en
Publication of CN103645882A publication Critical patent/CN103645882A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a batch out-of-order random number generation method based on a single-chip microcomputer. The method includes the steps that a random and no-repetition out-of-order data table with the length of 256 bytes is established, adjacent data in the out-of-order data table are not continuous, data in the out-of-order data table do not repeat, and the data are out of order; according to the length of random numbers to be generated, the number of out-of-order data tables to be produced is determined; a plurality of data seeds are obtained through random access memory data of the single-chip microcomputer; when the random numbers are generated in batches, each byte of data are made to change through a pre-determined algorithm. The random number generation mode is high in randomness, the random numbers in batches are generated, the adjacent data are out of order, and confusion caused by similarity is not prone to occurrence. Besides, the random numbers in batches will not repeat, and the method is an ideal method for generating out-of-order random IDs in batches.

Description

The generation method of the out of order random number of SCM Based batch
Technical field
The present invention relates to singlechip technology field, specifically, the present invention relates to the generation method of the out of order random number of a kind of SCM Based batch.
Background technology
Existing single-chip microcomputer generates the method for random number, easily duplicates, and randomness is poor, needs trigger source.And in Mass production, data there will be continuously or the shortcoming such as easily repeat.
Summary of the invention
Technical matters to be solved by this invention is to provide the generation method of the out of order random number of a kind of SCM Based batch, when Mass production random number, have out of order, do not repeat, without features such as triggerings.
For solving the problems of the technologies described above, the invention provides the generation method of the out of order random number of a kind of SCM Based batch, comprise step:
A. the out of order tables of data that foundation at random, does not repeat and length is certain byte, data adjacent in described out of order tables of data are discontinuous, and in the out of order tables of data of same Zhang Suoshu, without the data that repeat, described data are out of order;
B. according to the length of the random number that will generate, determine the number of the described out of order tables of data that will produce;
C. the random access memory data by single-chip microcomputer obtain some data seeds;
D. described in Mass production during random number, take a pre-defined algorithm that each byte data is changed.
Alternatively, in above-mentioned steps B, the number of the described out of order tables of data that produce is corresponding consistent with the length of the described random number that will generate.
Alternatively, in above-mentioned steps C, described data seed is to adopt the mode that a plurality of random access memory data are averaged to obtain.
Alternatively, in above-mentioned steps C, in order to increase the randomness of data, described data seed increases thereupon.
Alternatively, in above-mentioned steps A, the length of described out of order tables of data is 256 bytes.
Alternatively, the described random number of generation is applied in various ID cards or electric label, as same batch No. ID out of order or electric label number.
Compared with prior art, the present invention has the following advantages:
The random number generating mode that the present invention proposes, randomness is strong, and the random number of generation is in batches, and adjacent data is out of order, is not easy to obscure because of similar.In addition, the random number of Mass production there will not be repetition, is the random ID(Identity Code of Mass production) Perfected process.
In addition, the random number that adopts mode of the present invention to generate, is used for No. ID that can be used as some wireless devices, data can not repeat, and completely discontinuous, and adjacent data difference is large, little with the interference of batch products data, decoding error probability is little, and generating mode is simple.
Generally speaking, method of the present invention when Mass production random number, have out of order, do not repeat, without features such as triggerings, overcome the defect existing in prior art, realized object of the present invention.
Accompanying drawing explanation
The above and other features of the present invention, character and advantage become more obvious by the description by below in conjunction with drawings and Examples, wherein:
Fig. 1 is the schematic flow diagram of generation method of the out of order random number of SCM Based batch of one embodiment of the invention.
Embodiment
Below in conjunction with specific embodiments and the drawings, the invention will be further described; set forth in the following description more details so that fully understand the present invention; but the present invention obviously can implement with the multiple alternate manner that is different from this description; those skilled in the art can do similar popularization, deduction according to practical situations without prejudice to intension of the present invention in the situation that, therefore should be with content constraints protection scope of the present invention of this specific embodiment.
Fig. 1 is the schematic flow diagram of generation method of the out of order random number of SCM Based batch of one embodiment of the invention.As shown in Figure 1, the generation method of the out of order random number of this batch mainly comprises following flow process:
Execution step S101, foundation at random, does not repeat and length is an out of order tables of data of certain byte (Bytes) (for example 256 bytes).This out of order tables of data generating has following characteristics:
A) in table, adjacent data are discontinuous; B) data that in same table, nothing repeats; C) data are out of order.
Execution step S102, according to the length of the random number that will generate, determines the number of the out of order tables of data that will produce.The number of the out of order tables of data that wherein, produce can be corresponding consistent with the length of the random number that will generate.For example, the random number that generate is 2 bytes, produces 2 out of order tables of data; The random number generating is 3 bytes, produces 3 out of order tables of data, by that analogy.
Execution step S103, the random-access memory (ram) data by single-chip microcomputer obtain some data seeds.In order to increase the randomness of data, data seed should increase thereupon.
Wherein, in order to increase the randomness of data, data seed can be to adopt the mode (being called for short many-valued average mode) that a plurality of random access memory data are averaged to obtain.
Execution step S104, during Mass production random number, takes a pre-defined algorithm to guarantee that each byte data changes, and is not only most significant digit or lowest order data variation.
Below for generating the out of order random number method of the batch example of 3 bytes:
First, generate three out of order tables of data:
unsigned?char?Random_table0[256]=
{0,94,188,226,97,63,221,131,194,156,126,32,163,253,31,65,157,195,33,127,252,162,64,30,95,1,227,189,62,96,130,220,35,125,159,193,66,28,254,160,225,191,93,3,128,222,60,98,190,224,2,92,223,129,99,61,124,34,192,158,29,67,161,255,70,24,250,164,39,121,155,197,132,218,56,102,229,187,89,7,219,133,103,57,186,228,6,88,25,71,165,251,120,38,196,154,101,59,217,135,4,90,184,230,167,249,27,69,198,152,122,36,248,166,68,26,153,199,37,123,58,100,134,216,91,5,231,185,140,210,48,110,237,179,81,15,78,16,242,172,47,113,147,205,17,79,173,243,112,46,204,146,211,141,111,49,178,236,14,80,175,241,19,77,206,144,114,44,109,51,209,143,12,82,176,238,50,108,142,208,83,13,239,177,240,174,76,18,145,207,45,115,202,148,118,40,171,245,23,73,8,86,180,234,105,55,213,139,87,9,235,181,54,104,138,212,149,203,41,119,244,170,72,22,233,183,85,11,136,214,52,106,43,117,151,201,74,20,246,168,116,42,200,150,21,75,169,247,182,232,10,84,215,137,107,53}
unsigned?char?Random_table1[256]=
{93,254,160,225,191,192,158,29,67,161,255,233,183,85,11,136,202,148,118,40,171,245,23,73,8,86,180,234,105,55,213,139,87,9,235,181,54,117,151,201,74,20,246,168,214,52,106,43,104,138,212,149,203,41,119,244,170,72,22,240,174,76,18,145,63,221,131,194,156,126,0,94,188,226,97,32,163,253,31,65,157,195,33,190,224,2,92,223,129,99,61,124,34,127,252,162,64,30,95,1,227,189,62,96,130,220,58,100,134,216,91,5,231,185,140,210,48,110,237,179,81,15,78,16,242,172,47,113,147,205,17,79,173,243,112,46,204,146,211,175,241,19,77,206,144,114,44,109,51,209,143,12,82,176,238,141,111,49,178,236,14,80,50,108,142,208,83,13,239,177,207,45,115,75,169,247,116,42,200,150,21,53,137,107,70,24,250,164,39,121,155,197,182,232,10,84,215,71,165,251,120,38,196,154,101,59,217,135,132,218,56,102,229,187,89,7,248,166,68,26,153,199,37,123,219,133,103,57,186,228,6,88,25,4,90,184,230,167,249,27,69,198,152,122,36,3,128,222,60,98,35,125,159,193,66,28}
unsigned?char?Random_table2[256]=
{54,214,52,106,43,179,42,200,150,21,53,117,151,201,74,20,41,132,218,56,102,229,187,89,119,244,170,72,22,240,174,76,18,145,165,251,120,38,196,154,101,59,217,135,63,221,131,194,208,144,114,44,109,51,209,143,12,87,9,235,181,83,13,239,177,207,45,115,75,169,247,7,248,166,68,26,153,199,37,123,246,168,137,107,70,24,250,164,39,121,155,197,60,98,35,125,159,193,66,14,80,50,108,142,79,173,243,112,220,58,100,134,156,126,0,94,188,226,97,32,163,253,31,65,216,91,5,140,157,195,33,190,224,2,92,223,116,231,185,129,82,176,238,141,111,49,178,236,99,61,124,34,127,252,162,210,48,110,46,182,81,15,78,16,242,189,62,96,130,147,205,17,104,172,47,113,19,77,206,64,30,204,146,211,175,241,237,95,1,227,6,88,232,10,84,215,71,25,4,191,192,158,29,67,161,57,186,228,255,233,183,85,11,136,90,184,230,138,212,149,203,152,122,36,3,128,222,167,249,27,86,180,234,202,148,118,40,171,245,105,55,103,69,198,28,213,139,23,73,8,93,254,160,225,219,133}
Then, by the random access memory ram (many-valued average mode) of single-chip microcomputer, obtain three random data seeds, suppose that three random data seeds that obtain are:
random_seed0=27;
random_seed1=69;
random_seed2=129。
Finally, adopt following algorithm to export in batches random data:
Figure BDA0000432956420000051
The data instance following (being front 50 groups of data below) of output:
B7?A2?1B
57?43?79
B5?E5?D7
EB?26?FD
AC?04?7C
34?05?5A
AB?E3?F8
49?62?9E
17?88?DD
96?E6?B7
B6?44?99
F6?2E?3B
18?FC?BE
4A?9A?18
CB?50?3A
95?CD?5C
AA?0F?B8
05?D9?DE
5B?BB?3C
B9?6D?9A
E7?F0?17
66?3A?BD
3C?5C?5B
DA?8E?39
F8?4D?7A
75?9B?1C
2B?F9?FE
C9?2F?D8
97?AE?59
71?7C?7B
2F?1A?9D
CD?D0?F7
93?9C?3E
12?4E?98
26?30?BA
7C?FA?DC
F9?7B?5D
A7?BA?37
45?DC?19
1B?0E?BB
E6?8F?FC
BC?59?DA
5A?3B?78
08?ED?1E
C0?1B?9B
5E?79?F9
04?AF?57
43?70?7D
51?AD?D9
11?CF?FB
By above sample data, can find out, adjacent data is discontinuous number, and the data of every 3 bytes are all unduplicated.
If the random data of output 4 bytes or 5 bytes and even length can be done corresponding expansion according to thinking of the present invention.
Applicating example of the present invention:
In the application of various ID cards or electric label, take method of the present invention to generate No. ID, with batch No. ID, card or electric label number out of order, discontinuous, and repeated code not, be not easy to occur that number, because of similar situation about disturbing, also there will not be repeated code situation.
In sum, the random number generating mode that the present invention proposes, randomness is strong, and the random number of generation is in batches, and adjacent data is out of order, is not easy to obscure because of similar.In addition, the random number of Mass production there will not be repetition, is the random ID(Identity Code of Mass production) Perfected process.
In addition, the random number that adopts mode of the present invention to generate, is used for No. ID that can be used as some wireless devices, data can not repeat, and completely discontinuous, and adjacent data difference is large, little with the interference of batch products data, decoding error probability is little, and generating mode is simple.
Generally speaking, method of the present invention when Mass production random number, have out of order, do not repeat, without features such as triggerings, overcome the defect existing in prior art, realized object of the present invention.
Although the present invention with preferred embodiment openly as above, it is not for limiting the present invention, and any those skilled in the art without departing from the spirit and scope of the present invention, can make possible change and modification.Therefore, every content that does not depart from technical solution of the present invention, any modification, equivalent variations and the modification above embodiment done according to technical spirit of the present invention, within all falling into the protection domain that the claims in the present invention define.

Claims (6)

1. a generation method for the out of order random number of SCM Based batch, comprises step:
A. the out of order tables of data that foundation at random, does not repeat and length is certain byte, data adjacent in described out of order tables of data are discontinuous, and in the out of order tables of data of same Zhang Suoshu, without the data that repeat, described data are out of order;
B. according to the length of the random number that will generate, determine the number of the described out of order tables of data that will produce;
C. the random access memory data by single-chip microcomputer obtain some data seeds;
D. described in Mass production during random number, take a pre-defined algorithm that each byte data is changed.
2. the generation method of the out of order random number of batch according to claim 1, is characterized in that, in above-mentioned steps B, the number of the described out of order tables of data that produce is corresponding consistent with the length of the described random number that will generate.
3. the generation method of the out of order random number of batch according to claim 2, is characterized in that, in above-mentioned steps C, described data seed is to adopt the mode that a plurality of random access memory data are averaged to obtain.
4. the generation method of the out of order random number of batch according to claim 3, is characterized in that, in above-mentioned steps C, in order to increase the randomness of data, described data seed increases thereupon.
5. the generation method of the out of order random number of batch according to claim 4, is characterized in that, in above-mentioned steps A, the length of described out of order tables of data is 256 bytes.
6. according to the generation method of the out of order random number of batch described in any one in claim 1 to 5, it is characterized in that, the described random number of generation is applied in various ID cards or electric label, as same batch No. ID out of order or electric label number.
CN201310659515.8A 2013-12-09 2013-12-09 Batch out-of-order random number generation method based on single-chip microcomputer Pending CN103645882A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310659515.8A CN103645882A (en) 2013-12-09 2013-12-09 Batch out-of-order random number generation method based on single-chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310659515.8A CN103645882A (en) 2013-12-09 2013-12-09 Batch out-of-order random number generation method based on single-chip microcomputer

Publications (1)

Publication Number Publication Date
CN103645882A true CN103645882A (en) 2014-03-19

Family

ID=50251107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310659515.8A Pending CN103645882A (en) 2013-12-09 2013-12-09 Batch out-of-order random number generation method based on single-chip microcomputer

Country Status (1)

Country Link
CN (1) CN103645882A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017157197A1 (en) * 2016-03-17 2017-09-21 阿里巴巴集团控股有限公司 Random number generation and acquisition method and device
CN107408031A (en) * 2014-12-03 2017-11-28 3M创新有限公司 Use the system and method for the generation random number of physical change present in material sample
CN109783058A (en) * 2018-12-24 2019-05-21 深圳市珍爱捷云信息技术有限公司 User identity code generating method, device, computer equipment and storage medium
CN109933609A (en) * 2019-01-30 2019-06-25 福建天泉教育科技有限公司 A kind of method and terminal of Mass production ID

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030182246A1 (en) * 1999-12-10 2003-09-25 Johnson William Nevil Heaton Applications of fractal and/or chaotic techniques
CN1465011A (en) * 2001-06-13 2003-12-31 索尼公司 Data transfer system, data transfer apparatus, data recording apparatus, data management method, identifier generation method
US20040131186A1 (en) * 2001-04-03 2004-07-08 Tomomi Kasuya Encrypting apparatus
CN1815527A (en) * 2005-02-03 2006-08-09 三洋电机株式会社 Circuit for random number generation
US20070174374A1 (en) * 2004-01-30 2007-07-26 Victor Company Of Japan, Limited Pseudorandom number generator and pseudorandom number generation program
CN101576948A (en) * 2009-06-09 2009-11-11 航天科工深圳(集团)有限公司 Allowed method for guarding singlechip programmer
CN101996065A (en) * 2009-08-26 2011-03-30 索尼株式会社 Random number generator and random number generating method
CN103345683A (en) * 2013-07-15 2013-10-09 武汉天喻信息产业股份有限公司 Off-line recharging method and system based on electronic wallet

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030182246A1 (en) * 1999-12-10 2003-09-25 Johnson William Nevil Heaton Applications of fractal and/or chaotic techniques
US20040131186A1 (en) * 2001-04-03 2004-07-08 Tomomi Kasuya Encrypting apparatus
CN1465011A (en) * 2001-06-13 2003-12-31 索尼公司 Data transfer system, data transfer apparatus, data recording apparatus, data management method, identifier generation method
US20070174374A1 (en) * 2004-01-30 2007-07-26 Victor Company Of Japan, Limited Pseudorandom number generator and pseudorandom number generation program
CN1815527A (en) * 2005-02-03 2006-08-09 三洋电机株式会社 Circuit for random number generation
CN101576948A (en) * 2009-06-09 2009-11-11 航天科工深圳(集团)有限公司 Allowed method for guarding singlechip programmer
CN101996065A (en) * 2009-08-26 2011-03-30 索尼株式会社 Random number generator and random number generating method
CN103345683A (en) * 2013-07-15 2013-10-09 武汉天喻信息产业股份有限公司 Off-line recharging method and system based on electronic wallet

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
亓民勇: "模拟信号随机性测试技术的研究与应用", 《中国优秀博硕士学位论文全文数据库 (硕士) 信息科技辑》 *
杨振海等: "随机数生成", 《数理统计与管理》 *
王松岩等: "考虑统计和互相关特性的多风电场风速数据模拟生成方法", 《电力系统自动化 》 *
谭阳: "关于随机数生成算法的研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107408031A (en) * 2014-12-03 2017-11-28 3M创新有限公司 Use the system and method for the generation random number of physical change present in material sample
CN107408031B (en) * 2014-12-03 2021-06-08 3M创新有限公司 System and method for generating random numbers using physical changes present in a material sample
WO2017157197A1 (en) * 2016-03-17 2017-09-21 阿里巴巴集团控股有限公司 Random number generation and acquisition method and device
CN107203365A (en) * 2016-03-17 2017-09-26 阿里巴巴集团控股有限公司 The generation of random number and acquisition methods and device
US10691415B2 (en) 2016-03-17 2020-06-23 Alibaba Group Holding Limited Random number generation and acquisition method and device
CN107203365B (en) * 2016-03-17 2020-09-08 阿里巴巴集团控股有限公司 Random number generation and acquisition method and device
US10929103B2 (en) 2016-03-17 2021-02-23 Advanced New Technologies Co., Ltd. Random number generation and acquisition method and device
US11182129B2 (en) 2016-03-17 2021-11-23 Advanced New Technologies Co., Ltd. Random number generation and acquisition method and device
CN109783058A (en) * 2018-12-24 2019-05-21 深圳市珍爱捷云信息技术有限公司 User identity code generating method, device, computer equipment and storage medium
CN109783058B (en) * 2018-12-24 2023-09-05 深圳市珍爱捷云信息技术有限公司 User identity code generation method and device, computer equipment and storage medium
CN109933609A (en) * 2019-01-30 2019-06-25 福建天泉教育科技有限公司 A kind of method and terminal of Mass production ID

Similar Documents

Publication Publication Date Title
CN103645882A (en) Batch out-of-order random number generation method based on single-chip microcomputer
Zou et al. Simultaneous Optimization of Charge‐Carrier Balance and Luminous Efficacy in Highly Efficient White Polymer Light‐Emitting Devices
Li et al. A fundamental tradeoff between computation and communication in distributed computing
CN110737659A (en) Graph data storage and query method, device and computer readable storage medium
Yuan et al. Interplay between structure and dynamics in adaptive complex networks: Emergence and amplification of modularity by adaptive dynamics
CN110083606A (en) Across chain storage method, terminal and storage medium
CN103701848B (en) A kind of Internet of Things secure storage method of data based on cloud computing and system
CN106407201A (en) Data processing method and apparatus
CN104737495A (en) Permutation method for correcting bit error in quantum key distribution protocol
CN109167661A (en) A kind of Byzantine failure tolerance common recognition method and terminal applied to alliance's chain
CN102752216A (en) Method for identifying dynamic characteristic application flow
CN102609464A (en) Method and device for associative table query of MONGODB shards
CN107769923B (en) A kind of true random-number generating method based on cpu clock and USB independent clock
Fan et al. On synchronous preference of complex dynamical networks
Yan et al. A semi-theoretical fluorescent lamp model for time-domain transient and steady-state simulations
CN110545170A (en) Block chain consensus method, device and equipment based on password drawing
CN105159653A (en) Random number post-processing circuit and method
Park et al. A noble key pre-distribution scheme with LU matrix for secure wireless sensor networks
CN103092767B (en) A kind of management method to cloud computing internal physical machine information memory pool
CN108108898A (en) A kind of corrugated board efficiently produces product plan and its scheduling method
CN103530086A (en) Software random number generation method with dispersion mechanism
CN103856320B (en) Dynamic S box construction method based on multistage chaotic systems
CN105931445A (en) Anti-interference wireless M-Bus short-distance meter reading control method
Bo et al. A method for designing hash function based on chaotic neural network
CN204926062U (en) Random number aftertreatment circuit

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140319

WD01 Invention patent application deemed withdrawn after publication