CN110768798A - Lightweight block chain consensus method, system and medium for Internet of things - Google Patents

Lightweight block chain consensus method, system and medium for Internet of things Download PDF

Info

Publication number
CN110768798A
CN110768798A CN201911017871.3A CN201911017871A CN110768798A CN 110768798 A CN110768798 A CN 110768798A CN 201911017871 A CN201911017871 A CN 201911017871A CN 110768798 A CN110768798 A CN 110768798A
Authority
CN
China
Prior art keywords
members
information
block
head
internet
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
CN201911017871.3A
Other languages
Chinese (zh)
Other versions
CN110768798B (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.)
National University of Defense Technology
Original Assignee
National University of Defense 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 National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN201911017871.3A priority Critical patent/CN110768798B/en
Publication of CN110768798A publication Critical patent/CN110768798A/en
Application granted granted Critical
Publication of CN110768798B publication Critical patent/CN110768798B/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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3263Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • H04L9/3268Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements using certificate validation, registration, distribution or revocation, e.g. certificate revocation list [CRL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3263Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/46Secure multiparty computation, e.g. millionaire problem
    • H04L2209/463Electronic voting
    • 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/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a lightweight block chain consensus method, a system and a medium for the Internet of things, wherein the method comprises the steps that each node member forms a committee according to hierarchical election, a head p packs a block B and sends pre-distribution information to all central members; the head seat p integrates the confirmation and the issue certificate according to the confirmation of each pivot member and broadcasts the confirmation and the issue certificate to all executive officers; the executive verifies the block B; if the head office p receives f +1 pieces of verification passing information, the head office p issues a block B and attaches a confirmation issuing certificate and a verification passing certificate; if f +1 pieces of verification failure information are received, the blank block B is issued and a verification failure certificate is attached. The method integrates the advantages of a distributed network structure with a block chain decentralized center and a natural hierarchical structure of the Internet of things, can be well adapted to various Internet of things devices, improves the fault tolerance rate of the nodes, reduces network communication as far as possible, reduces the pressure of network bandwidth and improves consensus efficiency.

Description

Lightweight block chain consensus method, system and medium for Internet of things
Technical Field
The invention relates to a block chain technology of the Internet of things, in particular to a lightweight block chain consensus method, a lightweight block chain consensus system and a lightweight block chain consensus medium for the Internet of things.
Background
The consensus mechanism of the block chain can well solve the problems of trust, safety and the like of the distributed network of the Internet of things. However, the diversity of the computer performance of the internet of things devices complicates the application of block chains directly in the internet of things. Meanwhile, a certain conflict exists between the inherent hierarchical structure of the internet of things and the decentralized distributed network structure of the block chain.
Therefore, how to implement lightweight blockchain consensus for the internet of things becomes a key technical problem to be solved urgently when the blockchain technology is applied to the internet of things.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: aiming at the problems in the prior art, the invention provides a lightweight block chain consensus method, a lightweight block chain consensus system and a lightweight block chain consensus medium for the Internet of things.
In order to solve the technical problems, the invention adopts the technical scheme that:
a lightweight block chain consensus method for the Internet of things comprises the following implementation steps:
1) each node member forms a committee according to hierarchical election, the upper limit number of the members in the committee is 2f +3g +2 and comprises a head position p, the total upper limit number containing the head position p is 3g +1 central pivot members, the upper limit number is 2f +1 executive officers, f +1 executive officers are activated executive officers, the rest f executive officers are observed executive officers, wherein g is the maximum central pivot member error node number allowed by reaching the consensus, and f is the maximum executive officer error node number; executing the next step when the consensus of the block B is required to be entered;
2) packing the block B by the head position p, and sending pre-release information to all the pivot members;
3) each pivot member checks whether the received pre-release information is continuous or not, and if so, returns confirmation release information to the head seat p;
4) the head p is in the set overtime time tp1Internally counting the number of the received confirmation release information, integrating the confirmation release information into a confirmation release certificate if the number of the confirmation release information is not less than 2g +1, and broadcasting the confirmation release certificate to all executive officers; otherwise if the head p is at the timeout tp1If 2g +1 pieces of confirmation release information cannot be collected, initiating the view change of the members of the center;
5) after receiving the confirmation issuing certificate, the executive officer verifies the block B, if the verification is passed, the executive officer broadcasts verification information to the head office p and all the pivot members, otherwise, the executive officer broadcasts verification failure information to the head office p and all the pivot members;
6) the head p is in the set overtime time tp2Internally counting the received verification information, and if f +1 consistent verification passing information is received, generating a verification passing certificate, issuing a block B and additionally confirming the issuing certificate and the verification passing certificate; and if f +1 consistent verification failure information is received, generating a verification failure certificate, issuing a blank block B and attaching the verification failure certificate.
Optionally, step 3) when the hub member checks whether the serial number n of the received pre-release message is continuous, the hub member further includes the following processing steps: if a hub member finds sequence number n and a locally stored historical sequence number nhN = n is not satisfiedh+1, the sequence number n is not continuous, and the block information lacking in the middle is requested to other pivot members and the head seat p; when the backbone member receives the missing request, n is added to itselfhAll thereafterThe block is packed and sent to the missing member; if the certificate is invalid in the block information taken by the pivot member, the block is not adopted; if the members of the hub cannot complement nhInitiating the view change of the members of the pivot to all the blocks of n; if the hub member finds that the sequence number n is less than or equal to the historical sequence number n stored locallyhThen a hub member view change is initiated.
Optionally, the head p in step 6) is in the set timeout time tp2The method also comprises the following processing steps when internally counting the received verification information: if the head seat p receives inconsistent verification information, directly activating an executive officer for observation; after receiving the activation request, the observed executive officers return the verification results to the center, the head selects f +1 identical verification results, selects the corresponding executive officers as the activated executive officers, and broadcasts block information; after receiving the block, the executive officer checks whether the executive officer is contained in the certificate of authentication, if so, the executive officer is an activated executive officer, and if not, the executive officer is an observed executive officer; if the executive officer does not receive the block information after the specified time, the executive officer applies for the block information from other committee members.
Optionally, the detailed step of initiating a pivot member view change includes:
s1) initiating the head p or the pivot member broadcast message of the pivot member view change, wherein the head p or the pivot member initiating the pivot member view change does not pause work;
s2) when a hub member receives broadcast messages which are sent by g +1 different hub members and initiate hub member view change, broadcasting a view change request, and stopping working in the view;
s3) when a pivot member receives the view change request, generating the view change request of the pivot member, broadcasting the view change request to other pivot members and stopping working;
s4) when a central member receives 2g +1 view change requests containing the central member, the central member becomes a new head seat and broadcasts new view information to all committees;
s5) after receiving the new view information, the pivot member checks whether the local block is consistent with the new view information, if finding the missing, the pivot member broadcasts the missing request, and after updating the view information, the pivot member starts working for the new view.
Optionally, the head p initiating the pivot member view change in step S1) or the pivot member determines whether the current pivot member view completes a valid tile, and if the current pivot member view does not complete a valid tile, step 1) is performed to re-elect.
Optionally, the step of forming a committee by the node members in step 1) according to the hierarchical election includes the following three steps:
1.1) at a set timeout t1Firstly, the members of the high hierarchy broadcast survival messages to each other to verify the activity; members capable of conducting election initiate election requests to members which are on the lower layer and do not participate in committee elections, and vote information is collected; other members post the ballot to the requesting member after receiving the first election request and only throw one ballot; if the time-out time t1If the result is reached, the next step is executed;
1.2) at a set timeout t2Firstly, determining all members of high-level activities, and enabling all the members to enter a committee and form a temporary committee; the temporary committee counts a member list of the current committee and the number of the remaining seats and broadcasts the member list and the number of the remaining seats; the election members send the collected vote information to a temporary committee; if the time-out time t2If the result is reached, the next step is executed;
1.3) at a set timeout t3After the temporary committee counts the votes of the members to be selected, the votes are counted>Sorting and filling the gaps in a weight mode, and selecting the member with the heaviest weight as a head-turn pivot head seat; the first 10 members with the most weight except the head seat are taken as the pivot of the committee and are sorted according to the weight; the first f +1 executives are then selected as the active executives, and the remaining f executives are the observed executives.
Optionally, the evaluation criteria of the members that can be bid for by the requesting member when the vote is delivered to the requesting member in step 1.1) are as follows: and (3) ordering all members in the view from heavy to light according to the weight, assuming that the number of the members in the highest layer is x, calculating the (A-x) × 2 nodes in the y layer, and then selecting the members as all non-highest nodes not lower than the y layer, wherein A is the upper limit number of the committee.
In addition, the invention also provides an internet of things-oriented lightweight blockchain consensus system, which comprises a plurality of internet of things nodes connected in a hierarchical topological structure, wherein the plurality of internet of things nodes are programmed or configured to execute the steps of the internet of things-oriented lightweight blockchain consensus method, or a computer program programmed or configured to execute the internet of things-oriented lightweight blockchain consensus method is stored in a storage medium of the plurality of internet of things nodes.
In addition, the present invention also provides a computer readable storage medium having stored thereon a computer program programmed or configured to execute the internet of things oriented lightweight blockchain consensus method.
Compared with the prior art, the invention has the following advantages:
1. according to the invention, the committee is formed by adopting each node member according to hierarchical election, so that the committee election can be realized based on a distributed network structure and a natural hierarchical structure of the Internet of things.
2. In the formula stage, a head seat p packs a block B and sends pre-release information to all central pivot members; each pivot member checks whether the received pre-release information is continuous or not, and if so, returns confirmation release information to the head seat p; the head p is in the set overtime time tp1Internally counting the number of the received confirmation release information, integrating the confirmation release information into a confirmation release certificate if the number of the confirmation release information is not less than 2g +1, and broadcasting the confirmation release certificate to all executive officers; otherwise if the head p is at the timeout tp1If 2g +1 pieces of confirmation release information cannot be collected, initiating the view change of the members of the center; after receiving the confirmation issuing certificate, the executive officer verifies the block B, if the verification is passed, the executive officer broadcasts verification information to all the pivot members, otherwise, the executive officer broadcasts verification failure information to all the pivot members; the head p is in the set overtime time tp2Internally counting the received verification information, and if f +1 consistent verification passing information is received, generatingVerifying the passed certificate, issuing the block B and additionally confirming the issued certificate and the passed certificate; and if f +1 consistent verification failure information is received, generating a verification failure certificate, issuing a blank block B and attaching the verification failure certificate. By the method, the block consensus can be achieved based on a distributed network structure and a natural hierarchical structure of the Internet of things.
In conclusion, the method and the device have the advantages of combining the advantages of a distributed network structure with block chain decentralized centralization and a natural hierarchical structure of the Internet of things, can be well suitable for various Internet of things devices, improve the fault tolerance rate of the nodes, reduce network communication as much as possible, reduce the pressure of network bandwidth and improve consensus efficiency.
Drawings
Fig. 1 is a schematic diagram of a consensus principle of an embodiment of the present invention.
FIG. 2 is a flow chart illustrating the creation of committees according to hierarchical elections in an embodiment of the present invention.
Detailed Description
As shown in fig. 1, the implementation steps of the internet-of-things oriented lightweight block chain consensus method in this embodiment include:
1) each node member forms a committee according to hierarchical election, the upper limit number of the members in the committee is 2f +3g +3 and comprises a head position p, the total upper limit number containing the head position p is 3g +1 central pivot members, the upper limit number is 2f +1 executive officers, f +1 executive officers are activated executive officers, the rest f executive officers are observed executive officers, wherein g is the maximum central pivot member error node number allowed by reaching the consensus, and f is the maximum executive officer error node number; the next step is performed when the consensus of block B needs to be entered.
2) Head office p packs block B and sends pre-release information to all hub members, see step ① in fig. 1;
referring to fig. 1, the format of the pre-release information in this embodiment is:
<PRE-REQUEST, n, v, r, B>p
where PRE-REQUEST indicates PRE-release information, n is the block B sequence number, v is the current view number, and r is the current view numberThe number of rounds of the previous election is,<>pthe presentation information is encrypted by the chairman p with its private key. The embodiment is embodied in<X>YIndicating that information X is encrypted with the public key of Y, and hence here<>pThe presentation information is encrypted by the chairman p with its private key, as follows.
3) Each pivot member checks whether the received pre-release information has a continuous serial number n, and if so, returns a confirmation release information to the head p, see step ② in fig. 1;
referring to fig. 1, the format of the confirmation issue information in this embodiment is:
<COMMIT, n, v, r, j, B>j
wherein n is the block B serial number, v is the current view number, r is the current election turn, j represents the pivot member node number,<>jthe presentation information is encrypted by hub member j with its private key.
4) The head p is in the set overtime time tp1Counting the number of the received confirmation release information, integrating the confirmation release information into a confirmation release certificate and broadcasting the confirmation release certificate to all executive officers if the number is not less than 2g +1, and referring to step ③ in figure 1, otherwise, if the head p is in the overtime time tp1If 2g +1 pieces of confirmation release information cannot be collected, initiating the view change of the members of the center;
referring to fig. 1, the format of the certificate of issuance confirmed in this embodiment is:
{<COMMIT, n, v, r, j, B>j},j∈{A|2g+1}
wherein, the < COMMIT, n, v, r, j, B > j is the confirmed issuance information { < COMMIT, n, v, r, j, B > j } in step 3), j ∈ { a |2g +1} represents a set of 2g +1 confirmed issuance information received by the head office p, and the set is the confirmed issuance certificate.
5) After receiving the confirmation issuing certificate, the executive officer verifies the block B, if the verification is passed, the executive officer broadcasts verification information to the head office p and all the pivot members, otherwise, the executive officer broadcasts verification failure information to the head office p and all the pivot members, and the step ④ in the figure 1 is included;
referring to fig. 1, in this embodiment, if the verification passes, the format of the broadcast verification information is:
<REPLY, n, v, r, i, |B|, YES>i
in the above formula, REPLY represents the verification information, n is the serial number of the block B, v is the current view number, r is the current round of election, i represents the member node number, | B | represents the entropy value of the block B, YES represents the verification pass identifier,<>ithe node i of the executed officer is encrypted by a private key, E represents a set formed by all executive officer members, and f is the maximum number of wrong nodes of the executive officer;
referring to fig. 1, in this embodiment, if the verification fails, the format of the broadcast verification information is:
<REPLY, n, v, r, i, |B|, NO>i
in the above formula, REPLY represents the verification information, n is the serial number of the block B, v is the current view number, r is the current round of election, i represents the member node number, | B | represents the entropy value of the block B, NO represents the verification failure identifier,<>ithe node i of the executed officer is encrypted by a private key, E represents a set formed by all executive officer members, and f is the maximum number of wrong nodes of the executive officer;
6) the head p is in the set overtime time tp2And internally counting the received verification information, generating a verification passing certificate, namely a collection of f +1 consistent verification passing information if f +1 consistent verification passing information is received, then issuing a block B and additionally confirming the issuing certificate and the verification passing certificate, referring to step ⑤ in fig. 1, and generating a verification failing certificate, namely a collection of f +1 consistent verification failing information if f +1 consistent verification failing information is received, issuing a blank block B and additionally attaching the verification failing certificate.
In this embodiment, the format of the issued block is:
<BLOCK, n, v, r, B, CC, RC>p
in the above formula, BLOCK represents BLOCK issue information, n is the serial number of BLOCK B, v is the current view number, r is the current election turn, CC is the certificate of confirmation issue, RC is the corresponding certificate of passing verification, p represents the head node,<>pthe representation is encrypted by the chairman p with the private key.
In this embodiment, the format of the issued blank block is:
<BLOCK, n, v, r, BLANK, RC>p
in the above formula, BLOCK represents BLOCK release information, n is a BLOCK serial number, v is a current view number, r is a current election turn, BLOCK represents an empty BLOCK, RC is a corresponding authentication non-passing certificate, p represents a head node,<>pthe representation is encrypted by the chairman p with the private key.
In this embodiment, the step 3) of checking, by the hub member, whether the serial number n of the received pre-release information is continuous further includes the following processing steps: if a hub member finds sequence number n and a locally stored historical sequence number nhN = n is not satisfiedh+1, the sequence number n is not continuous, and the block information lacking in the middle is requested to other pivot members and the head seat p; when the backbone member receives the missing request, n is added to itselfhPackaging all the subsequent blocks and sending the blocks to the missing members; if the certificate is invalid in the block information taken by the pivot member, the block is not adopted; if the members of the hub cannot complement nhInitiating the view change of the members of the pivot to all the blocks of n; if the hub member finds that the sequence number n is less than or equal to the historical sequence number n stored locallyhThen a hub member view change is initiated. By the method, the continuity of the block can be effectively verified.
In this embodiment, the format of the block information that the pivot member requests the other pivot members and the head p for lack in the middle is:
<HOLE, nh, v, r, j>j
in the above formula, HOLE represents a block information request lacking in the middle, nhIs the history serial number stored locally, r is the current election turn, j represents the number of the member node of the pivot,<>jthe representation is encrypted by hub member j with a private key.
In this embodiment, the head p in step 6) is at the set timeout tp2The method also comprises the following processing steps when internally counting the received verification information: if the head seat p receives inconsistent verification information, directly activating an executive officer for observation; executive officer of observationAfter receiving the activation request, returning the verification result to the center, selecting f +1 same verification results from the center, selecting the corresponding executive officers as the activated executive officers, and broadcasting block information; after receiving the block, the executive officer checks whether the executive officer is contained in the certificate of authentication, if so, the executive officer is an active executive officer, and if not, the executive officer is an observed executive officer; if the executive officer does not receive the block information after the specified time, the executive officer applies for the block information from other committee members.
In this embodiment, the message format of the executive who activates observation is:
<WAKE-UP, n, v, r, COMMIT-CERTIFICATE>p
in the above formula, WAKE-UP indicates a message activating an executive for observation, n is a sequence number of the block B, v is a current view number, r is a current election turn, COMMIT-CERTIFICATE indicates a confirmation issuance CERTIFICATE in step 4), p indicates a head node,<>pthe representation is encrypted by the chairman p with the private key.
In this embodiment, the detailed step of initiating the pivot member view change includes:
s1) initiating the head p or the pivot member broadcast message of the pivot member view change, wherein the head p or the pivot member initiating the pivot member view change does not pause work;
in this embodiment, the format of the broadcast message is:
<PRE-VIEWCHANGE, v, r, j>j/p
in the above formula, PRE-VIEWCHANGE represents the pivot member view change request, v is the current view number, r is the current election turn, j represents the node number of the pivot member, p represents the node number of the head p,<>j/pthe representation is encrypted by the head p or hub member j with a private key.
S2) when a hub member receives broadcast messages which are sent by g +1 different hub members and initiate hub member view change, broadcasting a view change request, and stopping working in the view;
in this embodiment, the format of the broadcast view change request is:
<VIEW-CHANGE, n, B, v, r, j>j
in the above formula, VIEW-CHANGE represents a broadcast VIEW CHANGE request, n is the sequence number of the block B, v is the current VIEW number, r is the current election turn, j represents the backbone member node number,<>jthe representation is encrypted by hub member j with a private key.
S3) when a pivot member receives the view change request, generating the view change request of the pivot member, broadcasting the view change request to other pivot members and stopping working;
s4) when a central member receives 2g +1 view change requests containing the central member, the central member becomes a new head seat and broadcasts new view information to all committees;
in this embodiment, the format of the new view information is:
<NEW-VIEW, n’, B’, v+1, j, VCC>j
in the above formula, NEW-VIEW represents the request for NEW VIEW information to all committees, n ' is the maximum sequence number of all legal blocks B in all VIEW change requests received by them, B ' is the block corresponding to the maximum sequence number n ', v +1 is the NEW VIEW number, j is the number of the NEW head seat, VCC is the set of all VIEW change requests received by them, j represents the number of the central member node,<>jthe representation is encrypted by hub member j with a private key.
S5) after receiving the new view information, the pivot member checks whether the local block is consistent with the new view information, if finding the missing, the pivot member broadcasts the missing request, and after updating the view information, the pivot member starts working for the new view.
In this embodiment, the head p initiating the pivot member view change in step S1) or the pivot member determines whether the current pivot member view completes one valid tile, and if it is found that the current pivot member view does not complete one valid tile, step 1) is performed to re-elect.
In this embodiment, the maximum number of error nodes g of the central member allowed by the consensus is 3, and the maximum number of error nodes f of the executive is 20, so that the upper limit number of the committee is 51, the upper limit number of the central member is 10 (3 × 3+1=10 (g = 3)), and the committee elects to elect by levels, and only when the upper level cannot be satisfied, the competition is started. As shown in fig. 2, the step of forming committee by hierarchical election of each node member in step 1) in the present embodiment includes the following three steps:
1.1) at a set timeout t1Firstly, the members of the high hierarchy broadcast survival messages to each other to verify the activity; members capable of conducting election initiate election requests to members which are on the lower layer and do not participate in committee elections, and vote information is collected; other members post the ballot to the requesting member after receiving the first election request and only throw one ballot; if the time-out time t1If the result is reached, the next step is executed;
in this embodiment, the format of the alive message is:
<ALIVE, i, r>i
in the above formula, ALIVE represents the activity verification broadcast, i is the node number, r is the election turn,<>ithe representation is encrypted by member i with a private key.
In this embodiment, the format of the election request initiated by a member is as follows:
<REQ-VOTE, i, r>i
in the above formula, REQ-VOTE represents an election request, i is the node number, r is the election turn,<>ithe representation is encrypted by member i with a private key.
In this embodiment, the vote format delivered to the requesting member by the other members after receiving the first election request is as follows:
<VOTE, i, r, RV>i
in the above formula, VOTE represents VOTE, i is node number, r is election turn, RV is the first election request it receives,<>ithe representation is encrypted by member i with a private key.
1.2) at a set timeout t2Firstly, determining all members of high-level activities, and enabling all the members to enter a committee and form a temporary committee; the temporary committee counts a member list of the current committee and the number of the remaining seats and broadcasts the member list and the number of the remaining seats; the members in the competition select the collected selectionsTicket information is sent to a temporary committee; if the time-out time t2If the result is reached, the next step is executed;
1.3) at a set timeout t3After the temporary committee counts the votes of the members to be selected, the votes are counted>Sorting and filling the gaps in a weight mode, and selecting the member with the heaviest weight as a head-turn pivot head seat; the first 10 members with the most weight except the head seat are taken as the pivot of the committee and are sorted according to the weight; the first f +1 executives are then selected as the active executives, and the remaining f executives are the observed executives.
In this embodiment, the criteria for evaluating the members that can be bid for by the requesting member when delivering the vote to the requesting member in step 1.1) are as follows: and (3) ordering all members in the view from heavy to light according to the weight, assuming that the number of the members in the highest layer is x, calculating the (A-x) × 2 nodes in the y layer, and then selecting the members as all non-highest nodes not lower than the y layer, wherein A is the upper limit number of the committee.
Aiming at the hierarchical structure of the internet of things, the lightweight block chain consensus method for the internet of things adopts a high-level management bottom-layer method in the election and consensus processes, low-level nodes obey the results of high-level nodes, the topological structure of the nodes is expressed based on a tree-graph structure, and each node has a hierarchical score; the higher the level is, the larger the weight is, the weight of the same level is also divided into different sizes; the high level weights are absolutely higher than the low level. In addition, the lightweight block chain consensus method for the internet of things in the embodiment is based on the following assumptions: the cryptology means is assumed to be reliable, so that the data is not tampered, and the signature is credible; assume that the calculation results of the loyal nodes are unique; if the node has network communication abnormity, node shutdown, node logic error and the like, the node is regarded as an error node.
In addition, the present embodiment also provides an internet of things-oriented lightweight blockchain consensus system, which includes a plurality of internet of things nodes connected in a hierarchical topology structure, where the plurality of internet of things nodes are programmed or configured to execute the steps of the internet of things-oriented lightweight blockchain consensus method according to the present embodiment, or a storage medium of the plurality of internet of things nodes stores a computer program programmed or configured to execute the internet of things-oriented lightweight blockchain consensus method according to the present embodiment.
In addition, the present embodiment also provides a computer-readable storage medium, on which a computer program is stored, which is programmed or configured to execute the foregoing internet-of-things-oriented lightweight blockchain consensus method according to the present embodiment.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein. The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments, and all technical solutions belonging to the idea of the present invention belong to the protection scope of the present invention. It should be noted that modifications and embellishments within the scope of the invention may occur to those skilled in the art without departing from the principle of the invention, and are considered to be within the scope of the invention.

