CN108365960A - Random number providing method and device - Google Patents

Random number providing method and device Download PDF

Info

Publication number
CN108365960A
CN108365960A CN201711479264.XA CN201711479264A CN108365960A CN 108365960 A CN108365960 A CN 108365960A CN 201711479264 A CN201711479264 A CN 201711479264A CN 108365960 A CN108365960 A CN 108365960A
Authority
CN
China
Prior art keywords
random number
data
submitted
source
undertake
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.)
Granted
Application number
CN201711479264.XA
Other languages
Chinese (zh)
Other versions
CN108365960B (en
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.)
Beijing European Chain Technology Co Ltd
Original Assignee
Beijing European Chain Technology 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 Beijing European Chain Technology Co Ltd filed Critical Beijing European Chain Technology Co Ltd
Priority to CN201711479264.XA priority Critical patent/CN108365960B/en
Publication of CN108365960A publication Critical patent/CN108365960A/en
Application granted granted Critical
Publication of CN108365960B publication Critical patent/CN108365960B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/126Applying verification of the received information the source of the received data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2463/00Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00
    • H04L2463/102Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00 applying security measure for e-commerce

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the present invention provides a kind of random number providing method and device, wherein method includes:It receives the source random number to be submitted in the data promise and data promise that multiple data providings are submitted and stores into block chain, promise verification is carried out through non-reversible algorithm to each source random number;If determined after promising to undertake verification:Commitment value during the commitment value being calculated is promised to undertake with the data that data providing is submitted is identical, then receives the source random number of data providing submission;The source random number submitted to accepted data providing is calculated through non-reversible algorithm, is generated random number and is stored into block chain;Order request based on the purchase random number that ordering party submits, ordering party is supplied to by the random number of generation.The source random number that the scheme of the embodiment of the present invention can prevent individual data provider from being submitted is to monitor that the source random number that other data providings upload is submitted later, and there are the possibility of cheating, so that it is guaranteed that the randomness of the random number based on source generating random number.

Description

