CN108964879B - Lottery drawing method, consensus method, device and storage medium - Google Patents

Lottery drawing method, consensus method, device and storage medium Download PDF

Info

Publication number
CN108964879B
CN108964879B CN201810806721.XA CN201810806721A CN108964879B CN 108964879 B CN108964879 B CN 108964879B CN 201810806721 A CN201810806721 A CN 201810806721A CN 108964879 B CN108964879 B CN 108964879B
Authority
CN
China
Prior art keywords
consensus
random number
node
random numbers
held
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
CN201810806721.XA
Other languages
Chinese (zh)
Other versions
CN108964879A (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.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei 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 Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN201810806721.XA priority Critical patent/CN108964879B/en
Publication of CN108964879A publication Critical patent/CN108964879A/en
Application granted granted Critical
Publication of CN108964879B publication Critical patent/CN108964879B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Power Engineering (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention designs a drawing method, which comprises the steps of freezing a certain number of assets to obtain the qualification of a first random number with the number corresponding to the assets; secondly, generating seed information according to a plurality of second random numbers of the first N blocks, wherein N is a positive integer; generating a first random number according to the seed information; judging whether the current node is selected as a member of the consensus committee or not according to the held first random number and the preconfigured difficulty value; and finally, broadcasting the held first random number, receiving the first random numbers broadcast by other nodes, sequencing the held first random number and the first random numbers broadcast by other nodes, and dividing the consensus committee members corresponding to the first random numbers in the sequencing result into accounting nodes and consensus nodes according to a pre-configured rule, so that the consensus committee members are composed of different nodes in each round of consensus, and the problem that the consensus committee members damage the benefits of other nodes in order to obtain the benefits and carry out the collusion is solved.

Description

Lottery drawing method, consensus method, device and storage medium
Technical Field
The invention relates to the technical field of block chains, in particular to a drawing method, a consensus method, equipment and a storage medium.
Background
In the existing block chain network, because the number of nodes is large, each block can only pack less transaction information. In order to improve the performance of the number of packed transactions per second in a blockchain network, the conventional solution is to select a fixed number of super nodes with strong public confidence to form a consensus committee. The super node is used as a member of a consensus committee to perform operations such as consensus on transaction information and block generation. Because the super node is fixed and unchangeable, theoretically, anyone has no way to ensure that the super node does not collude for the benefit and damage the benefit of other nodes.
In view of the foregoing, there is a need to provide a method for successfully preventing the members of the consensus committee from colluding and damaging the benefits of other nodes.
Disclosure of Invention
Accordingly, the present invention provides a drawing method that solves or partially solves the above mentioned problems.
In a first aspect, the present invention provides a drawing method, including:
freezing a number of assets to qualify for a corresponding number of first random numbers for the assets;
generating seed information according to a plurality of second random numbers of the first N blocks, wherein N is a positive integer;
generating a first random number according to the seed information;
judging whether the current node is selected as a member of a consensus committee or not according to the held first random number and a pre-configured difficulty value;
broadcasting the held first random number, receiving the first random numbers broadcast by other nodes, sequencing the held first random number and the first random numbers broadcast by other nodes, and dividing the members of the consensus committee corresponding to each first random number in the sequencing result into an accounting node and a consensus node according to a pre-configured rule.
In a second aspect, the present invention further provides a consensus method, including:
and (4) generating a block after performing two-stage voting operation by using a BFT consensus algorithm.
In a third aspect, the present invention also provides an apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform a drawing method and a consensus method provided according to embodiments of the present invention.
In a fourth aspect, the present invention also provides a storage medium storing a computer program, the computer program causing a computer to execute the drawing method and the consensus method according to the embodiments of the present invention.
The beneficial results of the invention are as follows:
the invention designs a drawing method, which comprises the steps of freezing a certain number of assets to obtain the qualification of a first random number with the number corresponding to the assets; secondly, generating seed information according to a plurality of second random numbers of the first N blocks, wherein N is a positive integer; generating a first random number according to the seed information; judging whether the current node is selected as a member of the consensus committee or not according to the held first random number and the preconfigured difficulty value; and finally, broadcasting the held first random number, receiving the first random numbers broadcast by other nodes, sequencing the held first random number and the first random numbers broadcast by other nodes, and dividing the consensus committee members corresponding to the first random numbers in the sequencing result into accounting nodes and consensus nodes according to a pre-configured rule, so that the consensus committee members are composed of different nodes in each round of consensus, and the problem that the consensus committee members damage the benefits of other nodes in order to obtain the benefits and carry out the collusion is solved.
The invention designs a consensus method capable of executing the drawing method, and the BFT consensus algorithm is used for generating the blocks after two-stage voting operation, so that the performance of the block chain network for packing transaction quantity per second is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a schematic diagram of a drawing scene according to an embodiment of the present invention.
Fig. 2 is a flowchart of a drawing method according to an embodiment of the present invention.
Fig. 3 is a flowchart of step S13 in the preferred embodiment shown in fig. 1.
Fig. 4 is a flowchart of step S15 in the preferred embodiment shown in fig. 1.
Fig. 5 is a flow chart of a preferred embodiment shown in fig. 1.
Fig. 6 is a flowchart of a consensus method according to an embodiment of the present invention.
Fig. 7 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed description of the invention
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 is a schematic diagram of a drawing scene according to an embodiment of the present invention. As shown in fig. 1, in this embodiment, each time a block is generated by the accounting node, N sorted second random numbers are generated, and the N second random numbers are broadcast to the blockchain network, where N is a positive integer; assuming that N is 5, the accounting node generating the block with the height H is accounting node A, and after generating the block H, accounting node A generates 5 second random numbers in sequence, which are respectively A1, A2, A3, A4 and A5, and broadcasts the 5 second random numbers to the block chain network; generating a block with the height of H +1 as an accounting node B, generating 5 second random numbers which are respectively B1, B2, B3, B4 and B5 and are sorted after the accounting node B generates the block H +1, and broadcasting the 5 second random numbers to the block chain network; generating a block with the height of H +2 as an accounting node C, generating 5 second random numbers which are respectively C1, C2, C3, C4 and C5 after the accounting node C generates the block H +2, and broadcasting the 5 second random numbers to the block chain network; generating a block with the height of H +3 as an accounting node D, generating 5 second random numbers which are respectively D1, D2, D3, D4 and D5 after the accounting node D generates the block H +3, and broadcasting the 5 second random numbers to the block chain network; generating a block with the height of H +4 as an accounting node E, generating 5 second random numbers which are respectively E1, E2, E3, E4 and E5 after the accounting node E generates the block H +4, and broadcasting the 5 second random numbers to the block chain network;
fig. 2 is a flowchart of a drawing method according to an embodiment of the present invention. As shown in fig. 2, in this embodiment, the present invention provides a drawing method, including:
s11: freezing a number of assets to qualify for a corresponding number of first random numbers for the assets;
s13: generating seed information according to a plurality of second random numbers of the first N blocks, wherein N is a positive integer;
s15: generating a first random number according to the seed information;
s17: judging whether the current node is selected as a member of a consensus committee or not according to the held first random number and a pre-configured difficulty value;
s19: broadcasting the held first random number, receiving the first random numbers broadcast by other nodes, sequencing the held first random number and the first random numbers broadcast by other nodes, and dividing the members of the consensus committee corresponding to each first random number in the sequencing result into an accounting node and a consensus node according to a pre-configured rule.
Specifically, taking the application scenario shown in fig. 1 as an example, assuming that the asset is an asset token, every 10000 asset tokens frozen can be qualified to obtain 1 first random number; assuming node F has 10000 asset tokens, the first random number held by node F is less than the preconfigured difficulty value.
In step S11, node F freezes 10000 asset tokens, node F qualifies for 1 random number;
in step S13, the node F generates seed information according to a plurality of second random numbers of the first 5 blocks;
in step S15, the node F generates a first random number according to the seed information;
in step S17, the node F determines whether the current node is selected as a member of the consensus committee according to the held first random number and the preconfigured difficulty value; node F is selected as a consensus committee member because the held first random number of node F is less than the preconfigured difficulty value.
In step S19, the node F broadcasts the held first random number, receives the first random numbers broadcast by other nodes, sorts the held first random number and the first random numbers broadcast by other nodes, and divides the consensus committee members corresponding to each first random number in the sorted result into the accounting node and the consensus node according to the pre-configured rule.
Fig. 3 is a flowchart of step S13 in the preferred embodiment shown in fig. 2. As shown in fig. 3, in a preferred embodiment, step S13 includes:
s131: acquiring a plurality of second random numbers of the first N blocks;
s133: and performing hash operation on the obtained plurality of second random numbers after combination operation to obtain seed information, wherein each second random number can only be used for generating one piece of seed information.
Specifically, taking the application scenario shown in fig. 1 as an example, assume that the current block height is H + 5.
In step S131, the node F obtains a plurality of second random numbers for generating the first 5 blocks, for example, the second random numbers on the diagonal of the block with the block height H to the block with the block height H + 4: a5, B4, C3, D2, E1;
in step S133, the node F performs a hash operation after combining and operating the acquired plurality of second random numbers, and obtains seed information seed, which is sha256(a5+ B4+ C3+ D2+ E1).
It should be noted that, in the current embodiment, the hash operation uses a sha256() algorithm, and the seed information is a second random number on a diagonal line of the first 5 blocks; in further embodiments, the hash operation may be MD5, sha1, sha2 or other algorithm for calculating hash values, and the seed information may be a second random number of other combinations of the first N blocks, all of which achieve the same technical effect.
Fig. 4 is a flowchart of step S15 in the preferred embodiment shown in fig. 2. As shown in fig. 4, in a preferred embodiment, step S15 includes:
s151: performing hash operation on the seed information and the public key of the current node to obtain a first hash value;
s153: signing the first hash value through a private key of the current node to generate signature information;
s155: and carrying out Hash operation on the signature information to obtain a first random number.
Specifically, taking the application scenario shown in fig. 1 as an example,
in step S151, the node F performs a hash operation on the seed information seed and the public key pub (F) of the node F to obtain a first hash value, hash1 ═ sha256(Head (H-1) + pub (F));
in step S153, the node F signs the first hash value hash1 with a private key priv (F) of the node F, and generates signature information, Sign ═ Sign (priv (F), hash 1);
in step S137, the node F performs a hash operation on the signature information sign to obtain a first random number, R ═ sha256 (sign).
The generation of random numbers is random and verifiable and cannot be predicted nor forged. It should be noted that, in the current embodiment, the hash operation uses a sha256() algorithm, and the public information of the previous block is the block header information of the previous block; in further embodiments, the hash operation may be MD5, sha1, sha2 or other algorithms for calculating hash values, and the public information of the previous chunk may be the meikel root or other public information of the previous chunk, all of which achieve the same technical effect.
In a preferred embodiment, the random number held by the current node is compared with the preconfigured difficulty value to determine whether the current node is selected as a consensus committee member, and if the random number held by the current node is smaller than the preconfigured difficulty value, the current node is selected as the consensus committee member.
In a preferred embodiment, broadcasting a first random number held by a current node, receiving first random numbers broadcast by other nodes, sorting the first random number held by the current node and the first random numbers broadcast by other nodes, and dividing a consensus committee member corresponding to each first random number in a sorting result into an accounting node and a consensus node according to a pre-configured rule, includes:
carrying out sequencing operation on a first random number held by a current node and a first random number for receiving other node broadcasts;
and selecting the node corresponding to the first random number with the minimum value as the accounting node of the current block, wherein the consensus committee members except the accounting node are the consensus nodes of the current block.
Fig. 5 is a flow chart of a preferred embodiment shown in fig. 1. As shown in fig. 5, in a preferred embodiment, generating the first random number according to the seed information includes:
setting an overtime duration;
generating seed information according to a plurality of second random numbers of the first N blocks;
generating a first random number according to the seed information;
judging whether the current node is selected as a member of a consensus committee or not according to the held first random number and a pre-configured difficulty value;
and judging whether the membership of the consensus committee forms a complete consensus committee or not according to the membership of the consensus committee and a threshold value of the pre-configured membership of the consensus committee within the timeout duration, if not, not forming the consensus committee, and not dividing the bookkeeping node and the consensus node.
Specifically, taking the application scenario shown in fig. 1 as an example, the timeout period is set to 15s, a total of 33 consensus committee members participating in consensus are set, and within the timeout period, the number of the consensus committee members does not reach 33, and no consensus committee is formed.
In step S21, a timeout period is set, the timeout period being 15S;
in step S23, the node F generates seed information according to a plurality of second random numbers of the first N blocks;
in step S25, the node F generates a first random number according to the seed information;
in step S27, the node F determines whether the current node is selected as a consensus committee member according to the held first random number and the preconfigured difficulty value, and the node F is selected as the consensus committee member because the random number of the node F is smaller than the preconfigured difficulty value;
in step S29, the node F determines whether the number of consensus committee members forms a complete consensus committee based on the number of consensus committee members and a pre-configured threshold value of the number of consensus committee members within a timeout period, and does not divide the accounting node and the consensus nodes because the number of consensus committee members does not reach 33 within 15S and no consensus committee is formed.
In a preferred embodiment, the blockchain network adjusts the preconfigured difficulty value at the current block height when the last block height does not form the consensus committee, comprising:
adjusting the pre-configured difficulty value during the current block height so that enough nodes are selected as members of the consensus committee within the timeout period;
a complete consensus committee is formed within the time-out period.
Specifically, a total of 33 consensus committee members participating in consensus were set. Assuming that the last block height is H +5 and that only 30 nodes hold random numbers less than the preconfigured difficulty value within 15s, no consensus committee is formed. At a tile height of H +6, the blockchain network adjusts the preconfigured difficulty value such that greater than or equal to 33 nodes are selected as consensus board members within 15s, thereby forming a complete consensus board.
In the present embodiment, it is assumed that the preconfigured difficulty value is adjusted by changing the value of the difficulty coefficient. Assuming that the pre-configured difficulty value D is related to the difficulty coefficient C as follows: d ═ 33 × C; since the previous block height is H +5, and only 30 nodes hold random numbers less than the pre-configured difficulty value within 15s, no consensus committee is formed, and therefore, when the block height is H +6, the difficulty coefficient C should be increased, thereby increasing the difficulty value D; the higher the value of the pre-configured difficulty value D, the easier it is for the node to satisfy the condition that the held random number R is smaller than the pre-configured difficulty value D, and within the timeout period of 15s, enough nodes are selected as the consensus committee members, so that the block with the block height H +6 can form a complete consensus committee. It should be noted that in further embodiments, the preconfigured difficulty value may be changed by other algorithms such as addition, multiplication, and the like, to achieve the same technical effect.
Fig. 6 is a flowchart of a consensus method according to an embodiment of the present invention. As shown in fig. 6, in the present embodiment, the present invention provides a consensus method, including:
s31: and (4) generating a block after performing two-stage voting operation by using a BFT consensus algorithm.
In a preferred embodiment, the accounting node will take a certain amount of assets as rewards when the accounting node generates the correct block.
In a preferred embodiment, after the consensus node performs a two-stage correct voting operation on the accounting node generation block, the consensus node acquires a certain amount of assets as a reward.
Fig. 5 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
As shown in fig. 7, as another aspect, the present application also provides an apparatus 700 including one or more Central Processing Units (CPUs) 701 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data necessary for the operation of the apparatus 800 are also stored. The CPU701, the ROM702, and the RAM703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to an embodiment of the present disclosure, the equity certification consensus method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing a drawing method and a consensus method. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the drawing methods and consensus methods described herein.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The above description is only for the preferred embodiment of the present invention, and should not be used to limit the scope of the claims of the present invention. While the foregoing description will be understood and appreciated by those skilled in the relevant art, other equivalents may be made thereto without departing from the scope of the claims.

Claims (12)

1. A method of drawing a lot, comprising:
freezing a number of assets to qualify for a corresponding number of first random numbers for the assets;
generating seed information according to a plurality of second random numbers of the first N blocks, wherein N is a positive integer;
generating the first random number according to the seed information;
judging whether the current node is selected as a member of a consensus committee or not according to the held first random number and a pre-configured difficulty value;
broadcasting the held first random number, receiving the first random numbers broadcast by other nodes, sequencing the held first random number and the first random numbers broadcast by other nodes, and dividing the members of the consensus committee corresponding to each first random number in the sequencing result into an accounting node and a consensus node according to a pre-configured rule.
2. The method of claim 1, wherein the generating seed information according to the second random numbers of the first N blocks comprises:
acquiring a plurality of second random numbers of the first N blocks, wherein each time an accounting node generates one block, N sequenced second random numbers are generated, and the N second random numbers are broadcasted to a block chain network;
and performing hash operation on the obtained second random numbers after combination operation to obtain seed information, wherein each second random number can only be used for generating one piece of seed information.
3. The method of claim 1, wherein the generating the first random number according to the seed information comprises:
performing hash operation on the seed information and the public key of the current node to obtain a first hash value;
signing the first hash value through a private key of a current node to generate signature information;
and carrying out Hash operation on the signature information to obtain the first random number.
4. The method of claim 1, wherein determining whether the current node is selected as a member of a consensus committee based on the held first random number and a preconfigured difficulty value comprises:
comparing the held first random number with the pre-configured difficulty value, and if the held first random number is smaller than the pre-configured difficulty value, selecting the first random number as a member of the consensus committee.
5. The method of claim 1, wherein broadcasting the held first random number and receiving the first random numbers broadcast by other nodes, and wherein sorting the held first random number and the first random numbers broadcast by other nodes into the members of the consensus committee according to the pre-configured rules comprises:
the held first random number and the first random number broadcasted by other nodes are subjected to sequencing operation;
and selecting the node corresponding to the first random number with the minimum value as the accounting node of the current block, wherein the members of the consensus committee except the accounting node are the consensus nodes of the current block.
6. The method of claim 1, wherein the generating the first random number according to the seed information comprises:
setting an overtime duration;
generating seed information according to a plurality of second random numbers of the first N blocks;
generating a first random number according to the seed information;
judging whether the current node is selected as a member of a consensus committee or not according to the held first random number and a pre-configured difficulty value;
and judging whether the number of the members of the consensus committee forms a complete consensus committee or not according to the number of the members of the consensus committee and a threshold value of the number of the members of the pre-configured consensus committee within a timeout duration, if not, not forming the consensus committee, and not dividing the bookkeeping node and the consensus node.
7. The method of claim 6, wherein the blockchain network adjusts the preconfigured difficulty value at the current block height when the last block height did not form the consensus committee, comprising:
adjusting the pre-configured difficulty value during the current block height so that enough nodes are selected as members of the consensus committee within the timeout period;
a complete consensus committee is formed within the time-out period.
8. A consensus method performed by a node selected by the drawing method according to any one of claims 1 to 7, comprising:
and (4) generating a block after performing two-stage voting operation by using a BFT consensus algorithm.
9. The method of claim 8, wherein the accounting node will obtain an amount of assets as a reward when the accounting node generates the correct block.
10. The method of claim 8, wherein the consensus node receives a certain amount of assets as a reward after the consensus node has performed a two-stage correct voting operation on the accounting node generation block.
11. A computer device, the device comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in any of claims 1-10.
12. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-10.
CN201810806721.XA 2018-07-20 2018-07-20 Lottery drawing method, consensus method, device and storage medium Active CN108964879B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810806721.XA CN108964879B (en) 2018-07-20 2018-07-20 Lottery drawing method, consensus method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810806721.XA CN108964879B (en) 2018-07-20 2018-07-20 Lottery drawing method, consensus method, device and storage medium

Publications (2)

Publication Number Publication Date
CN108964879A CN108964879A (en) 2018-12-07
CN108964879B true CN108964879B (en) 2021-04-13

Family

ID=64495870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810806721.XA Active CN108964879B (en) 2018-07-20 2018-07-20 Lottery drawing method, consensus method, device and storage medium

Country Status (1)

Country Link
CN (1) CN108964879B (en)

Families Citing this family (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109508565B (en) * 2018-12-29 2021-04-09 西安纸贵互联网科技有限公司 Account book accounting method of block chain network with multi-chain sharing computing power
CN110011974B (en) * 2019-03-07 2021-08-10 港融科技有限公司 Accounting method and device of block chain, terminal and computer-readable storage medium
CN110247753B (en) * 2019-06-17 2020-10-09 北京瑞策科技有限公司 Block output method and device based on block chain node point network
CN110225044B (en) * 2019-06-17 2020-11-27 北京瑞策科技有限公司 Verification method and device on block chain
CN110224840B (en) * 2019-06-17 2019-12-31 北京艾摩瑞策科技有限公司 Block chain based packaging method and device
CN110224839B (en) * 2019-06-17 2020-10-30 北京瑞策科技有限公司 Verification method and device applied to block chain
CN110247773B (en) * 2019-06-17 2020-12-25 北京瑞策科技有限公司 Packing method and device on block chain
CN110245949B (en) * 2019-06-17 2021-05-28 北京瑞策科技有限公司 Packing method and device related to block chain
CN110210865A (en) * 2019-06-17 2019-09-06 北京艾摩瑞策科技有限公司 Packaging method and device based on block chain
CN110223070B (en) * 2019-06-17 2020-12-11 北京瑞策科技有限公司 Verification method and device based on block chain node point network
CN110225043B (en) * 2019-06-17 2021-04-02 北京瑞策科技有限公司 Packing method and device applied to block chain
CN110223069A (en) * 2019-06-17 2019-09-10 北京艾摩瑞策科技有限公司 Packaging method and device based on block chain meshed network
CN110222537B (en) * 2019-06-17 2021-01-29 北京瑞策科技有限公司 Verification method and device applied to block chain nodes
CN110224813B (en) * 2019-06-17 2021-02-09 北京瑞策科技有限公司 Block discharging method and device based on block chain
CN110233722B (en) * 2019-06-17 2020-10-30 北京瑞策科技有限公司 Block output method and device on block chain
CN110222538B (en) * 2019-06-17 2020-09-08 北京瑞策科技有限公司 Verification method and device related to block chain
CN110457006B (en) * 2019-07-22 2021-08-06 上海朝夕网络技术有限公司 Distributed multi-party random number generation method and system based on hardware
CN110545170A (en) * 2019-09-16 2019-12-06 福建中科中欣智能科技有限公司 Block chain consensus method, device and equipment based on password drawing
CN111402079A (en) * 2020-03-24 2020-07-10 中国南方电网有限责任公司 Method and device for acquiring power block, computer equipment and storage medium
CN117037988B (en) * 2023-08-22 2024-05-17 广州视景医疗软件有限公司 Electronic medical record storage method and device based on blockchain

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015031755A1 (en) * 2013-08-29 2015-03-05 Wandisco, Inc. Distributed file system using consensus nodes
CN106878071A (en) * 2017-01-25 2017-06-20 上海钜真金融信息服务有限公司 A kind of block chain common recognition mechanism based on Raft algorithms
CN106936589A (en) * 2017-04-21 2017-07-07 杭州秘猿科技有限公司 A kind of acentric the license parallel sharding method of chain and method of commerce

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015031755A1 (en) * 2013-08-29 2015-03-05 Wandisco, Inc. Distributed file system using consensus nodes
CN106878071A (en) * 2017-01-25 2017-06-20 上海钜真金融信息服务有限公司 A kind of block chain common recognition mechanism based on Raft algorithms
CN106936589A (en) * 2017-04-21 2017-07-07 杭州秘猿科技有限公司 A kind of acentric the license parallel sharding method of chain and method of commerce

Also Published As

Publication number Publication date
CN108964879A (en) 2018-12-07

Similar Documents

Publication Publication Date Title
CN108964879B (en) Lottery drawing method, consensus method, device and storage medium
CN109067516B (en) Lottery drawing method, consensus method, device and storage medium
CN107301546B (en) Random number generation and application method and device
CN111031346B (en) Method and device for enhancing video image quality
CN108984662B (en) Block chain data synchronization method
CN110852882B (en) Packet consensus method, apparatus, device, and medium for blockchain networks
CN113194146B (en) Leader node determination method, computer device, and storage medium
CN110245061B (en) Computing device, power consumption prediction method thereof, and computer-readable storage medium
CN111798238A (en) Parallel chain consensus method, device and storage medium
CN105183856A (en) Method and device for evaluating information content quality
CN112181657A (en) Video processing method and device, electronic equipment and storage medium
CN104967690A (en) Information push method and device
CN111008249B (en) Parallel chain block synchronization method, device and storage medium
CN108964878B (en) Lottery drawing method, consensus method, device and storage medium
CN116483587B (en) Video super-division parallel method, server and medium based on image segmentation
CN110322350B (en) Method, device, equipment and storage medium for cutting hollow block in consensus network
CN112600905A (en) Transaction broadcasting and block generating method, apparatus and storage medium
CN110262925B (en) Remote backup method, device, terminal equipment and medium for pictures
CN112819625B (en) Parallel chain arbitration consensus method, computer device, and storage medium
CN107203633B (en) Data table pushing processing method and device and electronic equipment
Bjelde et al. Brief announcement: approximation algorithms for unsplittable resource allocation problems with diseconomies of scale
CN109803160B (en) Resource allocation method, device and system
CN112948388A (en) Parallel chain arbitration consensus method, computer device and storage medium
CN113762016A (en) Key frame selection method and device
CN112799820A (en) Data processing method, data processing apparatus, electronic device, storage medium, and program product

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