Claims (9)

1. A lightweight block chain consensus method for the Internet of things is characterized by comprising the following implementation steps:
1) each node member forms a committee according to hierarchical election, the upper limit number of the members in the committee is 2f +3g +2, the upper limit number of the members comprises a head p, the total upper limit number containing the head p is 3g +1 central member, the upper limit number is 2f +1 executive officers, wherein f +1 executive officers are activated executive officers, the rest f executive officers are observed executive officers, g is the maximum central member error node number allowed by reaching consensus, and f is the maximum executive officer error node number; executing the next step when the consensus of the block B is required to be entered;
2) packing the block B by the head position p, and sending pre-release information to all the pivot members;
3) each pivot member checks whether the received pre-release information is continuous or not, and if so, returns confirmation release information to the head seat p;
4) the head p is in the set overtime time tp1Internally counting the number of the received confirmation release information, integrating the confirmation release information into a confirmation release certificate if the number of the confirmation release information is not less than 2g +1, and broadcasting the confirmation release certificate to all executive officers; otherwise if the head p is at the timeout tp1If 2g +1 pieces of confirmation release information cannot be collected, initiating the view change of the members of the center;
5) after receiving the confirmation issuing certificate, the executive officer verifies the block B, if the verification is passed, the executive officer broadcasts verification information to the head office p and all the pivot members, otherwise, the executive officer broadcasts verification failure information to the head office p and all the pivot members;
6) the head p is in the set overtime time tp2Internally counting the received verification information, and if f +1 consistent verification passing information is received, generating a verification passing certificate, issuing a block B and additionally confirming the issuing certificate and the verification passing certificate; and if f +1 consistent verification failure information is received, generating a verification failure certificate, issuing a blank block B and attaching the verification failure certificate.
2. The internet-of-things-oriented lightweight blockchain consensus method according to claim 1, wherein the step 3) of checking, by the hub member, whether the sequence number n of the received pre-release information is continuous further comprises the following processing steps: if a hub member finds sequence number n and a locally stored historical sequence number nhN = n is not satisfiedh+1, the sequence number n is not continuous, and the block information lacking in the middle is requested to other pivot members and the head seat p; when the backbone member receives the missing request, n is added to itselfhPackaging all the subsequent blocks and sending the blocks to the missing members; if the certificate is invalid in the block information taken by the pivot member, the block is not adopted; if the members of the hub cannot complement nhInitiating the view change of the members of the pivot to all the blocks of n; if the hub member finds that the sequence number n is less than or equal to the historical sequence number n stored locallyhThen a hub member view change is initiated.
3. The Internet of things-oriented lightweight blockchain consensus method according to claim 1, wherein in step 6), the head p is in a set timeout period tp2The method also comprises the following processing steps when internally counting the received verification information: if the head seat p receives inconsistent verification information, directly activating an executive officer for observation; after receiving the activation request, the executive officer returns the verification result to the center, and the chief officer selects f +1 same verification results and selects the corresponding verification resultsThe executive officer becomes the active executive officer, and broadcasts the block information; after receiving the block, the executive officer checks whether the executive officer is contained in the certificate of authentication, if so, the executive officer is an activated executive officer, and if not, the executive officer is an observed executive officer; if the executive officer does not receive the block information after the specified time, the executive officer applies for the block information from other committee members.
4. The internet of things-oriented lightweight blockchain consensus method according to claim 1, wherein the detailed step of initiating a hub member view change comprises:
s1) initiating the head p or the pivot member broadcast message of the pivot member view change, wherein the head p or the pivot member initiating the pivot member view change does not pause work;
s2) when a hub member receives broadcast messages which are sent by g +1 different hub members and initiate hub member view change, broadcasting a view change request, and stopping working in the view;
s3) when a pivot member receives the view change request, generating the view change request of the pivot member, broadcasting the view change request to other pivot members and stopping working;
s4) when a central member receives 2g +1 view change requests containing the central member, the central member becomes a new head seat and broadcasts new view information to all committees;
s5) after receiving the new view information, the pivot member checks whether the local block is consistent with the new view information, if finding the missing, the pivot member broadcasts the missing request, and after updating the view information, the pivot member starts working for the new view.
5. The internet-of-things-oriented lightweight blockchain consensus method according to claim 4, wherein in step S1), the head p initiating the pivot member view change or the pivot member determines whether the current pivot member view completes a valid block, and if the current pivot member view does not complete a valid block, the re-election in step 1) is performed.
6. The Internet of things-oriented lightweight blockchain consensus method according to any one of claims 1 to 5, wherein the step of forming a committee by hierarchical election of each node member in the step 1) comprises the following three steps:
1.1) at a set timeout t1Firstly, the members of the high hierarchy broadcast survival messages to each other to verify the activity; members capable of conducting election initiate election requests to members which are on the lower layer and do not participate in committee elections, and vote information is collected; other members post the ballot to the requesting member after receiving the first election request and only throw one ballot; if the time-out time t1If the result is reached, the next step is executed;
1.2) at a set timeout t2Firstly, determining all members of high-level activities, and enabling all the members to enter a committee and form a temporary committee; the temporary committee counts a member list of the current committee and the number of the remaining seats and broadcasts the member list and the number of the remaining seats; the election members send the collected vote information to a temporary committee; if the time-out time t2If the result is reached, the next step is executed;
1.3) at a set timeout t3After the temporary committee counts the votes of the members to be selected, the votes are counted>Sorting and filling the gaps in a weight mode, and selecting the member with the heaviest weight as a head-turn pivot head seat; the first 10 members with the most weight except the head seat are taken as the pivot of the committee and are sorted according to the weight; the first f +1 executives are then selected as the active executives, and the remaining f executives are the observed executives.
7. The internet-of-things-oriented lightweight blockchain consensus method according to claim 6, wherein the member evaluation criteria for the soliciting member to bid for when delivering the vote to the soliciting member in step 1.1) are as follows: and (3) ordering all members in the view from heavy to light according to the weight, assuming that the number of the members in the highest layer is x, calculating the (A-x) × 2 nodes in the y layer, and then selecting the members as all non-highest nodes not lower than the y layer, wherein A is the upper limit number of the committee.
8. An internet-of-things-oriented lightweight blockchain consensus system, comprising a plurality of internet-of-things nodes connected in a hierarchical topology, wherein the plurality of internet-of-things nodes are programmed or configured to perform the steps of the internet-of-things-oriented lightweight blockchain consensus method according to any one of claims 1 to 7, or wherein a storage medium of the plurality of internet-of-things nodes has stored thereon a computer program programmed or configured to perform the internet-of-things-oriented lightweight blockchain consensus method according to any one of claims 1 to 7.
9. A computer-readable storage medium having stored thereon a computer program programmed or configured to perform the internet-of-things oriented lightweight blockchain consensus method according to any one of claims 1 to 7.
CN201911017871.3A 2019-10-24 2019-10-24 Internet of things-oriented lightweight block chain consensus method, system and medium Active CN110768798B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911017871.3A CN110768798B (en) 2019-10-24 2019-10-24 Internet of things-oriented lightweight block chain consensus method, system and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911017871.3A CN110768798B (en) 2019-10-24 2019-10-24 Internet of things-oriented lightweight block chain consensus method, system and medium

