CN108363561B - Data screening method and device based on block chain - Google Patents

Data screening method and device based on block chain Download PDF

Info

Publication number
CN108363561B
CN108363561B CN201711487166.0A CN201711487166A CN108363561B CN 108363561 B CN108363561 B CN 108363561B CN 201711487166 A CN201711487166 A CN 201711487166A CN 108363561 B CN108363561 B CN 108363561B
Authority
CN
China
Prior art keywords
commitment
data
random number
group
submitted
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.)
Active
Application number
CN201711487166.0A
Other languages
Chinese (zh)
Other versions
CN108363561A (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 Oracle Chain Technology Co ltd
Original Assignee
Beijing Oracle 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 Oracle Chain Technology Co ltd filed Critical Beijing Oracle Chain Technology Co ltd
Priority to CN201711487166.0A priority Critical patent/CN108363561B/en
Publication of CN108363561A publication Critical patent/CN108363561A/en
Application granted granted Critical
Publication of CN108363561B publication Critical patent/CN108363561B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F7/588Random number generators, i.e. based on natural stochastic processes
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C15/00Generating random numbers; Lottery apparatus
    • G07C15/006Generating random numbers; Lottery apparatus electronically

Abstract

The embodiment of the invention provides a data screening method and device based on a block chain, wherein the method comprises the following steps: receiving data commitments submitted by a plurality of data providers, dividing the data commitments into commitment groups according to random number numbers carried in the data commitments, storing the commitment groups into a block chain, receiving source random numbers to be submitted in the data commitments, and storing the source random numbers into the block chain; performing commitment verification on the source random number by taking the commitment group as a unit; and if all the calculated commitment values in the commitment group are the same as the commitment values in the data commitment, accepting the source random number in the commitment group as the source random number required for calculating one random number. The scheme of the embodiment of the invention can prevent the source random number submitted by an individual data provider from being submitted after monitoring the source random numbers uploaded by other data providers, and has the possibility of cheating, thereby ensuring the randomness of the random number generated based on the source random number.

Description

Data screening method and device based on block chain
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data screening method and apparatus based on a block chain.
Background
In a traditional network environment, random numbers are generated by respective hardware environments, but in a blockchain environment, a trust mechanism is lacked between each node and each account, so that the randomness of the random numbers provided by any node and any account cannot be trusted.
Random numbers are data resources, and have applications in many fields, for example, in mechanisms such as drawing lots among a plurality of subjects or random allocation. Such as motor vehicle purchase wages, group draw for games, lottery tickets, etc., which use random numbers.
The most important characteristic of random numbers is to ensure the randomness of generation, which cannot be controlled by anyone. If a node provides a purposeful random number that is generated without the random number but with certain information, the random number may affect the result of the final application.
For example, a node may generate a random number for which favorable results are obtained through a limited number of experiments, which is also unfair.
Disclosure of Invention
The invention provides a data screening method and device based on a block chain, which can prevent the possibility of cheating caused by the fact that source random numbers submitted by individual data providers are submitted after monitoring source random numbers uploaded by other data providers, and therefore the randomness of random numbers generated based on the source random numbers is ensured.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, a data screening method based on a block chain is provided, including:
receiving data commitments submitted by a plurality of data providers, wherein the data commitments carry commitment values and random number numbers, which are obtained by calculating source random numbers corresponding to the source random numbers to be submitted by the data providers through an irreversible algorithm, and the random number numbers are used for identifying different random numbers to be generated based on the source random numbers;
dividing the data commitments into commitment groups according to the random number numbers, and storing the commitment groups into a block chain, wherein each random number corresponds to one commitment group, and each commitment group comprises the data commitment with the appointed number;
receiving source random numbers to be submitted in the data commitments submitted by the plurality of data providers, and storing the source random numbers into a block chain;
performing commitment verification on the source random number submitted by the data provider in each commitment group by using the commitment group as a unit through the irreversible algorithm;
if the commitment is verified: and if all the calculated commitment values in the commitment group are the same as the commitment values in the data commitment submitted by the data provider, accepting the source random number submitted by the data provider in the commitment group as the source random number required for calculating one random number.
In a second aspect, a data filtering apparatus based on a block chain is provided, including:
a commitment receiving module, configured to receive data commitments submitted by multiple data providers, where the data commitments carry commitment values and random number numbers, which are obtained by calculating, by an irreversible algorithm, source random numbers corresponding to source random numbers to be submitted by the data providers, and the random number numbers are used to identify different random numbers to be generated based on the source random numbers;
the commitment storage module is used for dividing each data commitment into commitment groups according to the random number numbers and storing the commitment groups into a block chain, wherein each random number corresponds to one commitment group, and each commitment group comprises the data commitment with the appointed number;
a source random number storage module, configured to receive source random numbers to be submitted in the data commitments submitted by the multiple data providers, and store the source random numbers in a block chain;
the commitment verification module is used for carrying out commitment verification on the source random number submitted by the data provider in each commitment group through the irreversible algorithm by taking the commitment group as a unit;
if the commitment is verified: and if all the calculated commitment values in the commitment group are the same as the commitment values in the data commitment submitted by the data provider, accepting the source random number submitted by the data provider in the commitment group as the source random number required for calculating one random number.
According to the data screening method and device based on the block chain, provided by the invention, commitment verification is carried out on the source random numbers submitted by the data providers in a data commitment mode, so that the source random numbers submitted by the individual data providers are prevented from being submitted after monitoring the source random numbers uploaded by other data providers, and the possibility of cheating exists, and the randomness of the random numbers generated based on the source random number calculation is ensured.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a logic diagram illustrating the generation of random numbers according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the screening of source random numbers for calculating random numbers according to an embodiment of the present invention;
fig. 3 is a flowchart of a block chain-based data screening method according to an embodiment of the present invention;
fig. 4 is a flowchart of a block chain-based data screening method according to an embodiment of the present invention;
fig. 5 is a flow chart of a block chain-based data screening method according to an embodiment of the present invention;
fig. 6 is a first schematic structural diagram of a block chain-based data screening apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a data screening apparatus based on a blockchain according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram three of a data screening apparatus based on a block chain according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
According to the scheme, the defect that in the prior art, the generation of the random number is generated by respective hardware environments of data providers, but in the block chain environment, due to the fact that a trust mechanism is lacked between each node and each account, the randomness of the random number provided by any one node and any one account cannot be trusted is overcome. The core idea is that based on source random numbers submitted by various data providers, the source random numbers are calculated through an irreversible algorithm, and a final random number is generated.
Fig. 1 is a schematic diagram of a logic for generating a random number according to an embodiment of the present invention. The generation logic is to obtain a plurality of source random numbers from a different plurality of data sources, each source random number itself also being randomly generated. And finally obtaining a random number through an irreversible algorithm based on the random numbers.
In the above concept of the scheme for generating random numbers, in principle, as long as one source random number is generated randomly, it can be ensured that the finally obtained random number has better randomness. Therefore, the process of screening the source random numbers for calculating the random numbers is particularly important.
As shown in fig. 2, this embodiment provides a specific scheme for screening source random numbers used for calculating random numbers, that is, screening the source random numbers in a manner of "data commitment + data submission", and combines the screening process with the block chain technique. Firstly, a server receives data commitments submitted by various data providers, wherein the data commitments carry commitment values obtained by calculating source random numbers corresponding to the source random numbers to be submitted by the data providers through an irreversible algorithm and random number numbers used for identifying different random numbers to be generated based on the source random numbers; then, the server divides each data commitment into a plurality of commitment groups according to random number numbers and stores the commitment groups into a block chain; then, the server receives source random numbers to be submitted in previous data commitments submitted by a plurality of data providers, stores the source random numbers into the block chain, and generally processes the block numbers of the submitted data to be greater than the block numbers of the data commitments (the block numbers in the embodiment are all numbered according to the sequence of the generation process of the block chain) based on the sequence of the received data commitments and the corresponding submitted data (including the source random numbers); and finally, taking the commitment group as a unit, carrying out commitment verification on the source random numbers submitted by the data providers in the commitment groups through an irreversible algorithm, and if all the calculated commitment values are the same as the commitment values in the data commitments submitted by the data providers, accepting the source random numbers submitted by the data providers in the commitment group to serve as the source random numbers required for calculating one random number. In the process of screening the random numbers, the commitment of the data and the storage of the source random numbers are carried out through the block chains, so that the non-tamper property of the data is ensured, and the authenticity of the finally screened source random numbers is ensured.
The technical solution of the present application is further illustrated by the following examples.
Example one
Based on the above concept of the scheme of screening the source random number, as shown in fig. 3, it is a flowchart of a block chain-based data screening method shown in the embodiment of the present invention, and the method is mainly executed by a server disposed in a network. As shown in fig. 3, the data screening method based on the blockchain includes the following steps:
s310, receiving data commitments submitted by a plurality of data providers, wherein the data commitments carry commitment values and random number numbers, which are obtained by calculating source random numbers corresponding to source random numbers to be submitted by the data providers through an irreversible algorithm, and the random number numbers are used for identifying different random numbers to be generated based on the source random numbers;
due to network delay and the like, the time when each data provider provides the source random number is not synchronous, and is early or late. In order to prevent the source random numbers submitted by individual data providers from being submitted after monitoring the source random numbers uploaded by other data providers, cheating is possible, so the scheme adopts a mode of 'data commitment + data submission' (referred to as 'data commitment') to limit the data providers to submit the source random numbers so as to ensure that the source random numbers provided by the data providers are provided in advance, and are not provided after learning the source random numbers provided by other data providers.
The submitting of the source random number in a "data commitment" manner means that, before submitting the source random number by each data provider, a data commitment for the source random number to be submitted is submitted first, the content of the data commitment includes a commitment value corresponding to the source random number to be submitted, and the commitment value is obtained after the data provider calculates the source random number to be submitted through the irreversible algorithm and is used for a subsequent server to carry out commitment verification on the received source random number submitted by the data provider.
Meanwhile, in order to well identify the association relationship between each source random number and the random number generated corresponding to the source random number, the data commitment further includes a random number for identifying different random numbers to be generated based on the source random number, and the random number may be labeled in sequence.
In an actual application scenario, the generation process of the block chain is publicly transparent for each data provider in the whole network, and the data provider can actively determine the random number expected to be calculated by the source random number corresponding to the submitted data commitment according to the random number stored in the block being generated in the current block chain grasped by the data provider, and carry the random number of the corresponding random number in the submitted data commitment.
In addition, in order to reflect the association relationship between the commitment value submitted by the data provider and the random number, the data commitment may include the ID of the data provider, the random number and the commitment value at the same time, and the commitment value may be obtained by the data provider directly calculating the source random number to be submitted through the irreversible algorithm, or may be obtained by calculating the source random number to be submitted, the ID of the data provider and the character string spliced by the random number through the irreversible algorithm. The irreversible algorithm may be a hash algorithm, and the calculated commitment value is a hash value.
S320, dividing each data commitment into commitment groups according to random number numbers, and storing the commitment groups into a block chain, wherein each random number corresponds to one commitment group, and each commitment group comprises a specified number of data commitments.
Before calculating the random number, the number of source random numbers required for calculation to obtain one random number may be specified in advance. For example, in the present embodiment, after the data provider submits the data commitment, the received data commitments are divided, and then which source random numbers received in the future are divided in advance to form a group, which is used for calculating one random number.
Specifically, after receiving data commitments submitted by a plurality of data providers, the data commitments may be divided into at least one commitment group, where each commitment group includes a specified number of data commitments, and the specified number is the number of source random numbers required for calculating one random number. Accordingly, the source random number corresponding to each data commitment in each commitment group can be used to generate a random number.
Based on the correspondence between the source random number and the random number generated by the source random number, after receiving the data commitment submitted by the data provider, the server can divide the data commitments belonging to the same random number into commitment groups according to the random number numbers carried in the data commitments, wherein each random number corresponds to one commitment group, and each commitment group comprises the data commitment with the appointed number. Therefore, the one-to-one correspondence between the source random number corresponding to each commitment group and the random number generated correspondingly to the source random number can be well distinguished. For convenience of operation, all data commitments belonging to the same commitment group are stored in one block when forming the commitment group. In other words, the data commitments stored in the blockchain are all stored in the manner of a commitment group.
S330, receiving source random numbers to be submitted in data commitments submitted by a plurality of data providers, and storing the source random numbers into a block chain.
After each data provider submits the data commitment, each data provider provides the source random number corresponding to the commitment value in the data commitment to the server. And after receiving the source random numbers submitted by each data provider, the server stores the original random numbers into the block chain. Based on the sequence of receiving a data commitment and its corresponding commit data (including the source random number), the block number for processing the commit data is generally greater than the block number of the data commitment.
In an actual application scenario, except for the root block, any block in a block chain may store the data commitment with the block number pointing to the current block, or may store the commit data corresponding to the data commitment with the block number pointing to the block before the current block. However, since the data provider will submit the submitted data corresponding to the data commitment immediately after submitting the data commitment, the block number for processing the submitted data is not much greater than the block number of the data commitment (generally, 1-2 blocks are delayed). If the block number of the submitted data is more than the block number of the data acceptance, the data provider who submits the submitted data is likely to monitor the source random number submitted by other data providers and then upload the submitted data, and a large cheating suspicion exists.
And S340, taking the commitment group as a unit, and carrying out commitment verification on the source random number submitted by the data provider in each commitment group through an irreversible algorithm.
After the server receives the source random numbers submitted by the data providers, the source random numbers can be grouped according to the commitment groups in which the data commitments corresponding to the source random numbers are located, and the commitment groups are taken as units to carry out commitment verification on the source random numbers corresponding to the data commitments submitted by the data providers in the commitment groups.
Specifically, all source random numbers corresponding to each commitment group are respectively calculated by the irreversible algorithm to obtain a commitment value, and the commitment value is compared with a commitment value in a data commitment submitted by a previous data provider to complete commitment verification.
S350, if the commitment is verified, determining: and if all the calculated commitment values in the commitment group are the same as the commitment values in the data commitment submitted by the data provider, the source random number submitted by the data provider in the commitment group is accepted as the source random number required for calculating one random number.
Specifically, the method includes calculating, by the irreversible algorithm, a commitment value for all source random numbers corresponding to each commitment group, and if the commitment value is the same as a commitment value in a data commitment submitted by a previous data provider, indicating that the source random numbers submitted by the data providers in the commitment group are valid, and the server may accept the source random numbers submitted by the data providers in the commitment group as a source random number required for calculating one random number.
Of course, after step S340, the following steps may also be performed:
if the commitment is verified: and if at least one commitment value in the calculated commitment group corresponds to a different commitment value in the data commitment submitted by the data provider, rejecting the source random number submitted by the data provider in the commitment group.
Specifically, all source random numbers corresponding to each commitment group are respectively calculated by the irreversible algorithm to obtain commitment values, if at least one commitment value exists in the commitment values and the commitment value in the data commitment submitted by the previous data provider is different, it is indicated that the source random numbers submitted by the data provider in the commitment group are all invalid, the server can reject the source random numbers submitted by the data provider in the commitment group, and the source random numbers cannot be used as the source random numbers required for calculating any random number.
When verifying commitments for each commitment group, the fact that at least one commitment value is different from the corresponding commitment value in the data commitments submitted by the previous data provider includes: the data provider submits source random numbers corresponding to all data commitments contained in the commitment group, and at least one commitment value in commitment values obtained by calculating the source random numbers through the irreversible algorithm is different from the commitment value in the data commitment submitted by the previous data provider; or, the data provider does not submit the source random numbers corresponding to all the data commitments included in the commitment group (for example, within a certain time period after the commitment group is created, at least one source random number corresponding to the data commitments included in the commitment group and submitted by the data provider is not received), both of the above two cases can cause the commitment verification failure on the commitment group, and the server can directly reject the source random numbers corresponding to the commitment group.
The data screening method based on the block chain provided by the embodiment of the invention combines the block chain technology, and after receiving data commitments submitted by a plurality of data providers, the data commitments can be stored into a block in a commitment group mode according to random number numbers carried in the data commitments; and then carrying out commitment verification on the received source random numbers by taking a commitment group as a unit, and screening the source random numbers for calculating the random numbers. The scheme can prevent the possibility of cheating because the source random number submitted by the individual data provider is submitted after the source random number uploaded by other data providers is monitored, thereby improving the randomness of the result generated by generating the random number; meanwhile, in the process of screening the random numbers, the commitment of the data and the storage of the source random numbers are carried out through the block chains, so that the non-tamper property of the data is ensured, and the authenticity of the finally screened source random numbers is ensured.
Example two
As shown in fig. 4, which is a flowchart of a block chain-based data screening method according to an embodiment of the present invention, the method may be regarded as a specific implementation manner of the method shown in fig. 3, and a process of dividing each data commitment by random number numbers to form commitment groups and storing the commitment groups in a block chain is mainly refined. As shown in fig. 4, the data screening method based on the blockchain includes the following steps:
s410, receiving data commitments submitted by a plurality of data providers, wherein the data commitments carry commitment values and random number numbers, which are obtained by calculating source random numbers corresponding to source random numbers to be submitted by the data providers through an irreversible algorithm, and the random number numbers are used for identifying different random numbers to be generated based on the source random numbers.
This step S410 is the same as the step S310 described above.
S420, determine whether the commitment group corresponding to the random number carried in the received data commitment has been stored in the block chain.
After receiving the data commitment submitted by the data provider, the server compares the random number carried in the data commitment with the random number corresponding to the data commitment in each commitment group stored in the current block chain to determine whether to store the data commitment into the block chain.
If the commitment group corresponding to the random number carried in the received data commitment has been stored in the blockchain, step S430 is executed to discard the data commitment.
Specifically, if the commitment group corresponding to the random number carried in the data commitment has been stored in the blockchain, it indicates that the commitment group corresponding to the random number has been generated and completed, and there is a hysteresis in the operation of the data provider providing the data commitment. Each random number stored on a block chain basis corresponds to only one commitment group, and thus the data commitment can only be discarded.
If the commitment group corresponding to the random number carried in the received data commitment is not stored in the block chain, step S440 is executed to divide the data commitments into commitment groups according to the random number, and store the commitment groups into the block chain, wherein each random number corresponds to one commitment group, and each commitment group comprises a specified number of data commitments.
S450, receiving source random numbers to be submitted in data commitments submitted by a plurality of data providers, and storing the source random numbers into a block chain.
And S460, taking the commitment group as a unit, and performing commitment verification on the source random number submitted by the data provider in each commitment group through an irreversible algorithm.
S470, if the commitment is verified, determining: and if all the calculated commitment values in the commitment group are the same as the commitment values in the data commitment submitted by the data provider, the source random number submitted by the data provider in the commitment group is accepted as the source random number required for calculating one random number.
Steps S440 to S470 correspond to steps S320 to S350 described above.
Based on the embodiment shown in fig. 3, the block chain-based data screening method provided in the embodiment of the present invention compares the random number carried in the data commitment with each random data number stored in the current block chain, and determines whether to store the current data commitment into the block chain according to the comparison result. The scheme effectively ensures that the data commitments in the currently generated blocks are all the data commitments recently submitted by the data provider, and the data commitments meet the willingness of the data provider to calculate which random number the submitted source random number is to be used for, and meanwhile, the real-time performance of the data screening process is improved.
EXAMPLE III
As shown in fig. 5, which is a flow chart of a block chain-based data screening method according to an embodiment of the present invention, the method may be regarded as a specific implementation of the method shown in fig. 3, and the process of committing and verifying each source random number is mainly refined. As shown in fig. 5, the data screening method based on the blockchain includes the following steps:
and S510, receiving data commitments submitted by a plurality of data providers, wherein the data commitments carry commitment values and random number numbers, which are obtained by calculating source random numbers corresponding to source random numbers to be submitted by the data providers through an irreversible algorithm, and the random number numbers are used for identifying different random numbers to be generated based on the source random numbers.
S520, dividing the data commitments into commitment groups according to random number numbers, and storing the commitment groups into a block chain, wherein each random number corresponds to one commitment group, and each commitment group comprises a specified number of data commitments.
Steps S510 to S520 correspond to the same contents as steps S310 to S320.
S530, the index number of the commitment group in the commitment group where the data commitment submitted by the data provider is located is fed back to the data provider.
In order to facilitate management of each commitment group stored in the block chain, and identification of the commitment group and a corresponding relationship between the commitment group and a corresponding data commitment and a source random number, after the commitment group is created, the server sets a commitment group index number uniquely identifying the commitment group for each commitment group (the commitment group index numbers can be sequentially labeled according to the creation order of the commitment group).
After creating a commitment group, the server feeds back a commitment group index number of the commitment group to data providers corresponding to data commitments in the commitment group, so that the data providers control the commitment group in which the data commitments submitted by the data providers are located.
And S540, receiving the source random numbers to be submitted in the data commitments submitted by the plurality of data providers and the commitment group index numbers of the commitment group in which the source random numbers are positioned, and storing the source random numbers and the corresponding commitment group index numbers into the block chain in a correlation manner.
This step is similar to step S330 described above, except that the server receives and stores the source random numbers submitted by a plurality of data providers, and also receives the commitment group index number of the commitment group in which the data commitment corresponding to the source random number submitted by each data provider is located. The server stores the association between the commitment group index number and the source random number in the block chain so as to conveniently identify the association relationship between the source random number and the commitment group.
And S550, searching a source random number corresponding to each commitment group from the block chain according to the commitment group index number, and performing commitment verification through an irreversible algorithm.
Step S550 may be used as a refinement of step S340.
Specifically, when performing commitment verification on the source random numbers corresponding to the data commitments in each commitment group stored in the block chain, the source random numbers corresponding to each commitment group may be searched from the block chain according to the commitment group index number of the commitment group, and then the source random numbers are subjected to commitment verification through an irreversible algorithm. The source random number corresponding to the data commitment is searched through the commitment group index number more conveniently and quickly.
In a specific application scenario, in order to prevent the source random number submitted by an individual data provider from being submitted after monitoring the source random numbers uploaded by other data providers, cheating may occur, and therefore, after the source random number corresponding to each commitment group is found from the block chain according to the commitment group index number, the block number where the commitment group is located and the block number where the source random number is located may be compared first. If the block number of at least one source random number corresponding to the commitment group is greater than and exceeds the preset value of the block number of the commitment group, the commitment verification of the source random number corresponding to the commitment group is abandoned.
In an actual application scenario, except for the root block, any block in a block chain may store the data commitment with the block number pointing to the current block, or may store the commit data corresponding to the data commitment with the block number pointing to the block before the current block. However, since the data provider will submit the submitted data corresponding to the data commitment immediately after submitting the data commitment, the block number for processing the submitted data is not much greater than the block number of the data commitment (generally, 1-2 blocks are delayed). If the block number of the submitted data is more than the block number of the data acceptance, the data provider who submits the submitted data is likely to monitor the source random number submitted by other data providers and then upload the submitted data, and a large cheating suspicion exists. Therefore, if the block number of at least one source random number included in the commitment group corresponding to the commitment group is greater than or exceeds the block number predetermined value (for example, more than 3 blocks after the commitment), the source random number submitted by the data provider is considered to have cheating suspicion, the corresponding server determines that the source random number of the whole commitment group is invalid, and gives up the commitment verification of the source random number corresponding to the commitment group.
Of course, if it is determined after the comparison between the block number of the commitment group and the block number of the source random number, that there is no cheating possibility in any source random number, the server may take the commitment group as a unit and continue to perform commitment verification on the source random numbers submitted by the data providers in the commitment groups through an irreversible algorithm.
S560, if the commitment is verified: and if all the calculated commitment values in the commitment group are the same as the commitment values in the data commitment submitted by the data provider, the source random number submitted by the data provider in the commitment group is accepted as the source random number required for calculating one random number.
This step S560 is the same as the step S350 described above.
Based on the embodiment shown in fig. 3, the block chain-based data screening method provided in the embodiment of the present invention allocates a commitment group index number to each commitment group, and issues the commitment group index number to each data provider in each corresponding commitment group, so that the data provider carries the commitment group index number when submitting a source random number, thereby facilitating a server to identify the commitment group to which each source random number belongs, quickly implementing commitment verification of the source random number corresponding to each commitment group, and improving processing efficiency.
Example four
Fig. 6 is a schematic structural diagram of a block chain-based data screening apparatus according to an embodiment of the present invention, which may be a server disposed in a network, for performing the method steps shown in fig. 3. As shown in fig. 6, the block chain-based data filtering apparatus includes:
a commitment receiving module 610, configured to receive data commitments submitted by multiple data providers, where the data commitments carry commitment values and random number numbers, which are obtained by calculating, through an irreversible algorithm, source random numbers corresponding to source random numbers to be submitted by the data providers, and the random number numbers are used to identify different random numbers to be generated based on the source random numbers;
a commitment storage module 620, configured to divide each data commitment into commitment groups according to random number numbers, and store the commitment groups into a block chain, where each random number corresponds to one commitment group, and each commitment group includes a specified number of data commitments;
a source random number storage module 630, configured to receive source random numbers to be submitted in data commitments submitted by multiple data providers, and store the source random numbers in a block chain;
the commitment verification module 640 is configured to perform commitment verification on the source random numbers submitted by the data providers in each commitment group through an irreversible algorithm by using the commitment group as a unit;
if the commitment is verified: and if all the calculated commitment values in the commitment group are the same as the commitment values in the data commitment submitted by the data provider, the source random number submitted by the data provider in the commitment group is accepted as the source random number required for calculating one random number.
Further, as shown in fig. 7, on the basis of the apparatus shown in fig. 6, the apparatus may further include:
a block number determining module 710, configured to determine whether a commitment group corresponding to a random number carried in a received data commitment has been stored in a block chain;
if it is already stored in the blockchain, the commitment storage module 620 is triggered to discard the data commitment;
if the data commitments are not stored in the blockchain, the commitment storage module 620 is triggered to execute the step of dividing each data commitment into commitment groups according to the random number and storing the commitment groups into the blockchain.
The device structure shown in fig. 7 may be used to perform the method steps shown in fig. 4.
Further, as shown in fig. 8, on the basis of the apparatus shown in fig. 6, the apparatus may further include:
the index number feedback module 810 is configured to feed back, to the data provider, the commitment group index number of the commitment group in which the data commitment submitted by the data provider is located;
correspondingly, the source random number storage module 630 is further configured to, in the process of receiving a source random number to be submitted in a data commitment submitted by a plurality of data providers, synchronously receive a commitment group index number of a commitment group in which the source random number submitted by the data providers is located, and store the source random number and the corresponding commitment group index number in a block chain in an associated manner.
Further, the commitment verifying module 640 is configured to search a source random number corresponding to each commitment group from the block chain according to the commitment group index number, and perform commitment verification through an irreversible algorithm.
Further, the block number determining module 710 is further configured to trigger the commitment verifying module 640 to abort the commitment verification of the source random number corresponding to the commitment group if the block number of the at least one source random number included in the commitment group corresponding to the commitment group is greater than or exceeds the predetermined value of the block number of the commitment group.
The device structure shown in fig. 8 may be used to perform the method steps shown in fig. 5.
The data screening device based on the block chain provided by the embodiment of the invention combines the block chain technology, and after receiving data commitments submitted by a plurality of data providers, the data commitments can be stored into a block in a commitment group mode according to random number numbers carried in the data commitments; and then carrying out commitment verification on the received source random numbers by taking a commitment group as a unit, and screening the source random numbers for calculating the random numbers. The scheme can prevent the possibility of cheating because the source random number submitted by the individual data provider is submitted after the source random number uploaded by other data providers is monitored, thereby improving the randomness of the result generated by generating the random number; meanwhile, in the process of screening the random numbers, the commitment of the data and the storage of the source random numbers are carried out through the block chains, so that the non-tamper property of the data is ensured, and the authenticity of the finally screened source random numbers is ensured.
Further, the random number carried in the data commitment is compared with each random data number stored in the current block chain, and whether the current data commitment is stored in the block chain is determined according to the comparison result. The scheme effectively ensures that the data commitments in the currently generated blocks are all the data commitments recently submitted by the data provider, and the data commitments meet the willingness of the data provider to calculate which random number the submitted source random number is to be used for, and meanwhile, the real-time performance of the data screening process is improved.
Furthermore, by allocating the commitment group index number to each commitment group and issuing the commitment group index number to each data provider in each corresponding commitment group, the data provider carries the commitment group index number when submitting the source random number, so that the server can conveniently identify the commitment group to which each source random number belongs, the commitment verification of the source random number corresponding to each commitment group is quickly realized, and the processing efficiency is improved.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (4)

1. A data screening method based on a block chain is characterized by comprising the following steps:
receiving data commitments submitted by a plurality of data providers, wherein the data commitments carry commitment values and random number numbers, which are obtained by calculating source random numbers corresponding to the source random numbers to be submitted by the data providers through an irreversible algorithm, and the random number numbers are used for identifying different random numbers to be generated based on the source random numbers;
dividing the data commitments into commitment groups according to the random number numbers, and storing the commitment groups into a block chain, wherein each random number corresponds to one commitment group, and each commitment group comprises the data commitment with the appointed number;
receiving source random numbers to be submitted in the data commitments submitted by the plurality of data providers, and storing the source random numbers into a block chain;
performing commitment verification on the source random number submitted by the data provider in each commitment group by using the commitment group as a unit through the irreversible algorithm;
if the commitment is verified: if all the calculated commitment values in the commitment group are the same as the commitment values in the data commitment submitted by the data provider, the source random number submitted by the data provider in the commitment group is accepted as the source random number required for calculating one random number,
after dividing each data commitment according to the random number to form a commitment group and storing the commitment group into a block chain, the method further comprises the following steps:
feeding back the commitment group index number of the commitment group in which the data commitment submitted by the data provider is located to the data provider;
in the process of receiving the source random numbers to be submitted in the data commitments submitted by the plurality of data providers, synchronously receiving commitment group index numbers of a commitment group in which the source random numbers submitted by the data providers are positioned, and storing the source random numbers and the corresponding commitment group index numbers into a block chain in an associated manner,
the verifying commitment of the source random number submitted by the data provider in each commitment group by the irreversible algorithm by taking the commitment group as a unit comprises:
searching the source random number corresponding to each commitment group from the block chain according to the commitment group index number, and carrying out commitment verification by the irreversible algorithm,
after finding the source random number corresponding to each commitment group from the block chain according to the commitment group index number, the method further comprises:
if the block number of at least one source random number corresponding to the commitment group is greater than and exceeds the preset value of the block number of the commitment group, the commitment verification of the source random number corresponding to the commitment group is abandoned.
2. The method of claim 1, wherein before dividing each of the data commitments into commitment groups according to the random number, storing the commitments into block chains, further comprising:
judging whether the commitment group corresponding to the random number carried in the received data commitment is stored in a block chain;
discarding the data commitment if stored into a blockchain;
and if the data commitments are not stored in the block chain, the step of dividing each data commitment into commitment groups according to the random number and storing the commitment groups into the block chain is executed.
3. A block chain-based data screening device, comprising:
a commitment receiving module, configured to receive data commitments submitted by multiple data providers, where the data commitments carry commitment values and random number numbers, which are obtained by calculating, by an irreversible algorithm, source random numbers corresponding to source random numbers to be submitted by the data providers, and the random number numbers are used to identify different random numbers to be generated based on the source random numbers;
the commitment storage module is used for dividing each data commitment into commitment groups according to the random number numbers and storing the commitment groups into a block chain, wherein each random number corresponds to one commitment group, and each commitment group comprises the data commitment with the appointed number;
a source random number storage module, configured to receive source random numbers to be submitted in the data commitments submitted by the multiple data providers, and store the source random numbers in a block chain;
the commitment verification module is used for carrying out commitment verification on the source random number submitted by the data provider in each commitment group through the irreversible algorithm by taking the commitment group as a unit;
if the commitment is verified: if all the calculated commitment values in the commitment group are the same as the commitment values in the data commitment submitted by the data provider, the source random number submitted by the data provider in the commitment group is accepted as the source random number required for calculating one random number;
the index number feedback module is used for feeding back the commitment group index number of the commitment group in which the data commitment is submitted to the data provider;
the source random number storage module is further configured to, in a process of receiving a source random number to be submitted in the data commitments submitted by the plurality of data providers, synchronously receive a commitment group index number of a commitment group in which the source random number submitted by the data providers is located, and store the source random number and a corresponding commitment group index number in a block chain in an associated manner,
the commitment verification module is used for searching the source random number corresponding to each commitment group from the block chain according to the commitment group index number and carrying out commitment verification by the irreversible algorithm,
the block number determining module is further configured to trigger the commitment verifying module to abort the commitment verification of the source random number corresponding to the commitment group if a block number of at least one source random number included in the commitment group corresponding to the commitment group is greater than or exceeds a predetermined value of the block number of the commitment group.
4. The apparatus of claim 3, further comprising:
a block number judgment module, configured to judge whether a commitment group corresponding to the random number carried in the received data commitment has been stored in a block chain;
if the data committed has been stored in the blockchain, triggering the committed storage module to discard the data committed;
if the data commitments are not stored in the block chain, triggering the commitment storage module to execute the step of dividing each data commitment into commitment groups according to the random number and storing the commitments into the block chain.
CN201711487166.0A 2017-12-29 2017-12-29 Data screening method and device based on block chain Active CN108363561B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711487166.0A CN108363561B (en) 2017-12-29 2017-12-29 Data screening method and device based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711487166.0A CN108363561B (en) 2017-12-29 2017-12-29 Data screening method and device based on block chain

Publications (2)

Publication Number Publication Date
CN108363561A CN108363561A (en) 2018-08-03
CN108363561B true CN108363561B (en) 2020-11-20

Family

ID=63010555

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711487166.0A Active CN108363561B (en) 2017-12-29 2017-12-29 Data screening method and device based on block chain

Country Status (1)

Country Link
CN (1) CN108363561B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110990808B (en) * 2019-11-21 2022-04-01 杭州趣链科技有限公司 Notarization number shaking method based on block chain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850984A (en) * 2014-05-13 2015-08-19 电子科技大学 Safe operation method for offline payment of electronic money
CN105825383A (en) * 2016-03-18 2016-08-03 桂林电子科技大学 Random number generation and verification method with both sides in participation
US20170149819A1 (en) * 2015-11-25 2017-05-25 International Business Machines Corporation Resisting replay attacks efficiently in a permissioned and privacy- preserving blockchain network
CN107193490A (en) * 2017-05-16 2017-09-22 北京中星仝创科技有限公司 A kind of distributed data-storage system and method based on block chain
CN107342867A (en) * 2017-07-07 2017-11-10 北京牛链科技有限公司 Signature sign test method and apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850984A (en) * 2014-05-13 2015-08-19 电子科技大学 Safe operation method for offline payment of electronic money
US20170149819A1 (en) * 2015-11-25 2017-05-25 International Business Machines Corporation Resisting replay attacks efficiently in a permissioned and privacy- preserving blockchain network
CN105825383A (en) * 2016-03-18 2016-08-03 桂林电子科技大学 Random number generation and verification method with both sides in participation
CN107193490A (en) * 2017-05-16 2017-09-22 北京中星仝创科技有限公司 A kind of distributed data-storage system and method based on block chain
CN107342867A (en) * 2017-07-07 2017-11-10 北京牛链科技有限公司 Signature sign test method and apparatus

Also Published As

Publication number Publication date
CN108363561A (en) 2018-08-03

Similar Documents

Publication Publication Date Title
CN108390762B (en) Data screening method and device based on block chain
CN108365960B (en) Random number providing method and device
CN109034809B (en) Block chain generation method and device, block chain node and storage medium
CN109542888B (en) Data modification and synchronization method, device, equipment and storage medium of block chain
CN108334307B (en) Data screening method and device based on block chain
CN108334553B (en) Data screening method and device based on block chain
CN115967504A (en) Encrypted malicious traffic detection method and device, storage medium and electronic device
CN111694843B (en) Missing number detection method and device, electronic equipment and storage medium
WO2020082213A1 (en) Network expandability blockchain implementation method
CN108363561B (en) Data screening method and device based on block chain
US20190108416A1 (en) Methods for more effectively moderating one or more images and devices thereof
CN108170403B (en) Data screening method and device
CN115022326A (en) Block chain Byzantine fault-tolerant consensus method based on collaborative filtering recommendation
CN108415686B (en) Account-splitting calculation method and device in random number providing process
Zhang et al. A framework for resource-aware online traffic classification using CNN
CN111813580B (en) Matrix representation-based distributed model training optimization method
Zhao et al. Block cipher identification scheme based on hamming weight distribution
CN114503143A (en) Unifying protocol consensus
CN115037790B (en) Abnormal registration identification method, device, equipment and storage medium
CN107766486A (en) Method, apparatus, computer-readable recording medium and the storage control of randomly drawing sample data
CN114244536A (en) Block chain service processing method, device, equipment and storage medium
CN114048512A (en) Method and device for processing sensitive data
Zhang Data fusion optimization analysis of wireless sensor networks based on joint DS evidence theory and matrix analysis
Cao et al. Prep: Pre-training with temporal elapse inference for popularity prediction
CN110766338A (en) DPOS (distributed data processing) bifurcation prediction model method based on artificial intelligence and EOS (Ethernet over Ethernet) and IO (input/output) of block chain technology

Legal Events

Date Code Title Description
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