CN110768798B - Internet of things-oriented lightweight block chain consensus method, system and medium - Google Patents

Internet of things-oriented lightweight block chain consensus method, system and medium Download PDF

Info

Publication number
CN110768798B
CN110768798B CN201911017871.3A CN201911017871A CN110768798B CN 110768798 B CN110768798 B CN 110768798B CN 201911017871 A CN201911017871 A CN 201911017871A CN 110768798 B CN110768798 B CN 110768798B
Authority
CN
China
Prior art keywords
members
information
block
internet
things
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
CN201911017871.3A
Other languages
Chinese (zh)
Other versions
CN110768798A (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

Internet of things-oriented lightweight block chain consensus method, system and medium
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 chains 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 use of block chains directly in the internet of things. Meanwhile, the inherent hierarchical structure of the internet of things and the decentralized distributed network structure of the block chain have certain conflict.
Therefore, how to implement lightweight block chain consensus for the internet of things has become a key technical problem to be solved urgently when the block chain 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 needs to be entered;
2) packing the block B by the head seat 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 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, when the hub member checks whether the serial number n of the received pre-release information is continuous in step 3), the method further includes the following processing steps: if the hub member finds sequence number n and the history sequence number n stored locallyhN = 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.
Optionally, 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; upon receiving the activation request, the observed executive willReturning the verification result to the center, selecting f +1 same verification results from the center, selecting the corresponding executive officers as 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 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 a view change request containing 2g +1 of 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) timeout at setupTime 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 t 1If yes, executing the next step;
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 p packs a block B and sends pre-release information to all central 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 t p1Internally 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 member 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, 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. 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) The head position p packs the block B and sends pre-issue information to all the pivot members, which refers to the step I in the figure 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, r is the current election round,< >pthe presentation information is encrypted by the chairman p with its private key. The embodiment is embodied in <X>YIndicates that the 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, the same applies below.
3) Each pivot member checks whether the serial number n of the received pre-release information is continuous or not, if so, returns a confirmation release information to the head seat p, and refers to the step II in the figure 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 isIs the sequence number of block B, v is the current view number, r is the current election round, j represents the backbone 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 tp1Internally counting the number of the received confirmation release information, integrating the confirmation release information into confirmation release certificates and broadcasting the confirmation release certificates to all executive officers if the number of the received confirmation release information is not less than 2g +1, and referring to the step three in the figure 1; 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;
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 (IV) in the figure 1 is referred;
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 tp2Counting the received verification information, if f +1 consistent verification passing information is received, generating a verification passing certificate, namely a collection of f +1 consistent verification passing information, then issuing a block B and additionally confirming the issuing certificate and the verification passing certificate, referring to the step (v) in the figure 1; if f +1 consistent verification failing information is received, generating a verification failing certificate, namely a collection of f +1 consistent verification failing information, issuing a blank block B and 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 the hub member finds sequence number n and local storeHistory serial 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; 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 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 level 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 time outTime 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:
<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 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 t3In the method, after the temporary committee counts the votes of the election members, the votes are counted according to the number of the votes>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 who can bid for 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 (A-x) 2 nodes in the y layer, and then, selecting the members which are not lower than all the nodes in the non-highest layer of 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 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 in this 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 in this embodiment.
In addition, the present embodiment also provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program that is programmed or configured to execute the foregoing internet-of-things-oriented lightweight blockchain consensus method of 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 scope of the present invention is not limited to the above embodiments, and all technical solutions that belong to the idea of the present invention belong to the scope of the present invention. It should be noted that modifications and adaptations to those skilled in the art without departing from the principles of the present invention should also be considered as within the scope of the present 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 and comprises a head position p, the total upper limit number containing the head position 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 for achieving consensus, and f is the maximum executive officer error node number; executing the next step when the consensus of the block B needs to be entered;
2) packing the block B by the head seat p, and sending pre-release information to all the pivot members;
3) each pivot member checks whether the received pre-release information has continuous serial numbers n, and if so, returns confirmation release information to the head seat p;
4) The head p is in the set overtime 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 member 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 seat p and all the pivot members, otherwise, the executive officer broadcasts verification failure information to the head seat p and all the pivot members;
6) the head p is in the set overtime 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; if f +1 consistent verification failure messages are 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 n hN = 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 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.
4. The internet of things-oriented lightweight blockchain consensus method as claimed in 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 pivot member receives the broadcast message which is sent by g +1 different pivot members and initiates pivot 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 exceedTime of flight 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 block chain consensus method according to claim 6, wherein the member judgment criteria for the solicitation member to bid for when delivering the vote to the solicitation 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 (A-x) 2 nodes in the y layer, and then, selecting the members which are not lower than all the nodes in the non-highest layer of 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 of any one of claims 1 to 7, or a computer program programmed or configured to perform the internet-of-things-oriented lightweight blockchain consensus method of any one of claims 1 to 7 is stored on a storage medium of the plurality of internet-of-things nodes.
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 of 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 CN110768798A (en) 2020-02-07
CN110768798B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113938494B (en) * 2021-10-13 2023-09-12 中国人民解放军国防科技大学 Chain network segmentation and recombination method and system for large-scale Internet of things scene
CN114070733B (en) * 2022-01-17 2023-01-31 清华大学 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
Blockchain-based trusted data sharing among trusted stakeholders in IoT;Peichang Shi et al.;《WILEY》;20190709;全文 *
区块链技术在物联网工程中的应用研究;赵满等;《信息与电脑》;20190615;全文 *
物联网下的区块链访问控制综述;史锦山等;《软件学报》;20190327;全文 *

Also Published As

Publication number Publication date
CN110768798A (en) 2020-02-07

Similar Documents

Publication Publication Date Title
US11411721B2 (en) Systems and methods for selecting and utilizing a committee of validator nodes in a distributed system
CN110113388B (en) Improved clustering algorithm-based block chain system consensus method and device
CN106447311B (en) A kind of block chain of Byzantine failure tolerance algorithms of four communications builds block method
CN106406896A (en) Block chain block-building method based on parallel PipeLine technology
CN113642019A (en) Double-layer grouping Byzantine fault-tolerant consensus method and system
CN112235379B (en) Block chain bottom layer shared storage method
CN108632362A (en) A kind of method that privately owned block chain builds the election of block node
CN111010278B (en) High-fault-tolerance layering consensus method based on DPoS
CN110768798B (en) Internet of things-oriented lightweight block chain consensus method, system and medium
CN110602217B (en) Block chain-based alliance management method, device, equipment and storage medium
US20050132154A1 (en) Reliable leader election in storage area network
US20200286049A1 (en) Systems and methods of self-administered protocols on a blockchain platform
CN108512667A (en) A kind of certification certificates constructing method based on block chain
CN111935207A (en) Block chain system consensus method based on improved C4.5 algorithm
WO2021135934A1 (en) Blockchain accounting method and apparatus, node and storage medium
CN113783899B (en) Node exit method and blockchain system
CN108881476A (en) Block chain dispositions method and system
CN112116349B (en) High-throughput-rate-oriented random consensus method and device for drawing account book
CN111107103B (en) Method, system and storage medium for maintaining performance of alliance chain
CN110730241B (en) Global scale oriented blockchain infrastructure
CN110071966B (en) Block chain networking and data processing method based on cloud platform
CN115412263B (en) Bayesian-busy-court fault-tolerant consensus method based on double blinding
EP4122184B1 (en) Rapid ledger consensus system and method for distributed wireless networks
CN115720227A (en) Election method and device for consensus nodes of block chain and electronic equipment
CN115065689A (en) History evaluation-based alliance link block data storage method and system

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