Random number providing method and device
Technical field
This application involves field of computer technology more particularly to a kind of random number providing method and devices.
Background technology
In traditional network environment, random number is all generated by respective hardware environment, but in block chain environment, it is each Lack faith mechanism between node, account, thus can not possibly trust any one node, the random number that account provides it is random Property.
Random number itself is a kind of data resource, has application in many fields, for example, for the pumping between multiple main bodys The application in mechanism such as sign or be randomly assigned.For example, the number of shaking of motor vehicle purchase, the necks such as lot, lottery ticket of the grouping of match Domain, these can all use and arrive random number.
The most important characteristic of random number is the randomness that ensure that it is generated, and cannot be manipulated by anyone.If What some node provided is not random number, but under conditions of obtaining certain information, generation it is purposive random Number, then this random number is possible to influence the result of final applied item.
For example, node can generate the random number to its favourable outcome by the experiment of limited number of time, it is also injustice in this way Flat.
Invention content
The present invention provides a kind of random number providing method and device, the source that can prevent individual data provider from being submitted Random number is to monitor that the source random number that other data providings upload is submitted later, and there are the possibility of cheating, so that it is guaranteed that The randomness of random number based on source generating random number.
In order to achieve the above objectives, the embodiment of the present invention adopts the following technical scheme that:
In a first aspect, a kind of random number providing method is provided, including:
It receives the data that multiple data providings are submitted to promise to undertake and store into block chain, the data carry institute in promising to undertake State the commitment value that the source random number corresponding to the source random number that data providing to be submitted is calculated through non-reversible algorithm;
It receives the source random number to be submitted during the data that the multiple data providing is submitted are promised to undertake and stores to area In block chain, and promise verification is carried out through the non-reversible algorithm to each source random number;
If determined after promising to undertake verification:The commitment value being calculated is promised to undertake with the data that the data providing is submitted In commitment value it is identical, then receive the source random number that the data providing is submitted;
The source random number submitted to the accepted data providing is calculated through the non-reversible algorithm, generate with Machine number is simultaneously stored into block chain;
Order request based on the purchase random number that ordering party submits, the order is supplied to by the random number of generation Side.
Second aspect provides a kind of random number offer device, including:
Promise to undertake memory module, the data for receiving multiple data providings submissions are promised to undertake and stored into block chain, institute Stating the source random number warp carried during data are promised to undertake corresponding to the source random number that the data providing to be submitted can not inverse operator The commitment value that method is calculated;
Authentication module is promised to undertake, for receiving the source to be submitted during the data that the multiple data providing is submitted are promised to undertake Random number is simultaneously stored into block chain, and carries out promise verification through the non-reversible algorithm to each source random number;
If determined after promising to undertake verification:The commitment value being calculated is promised to undertake with the data that the data providing is submitted In commitment value it is identical, then receive the source random number that the data providing is submitted;
Random number generation module, the source random number for being submitted to the accepted data providing is through described irreversible Algorithm is calculated, and is generated random number and is stored into block chain;
Random number provides module, the order request of the purchase random number for being submitted based on ordering party, described in generation Random number is supplied to the ordering party.
Random number providing method provided by the invention and device submit data providing in a manner of " data promise " Source random number carries out promise verification, is to monitor that other data provide to prevent the source random number that individual data provider is submitted It is submitted after the source random number of Fang Shangchuan, there are the possibility of cheating, so that it is guaranteed that calculating the random of generation based on source random number Several randomness.
Above description is only the general introduction of technical scheme, in order to better understand the technological means of the application, And can be implemented in accordance with the contents of the specification, and in order to allow above and other objects, features and advantages of the application can It is clearer and more comprehensible, below the special specific implementation mode for lifting the application.
Description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit are common for this field Technical staff will become clear.Attached drawing only for the purpose of illustrating preferred embodiments, and is not considered as to the application Limitation.And throughout the drawings, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 is the generation logical schematic of the random number of the embodiment of the present invention;
Fig. 2 is the schematic diagram that random number is provided in business environment of the embodiment of the present invention;
Fig. 3 is the random number providing method flow chart one shown in the embodiment of the present invention;
Fig. 4 is the random number providing method flowchart 2 shown in the embodiment of the present invention;
Fig. 5 is the random number providing method flow chart 3 shown in the embodiment of the present invention;
Fig. 6 provides the structural schematic diagram one of device for the random number shown in the embodiment of the present invention;
Fig. 7 provides the structural schematic diagram two of device for the random number shown in the embodiment of the present invention;
Fig. 8 provides the structural schematic diagram three of device for the random number shown in the embodiment of the present invention.
Specific implementation mode
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.
This programme improves in the prior art, and random number is generated as being generated by the respective hardware environment of data providing, But in block chain environment, due to lacking faith mechanism between each node, account, any one can not possibly be trusted The defect of the randomness for the random number that node, account provide.Its core concept be the source submitted based on each data providing with Machine number calculates through non-reversible algorithm these source random numbers to generate final random number.
As shown in Figure 1, the generation logical schematic of the random number for the embodiment of the present invention.The generation logic is from different Multiple data sources obtain multiple source random numbers, and each source random number itself can also be to randomly generate.Be then based on these with Machine number finally obtains a random number through non-reversible algorithm.
In the scheme thought of above-mentioned generation random number, if in principle there are one source random number be randomly generate, then Ensure that finally obtained random number has preferable randomness.This random digit generation method can refer to existing In various business links, to need the ordering party of random number to provide effective random number.
As shown in Fig. 2, this gives how in business environment provide random number concrete scheme, that is, use The mode of " data promise to undertake+submit data " screens each source random number for calculating random number, is then based on each source random number again It calculates and generates random number, and the screening process, random number calculating process are combined with block chain technology.First, server It first receives the data that each data providing is submitted to promise to undertake and store into block chain, which carries data providing in promising to undertake and be intended to The commitment value that source random number corresponding to the source random number of submission is calculated through non-reversible algorithm;Then, server receives more The source random number to be submitted in the promise of data before that a data providing is submitted, source random number is stored into block chain, base In receiving, data are promised to undertake and its area of data is submitted in the sequencing of submission data (including source random number), general processing accordingly Block number is greater than the block number where data are promised to undertake, and (block number is suitable by the generating process of block chain in the present embodiment Sequence is numbered);Then, promise verification is carried out through non-reversible algorithm to each source random number, if the commitment value being calculated with number Commitment value during the data submitted according to provider are promised to undertake corresponds to identical, then receives the source random number, and the accepted source of utilization with Machine number is calculated to generate to calculate at random and be stored into block chain;Finally, the order request for the purchase random number submitted based on ordering party, will The random number of generation is supplied to ordering party.Due to during screening random number, data are promised to undertake by block chain, source it is random Number and random number stored, ensure that these data can not tamper, to ensure that the random number ultimately generated Authenticity.
The technical solution of the application is further illustrated below by multiple embodiments.
Embodiment one
Based on the scheme thought of above-mentioned offer random number, as shown in figure 3, it is carried for the random number shown in the embodiment of the present invention For method flow diagram one, the main server for setting in a network of execution of this method.As shown in figure 3, random number provider Method includes the following steps:
S310 receives the data that multiple data providings are submitted and promises to undertake and store into block chain, and data carry in promising to undertake The commitment value that source random number corresponding to the source random number to be submitted of data providing is calculated through non-reversible algorithm.
Due to network delay etc., the time that each data providing provides source random number is nonsynchronous, has morning to have late. The source random number that individual data provider is submitted in order to prevent be monitor other data providings upload source random number it It submits afterwards, there are the possibility of cheating, therefore this programme (referred to as " data by the way of a kind of " data promise to undertake+submit data " Promise to undertake ") to limit data providing source random number is submitted, to ensure that the source random number that each data providing provides is to be provided in advance , rather than provided again after having known the source random number that other data providings are provided.
So-called " data promise " mode submits source random number to refer to, before each data providing submits source random number, first The data for the source random number to be submitted are submitted to promise to undertake, the content which promises to undertake includes corresponding to the source random number to be submitted Commitment value, the commitment value be data providing to the source random number to be submitted through above-mentioned non-reversible algorithm calculating after obtain, with The source random number submitted to the data providing received for subsequent server carries out promise verification.
Further include using in data promise meanwhile in order to be associated processing to data promise using block chain well In the Data Identification that data providing mark data is promised to undertake, such as the Data Identification can be that data promise is intended to processed block Block number, i.e. the first block number;Either for identify based on source random number different random number to be generated with Machine number is numbered;Or it is only for the data number that each data of mark data provider oneself offer are promised to undertake.
In practical application scene, the generating process of block chain is all open and clear for each data providing in the whole network , the block number of the block generated in the current block chain that data providing can be grasped according to it actively determines it The data of submission are handled desired by promising to undertake in which block, and carry the first of respective block in the data of submission promise Block number;Or data providing can be random according to being stored in the block that is generating in the current block chain of its grasp Number number actively determines the random number obtained from calculating desired by corresponding source random number in the data promise that it is submitted, and The random number number of corresponding random number is carried in the data of submission are promised to undertake;Again or data providing in order to distinguish its submission Each data promise to undertake and carry corresponding data number in the data of submission promise.
The incidence relation between commitment value and block in order to embody data providing submission, can be simultaneously in data promise Including the identity ID of the data providing, above-mentioned first block number and commitment value, and the commitment value can be not only above-mentioned Data providing directly obtains the source random number to be submitted after the calculating of above-mentioned non-reversible algorithm, can also be to be submitted Source random number, the spliced character string of the identity ID of data providing and the first block number institute are through above-mentioned non-reversible algorithm meter It is obtained after calculation.
Alternatively, the incidence relation of the commitment value and random number in order to embody data providing submission, it can in data promise Identity ID comprising the data providing, above-mentioned random number number and commitment value simultaneously, and the commitment value can be not only upper It states data providing directly to obtain the source random number to be submitted after the calculating of above-mentioned non-reversible algorithm, can also be to being intended to submit Source random number, the spliced character string of identity ID and random number number institute of data providing is through above-mentioned non-reversible algorithm meter It is obtained after calculation.
Or in order to embody the incidence relation of the commitment value of data providing submission and the source random number of submission, in number According to identity ID, above-mentioned data number and the commitment value that can include the data providing in promise simultaneously, and the commitment value is not only It can be that above-mentioned data providing directly obtains the source random number to be submitted after the calculating of above-mentioned non-reversible algorithm, can also be The spliced character string of identity ID and data number institute to the source random number, data providing to be submitted is through above-mentioned irreversible Algorithm obtains after calculating.
Above-mentioned non-reversible algorithm can be hash algorithm, and the commitment value being calculated is cryptographic Hash.
S320 receives the source random number to be submitted during the data that multiple data providings are submitted are promised to undertake and stores to block chain In, and promise verification is carried out through non-reversible algorithm to each source random number.
Each data providing is after having submitted data to promise to undertake, the corresponding source of commitment value is random in then promising to undertake the data Number is supplied to server.Server stores former random number to area after receiving the source random number that each data providing is submitted In block chain.Based on receiving, data are promised to undertake and its sequencing of submission data (including source random number), general processing carry accordingly The block number of intersection number evidence is greater than the block number where data are promised to undertake.
It, both can be with memory block in either block in a block chain other than root zone block in practical application scene Number be directed toward current block data promise to undertake, can also memory block number be directed toward current block before block data promise to undertake Corresponding submission data.But since data set provider is after submitting data to promise to undertake, data promise pair can be generally submitted at once The submission data answered, therefore the block number that general processing submits the block number of data to be not more than where data are promised to undertake is too many (generally delaying 1-2 block).If the block number that block number where submitting data is more than where data are promised to undertake is too many, that After submitting the data providing of the submission data to be likely to the source random number for having listened to the submission of other data providings, then The submission data of upload, there are larger cheating suspicion.
After the source random number that server receives that above-mentioned how many a data providings are submitted, can by these source random numbers, Storage order in block chain where being promised to undertake by its corresponding data, carries out promise verification to each source random number successively.
Specifically, each source random number is carried out respectively that commitment value is calculated through above-mentioned non-reversible algorithm, and this is held Commitment value during promise value is promised to undertake with the data that data providing before is submitted is compared, and completes to promise to undertake verification.
S330, if determined after promising to undertake verification:During the commitment value being calculated is promised to undertake with the data that data providing is submitted Commitment value it is identical, then receive data providing submission source random number.
Specifically, it carries out that commitment value is calculated through above-mentioned non-reversible algorithm respectively for each source random number, and this holds Commitment value during promise value is promised to undertake with the data that data providing before is submitted is corresponding identical, then shows what the data providing was submitted The source random number is effective, server be subjected to the data providing submission source random number, using as calculate a random number institute The source random number needed.
Certainly, after step S320, following steps be can also carry out:
If determined after promising to undertake verification:Promise in the data promise that the commitment value being calculated is submitted with data providing Value correspondence differs, then refuses the source random number of data providing submission.
Specifically, it carries out that commitment value is calculated through above-mentioned non-reversible algorithm respectively for each source random number, if certain A commitment value is corresponding with the commitment value in the data promise that data providing before is submitted to be differed, then shows the data providing The source random number of submission is invalid, and server is rejected by the source random number of data providing submission, which cannot make To calculate the source random number needed for any one random number.
S340, the source random number submitted to accepted data providing are calculated through non-reversible algorithm, are generated random It counts and stores into block chain.
For example, before calculating random number, can preassign for be calculated a required source of random number with The number of machine number.For example, the present embodiment can data providing submit source random number after, by accepted multiple sources with Machine number is divided, to determine for calculating the source random number needed for a random number.
Specifically, after receiving the source random number that multiple data providings are submitted, can first to these source random numbers into Row is as described above to promise to undertake verification, and retains the source random number for receiving to be proved to be successful;Then, to the number of accepted source random number Mesh is counted, and according to for calculating specifying number for the source random number needed for random number, to accepted source random number into Row divide, form at least one data group, each data group includes the source random number specified number, using as calculating one with Source random number needed for machine number.Then, the source random number in each data group is calculated through non-reversible algorithm, generates one Random number is simultaneously stored into block chain.
S350, the order request based on the purchase random number that ordering party submits, ordering party is supplied to by the random number of generation.
After ordering party submits order request for buying random number, can according to the order contents in order request, Such as generated random number is supplied to ordering party by quantity on order.
What needs to be explained here is that ordering party submits order request and produces the process of random number number, there is no stringent Time sequencing, two process links can be completed relatively independently.
Random number providing method provided in an embodiment of the present invention draws the generating process of random number in conjunction with block chain technology It uses in commercial field, supply random number service can be provided for ordering party.The process of generation random number can prevent a in this programme The source random number that other data providing is submitted is to monitor that the source random number that other data providings upload is submitted later, is deposited In the possibility of cheating, to improve the randomness for generating random number and generating result;Simultaneously as in the process for providing random number In, data promise, source random number and the random number of generation are stored by block chain, ensure that can not usurping for these data It is modified, to ensure that the authenticity for the random number being finally calculated.
Embodiment two
As shown in figure 4, it is the random number providing method flowchart 2 shown in the embodiment of the present invention, this method can be considered figure The specific implementation of method shown in 3 is refined mainly for the generating process of random number.As shown in figure 4, the random number Providing method includes the following steps:
S410 receives the data that multiple data providings are submitted and promises to undertake and store into block chain, and data carry in promising to undertake The commitment value that source random number corresponding to the source random number to be submitted of data providing is calculated through non-reversible algorithm.
S420 receives the source random number to be submitted during the data that multiple data providings are submitted are promised to undertake and stores to block chain In, and promise verification is carried out through non-reversible algorithm to each source random number.
S430, if determined after promising to undertake verification:During the commitment value being calculated is promised to undertake with the data that data providing is submitted Commitment value it is identical, then receive data providing submission source random number.
Step S410~step S430 and the content of above-mentioned steps S310~step S330 are corresponding identical.
Multiple source random numbers are spliced to form the first character string by S440, are counted through non-reversible algorithm to the first character string It calculates, and obtained calculated value is denoted as random number seed.
Specifically, for multiple source random numbers for being received after promising to undertake and verifying, can first by these source random numbers sequences into Row is spliced to form a character string, i.e. the first character string;Then first character string is calculated through non-reversible algorithm, and will Obtained calculated value is as the random number seed for calculating above-mentioned random number.
Specification is needed, carries out being spliced to form the first character in the source random number sequence for submitting each data providing Can be that the source random number that logarithm is submitted according to provider directly carries out splicing the first character string of generation, or logarithm when string It is raw after the source random number and some auxiliary informations (such as identity ID etc. of data providing) submitted according to provider are integrally spliced At the first character string.
S450 carries out the additional information of random number seed and ordering party to be spliced to form the second character string, to the second character String is calculated through non-reversible algorithm, and using obtained calculated value as random number.
Specifically, after generating above-mentioned random number seed, the random number seed and some auxiliary information (ratios can be based on Such as random number number, the additional information of ordering party) after whole splicing, generate the second character string;Then to second character string It is calculated through non-reversible algorithm, and using obtained calculated value as random number.
Calculating random number based on random number seed is advantageous in that, when needing disposably to generate multiple random numbers, and/or number When lacking according to the source random number that provider provides, can disposably it be generated using random number seed combination auxiliary information multiple random Number, to meet the use demand of random number.
The additional information of above-mentioned ordering party includes:O/No. and/or the identity ID of ordering party.
Step S440~step S450 can be used as the refinement of above-mentioned steps S340.
S460, the order request based on the purchase random number that ordering party submits, ordering party is supplied to by the random number of generation.
This step S460 is similar to the content of above-mentioned steps S350.
In practical application scene, if current do not have ordering party to submit order request, generated random number is abandoned Or random number seed avoids carrying out cheating after being obtained by other people to ensure the real-time of random number generation.
Random number providing method provided in an embodiment of the present invention, on the basis of embodiment shown in Fig. 3, by multiple sources Random number is calculated through non-reversible algorithm, and the process for generating a random number is unfolded, using random number seed as centre Value, can disposably generate multiple random numbers, to meet demand of the ordering party to random number in conjunction with additional information.
Embodiment three
As shown in figure 5, it is the random number providing method flow chart 3 shown in the embodiment of the present invention, this method can be considered figure The purchase order process of the specific implementation of method shown in 3, generating process and ordering party mainly for random number carries out Association.As shown in figure 5, the random number providing method includes the following steps:
S510 obtains the O/No. corresponding to the order request for the purchase random number that ordering party submits and broadcast;
Demand in order to buy random number according to ordering party generates random number, can first obtain the purchase of ordering party's submission The order request of random number, then according to the number of the O/No. (O/No. corresponds to a random number) in order request The corresponding production random number of amount.Server broadcasts O/No. in the entire network, so that each data in network carry Donor submits source random number according to O/No..O/No. can be interpreted as to above-mentioned random number number here.
S520 receives the data promise and O/No. that multiple data providings are submitted and stores into block chain, number It is calculated through non-reversible algorithm according to the source random number carried in promise corresponding to the source random number to be submitted of data providing Commitment value.
This step S520 is similar to above-mentioned steps S310 contents.
Specifically, while data providing submits data to promise to undertake, the data is also had submitted and promise to undertake pointed order Number, for notification server, the source random number to be submitted of instruction is for calculating the O/No. institute during notebook data is promised to undertake Corresponding random number.
S530 receives the source random number to be submitted during the data that multiple data providings are submitted are promised to undertake and stores to block chain In, and promise verification is carried out through non-reversible algorithm to each source random number.
S540, if determined after promising to undertake verification:During the commitment value being calculated is promised to undertake with the data that data providing is submitted Commitment value it is identical, then receive data providing submission source random number.
Step S530~step S540 and the content of above-mentioned steps S320~step S330 are corresponding identical.
S550 promises to undertake that corresponding source random number is carried out through non-reversible algorithm to the data of accepted same O/No. It calculates, generate random number and stores into block chain.
This step S550 can be used as the refinement of above-mentioned steps S340.
Specifically, due to having been identified in being promised to undertake in data produced by the data promise to undertake that corresponding source random number is computed Random number random number number, therefore when extraction source random number calculates random number, corresponding same random number can be extracted and compiled Number the source random number specified number, using as calculating the source random number needed for the random number numbering corresponding random number.
S560, based on ordering party submit purchase random number O/No., by based on same order number generation with Machine number is supplied to ordering party.
This step S560 can be used as the refinement of above-mentioned steps S350.
Specifically, server, can be based on the purchase random number submitted before ordering party when providing random number to ordering party O/No., by based on same order number generate random number be supplied to the ordering party.
Random number providing method provided in an embodiment of the present invention on the basis of embodiment shown in Fig. 3, is compiled by order Number, the purchase of random number and the process for generating random number are associated, one-to-one relationship is formed, is avoided because of two mistakes Journey mutually disconnects and the number of order number and the random number of generation is caused to mismatch caused trouble, improves and is produced to random number The management and control effect of raw process.
Example IV
As shown in fig. 6, it provides the structural schematic diagram one of device for the random number shown in the embodiment of the present invention, which can The server of setting in a network is thought, for executing method and step as shown in Figure 3.As shown in fig. 6, the random number provides dress Set including:
Promise to undertake memory module 610, the data for receiving multiple data providings submissions are promised to undertake and are stored into block chain, The source random number that data carry in promising to undertake corresponding to the source random number to be submitted of data providing is calculated through non-reversible algorithm Commitment value;
Promise to undertake authentication module 620, it is random for receiving the source to be submitted during the data that multiple data providings are submitted are promised to undertake It counts and stores into block chain, and promise verification is carried out through non-reversible algorithm to each source random number;
If determined after promising to undertake verification:Promise in the data promise that the commitment value being calculated is submitted with data providing Be worth it is identical, then receive data providing submission source random number;
Random number generation module 630, the source random number for being submitted to accepted data providing is through non-reversible algorithm It is calculated, generate random number and is stored into block chain;
Random number provides module 640, the order request of purchase random number for being submitted based on ordering party, by generation with Machine number is supplied to ordering party.
Further, as shown in fig. 7, on the basis of device shown in Fig. 6, above-mentioned random number generation module 630 may include:
Seed generation unit 710, for multiple source random numbers to be spliced to form the first character string, to the first character string through not Reversible algorithm is calculated, and obtained calculated value is denoted as random number seed;
Random number generation unit 720 is spliced to form second for carrying out the additional information of random number seed and ordering party Character string calculates the second character string through non-reversible algorithm, and using obtained calculated value as random number;
The additional information of the ordering party includes:O/No. and/or the identity ID of ordering party.
Further, above-mentioned random number provides module 640 and can be additionally used in:
If current do not have ordering party to submit order request, generated random number or random number seed are abandoned.
Fig. 7 shown device structures can be used for executing method and step shown in Fig. 4.
Further, as shown in figure 8, on the basis of device shown in Fig. 6, may also include:
Order acquisition module 810, for obtaining the order corresponding to the order request for the purchase random number that ordering party submits It numbers and broadcasts;
The data that multiple data providings of above-mentioned reception are submitted may also include O/No. in promising to undertake;
Correspondingly, above-mentioned random number generation module 630, it may also be used for promised to undertake to the data of accepted same O/No. Corresponding source random number is calculated through non-reversible algorithm, generates random number;
Correspondingly, above-mentioned random number provides module 640, it may also be used for the order based on the purchase random number that ordering party submits The random number generated based on same order number is supplied to ordering party by number.
Fig. 8 shown device structures can be used for executing method and step shown in Fig. 5.
Random number provided in an embodiment of the present invention provides device and draws the generating process of random number in conjunction with block chain technology It uses in commercial field, supply random number service can be provided for ordering party.The process of generation random number can prevent a in this programme The source random number that other data providing is submitted is to monitor that the source random number that other data providings upload is submitted later, is deposited In the possibility of cheating, to improve the randomness for generating random number and generating result;Simultaneously as in the process for providing random number In, data promise, source random number and the random number of generation are stored by block chain, ensure that can not usurping for these data It is modified, to ensure that the authenticity for the random number being finally calculated.
Further, by being calculated through non-reversible algorithm multiple source random numbers, the process of a random number is generated It is unfolded, using random number seed as median, multiple random numbers can be disposably generated in conjunction with additional information, to meet Demand of the ordering party to random number.
Further, by O/No., the purchase of random number and the process for generating random number are associated, form one One-to-one correspondence avoids causing the number of order number and the random number of generation to mismatch institute because two processes mutually disconnect The trouble brought improves the management and control effect that process is generated to random number.
One of ordinary skill in the art will appreciate that:Realize that all or part of step of above-mentioned each method embodiment can lead to The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer read/write memory medium.The journey When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned includes:ROM, RAM, magnetic disc or The various media that can store program code such as person's CD.
Finally it should be noted that:The above various embodiments is only to illustrate the technical solution of the application, rather than its limitations;To the greatest extent Pipe is described in detail the application with reference to foregoing embodiments, it will be understood by those of ordinary skill in the art that:Its according to So can with technical scheme described in the above embodiments is modified, either to which part or all technical features into Row equivalent replacement;And these modifications or replacements, each embodiment technology of the application that it does not separate the essence of the corresponding technical solution The range of scheme.