Publications (2)

Publication Number Publication Date
CN110768798A true CN110768798A (en) 2020-02-07
CN110768798B CN110768798B (en) 2022-06-28

Family

ID=69333572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911017871.3A Active CN110768798B (en) 2019-10-24 2019-10-24 Internet of things-oriented lightweight block chain consensus method, system and medium

Country Status (1)

Country Link
CN (1) CN110768798B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113938494A (en) * 2021-10-13 2022-01-14 中国人民解放军国防科技大学 Chain network segmentation and recombination method and system for large-scale Internet of things scene
CN114070733A (en) * 2022-01-17 2022-02-18 清华大学 Consensus method, device and system based on block chain network

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107395403A (en) * 2017-07-07 2017-11-24 北京区块链云科技有限公司 A kind of fiduciary block chain common recognition method suitable for extensive ecommerce
CN108200203A (en) * 2018-02-06 2018-06-22 北京奇虎科技有限公司 Block catenary system based on double-layer network
CN109447795A (en) * 2018-09-11 2019-03-08 中国人民解放军国防科技大学 Byzantine consensus method supporting rapid achievement of final confirmation
WO2019119034A1 (en) * 2017-12-19 2019-06-27 Blockchain It Solutions Pty Ltd A system and method for implementing a computer network
CN110069345A (en) * 2019-04-23 2019-07-30 江苏大学 Crowdsourcing resource distribution formula anonymity dispensing method and its allocating system based on block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107395403A (en) * 2017-07-07 2017-11-24 北京区块链云科技有限公司 A kind of fiduciary block chain common recognition method suitable for extensive ecommerce
WO2019119034A1 (en) * 2017-12-19 2019-06-27 Blockchain It Solutions Pty Ltd A system and method for implementing a computer network
CN108200203A (en) * 2018-02-06 2018-06-22 北京奇虎科技有限公司 Block catenary system based on double-layer network
CN109447795A (en) * 2018-09-11 2019-03-08 中国人民解放军国防科技大学 Byzantine consensus method supporting rapid achievement of final confirmation
CN110069345A (en) * 2019-04-23 2019-07-30 江苏大学 Crowdsourcing resource distribution formula anonymity dispensing method and its allocating system based on block chain

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
PEICHANG SHI ET AL.: "Blockchain-based trusted data sharing among trusted stakeholders in IoT", 《WILEY》 *
史锦山等: "物联网下的区块链访问控制综述", 《软件学报》 *
赵满等: "区块链技术在物联网工程中的应用研究", 《信息与电脑》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113938494A (en) * 2021-10-13 2022-01-14 中国人民解放军国防科技大学 Chain network segmentation and recombination method and system for large-scale Internet of things scene
CN113938494B (en) * 2021-10-13 2023-09-12 中国人民解放军国防科技大学 Chain network segmentation and recombination method and system for large-scale Internet of things scene
CN114070733A (en) * 2022-01-17 2022-02-18 清华大学 Consensus method, device and system based on block chain network
CN114070733B (en) * 2022-01-17 2023-01-31 清华大学 Consensus method, device and system based on block chain network
WO2023134159A1 (en) * 2022-01-17 2023-07-20 清华大学 Consensus method and apparatus based on blockchain network, electronic device and storage medium

