CN113157700A - Block chain technology-based rapid drawing/sorting method - Google Patents

Block chain technology-based rapid drawing/sorting method Download PDF

Info

Publication number
CN113157700A
CN113157700A CN202110451727.1A CN202110451727A CN113157700A CN 113157700 A CN113157700 A CN 113157700A CN 202110451727 A CN202110451727 A CN 202110451727A CN 113157700 A CN113157700 A CN 113157700A
Authority
CN
China
Prior art keywords
sorting
block
activity
random number
index
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
CN202110451727.1A
Other languages
Chinese (zh)
Other versions
CN113157700B (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.)
Taiyuan University of Technology
Original Assignee
Taiyuan University of Technology
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 Taiyuan University of Technology filed Critical Taiyuan University of Technology
Priority to CN202110451727.1A priority Critical patent/CN113157700B/en
Publication of CN113157700A publication Critical patent/CN113157700A/en
Application granted granted Critical
Publication of CN113157700B publication Critical patent/CN113157700B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2291User-Defined Types; Storage management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to the technical field of block chains, and provides a block chain technology-based rapid drawing/sorting method, which comprises the following steps: s1, the participant of the drawing/sorting activity randomly selects a drawing/sorting block in the history blocks of the block chain; s2, the event host selects a future T2Taking the block which is output at the moment as an initial drawing/sorting block; creating a drawing/sorting table, starting from an initial block, calculating an index value and a next block for calculating the index value by using the random number in the head of the drawing/sorting block, and calculating the drawing/sorting number according to the index value of each blockSo as to quickly determine all drawing/sorting results, and the sorting method is simple and quick.

Description

