[go: up one dir, main page]

CN111935207A - Block chain system consensus method based on improved C4.5 algorithm - Google Patents

Block chain system consensus method based on improved C4.5 algorithm Download PDF

Info

Publication number
CN111935207A
CN111935207A CN202010584378.6A CN202010584378A CN111935207A CN 111935207 A CN111935207 A CN 111935207A CN 202010584378 A CN202010584378 A CN 202010584378A CN 111935207 A CN111935207 A CN 111935207A
Authority
CN
China
Prior art keywords
consensus
block
layer
node
level
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.)
Pending
Application number
CN202010584378.6A
Other languages
Chinese (zh)
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.)
Hainan University
Original Assignee
Hainan University
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 Hainan University filed Critical Hainan University
Priority to CN202010584378.6A priority Critical patent/CN111935207A/en
Publication of CN111935207A publication Critical patent/CN111935207A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/24323Tree-organised classifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/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/3247Cryptographic 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 digital signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • Evolutionary Biology (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了基于改进型C4.5算法区块链系统共识方法,包括一级共识层共识:组内从节点将请求发送给主节点,主节点在接收一段时间的请求后,将若干请求打包成一个区块,然后将该区块广播给它所属组进行一次PBFT共识;二级共识层共识:区块通过一级共识层的共识验证过程后,将在二级共识层进行二次PBFT共识确认。二级共识层内的K个节点通过积分投票机制选举出一个主节点,该节点会将这段时间内收集的通过了所属一级共识层共识的请求打包成一个区块广播给二级共识层的所有节点进行PBFT共识。

Figure 202010584378

The invention discloses a consensus method for a blockchain system based on an improved C4.5 algorithm, including a first-level consensus layer consensus: a slave node in a group sends a request to a master node, and the master node packages several requests after receiving the requests for a period of time A block is then broadcast to the group to which it belongs for a PBFT consensus; the second-level consensus layer consensus: after the block passes the consensus verification process of the first-level consensus layer, a second PBFT consensus will be performed at the second-level consensus layer confirm. The K nodes in the second-level consensus layer elect a master node through the point voting mechanism, and the node will package the requests collected during this period that have passed the consensus of the first-level consensus layer into a block and broadcast it to the second-level consensus layer. All nodes of PBFT consensus.

Figure 202010584378

Description

基于改进型C4.5算法区块链系统共识方法Consensus method of blockchain system based on improved C4.5 algorithm

技术领域technical field

本发明属于区块链系统技术领域,具体地说,涉及基于改进型C4.5算法区块链系统共识方法。The invention belongs to the technical field of blockchain systems, and in particular relates to a consensus method for a blockchain system based on an improved C4.5 algorithm.

背景技术Background technique

区块链是一个去中心化的分布式系统,具有开放性,可追溯性,去中心化和不可篡改等特点。共识算法是区块链技术的核心,直接影响到区块链系统的可扩展性。区块链可以分为公有链,私有链和联盟链,现在联盟链常用的共识算法为实用拜占庭容错算法(PBFT),PBFT是一种用于解决拜占庭将军问题的算法,其能够在网络中存在恶意节点的情况下保证各个节点间的一致性。如图1所示为现有PBFT算法的流程示意图,PBFT共识算法主要由一致性协议,视图更换协议和检查点协议组成。一致性协议用来保证全网所有节点保存数据的一致性,其通过三阶段节点间的互相通信来实现;视图更换协议用于替换故障节点从而保证系统的正常进行;检查点协议用于定期清理过期交互数据减轻节点存储压力,定期检查系统是否统一,对不一致节点进行同步。然而现有的拜占庭容错算法要么是可扩展性差,是容错率低,要么主节点的选取随意会引起视图的变化过程,影响整个共识过程,并且该算法在节点数目增多时通信量较大,导致网络堵塞。如何改进现有PBFT算法是大规模区块链应用的前提。Blockchain is a decentralized distributed system with the characteristics of openness, traceability, decentralization and immutability. Consensus algorithm is the core of blockchain technology, which directly affects the scalability of the blockchain system. Blockchain can be divided into public chain, private chain and alliance chain. The consensus algorithm commonly used in alliance chain is Practical Byzantine Fault Tolerance (PBFT). PBFT is an algorithm used to solve Byzantine generals problem, which can exist in the network. In the case of malicious nodes, the consistency between each node is guaranteed. Figure 1 is a schematic flow chart of the existing PBFT algorithm. The PBFT consensus algorithm is mainly composed of a consensus protocol, a view replacement protocol and a checkpoint protocol. Consistency protocol is used to ensure the consistency of data saved by all nodes in the whole network, which is realized by mutual communication between nodes in three stages; view replacement protocol is used to replace faulty nodes to ensure the normal operation of the system; checkpoint protocol is used to periodically clean up Expired interactive data reduces the storage pressure of nodes, regularly checks whether the system is unified, and synchronizes inconsistent nodes. However, the existing Byzantine fault-tolerant algorithms either have poor scalability and low fault-tolerance rate, or the random selection of the master node will cause the view change process and affect the entire consensus process. Network congestion. How to improve the existing PBFT algorithm is the premise of large-scale blockchain application.

有鉴于此特提出本发明。The present invention has been made in view of this.

发明内容SUMMARY OF THE INVENTION

本发明要解决的技术问题在于克服现有技术的不足,提供基于改进型C4.5算法区块链系统共识方法,为解决上述技术问题,本发明采用技术方案的基本构思是:The technical problem to be solved by the present invention is to overcome the deficiencies of the prior art and provide a consensus method based on the improved C4.5 algorithm block chain system. In order to solve the above technical problems, the basic concept of the technical solution adopted in the present invention is:

基于改进型C4.5算法区块链系统共识方法,包括一级共识层共识:组内从节点将请求发送给主节点,主节点在接收一段时间的请求后,将若干请求打包成一个区块,然后将该区块广播给它所属组进行一次 PBFT共识;二级共识层共识:区块通过一级共识层的共识验证过程后,将在二级共识层进行二次PBFT共识确认。二级共识层内的K个节点通过积分投票机制选举出一个主节点,该节点会将这段时间内收集的通过了所属一级共识层共识的请求打包成一个区块广播给二级共识层的所有节点进行PBFT共识;若这段时间内一级共识层没有新的请求,那么节点将打包一个空区块发送给二级共识层共识上链,然后进行下一次选举;提交阶段:当区块经过二级共识层的共识后,所有主节点将对此区块进行数字签名并收集来自其他主节点的数字签名,表示认同此区块的真实性和有效性;然后将此二级共识层的数字签名集合附带区块本身打包成提交消息广播至其所属的一级共识层内的所有从节点,表示可以将此区块进行上链操作。至此任意一级共识层的节点都会收到此区块的提交消息;执行阶段:从节点在收到来自主节点的提交消息后,对区块附带的数字签名集合进行验证,可判断出该区块是否经过了二级共识层的共识验证。若验证失败,则可认为该从节点所属的主节点存在恶意行为,可举报此次违法操作,达到从节点向上监督的作用;若验证成功,则可以执行此区块的请求内容,并将区块记录上链。Based on the improved C4.5 algorithm blockchain system consensus method, including the first-level consensus layer consensus: the slave node in the group sends the request to the master node, and after receiving the request for a period of time, the master node packages several requests into a block , and then broadcast the block to the group it belongs to for a PBFT consensus; the second-level consensus layer consensus: After the block passes the consensus verification process of the first-level consensus layer, it will be confirmed by the second-level PBFT consensus at the second-level consensus layer. The K nodes in the second-level consensus layer elect a master node through the point voting mechanism, and the node will package the requests collected during this period that have passed the consensus of the first-level consensus layer into a block and broadcast it to the second-level consensus layer. All nodes in the PBFT consensus; if there is no new request from the first-level consensus layer during this period, the node will pack an empty block and send it to the second-level consensus layer consensus chain, and then conduct the next election; submission stage: when the district After the block has passed the consensus of the secondary consensus layer, all master nodes will digitally sign the block and collect digital signatures from other master nodes, indicating that they agree with the authenticity and validity of this block; The set of digital signatures attached to the block itself is packaged into a submission message and broadcast to all slave nodes in the first-level consensus layer to which it belongs, indicating that the block can be chained. So far, the nodes of any level of consensus layer will receive the commit message of this block; in the execution stage: after receiving the commit message from the master node, the slave node verifies the set of digital signatures attached to the block, and can determine the block Whether it has passed the consensus verification of the secondary consensus layer. If the verification fails, it can be considered that the master node to which the slave node belongs has malicious behavior, and the illegal operation can be reported to achieve the role of the slave node's upward supervision; if the verification is successful, the request content of this block can be executed, and the block Block records are on the chain.

采用上述技术方案后,本发明与现有技术相比具有以下有益效果。After adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art.

本发明一定程度上保证了主节点的可靠性,减少视图切换次数,进而获得更高的共识效率,同时通过节点分组将全局去中心化共识改进为分层次的多中心化共识,有效缓解单纯使用PBFT算法带来的节点数目增多通信量过大的问题,提高了主节点诚实概率,减少了节点间共识时间,提高共识效率。The invention ensures the reliability of the main node to a certain extent, reduces the number of view switching, and thus achieves higher consensus efficiency. At the same time, the global decentralized consensus is improved to a hierarchical multi-centralized consensus through node grouping, which effectively alleviates the simple use of The PBFT algorithm increases the number of nodes and the communication volume is too large, which improves the honest probability of the master node, reduces the consensus time between nodes, and improves the consensus efficiency.

下面结合附图对本发明的具体实施方式作进一步详细的描述。The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

附图说明Description of drawings

附图作为本申请的一部分,用来提供对本发明的进一步的理解,本发明的示意性实施例及其说明用于解释本发明,但不构成对本发明的不当限定。显然,下面描述中的附图仅仅是一些实施例,对于本领域普通技术人员来说,在不付出创造性劳动的前提下,还可以根据这些附图获得其他附图。在附图中:The accompanying drawings are used as a part of the present application to provide a further understanding of the present invention, and the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but do not constitute an improper limitation of the present invention. Obviously, the drawings in the following description are only some embodiments, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort. In the attached image:

图1为现有PBFT算法流程图;Fig. 1 is the flow chart of the existing PBFT algorithm;

图2为决策树模型图;Figure 2 is a decision tree model diagram;

图3为节点分组后的两层区块链网络图;Figure 3 is a two-layer blockchain network diagram after nodes are grouped;

图4为改进型PBFT流程图。Figure 4 is a flowchart of the improved PBFT.

需要说明的是,这些附图和文字描述并不旨在以任何方式限制本发明的构思范围,而是通过参考特定实施例为本领域技术人员说明本发明的概念。It should be noted that these drawings and written descriptions are not intended to limit the scope of the present invention in any way, but to illustrate the concept of the present invention to those skilled in the art by referring to specific embodiments.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对实施例中的技术方案进行清楚、完整地描述,以下实施例用于说明本发明,但不用来限制本发明的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and the following embodiments are used to illustrate the present invention , but are not intended to limit the scope of the present invention.

实施例Example

C4.5决策树是一种经典的决策树算法,模型如图2所示,它通过计算比较各个特征的信息增益率来确定待分类特征,其基本流程如下:C4.5 decision tree is a classic decision tree algorithm. The model is shown in Figure 2. It determines the features to be classified by calculating and comparing the information gain rate of each feature. The basic process is as follows:

(1)设样本集S有s个训练样本,将样本集分成m类,第i类的实例个数为Si,Si/s即为概率Pi, Info(S)为类别信息熵,其计算公式为:(1) Suppose the sample set S has s training samples, divide the sample set into m classes, the number of instances of the i-th class is S i , S i /s is the probability P i , Info(S) is the class information entropy, Its calculation formula is:

Figure BDA0002553557000000021
Figure BDA0002553557000000021

(2)若选择特征A为分裂特征,则样本集S被划分为k个子集{S1,S2,...,Sk},设特征A有k 个不相关的值{α12,...,αk}则Sj中应为第i类的训练个体数量为Sij,Info(S)为ai的条件信息熵,计算公式为:(2) If feature A is selected as a splitting feature, the sample set S is divided into k subsets {S 1 , S 2 ,...,S k }, and feature A has k uncorrelated values {α 1 , α 2 , . _

Figure BDA0002553557000000022
Figure BDA0002553557000000022

其中,

Figure BDA0002553557000000023
是Sj中第i类的样本概率。in,
Figure BDA0002553557000000023
is the sample probability of class i in S j .

(3)计算条件属性A的信息增益:(3) Calculate the information gain of conditional attribute A:

Gain(A,S)=Info(S)-InfoA(S) (3)Gain(A, S)=Info(S)-Info A (S) (3)

(4)条件属性A作为划分标准将训练集S分为k个子集,ai则对应训练集Sj中的样本数量,属性A在样本S中的信息熵为:(4) The conditional attribute A is used as the dividing standard to divide the training set S into k subsets, a i corresponds to the number of samples in the training set S j , and the information entropy of the attribute A in the sample S is:

Figure BDA0002553557000000031
Figure BDA0002553557000000031

(5)属性A的信息增益率为:(5) The information gain rate of attribute A is:

Figure BDA0002553557000000032
Figure BDA0002553557000000032

为了让C4.5算法更加适用于区块链模型,本实施例对其进行改进,传统的C4.5算法在生成决策树时容易产生冗余规则、决策树规模过大、分类速度过慢等问题。结合区块链共识机制的实际应用场景,在PBFT 共识机制中,部分存在节点的属性值所带的数据信息是相似的,本实施例提出一种基于余弦相似度的改进 C4.5决策树算法,如公式(6)。如果任意两个属性值的信息熵之差在一个很小范围内时,如公式(7)所示。计算两个属性值的余弦相似度,合并相似度在阈值范围内的属性值,如公式(8)。该算法能够有效缩减决策树规模,减少了冗余规则,提高了分类速度。In order to make the C4.5 algorithm more suitable for the blockchain model, this embodiment improves it. The traditional C4.5 algorithm is prone to redundant rules when generating a decision tree, the size of the decision tree is too large, and the classification speed is too slow. question. Combined with the actual application scenario of the blockchain consensus mechanism, in the PBFT consensus mechanism, the data information carried by the attribute values of some existing nodes is similar. This embodiment proposes an improved C4.5 decision tree algorithm based on cosine similarity. , as in formula (6). If the difference between the information entropy of any two attribute values is within a small range, as shown in formula (7). Calculate the cosine similarity of two attribute values, and combine the attribute values whose similarity is within the threshold range, as shown in formula (8). The algorithm can effectively reduce the size of the decision tree, reduce redundant rules, and improve the classification speed.

Figure BDA0002553557000000033
Figure BDA0002553557000000033

Figure BDA0002553557000000034
Figure BDA0002553557000000034

其中,η越小越好,一般不超过0.1,此处设置η=0.1Among them, the smaller the η, the better, generally not more than 0.1, here η = 0.1

Figure BDA0002553557000000035
Figure BDA0002553557000000035

改进后的C4.5基本流程如下:The improved C4.5 basic process is as follows:

(1)计算节点属性中每个属性值的信息熵和属性的信息增益率;(1) Calculate the information entropy of each attribute value in the node attribute and the information gain rate of the attribute;

(2)根据式(7)比较每个属性的属性值中是否有信息熵在阈值范围内的属性值对,若存在则计算 (3),否则转(6);(2) According to formula (7), compare whether there is an attribute value pair whose information entropy is within the threshold range in the attribute value of each attribute, if there is, calculate (3), otherwise go to (6);

(3)再根据式(6)计算两个属性值对的余弦相似值,若大于阈值0.9,说明两个向量具有很高的相似性则转到(4),否则转(6);(3) Calculate the cosine similarity value of the two attribute value pairs according to formula (6). If it is greater than the threshold value of 0.9, it means that the two vectors have high similarity, then go to (4), otherwise go to (6);

(4)根据式(8)将两个属性值向量合并成新的属性值向量,则新的向量代表了新的子集、新的属性值。再将属性中的原来参与比较的属性值删掉,添加上新的属性值,构成新的属性;(4) Combine the two attribute value vectors into a new attribute value vector according to formula (8), and the new vector represents a new subset and a new attribute value. Then delete the original attribute value in the attribute that participated in the comparison, and add a new attribute value to form a new attribute;

(5)根据修改后的属性重新计算属性的信息熵,信息增益率;(5) Recalculate the information entropy and information gain rate of the attribute according to the modified attribute;

(6)再从属性集中选择出信息增益率最大的属性作为分裂属性。(6) Select the attribute with the largest information gain rate from the attribute set as the split attribute.

C4.5算法与PBFT共识机制相结合,利用决策树算法对参与共识的共识节点进行信任度评估分类,根据信任度等级高低依次顺序编号为{0,1,…,M-1}。在信任度评估分类的基础上,以K为比例进行抽样分组,信任等级评估的前K个节点为每组主节点,模型如图3所示,组内各个节点都保存着一份列表,列表上面会出现一个组内节点的地址,这个地址标识着这些节点之间为同一个组。此组内节点数存在一个上限M/K。当有新节点a加入时,向网络发放自己请求,附带公钥P,然后进入等待状态,网络中的主节点b收到来自新节点的请求信息后,确定自己的组内节点数目仍未到达上限,将接受加入信息附带上时间戳,以及本节点的公钥S,使用P加密,并以报文的形式传送到二级共识层,二级共识层其他节点在收到确定报文后 (可能同时会收到多个报文,以时间戳最早的为主),确定加入该组,并且发送回执报文,使用S加密。 b收到报文后向全组节点广播,更新节点列表,并向节点a同步最新的节点列表,a随即同步全网中区块的所有数据。当有节点c退出时,节点c需要向组内主节点d提交退出申请附带公钥S,主节点d接受退出信息附带时间戳以及本节点的公钥S,使用P加密,并以报文的形式向二级共识层提交退出申请,其他主节点共识确认同意后,发送回执报文,使用S加密。主节点d向组内发出节点c的信息,更新自己组内节点连接信息,当确认组内2f+1节点完成更新,节点c才真正退出区块链网络。The C4.5 algorithm is combined with the PBFT consensus mechanism, and the decision tree algorithm is used to evaluate and classify the consensus nodes participating in the consensus, which are numbered as {0,1,…,M-1} according to the level of trust. On the basis of the classification of trust evaluation, sampling and grouping are carried out in proportion to K. The first K nodes in the evaluation of trust level are the main nodes of each group. The model is shown in Figure 3. Each node in the group saves a list. The address of a node in the group will appear above, and this address identifies these nodes as the same group. There is an upper limit M/K for the number of nodes in this group. When a new node a joins, it sends its own request to the network, attaches the public key P, and then enters the waiting state. After receiving the request information from the new node, the master node b in the network determines that the number of nodes in its own group has not yet arrived. The upper limit, will accept the joining information with a timestamp, and the public key S of the node, encrypt it with P, and transmit it to the secondary consensus layer in the form of a message. After receiving the confirmation message ( It may receive multiple packets at the same time, the one with the earliest timestamp is the main one), determine to join the group, and send a receipt packet, using S encryption. After receiving the message, b broadcasts it to the entire group of nodes, updates the node list, and synchronizes the latest node list to node a, and a then synchronizes all the data of the blocks in the entire network. When a node c exits, the node c needs to submit an exit application with the public key S to the master node d in the group, and the master node d accepts the exit information with the timestamp and the public key S of the node, encrypts it with P, and uses the message Submit an exit application to the secondary consensus layer in the form of an exit application. After the other master nodes agree to the consensus, they will send a receipt message and use S encryption. The master node d sends the information of node c to the group to update the node connection information in its own group. When it is confirmed that the 2f+1 nodes in the group have completed the update, node c will actually exit the blockchain network.

在二级共识层中,为了进一步降低恶意节点成为主节点的概率,主节点的选取采用积分投票机制。投票结果的计算方式为:In the secondary consensus layer, in order to further reduce the probability of malicious nodes becoming master nodes, the selection of master nodes adopts a point voting mechanism. The voting results are calculated as:

T=所得票数*α+积分值*β(α+β=1) (9)T=Number of votes*α+Point value*β(α+β=1) (9)

其中T为最终分数,α,β是根据节点积分值变化而设定不同的修正参数。0≤α,β≤1。Where T is the final score, α, β are different correction parameters set according to the change of the integral value of the node. 0≤α, β≤1.

1.积分值的计算:系统初始化时,会为每个节点分配50分的积分值。一个周期内如果一个节点成功生产区块并经过验证有效,系统会奖励10分的积分值;若节点未在规定时间内完成出块,系统会扣除10 积分值。积分值会随节点的行为逐渐累加,此时为了避免积分值贫富差距过大,设定积分阈值为200分,超过200分后系统重置其积分值为50。1. Calculation of integral value: When the system is initialized, an integral value of 50 points will be assigned to each node. If a node successfully produces a block within a cycle and is verified to be valid, the system will reward 10 points of points; if the node fails to complete the block within the specified time, the system will deduct 10 points. The integral value will gradually accumulate with the behavior of the node. At this time, in order to avoid the excessive gap between the rich and the poor in the integral value, the integral threshold is set to 200 points. After 200 points, the system resets the integral value to 50.

2.关于积分表的维护,在联盟链中选取信任等级最高节点为权威节点来维护积分表,当节点成功共识后,会将执行成功的共识内容的哈希值作为证据绑定积分,权威节点会验证哈希值,如果验证通过,则对该节点进行累加积分,如果验证不通过,则根据节点地址,对节点积分扣除,最后在下一阶段共识开始之前,完成对积分表内所有节点积分加1分的操作,完成积分表维护过程积分制度的建立,一方面从博弈论角度惩罚奖励机制减轻了作恶节点对区块链系统共识的影响;另一方面保证了主节点选取的最优性,进一步降低主节点作恶的可能性。2. Regarding the maintenance of the score table, select the node with the highest trust level in the alliance chain as the authoritative node to maintain the score table. When the node successfully reaches the consensus, the hash value of the successful consensus content will be used as evidence to bind the score, and the authoritative node will The hash value will be verified. If the verification is passed, the node will accumulate points. If the verification fails, the node points will be deducted according to the node address. Finally, before the next stage of consensus starts, the points in the points table will be added to all nodes. The 1-point operation completes the establishment of the point system in the maintenance process of the point table. On the one hand, from the perspective of game theory, the punishment and reward mechanism reduces the impact of malicious nodes on the consensus of the blockchain system; Further reduce the possibility of masternodes doing evil.

改进PBFT共识算法流程图如图4所示,主要流程阶段如下:The flowchart of the improved PBFT consensus algorithm is shown in Figure 4. The main process stages are as follows:

(1)一级共识层共识:组内从节点将请求发送给主节点。主节点在接收一段时间的请求后,将若干请求打包成一个区块,然后将该区块广播给它所属组进行一次PBFT共识。(1) First-level consensus layer consensus: slave nodes in the group send requests to the master node. After receiving requests for a period of time, the master node packages several requests into a block, and then broadcasts the block to the group to which it belongs for a PBFT consensus.

(2)二级共识层共识:区块通过一级共识层的共识验证过程后,将在二级共识层进行二次PBFT共识确认。二级共识层内的K个节点通过积分投票机制选举出一个主节点,该节点会将这段时间内收集的通过了所属一级共识层共识的请求打包成一个区块广播给二级共识层的所有节点进行PBFT共识;若这段时间内一级共识层没有新的请求,那么节点将打包一个空区块发送给二级共识层共识上链,然后进行下一次选举。(2) Second-level consensus layer consensus: After the block passes the consensus verification process of the first-level consensus layer, the second PBFT consensus confirmation will be performed at the second-level consensus layer. The K nodes in the second-level consensus layer elect a master node through the point voting mechanism, and the node will package the requests collected during this period that have passed the consensus of the first-level consensus layer into a block and broadcast it to the second-level consensus layer. All nodes in the PBFT consensus; if there is no new request from the first-level consensus layer during this period, the node will pack an empty block and send it to the second-level consensus layer consensus chain, and then conduct the next election.

(3)提交阶段:当区块经过二级共识层的共识后,所有主节点将对此区块进行数字签名并收集来自其他主节点的数字签名,表示认同此区块的真实性和有效性;然后将此二级共识层的数字签名集合附带区块本身打包成提交消息广播至其所属的一级共识层内的所有从节点,表示可以将此区块进行上链操作。至此任意一级共识层的节点都会收到此区块的提交消息。(3) Submission stage: After the block has passed the consensus of the secondary consensus layer, all master nodes will digitally sign the block and collect digital signatures from other master nodes, indicating that they agree with the authenticity and validity of the block ; and then package the digital signature set of the second-level consensus layer with the block itself into a submission message and broadcast it to all slave nodes in the first-level consensus layer to which it belongs, indicating that the block can be put on the chain. So far, the nodes of any level of consensus layer will receive the commit message of this block.

(4)执行阶段:从节点在收到来自主节点的提交消息后,对区块附带的数字签名集合进行验证,可判断出该区块是否经过了二级共识层的共识验证。若验证失败,则可认为该从节点所属的主节点存在恶意行为,可举报此次违法操作,达到从节点向上监督的作用;若验证成功,则可以执行此区块的请求内容,并将区块记录上链。(4) Execution stage: After the slave node receives the submission message from the master node, it verifies the set of digital signatures attached to the block to determine whether the block has passed the consensus verification of the secondary consensus layer. If the verification fails, it can be considered that the master node to which the slave node belongs has malicious behavior, and the illegal operation can be reported to achieve the role of the slave node's upward supervision; if the verification is successful, the request content of this block can be executed, and the block Block records are on the chain.

以上所述仅是本发明的较佳实施例而已,并非对本发明作任何形式上的限制,虽然本发明已以较佳实施例揭露如上,然而并非用以限定本发明,任何熟悉本专利的技术人员在不脱离本发明技术方案范围内,当可利用上述提示的技术内容作出些许更动或修饰为等同变化的等效实施例,但凡是未脱离本发明技术方案的内容,依据本发明的技术实质对以上实施例所作的任何简单修改、等同变化与修饰,均仍属于本发明方案的范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention in any form. Although the present invention has been disclosed above with preferred embodiments, it is not intended to limit the present invention. Within the scope of the technical solution of the present invention, personnel can make some changes or modifications to equivalent examples of equivalent changes by using the above-mentioned technical content, but any content that does not depart from the technical solution of the present invention is based on the technical solution of the present invention. Substantially any simple modifications, equivalent changes and modifications made to the above embodiments still fall within the scope of the solutions of the present invention.

Claims (1)

1. The block chain system consensus method based on the improved C4.5 algorithm is characterized by comprising a first-level consensus layer consensus: the method comprises the following steps that a slave node in a group sends a request to a master node, the master node packs a plurality of requests into a block after receiving the request for a period of time, and then broadcasts the block to a group to which the block belongs to carry out PBFT consensus for one time; and (3) second-level consensus layer consensus: after the block passes the consensus verification process of the first-level consensus layer, the second-level consensus layer is subjected to the PBFT consensus confirmation. K nodes in the secondary consensus layer elect a main node through an integral voting mechanism, and the node packs the collected requests passing through the consensus of the primary consensus layer in the period of time into a block and broadcasts the block to all nodes of the secondary consensus layer for PBFT consensus; if the primary common-identification layer has no new request in the period of time, the node packs a vacant block and sends the vacant block to the secondary common-identification layer common-identification uplink, and then the next election is carried out; a submission stage: after the block is subjected to the consensus of the secondary consensus layer, all the main nodes carry out digital signature on the block and collect digital signatures from other main nodes to represent the authenticity and the effectiveness of the block; then, the block attached to the digital signature set of the secondary common identification layer is packaged into a submit message which is broadcast to all the slave nodes in the primary common identification layer to which the submit message belongs, so that the block can be subjected to uplink operation. The node of any level of the consensus layer receives the submission message of the block; an execution stage: after receiving the submitted message from the master node, the slave node verifies the digital signature set attached to the block, and can judge whether the block is subjected to consensus verification of the secondary consensus layer. If the verification fails, the master node to which the slave node belongs can be considered to have malicious behaviors, and the illegal operation can be reported, so that the effect of upward supervision of the slave node is achieved; if the verification is successful, the requested content for the block can be executed and the block is recorded for uplink.
CN202010584378.6A 2020-06-23 2020-06-23 Block chain system consensus method based on improved C4.5 algorithm Pending CN111935207A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010584378.6A CN111935207A (en) 2020-06-23 2020-06-23 Block chain system consensus method based on improved C4.5 algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010584378.6A CN111935207A (en) 2020-06-23 2020-06-23 Block chain system consensus method based on improved C4.5 algorithm

Publications (1)

Publication Number Publication Date
CN111935207A true CN111935207A (en) 2020-11-13

Family

ID=73317361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010584378.6A Pending CN111935207A (en) 2020-06-23 2020-06-23 Block chain system consensus method based on improved C4.5 algorithm

Country Status (1)

Country Link
CN (1) CN111935207A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860482A (en) * 2021-01-27 2021-05-28 西南林业大学 Block chain consensus performance optimization method
CN112866399A (en) * 2021-01-28 2021-05-28 深圳大学 Improved PBFT consensus method, device, intelligent terminal and storage medium
CN113645074A (en) * 2021-08-11 2021-11-12 永旗(北京)科技有限公司 A blockchain-based consensus method
CN113849556A (en) * 2021-08-11 2021-12-28 国网甘肃省电力公司信息通信公司 Sharing mechanism based on block chain distributed database
CN113922864A (en) * 2021-10-09 2022-01-11 郑州大学 Multi-layer satellite network security guarantee method based on Byzantine consensus
CN114301598A (en) * 2021-12-14 2022-04-08 中国人民解放军国防科技大学 Block chain consensus algorithm, system and storage medium based on hierarchical authority
CN114363354A (en) * 2021-12-30 2022-04-15 海南大学 Blockchain consensus method based on DIKWP model
CN114449000A (en) * 2021-12-28 2022-05-06 北京邮电大学 A vehicle network data consensus optimized storage method and storage system
CN115766742A (en) * 2022-11-03 2023-03-07 咪咕文化科技有限公司 Block chain consensus method, system, device and computer readable storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108648071A (en) * 2018-05-17 2018-10-12 阿里巴巴集团控股有限公司 Value evaluation of tourism resources method and apparatus based on block chain

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108648071A (en) * 2018-05-17 2018-10-12 阿里巴巴集团控股有限公司 Value evaluation of tourism resources method and apparatus based on block chain

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
黄宇翔: "区块链中基于C4.5决策树的PBFT共识算法性能优化研究", 《中国优秀硕士学位论文全文数据库》 *
黄宇翔;梁志宏;张梦迪;危兵;: "面向学分银行的区块链学习成果管控模型", 计算机工程, no. 05 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112860482A (en) * 2021-01-27 2021-05-28 西南林业大学 Block chain consensus performance optimization method
CN112866399A (en) * 2021-01-28 2021-05-28 深圳大学 Improved PBFT consensus method, device, intelligent terminal and storage medium
CN112866399B (en) * 2021-01-28 2023-01-31 深圳大学 An improved PBFT consensus method, device, intelligent terminal and storage medium
CN113645074A (en) * 2021-08-11 2021-11-12 永旗(北京)科技有限公司 A blockchain-based consensus method
CN113849556A (en) * 2021-08-11 2021-12-28 国网甘肃省电力公司信息通信公司 Sharing mechanism based on block chain distributed database
CN113922864A (en) * 2021-10-09 2022-01-11 郑州大学 Multi-layer satellite network security guarantee method based on Byzantine consensus
CN114301598A (en) * 2021-12-14 2022-04-08 中国人民解放军国防科技大学 Block chain consensus algorithm, system and storage medium based on hierarchical authority
CN114449000A (en) * 2021-12-28 2022-05-06 北京邮电大学 A vehicle network data consensus optimized storage method and storage system
CN114449000B (en) * 2021-12-28 2022-10-11 北京邮电大学 Internet of vehicles data consensus optimization storage method and storage system
CN114363354A (en) * 2021-12-30 2022-04-15 海南大学 Blockchain consensus method based on DIKWP model
CN114363354B (en) * 2021-12-30 2022-09-30 海南大学 Blockchain consensus method based on DIKWP model
CN115766742A (en) * 2022-11-03 2023-03-07 咪咕文化科技有限公司 Block chain consensus method, system, device and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN111935207A (en) Block chain system consensus method based on improved C4.5 algorithm
CN111106942B (en) Block chain credit process method based on AP-PBFT algorithm
CN113141414B (en) Grouped multi-chain asynchronous consensus method for block chain nodes in CNFS protocol
CN110784346B (en) Reputation value-based PBFT consensus system and method
CN109889382B (en) A Domain Name Information Maintenance System Based on Blockchain Hybrid Consensus
CN108847925B (en) Fragment block chain generation method based on tree structure
CN111131209B (en) An improved and efficient consensus method, system, computer equipment and storage medium
CN110677485A (en) Dynamic layered Byzantine fault-tolerant consensus method based on credit
CN111010278B (en) High-fault-tolerance layering consensus method based on DPoS
CN110113388A (en) A kind of method and apparatus of the block catenary system common recognition based on improved clustering algorithm
CN113660125B (en) A consensus method and device based on a random trusted committee
CN114938292B (en) Multi-level optimization PBFT consensus method based on node credibility
CN106406896A (en) Block chain block-building method based on parallel PipeLine technology
CN108848056A (en) Block chain common recognition method based on verifying
CN109919760B (en) Optimization method of Byzantine fault-tolerant consensus algorithm based on voting mechanism
CN114048517A (en) Dual channel consensus system and method for blockchains, computer readable storage medium
CN111798234B (en) Lightweight block chain system and construction method
CN115022326B (en) Block chain Bayesian-court fault tolerance consensus method based on collaborative filtering recommendation
CN115052017A (en) Layered consensus method and system based on dynamic reputation mechanism in Internet of vehicles environment
CN116260826B (en) A Byzantine fault-tolerant consensus method and system for supply chain traceability
CN113377869B (en) Block chain sharing information balanced storage method
US20260005872A1 (en) Data processing method and apparatus based on blockchain
CN110166364B (en) Software defined opportunistic network flow table updating method
CN114499874B (en) A Byzantine fault-tolerant consensus optimization method applied to the industrial Internet
CN115883578A (en) A 5G power network node trust management method based on blockchain technology

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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20201113