Claims (8)

1. a kind of random number providing method, which is characterized in that including:
It receives the data that multiple data providings are submitted to promise to undertake and store into block chain, the data carry the number in promising to undertake The commitment value that the source random number corresponding to the source random number to be submitted according to provider is calculated through non-reversible algorithm;
It receives the source random number to be submitted during the data that the multiple data providing is submitted are promised to undertake and stores to block chain In, and promise verification is carried out through the non-reversible algorithm to each source random number;
If determined after promising to undertake verification:During the commitment value being calculated is promised to undertake with the data that the data providing is submitted Commitment value is identical, then receives the source random number that the data providing is submitted;
The source random number submitted to the accepted data providing is calculated through the non-reversible algorithm, generates random number And it stores into block chain;
Order request based on the purchase random number that ordering party submits, the ordering party is supplied to by the random number of generation.
2. according to the method described in claim 1, it is characterized in that, the source submitted to the accepted data providing Random number is calculated through the non-reversible algorithm, is generated random number and is included:
The multiple source random number is spliced to form the first character string, first character string is carried out through the non-reversible algorithm It calculates, and obtained calculated value is denoted as random number seed;
It carries out the additional information of the random number seed and the ordering party to be spliced to form the second character string, to second word Symbol string is calculated through the non-reversible algorithm, and using obtained calculated value as the random number;
The additional information of the ordering party includes:O/No. and/or the identity ID of ordering party.
3. method according to claim 1 or 2, which is characterized in that the purchase random number submitted based on ordering party The random number of generation is supplied to the ordering party to include by order request:
If current do not have ordering party to submit order request, the generated random number or described random several is abandoned Son.
4. according to the method described in claim 1, it is characterized in that, the data promise for receiving multiple data providings and submitting Further include before:
Obtain the O/No. corresponding to the order request for the purchase random number that ordering party submits and broadcast;
The data that multiple data providings of the reception are submitted further include the O/No. in promising to undertake;
The source random number submitted to the accepted data providing is calculated through the non-reversible algorithm, generate with Machine number includes:
Promise to undertake the corresponding source random number through described irreversible the data of the accepted same O/No. Algorithm is calculated, and the random number is generated;
The order request of the purchase random number submitted based on ordering party, the order is supplied to by the random number of generation Side includes:
The O/No. based on the purchase random number that ordering party submits, described in being generated based on the identical O/No. Random number is supplied to the ordering party.
5. a kind of random number provides device, which is characterized in that including:
Promise to undertake memory module, the data for receiving multiple data providings submissions are promised to undertake and stored into block chain, the number According to the source random number carried in promise corresponding to the source random number that the data providing to be submitted through non-reversible algorithm meter Obtained commitment value;
Promise to undertake authentication module, it is random for receiving the source to be submitted during the data that the multiple data providing is submitted are promised to undertake It counts and stores into block chain, and promise verification is carried out through the non-reversible algorithm to each source random number;
If determined after promising to undertake verification:During the commitment value being calculated is promised to undertake with the data that the data providing is submitted Commitment value is identical, then receives the source random number that the data providing is submitted;
Random number generation module, the source random number for being submitted to the accepted data providing is through the non-reversible algorithm It is calculated, generate random number and is stored into block chain;
Random number provides module, the order request of the purchase random number for being submitted based on ordering party, by the described random of generation Number is supplied to the ordering party.
6. device according to claim 5, which is characterized in that the random number generation module includes:
Seed generation unit passes through first character string for the multiple source random number to be spliced to form the first character string The non-reversible algorithm is calculated, and obtained calculated value is denoted as random number seed;
Random number generation unit, for carrying out the additional information of the random number seed and the ordering party to be spliced to form second Character string calculates second character string through the non-reversible algorithm, and using obtained calculated value as described random Number;
The additional information of the ordering party includes:O/No. and/or the identity ID of ordering party.
7. device according to claim 5 or 6, which is characterized in that the random number provides module and is additionally operable to:
If current do not have ordering party to submit order request, the generated random number or described random several is abandoned Son.
8. device according to claim 5, which is characterized in that described device further includes:
Order acquisition module, the O/No. and wide corresponding to the order request of the purchase random number for obtaining ordering party's submission It broadcasts;
The data that multiple data providings of the reception are submitted further include the O/No. in promising to undertake;
The random number generation module is additionally operable to corresponding to the data promise to the accepted same O/No. The source random number is calculated through the non-reversible algorithm, generates the random number;
The random number provides module, is additionally operable to the O/No. for the purchase random number submitted based on ordering party, will be based on The random number that the identical O/No. generates is supplied to the ordering party.
CN201711479264.XA 2017-12-29 2017-12-29 Random number providing method and device Active CN108365960B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711479264.XA CN108365960B (en) 2017-12-29 2017-12-29 Random number providing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711479264.XA CN108365960B (en) 2017-12-29 2017-12-29 Random number providing method and device