Block chain technology-based rapid drawing/sorting method
Technical Field
The invention relates to the technical field of block chains, in particular to a fast drawing/sorting method based on a block chain technology.
Background
In modern society, how to distribute limited resources orderly, effectively and fairly is a subject related to the interest of each person. The drawing and sorting (queuing) are two common modes in the resource allocation process, and exist in a large amount in real life. For example: the game of the study room, the lottery promotion activity of the market, the time-limited second-killing lottery activity of the shopping website, the sports lottery issued by the national sports bureau, the double-color-ball lottery issued by the China welfare lottery issuing management center, the group drawing of the world cup competition team, the lecture sequencing of the American president competitors, and the like. Although these activities may publish some drawing/sorting rules in advance, since the activity host is a centralized operation and maintenance platform, huge manpower and material resources are invested, and on the other hand, the fairness is difficult to guarantee, and organizations or individuals related to interests may earn personal fraud, guard against self-theft, and hackers of third parties may also promote 35274c, probe these resource interests, invade into the system platform, and destroy and modify the drawing/sorting rules.
The block chain (Blockchain) is a decentralized chain data structure, data cannot be tampered and forged in a cryptographic mode, data modification of a single node or even multiple nodes cannot affect data of other more nodes, a random number in a public chain block head cannot be controlled or predicted, the block chain (Blockchain) is an ideal random number source, is applied to drawing/sorting activities, and can realize a quick drawing/sorting method with low supervision cost, openness, fairness and justice.
Disclosure of Invention
The invention overcomes the defects of the prior art, and solves the technical problems that: a block chain technology-based quick drawing/sorting method is provided, and the problems of openness, fairness and justice of drawing/sorting are solved.
In order to solve the technical problems, the invention adopts the technical scheme that: a fast drawing/sorting method based on block chain technology includes the following steps:
s1, the drawing/sorting activity participant arbitrarily selects a drawing/sorting block in the history blocks of the block chain, and the blocks selected by the drawing/sorting activity participants are different;
s2, the event host selects a future T2Taking the block which is output at the moment as an initial drawing/sorting block;
s3, creating a drawing/sorting table, wherein in the drawing/sorting table, all drawing/sorting activity participants are respectively provided with a number;
s4, when the designated initial drawing/sorting block waits for several blocks to be confirmed, extracting the random number N from the block head parameter of the initial drawing/sorting block1Calculating an index value according to the random number, determining the next block participating in index value calculation according to the index value, and repeatedly calculating the index value;
and S5, sorting the participants of the drawing/sorting activity according to the calculation result of the index.
The step S4 specifically includes the following steps:
s401, after the appointed initial drawing/sorting block waits for the confirmation of a plurality of blocks on the chain, extracting a random number N from the block head parameter of the initial drawing/sorting block1Converting it to decimal and then according to the random number N1Calculate the corresponding index Z1And according to the index Z1Finding the corresponding serial number from the drawing/sorting table; deleting the currently calculated row information of the participants of the drawing/sorting activities from the drawing/sorting table, and updating the drawing/sorting table;
s402, extracting a random number N from the block head parameter of the drawing/sorting block in the deleted row information in the drawing/sorting table2Converting it to decimal and then according to the random number N2Calculate the corresponding index Z2And according to the index Z2Finding the corresponding serial number from the new drawing/sorting table; deleting the line information of the currently calculated drawing/sorting number from the drawing/sorting table, and updating the drawing/sorting table;
s403, repeating the step S402 until only one row of the drawing sorting table remains;
wherein, the calculation formula of the index is as follows: zn= Nnmod Hn, and, ifZn=0, then Zn= Hn; where Hn = H-N +1, H represents the total number of people participating in the drawing/sorting, N represents the nth block participating in the calculation, NnRepresenting the random number in the nth block involved in the computation.
The block chain is a public chain with a random number parameter and a timestamp parameter in a block header.
In step S3, the serial number of the drawing/sorting block height selected by the participant of the drawing/sorting activity is the serial number of the drawing/sorting block height selected by the participant of the drawing/sorting activity.
The drawing/sorting activity takes the number as the drawing/sorting result.
The participants of the drawing/sorting activity are sorted according to the order in which the drawing/sorting activity participant indexes are found.
Will index ZnAs the ranking number of the drawing/ranking activity participant numbered n, rank the drawing/ranking activity participants.
Compared with the prior art, the invention has the following beneficial effects:
1. the invention is based on the block chain technology, is decentralized, and calculates the drawing/sorting result based on the random number of the unknown block, so that anyone can not cheat, and even if the drawing/sorting host is the drawing/sorting host, the drawing/sorting result can not be predicted or set in advance, thereby realizing a public, fair and fair drawing/sorting method.
2. In the invention, the random number in the block is generated by all nodes in the whole network in a cooperation way, thereby technically ensuring that the drawing/sorting result is more random and fair.
3. The invention belongs to a notarization-free hardware-free drawing/sorting method, a third party notarization is not needed, a drawing/sorting device is not needed, and the drawing/sorting cost can be greatly reduced.
4. According to the drawing/sorting method, drawing/sorting participants can freely and autonomously select the heights of the drawing/sorting blocks.
5. According to the drawing/sorting method, the drawing/sorting rule, the drawing/sorting block height, the corresponding relation between the drawing/sorting participant and the selected drawing/sorting block are published before drawing/sorting, any user can check through a block chain browser, and supervision of all parties is facilitated.
6. According to the invention, after the block is confirmed, any user can check the random number in the block head through the block chain browser, so that the drawing/sorting result is calculated, and the supervision of all parties is facilitated.
7. The drawing/sorting method of the invention can quickly determine all drawing/sorting results only by acquiring the random number parameter in a new block.
Drawings
Fig. 1 is a flowchart of a drawing/sorting method based on a block chain technique according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for a drawing/sorting participant to select a drawing/sorting block according to an embodiment of the present invention;
fig. 3 is a flowchart of a method for calculating a drawing/sorting number according to an embodiment of the present invention;
FIG. 4 illustrates the initial lot/sort block calculating the lot/sort number and updating the lot/sort table;
FIG. 5 is a second calculation of a lot/sort number and an update of the lot/sort table;
fig. 6 calculates the third time the drawing/sorting number and the update of the drawing/sorting table;
FIG. 7 is a fourth calculation of the lot/sort number and the update of the lot/sort table;
FIG. 8 is a fifth calculation of a lot/sort number and an update of the lot/sort table;
fig. 9 is a block header parameter diagram of a block chain applied in the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below, and it is obvious that the described embodiments are some embodiments of the present invention, but not all embodiments; all other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Because of the wide variety of block chain technologies, some important details are described for the convenience of understanding the implementation method of the present invention: in a blockchain network, data is permanently recorded in the form of files, called blocks. The new block cannot be changed or deleted any more once the uplink is acknowledged. Each tile records all events that occurred within a period of time before it was created. The parameter information in the block header may include: version number, parent block hash value, Merkle root, timestamp, difficulty value, random number, etc., which the present invention does not specifically limit, but must include a random number and a timestamp. The random number is used to generate a draw/sort number and the time stamp can verify the various times mentioned in the method of the present invention. The block has two identifiers, the hash value of the block header, and the block height. The present invention considers that the tile height is a continuously changing positive integer, which can be specified in advance, and thus is selected as the tile identifier of the present invention.
The basic principle of the fast drawing/sorting method based on the block chain technology is as shown in fig. 1, before starting drawing/sorting, a drawing/sorting event participant selects a drawing/sorting block (height) in a history block of the block chain at will, the event host designates an initial drawing/sorting block (height), and then writes the designated initial drawing/sorting block (height) and all drawing/sorting participant information and the selected corresponding block (height) on the block chain as evidence. Then at T1The information is published to the outside at any moment, and cannot be changed, and all parties can check the published information in the blockchain browser. The initial draw/sort block designated by the event host is the future T2Blocks generated at any moment in time relative to the publication time T1At that moment, it is a block that has not yet been generated. This initial drawing/sorting block is at T3After the time is confirmed by the whole network nodes, the data can not be changed in a bifurcation way, and the lottery/sorting event host can start the lottery/sorting operation. Draw and pickOrdering event host at T4All random numbers in the drawing/sorting block are extracted at all times, and then all drawing/sorting numbers are calculated. On the time axis, T1<T2<T3<T4. The adopted specific methods comprise a method for selecting a drawing/sorting block by a drawing/sorting participant, a method for selecting an initial drawing/sorting block by an event host and a calculation method for drawing/sorting numbers.
Specifically, the fast drawing/sorting method based on the block chain technology provided by the embodiment of the present invention includes the following steps:
and S1, the drawing/sorting activity participant arbitrarily selects a drawing/sorting block in the history blocks of the block chain, and the blocks selected by the drawing/sorting activity participants are different.
S2, the event host selects a future T2The block that is out of the block at that time is used as the initial drawing/sorting block.
S3, creating a drawing/sorting table, wherein in the drawing/sorting table, all drawing/sorting activity participants are respectively provided with a number; in step S3, the serial number of the drawing/sorting block height selected by the participant of the drawing/sorting activity is the serial number of the drawing/sorting block height selected by the participant of the drawing/sorting activity.
S4, when the designated initial drawing/sorting block waits for several blocks to be confirmed, extracting the random number N from the block head parameter of the initial drawing/sorting block1And calculating an index value according to the random number, determining a corresponding sorting number according to the index value, and repeatedly calculating the index value of the next block participating in the calculation of the index value.
The step S4 specifically includes the following steps:
s401, after the appointed initial drawing/sorting block waits for the confirmation of a plurality of blocks on the chain, extracting a random number N from the block head parameter of the initial drawing/sorting block1Converting it to decimal and then according to the random number N1Calculate the corresponding index Z1And according to the index Z1Finding the corresponding serial number from the drawing/sorting table; the currently calculated drawing/arrangingDeleting the row information of the sequence activity participants from the drawing and sorting table, and updating the drawing and sorting table;
s402, extracting a random number N from the block head parameter of the drawing/sorting block in the deleted row information in the drawing/sorting table2Converting it to decimal and then according to the random number N2Calculate the corresponding index Z2And according to the index Z2Finding the corresponding serial number from the new drawing/sorting table; deleting the line information of the currently calculated drawing/sorting number from the drawing/sorting table, and updating the drawing/sorting table;
s403, repeating the step S402 until only one row of the drawing sorting table remains;
wherein, the calculation formula of the index is as follows: zn= Nnmod Hn, and, if Zn=0, then Zn= Hn; where Hn = H-N +1, H represents the total number of people participating in the drawing/sorting, N represents the nth block participating in the calculation, NnRepresenting the random number in the nth block involved in the computation.
And S5, sorting the participants of the drawing/sorting activity according to the calculation result of the index.
The process of the method for selecting the drawing/sorting block by the drawing/sorting participant is shown in fig. 2, the drawing/sorting activity participant can select one drawing/sorting block (height) in the history blocks of the block chain at will, the only requirement is that the selected blocks (heights) cannot be the same, all the blocks must be unique, otherwise the activity host can re-select the same or re-start any selection of a round of blocks. The method for the event host to select the initial drawing/sorting block is simple and selects a future T2The block (height) of the block is reached at that moment.
The event host then sorts the activity according to the order of the selected blocks of the participants of the activity (i.e., the order of the heights of the selected blocks of the drawing/sorting participants from small to large), and then associates the drawing/sorting participants with the drawing/sorting blocks one by one (wherein the number of the drawing/sorting participants is the same as the number of the drawing/sorting blocks, and one drawing/sorting participant corresponds to one drawing/sorting block), as shown in table 1.
Table 1 draw/sort participants and their selected draw/sort blocks
Figure DEST_PATH_IMAGE001
Block _1, Block _2, Block _3,. and Block _ H in table 1 are the drawing/sorting blocks selected by the drawing/sorting participants, and the Block heights are not necessarily continuous, but are certainly arranged in the order from small to large. Then, writing the information of all participants and the selected block on the public chain of the blocks and then publishing, wherein the format is as follows:
Participant_1 Block_1—Participant_2 Block_2—……—Participant_H Block_H—Block_initialization
the last of these is the initial draw/sort block (height) selected for the event host.
Taking the drawing/sorting based on the ether house public link technique as an example, the ether house block-out speed is to take 1 block every 15 seconds on average, i.e. 4 blocks are taken out every minute on average, and 240 blocks are taken out every hour on average. Assuming that the time is 13 pm in 11/20/2018, the current ether house tile height is 6737645, assuming that the host of the drawing/sorting event counts 6 persons participating in the drawing/sorting event, and the host is prepared to plan to generate the initial drawing/sorting tile around 15 pm in 11/20/2018, the tile height of the initial drawing/sorting can be roughly calculated as: 6737645+240x2=6738125, the host may select the initial drawing/sort tile height to be 6738125, or may select nearby, for example, the host may finally select the initial drawing/sort tile height to be 6738120, and the remaining 6 drawing/sort participants may select the drawing/sort tile heights to be: 123456, 880880, 66666, 5840, 1037627, 1000. Then the activity host is sequenced according to the sequence of the block heights from small to large as follows: 1000. 5840, 66666, 123456, 880880, 1037627, and then draw/sort participants are mapped one-to-one to the draw/sort tiles as shown in table 2.
Table 2 draw/sort participants and their selected draw/sort blocks
Figure 571743DEST_PATH_IMAGE002
The name example is only schematically illustrated here, and then the lottery/sorting event host writes all the designated/selected information on the block public chain, and the format of the text information is as follows:
zhang San 1000-Li Si 5840-Wang Wu 66666-Zhao six 123456-Li gang 880880-Zhang Feng 1037627-6738120
When writing in a block public chain, firstly converting text information into UTF-8 codes, then converting the UTF-8 codes into 16-system codes, copying and pasting the codes into a sending option of an Etherhouse wallet, wherein the address of the sent wallet can be random, as the gas transferred by the Etherhouse has an upper limit, the sent data has a limit, only the data which is not more than 44KB can be sent approximately, and for the condition of excessive information, a block writing mode can be adopted. After the transaction is confirmed, the UTF-8 code can be selected below the transaction page of the block of the Etherhouse browser to inquire the text information written into the block.
Once the information is linked up, the lottery/sequencing event sponsor may be at T1The time of day publication, e.g., 13 pm and 30 pm on 11/20/2018, is published to the outside.
Note that: the block 6738125 is the height of the block estimated according to the average speed of the block, and the actual situation may be that the block is taken at any time around 15 pm on 11/20/11/2018, for example: the real block-out time of a block with height 6738125 is 52 minutes 32 seconds at 11/20/14 pm in 2018.
The process of the method for calculating the drawing/sorting number is shown in fig. 3, and the drawing/sorting based on the ether house public link technology is described as an example below, where the initial drawing/sorting block published by the drawing/sorting host is located at T2Blocks are clocked out as shown in table 3.
TABLE 3 initial lot/sort block out time
Figure DEST_PATH_IMAGE003
After each block of the Ethernet is confirmed by the whole network node through 120 blocks by default, the data can not be changed in a branching way, so that the block is confirmed T3Time = T2Time + Ts, Ts is the time when 120 blocks are confirmed by the nodes of the whole network, and the lottery/sorting host is at T3T after time4Only at that moment can the drawing/sorting operation be started, i.e. T3<T4. For example: the time after the 120 tile validation for the initial drawing/sorting tile with height 6738120 is 21 minutes 25 seconds at 15 pm on 11/20/2018, after which the drawing/sorting number is calculated for the initial drawing/sorting tile with height 6738120.
The calculation method of the drawing/sorting number specifically comprises the following steps:
1. a drawing/sorting table is created as shown in table 4. When the designated initial drawing/sorting block waits for the confirmation of a plurality of blocks on the chain, a random number N is extracted from the block head parameters of the initial drawing/sorting block1Converting it to decimal and then according to the random number N1Calculate the corresponding index Z1And according to the index Z1The corresponding drawing/sorting number is obtained from the drawing/sorting table; deleting the line information of the currently calculated drawing/sorting number from the drawing/sorting table, and updating the drawing/sorting table;
table 4 lottery/ordnance table
Figure 426567DEST_PATH_IMAGE004
2. Extracting a random number N from the block header parameter of the extracted extraction/sorting block in the extraction/sorting table2Converting it to decimal and then according to the random number N2Calculate the corresponding index Z2And according to the index Z2Finding the corresponding sorting number from the new drawing/sorting table; numbering the currently calculated drawing/sortingDeleting the row information from the drawing/sorting table, and updating the drawing/sorting table;
and sequentially calculating the subsequent drawing/sorting blocks according to the algorithm until all drawing/sorting numbers are found, namely only one row of the drawing/sorting table is left. The calculation formula of the index corresponding to each block is as follows: zn= Nnmod Hn, and, if Zn=0, then Zn= Hn; where Hn = H-N +1, H represents the total number of people participating in the drawing/sorting, N represents the nth block participating in the calculation, NnRepresenting the random number in the nth block involved in the computation.
In this embodiment, assume that the number of draw/sort participants is H =6, and also assume that the possible draw/sort numbers are 1-6, as shown in the second column of table 4. If there are more than 6 possible draw/sort numbers, the calculation process is the same and is not listed separately. The calculation of 6 drawing/sort numbers will be described below by taking block heights 6738120, 1000, 5840, 66666, 123456, 880880, 1037627 as examples.
The initial draw/sort chunk random number with height 6738120 is: 0xb393d84007562d80, converted to decimal: 12939923923878161792, H1=6, 12939923923878161792 mod 6=0, i.e. with index Z1=6, if the drawing/sorting number corresponding to the index 6 is 6, the calculation result is: the draw/sort participant coded 6 sorts first and then deletes the row of the draw/sort table numbered 6 and updates the draw/sort table as shown in fig. 4.
The height of the draw/sort block deleted from the draw/sort table is: 1037627, extracting random numbers from the block header parameters: 0x86fdc0762c5713f9, converted to decimal: 9727142383972717561, index Z2=9727142383972717561 mod 5=4, the draw/sort table is consulted to know that the draw/sort participant coded 4 is sorted second, and then the row with the draw/sort table number 4 is deleted and the draw/sort table is updated as shown in fig. 5.
The height of the draw/sort block deleted from the draw/sort table is: 123456, extracting random numbers from the block header parameters: 0xf4b883fed83092b2, converted to decimal: 17633989471541170866, index Z3=17633989471541170866 mod 4=0, i.e. with an index Z3=4, look up the draw/sort table, know that the draw/sort participant coded 5 is sorted third, then delete the row with draw/sort table number 5, update the draw/sort table as shown in fig. 6.
The height of the draw/sort block deleted from the draw/sort table is: 880880, extracting random numbers from the block header parameters: 0x2d1f47977b1ffa6b, converted to decimal: 3251396171916114539, index Z4=3251396171916114539mod 3=0, i.e. with an index Z4=3, look up the draw/sort table, know that the draw/sort participant coded 3 ranks fourth, then delete the row with draw/sort table number 3, update the draw/sort table, as shown in fig. 7.
The height of the draw/sort block deleted from the draw/sort table is: 66666, extracting the random number from the block header parameter: 0xfc631df0c04190b2, converted to decimal: 18186412640107073714, index Z5=18186412640107073714mod 2=0, i.e. with an index Z5= 2, look up the draw/sort table, know that draw/sort participant coded 2 sorts the fifth, then delete the row with draw/sort table number 2, update the draw/sort table, as shown in fig. 8. At this time, only one drawing/sorting code 1 remains, and the drawing/sorting participant with code 1 is known to sort sixth.
The final draw/sort number is: 6,4,5,3,2,1. Namely the ranking sequence is as follows: zhang Feng, Zhao Liu, Li Jiang, Wang Wu, Li Si and Zhang san.
In the above embodiments, the participants in the drawing/sorting activity are sorted according to the order in which they were found. In addition, in the embodiment of the invention, when the participants of the drawing/sorting activity are sorted, the index Z can also be sortednAs the ranking number of the drawing/ranking activity participant numbered n, rank the drawing/ranking activity participants. In this case, Zhang three is numbered 6, Li four is numbered 4, Wang five is numbered 5, Zhao six is numberedThe number is 3, the plum steel number is 2, and the Zhang Feng number is 1; the final sequence after finishing was: zhang Feng, Li Jiang, Zhao Liu, Li Si, Wang Wu and Zhang san. Although the above-mentioned final sorting is performed by using different sorting methods, it should be noted that neither method affects the fairness of the present embodiment.
Fig. 9 is a schematic diagram of parameters of block headers of a block chain used in the method for drawing lots and sorting lots according to an embodiment of the present invention, where the parameters of different block chain technologies in each block header may be different, and the present invention is not particularly limited thereto, but the present invention requires that two parameters, namely a random number and a time stamp, be included, where the random number is used to calculate a lot/sort number, and the time stamp can verify T mentioned in the present invention1、T2、T3、T4The time of day. After extracting the random number, if hexadecimal, conversion to decimal is required.
The embodiment of the invention calculates 6 drawing/sorting numbers through random numbers in 7 blocks of the Etherhouse, technically eliminates the possibility of cheating drawing/sorting, and solves the problem that the drawing/sorting of a third-party organization lacks safety, fairness and openness. Moreover, all the drawing/sorting results can be quickly determined only by acquiring the random number parameter in a new block. The sorting method is simple, the calculation process is quick and convenient, and the sorting speed is improved.
It should be noted that, because the essence of the drawing/sorting activity is to randomly assign a number which may occur and is inconsistent with each other to all drawing/sorting participants, the number represents the possible situations of whether to win or not, whether to rank at the order, etc., which is only determined according to the content of the specific drawing/sorting activity and does not affect the essence of the drawing/sorting activity. Wherein in the drawing activity, the number of drawing participants is less than or equal to the total number of possible drawing numbers, and in the sorting activity, the number of sorting participants is equal to the total number of possible sorting numbers. Neither case does affect the practice of the invention.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled 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 invention.