Also Published As

Publication number Publication date
CN110768798B (en) 2022-06-28

Similar Documents

Publication Publication Date Title
CN111601258B (en) Vehicle networking node data safety communication method based on block chain
CN106447311B (en) A kind of block chain of Byzantine failure tolerance algorithms of four communications builds block method
CN111010278B (en) High-fault-tolerance layering consensus method based on DPoS
CN109286685A (en) The system architecture of the more subchains of main chain adduction row of subchain can be expanded
CN108632362A (en) A kind of method that privately owned block chain builds the election of block node
US20050132154A1 (en) Reliable leader election in storage area network
CN111935207A (en) Block chain system consensus method based on improved C4.5 algorithm
CN110602217B (en) Block chain-based alliance management method, device, equipment and storage medium
CN110768798B (en) Internet of things-oriented lightweight block chain consensus method, system and medium
CN113642019A (en) Double-layer grouping Byzantine fault-tolerant consensus method and system
WO2021135934A1 (en) Blockchain accounting method and apparatus, node and storage medium
CN111130790B (en) Block co-recognition method based on block chain node network
CN111369319B (en) Crowd-sourced logistics dispatching and scheduling system and method based on blockchain
CN111127005A (en) Transaction endorsement method for block chain, electronic device and storage medium
CN108881476A (en) Block chain dispositions method and system
CN111970380A (en) Service processing method based on block chain and service processing system based on block chain
CN113783899B (en) Node exit method and blockchain system
CN111107103B (en) Method, system and storage medium for maintaining performance of alliance chain
CN110071966B (en) Block chain networking and data processing method based on cloud platform
CN115065689B (en) Alliance chain block data storage method and system based on historical evaluation
CN110730241A (en) Global scale oriented blockchain infrastructure
CN116260826A (en) Bayesian-busy fault tolerance consensus method and system in supply chain tracing
EP4122184B1 (en) Rapid ledger consensus system and method for distributed wireless networks
CN110535916B (en) Supply guarantee management method based on block chain
CN114820183B (en) Method and system for eliminating bifurcation problem in parallel voting certification consensus algorithm

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