Publications (2)

Publication Number Publication Date
CN108365960A true CN108365960A (en) 2018-08-03
CN108365960B CN108365960B (en) 2020-11-20

Family

ID=63010570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711479264.XA Active CN108365960B (en) 2017-12-29 2017-12-29 Random number providing method and device

Country Status (1)

Country Link
CN (1) CN108365960B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109450629A (en) * 2018-12-21 2019-03-08 深圳区块大陆科技有限公司 Based on block chain random-number generating method
CN109753269A (en) * 2019-01-30 2019-05-14 百度在线网络技术(北京)有限公司 Random digit generation method, device, equipment and the storage medium of block chain
CN109961550A (en) * 2019-03-29 2019-07-02 北京金山安全软件有限公司 Method and device for determining random number in block chain, electronic equipment and storage medium
CN110445616A (en) * 2019-07-15 2019-11-12 杭州复杂美科技有限公司 A kind of block is packaged the determining method of packing sequence, equipment and the storage medium of node
CN111142842A (en) * 2018-11-05 2020-05-12 北京彩球世纪科技有限公司 Method and system for generating random time on block chain
CN115376239A (en) * 2022-08-23 2022-11-22 北京女娲补天科技信息技术有限公司 Method, device and system for registering and shaking number, computer equipment and storage medium
WO2022247069A1 (en) * 2021-05-27 2022-12-01 南方科技大学 Blockchain-based mining method and apparatus, and mobile terminal and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170126684A1 (en) * 2014-05-16 2017-05-04 Nec Europe Ltd. Method for proving retrievability of information
US20170161991A1 (en) * 2015-12-02 2017-06-08 Aryo Ayati System and method for public verification of a gambling website or gaming event
CN106980488A (en) * 2017-03-14 2017-07-25 腾讯科技(深圳)有限公司 Random digit generation method and device
CN107301546A (en) * 2017-05-03 2017-10-27 北京众享比特科技有限公司 Generating random number and methods for using them and device
CN107392770A (en) * 2017-08-09 2017-11-24 北京云知科技有限公司 A kind of random-number generating method and system based on block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170126684A1 (en) * 2014-05-16 2017-05-04 Nec Europe Ltd. Method for proving retrievability of information
US20170161991A1 (en) * 2015-12-02 2017-06-08 Aryo Ayati System and method for public verification of a gambling website or gaming event
CN106980488A (en) * 2017-03-14 2017-07-25 腾讯科技(深圳)有限公司 Random digit generation method and device
CN107301546A (en) * 2017-05-03 2017-10-27 北京众享比特科技有限公司 Generating random number and methods for using them and device
CN107392770A (en) * 2017-08-09 2017-11-24 北京云知科技有限公司 A kind of random-number generating method and system based on block chain

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111142842A (en) * 2018-11-05 2020-05-12 北京彩球世纪科技有限公司 Method and system for generating random time on block chain
CN109450629A (en) * 2018-12-21 2019-03-08 深圳区块大陆科技有限公司 Based on block chain random-number generating method
CN109450629B (en) * 2018-12-21 2021-06-15 深圳区块大陆科技有限公司 Random number generation method based on block chain
CN109753269A (en) * 2019-01-30 2019-05-14 百度在线网络技术(北京)有限公司 Random digit generation method, device, equipment and the storage medium of block chain
CN109961550A (en) * 2019-03-29 2019-07-02 北京金山安全软件有限公司 Method and device for determining random number in block chain, electronic equipment and storage medium
CN110445616A (en) * 2019-07-15 2019-11-12 杭州复杂美科技有限公司 A kind of block is packaged the determining method of packing sequence, equipment and the storage medium of node
CN110445616B (en) * 2019-07-15 2022-03-04 杭州复杂美科技有限公司 Block packing node packing sequence determining method, equipment and storage medium
WO2022247069A1 (en) * 2021-05-27 2022-12-01 南方科技大学 Blockchain-based mining method and apparatus, and mobile terminal and storage medium
CN115376239A (en) * 2022-08-23 2022-11-22 北京女娲补天科技信息技术有限公司 Method, device and system for registering and shaking number, computer equipment and storage medium