Claims (7)

1. A fast drawing/sorting method based on block chain technology is characterized by comprising the following steps:
s1, the drawing/sorting activity participant arbitrarily selects a drawing/sorting block in the history blocks of the block chain, and the blocks selected by the drawing/sorting activity participants are different;
s2, the event host selects a future T2Taking the block which is output at the moment as an initial drawing/sorting block;
s3, creating a drawing/sorting table, wherein in the drawing/sorting table, all drawing/sorting activity participants are respectively provided with a number;
s4, when the designated initial drawing/sorting block waits for several blocks to be confirmed, extracting the random number N from the block head parameter of the initial drawing/sorting block1Calculating an index value according to the random number, determining the next block participating in index value calculation according to the index value, and repeatedly calculating the index value;
and S5, sorting the participants of the drawing/sorting activity according to the calculation result of the index.
2. The method as claimed in claim 1, wherein the step S4 comprises the following steps:
s401, after the appointed initial drawing/sorting block waits for the confirmation of a plurality of blocks on the chain, extracting a random number N from the block head parameter of the initial drawing/sorting block1Converting it to decimal and then according to the random number N1Calculate the corresponding index Z1And according to the indexZ1Finding the corresponding serial number from the drawing/sorting table; deleting the currently calculated row information of the participants of the drawing/sorting activities from the drawing/sorting table, and updating the drawing/sorting table;
s402, extracting a random number N from the block head parameter of the drawing/sorting block in the deleted row information in the drawing/sorting table2Converting it to decimal and then according to the random number N2Calculate the corresponding index Z2And according to the index Z2Finding the corresponding serial number from the new drawing/sorting table; deleting the line information of the currently calculated drawing/sorting number from the drawing/sorting table, and updating the drawing/sorting table;
s403, repeating the step S402 until only one row of the drawing sorting table remains;
wherein, the calculation formula of the index is as follows: zn= Nnmod Hn, and, if Zn=0, then Zn= Hn; where Hn = H-N +1, H represents the total number of people participating in the drawing/sorting, N represents the nth block participating in the calculation, NnRepresenting the random number in the nth block involved in the computation.
3. The method as claimed in claim 1, wherein the blockchain is a public chain having a random number parameter and a time stamp parameter in a blockhead.
4. The fast drawing/sorting method based on blockchain technology as claimed in claim 1, wherein in step S3, the serial number of the drawing/sorting block height selected by the number of the drawing/sorting activity participant is selected.
5. The method as claimed in claim 1, wherein the drawing/sorting activity uses a number as the drawing/sorting result.
6. A fast drawing/sorting method based on blockchain technology according to claim 1, characterized in that the drawing/sorting activity participants are sorted according to the order in which the drawing/sorting activity participant indexes are found.
7. The fast drawing/sorting method based on block chain technology as claimed in claim 1, wherein the index Z isnAs the ranking number of the drawing/ranking activity participant numbered n, rank the drawing/ranking activity participants.
CN202110451727.1A 2021-04-26 2021-04-26 Quick lottery/sequencing method based on block chain technology Active CN113157700B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110451727.1A CN113157700B (en) 2021-04-26 2021-04-26 Quick lottery/sequencing method based on block chain technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110451727.1A CN113157700B (en) 2021-04-26 2021-04-26 Quick lottery/sequencing method based on block chain technology

Publications (2)

Publication Number Publication Date
CN113157700A true CN113157700A (en) 2021-07-23
CN113157700B CN113157700B (en) 2024-05-14

Family

ID=76870680

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110451727.1A Active CN113157700B (en) 2021-04-26 2021-04-26 Quick lottery/sequencing method based on block chain technology

Country Status (1)

Country Link
CN (1) CN113157700B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114726534A (en) * 2022-03-28 2022-07-08 海南格子山网络科技有限公司 Method for realizing intelligent contract drawing based on Solana block chain technology

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002352037A (en) * 2001-05-23 2002-12-06 Ntt Data Corp Ranking method, lot drawing server, terminal, and program
CN105740440A (en) * 2016-02-01 2016-07-06 上海凭安网络科技有限公司 Indexing method for quickening block chain query
CN107103097A (en) * 2017-05-22 2017-08-29 中链科技有限公司 Drawing method and terminal device based on block chain technology
CN109918044A (en) * 2019-02-26 2019-06-21 太原理工大学 A kind of lot/sort method based on block chain technology
GB202009798D0 (en) * 2020-06-26 2020-08-12 Nchain Holdings Ltd Methods and devices for validating data in a blockchain network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002352037A (en) * 2001-05-23 2002-12-06 Ntt Data Corp Ranking method, lot drawing server, terminal, and program
CN105740440A (en) * 2016-02-01 2016-07-06 上海凭安网络科技有限公司 Indexing method for quickening block chain query
CN107103097A (en) * 2017-05-22 2017-08-29 中链科技有限公司 Drawing method and terminal device based on block chain technology
CN109918044A (en) * 2019-02-26 2019-06-21 太原理工大学 A kind of lot/sort method based on block chain technology
GB202009798D0 (en) * 2020-06-26 2020-08-12 Nchain Holdings Ltd Methods and devices for validating data in a blockchain network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李佩丽;徐海霞;马添军;穆永恒;: "可更改区块链技术研究", 密码学报, no. 05 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114726534A (en) * 2022-03-28 2022-07-08 海南格子山网络科技有限公司 Method for realizing intelligent contract drawing based on Solana block chain technology

Also Published As

Publication number Publication date
CN113157700B (en) 2024-05-14

Similar Documents

Publication Publication Date Title
CN109872152B (en) Block chain consensus method based on share authorization certification mechanism and related equipment
CN109985389B (en) Cheating-preventing method and system for card games based on intelligent block chain contracts
CN109743173A (en) Go out block node in block chain and determines method, block verification method and block catenary system
CN109918044B (en) Block chain technology-based drawing/sorting method
CN107103097A (en) Drawing method and terminal device based on block chain technology
CN106372533A (en) Block chain technology-based content storage method
CN108600161A (en) A kind of fair efficient block chain common recognition method
CN108365960B (en) Random number providing method and device
MX2011009462A (en) Method and device for extracting relationship circle of members in social network service (sns) network.
CN110474818B (en) Block chain network sniffer, network sniffing method and optimization method
Braverman et al. Mafia: A theoretical study of players and coalitions in a partial information environment
CN112468255B (en) Block link point time synchronization method based on network consensus and VRF algorithm
CN111935207A (en) Block chain system consensus method based on improved C4.5 algorithm
CN108667717A (en) Block chain processing method, medium, device and computing device based on instant communication message record
CN110855432A (en) Asynchronous BFT &amp; DPOS consensus mechanism for assigning verifier rewards based on verifiable random functions
CN111988137A (en) DPoS (dual port service) consensus method and system based on threshold signature and fair reward
CN113157700A (en) Block chain technology-based rapid drawing/sorting method
CN109087105A (en) For digging the Hash Search method of mine, digging mine machine and block catenary system
CN105141499A (en) Social network relationship recommendation method based on privacy degree and publicity degree
CN110310176A (en) A kind of data ciphering method and device based on block chain network
Ren et al. Pooled mining is driving blockchains toward centralized systems
CN105915442B (en) It is a kind of to reuse the EIM conversation managing methods and system for having group
CN106780062B (en) User group updating method and system based on social network and big data analysis
CN111223227B (en) Target user screening method and device
CN108833483B (en) Packet-based DPOS proxy node selection method

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