Also Published As

Publication number Publication date
CN108365960B (en) 2020-11-20

Similar Documents

Publication Publication Date Title
CN108365960A (en) Random number providing method and device
CN110599173B (en) Block chain consensus node determination method, device, equipment and storage medium
CN108388421A (en) The generation method and device of random number
CN108924130B (en) Block data verification method, device, equipment and storage medium
CN109034809A (en) Generation method, device, block chain node and the storage medium of block chain
CN107423978A (en) A kind of distributed energy business confirmation method based on alliance's block chain
CN108985772A (en) A kind of verification method, device, equipment and the storage medium of block chain
CN108846673B (en) Block data processing method, device, equipment and storage medium
CN107103097A (en) Drawing method and terminal device based on block chain technology
CN108390762A (en) Data screening method and apparatus based on block chain
CN109829824A (en) A kind of commodity transaction information sharing method based on block chain technology
CN111314067B (en) Block storage method and device, computer equipment and storage medium
CN108932348A (en) Merging treatment method, apparatus, block chain node and the storage medium of block chain
WO2022088606A1 (en) Gbdt and lr fusion method and apparatus based on federated learning, device, and storage medium
CN112069550B (en) Electronic contract evidence-storing system based on intelligent contract mode
CN109684519B (en) Decentralized chip research and development transaction data storage method and system based on block chain
CN109379343A (en) A kind of the isomery common recognition method and terminal of block chain
CN109858852A (en) A kind of warehouse receipt verification method based on block chain and zero-knowledge proof
CN111311211A (en) Data processing method and device based on block chain
Harshavardhan et al. Blockchain technology in cloud computing to overcome security vulnerabilities
CN108881387A (en) A kind of block chain common recognition system
CN110868286A (en) Method for generating random number based on block chain intelligent contract
CN113902384A (en) Tracing method and system based on RFID and intelligent contract
CN112100667A (en) Charity organization supervision and management method based on novel block chain structure
CN108334307A (en) Data screening method and apparatus based on block chain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant