[go: up one dir, main page]

CN112200680B - Blockchain node management method, device, computer and readable storage medium - Google Patents

Blockchain node management method, device, computer and readable storage medium Download PDF

Info

Publication number
CN112200680B
CN112200680B CN202011397915.2A CN202011397915A CN112200680B CN 112200680 B CN112200680 B CN 112200680B CN 202011397915 A CN202011397915 A CN 202011397915A CN 112200680 B CN112200680 B CN 112200680B
Authority
CN
China
Prior art keywords
consensus
node
network
nodes
target
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
CN202011397915.2A
Other languages
Chinese (zh)
Other versions
CN112200680A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011397915.2A priority Critical patent/CN112200680B/en
Priority to CN202110189183.6A priority patent/CN113162971B/en
Publication of CN112200680A publication Critical patent/CN112200680A/en
Application granted granted Critical
Publication of CN112200680B publication Critical patent/CN112200680B/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
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • 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/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • 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
    • 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 Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application discloses a block link point management method, a block link point management device, a computer and a readable storage medium, wherein the method comprises the following steps: acquiring at least two network nodes in a block chain network, and acquiring a consensus weight of each network node from a full node table; acquiring at least two consensus nodes from at least two network nodes based on the consensus weight of each network node; detecting the connection state of at least two consensus nodes, recording the consensus nodes with the connection state being the disconnection state as consensus nodes to be connected, acquiring the node address information of the consensus nodes to be connected from the whole node table, and establishing network connection among the consensus nodes to be connected based on the node address information to obtain a consensus network; and when a network quitting request of the network node to be processed is obtained, returning the consensus weight of the network node to be processed, and deleting the network node to be processed in the whole node table. By adopting the method and the device, the flexibility of network node management in the block chain network can be improved.

Description

区块链节点管理方法、装置、计算机以及可读存储介质Blockchain node management method, device, computer and readable storage medium

技术领域technical field

本申请涉及区块链技术领域,尤其涉及一种区块链节点管理方法、装置、计算机以及可续存储介质。The present application relates to the field of blockchain technology, and in particular, to a method, device, computer and sustainable storage medium for managing blockchain nodes.

背景技术Background technique

随着区块链技术的日益成熟,加上区块链的去中心化等的特性,使得区块链的应用日益广泛。其中,区块链网络中存在不止一个网络节点,而组成该区块链网络的网络节点可能发生变化,尤其是组成共识网络的网络节点发生变化的概率较高。目前,在将网络节点添加至区块链网络中时,是通过部署该网络节点的网络连接,以将该网络节点添加至区块链网络中,当区块链网络中的网络节点发生变化时,需要删除已有的网络连接,重新建立更新后的网络节点之间的网络连接,使得对网络节点的配置较为固定,对区块链网络的部署的更新较为困难,使得在对区块链网络的更新过程中耗费的资源较多,降低了对区块链网络中网络节点管理的灵活性。With the increasing maturity of blockchain technology, coupled with the decentralization and other characteristics of blockchain, the application of blockchain has become increasingly widespread. Among them, there is more than one network node in the blockchain network, and the network nodes that make up the blockchain network may change, especially the network nodes that make up the consensus network have a high probability of changing. At present, when a network node is added to the blockchain network, the network connection of the network node is deployed to add the network node to the blockchain network. When the network node in the blockchain network changes , it is necessary to delete the existing network connection and re-establish the network connection between the updated network nodes, so that the configuration of the network nodes is relatively fixed, and the update of the deployment of the blockchain network is more difficult, which makes it difficult to update the deployment of the blockchain network. The update process consumes more resources, which reduces the flexibility of network node management in the blockchain network.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供了一种区块链节点管理方法、装置、计算机设备以及存储介质,可以提高对区块链网络中网络节点管理的灵活性。The embodiments of the present application provide a blockchain node management method, device, computer equipment, and storage medium, which can improve the flexibility of network node management in a blockchain network.

本申请实施例一方面提供了一种区块链节点管理方法,包括:On the one hand, the embodiments of the present application provide a blockchain node management method, including:

获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的共识权重;Obtain at least two network nodes in the blockchain network, and obtain the consensus weight of each network node from the full node table;

基于每个网络节点的共识权重,从至少两个网络节点中获取至少两个共识节点;Obtain at least two consensus nodes from at least two network nodes based on the consensus weight of each network node;

检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点,从全节点表中获取待连接共识节点的节点地址信息,基于节点地址信息在待连接共识节点之间建立网络连接,得到共识网络;Detect the connection status of at least two consensus nodes, record the consensus node whose connection status is disconnected as the consensus node to be connected, and obtain the node address information of the consensus node to be connected from the full node table. Establish network connections between consensus nodes to obtain a consensus network;

当获取到待处理网络节点的退网请求时,从全节点表中获取待处理网络节点的共识权重,将待处理网络节点的共识权重发送至待处理网络节点,删除全节点表中的待处理网络节点,若发起退网请求的待处理网络节点属于共识网络,则更新该共识网络;待处理网络节点属于至少两个网络节点。When the logout request of the network node to be processed is obtained, the consensus weight of the network node to be processed is obtained from the full node table, the consensus weight of the network node to be processed is sent to the network node to be processed, and the pending network node is deleted from the full node table. The network node, if the pending network node that initiates the withdrawal request belongs to the consensus network, the consensus network is updated; the pending network node belongs to at least two network nodes.

其中,该全节点表包括每个网络节点的身份标签及共识权重;Among them, the full node table includes the identity label and consensus weight of each network node;

获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的共识权重,包括:Obtain at least two network nodes in the blockchain network, and obtain the consensus weight of each network node from the full node table, including:

获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的身份标签,从至少两个网络节点中获取身份标签为共识标签的网络节点,得到候选共识节点;Obtain at least two network nodes in the blockchain network, obtain the identity label of each network node from the full node table, obtain network nodes whose identity labels are consensus labels from at least two network nodes, and obtain candidate consensus nodes;

从全节点表中获取候选共识节点的共识权重;Obtain consensus weights of candidate consensus nodes from the full node table;

基于每个网络节点的共识权重,从至少两个网络节点中获取至少两个共识节点,包括:Based on the consensus weight of each network node, obtain at least two consensus nodes from at least two network nodes, including:

获取共识节点数量,基于候选共识节点的共识权重及共识节点数量,从候选共识节点中确定N个共识节点;共识节点数量用于表示组成共识网络的共识节点的数量,N为共识节点数量。Obtain the number of consensus nodes, and determine N consensus nodes from the candidate consensus nodes based on the consensus weight of the candidate consensus nodes and the number of consensus nodes; the number of consensus nodes is used to represent the number of consensus nodes that form a consensus network, and N is the number of consensus nodes.

其中,基于每个网络节点的共识权重,从至少两个网络节点中获取至少两个共识节点,包括:Among them, based on the consensus weight of each network node, at least two consensus nodes are obtained from at least two network nodes, including:

获取共识节点数量,基于每个网络节点的共识权重对至少两个网络节点进行排序,根据排序结果从至少两个网络节点中获取N个共识节点;共识节点数量用于表示组成共识网络的共识节点的数量,N为共识节点数量。Obtain the number of consensus nodes, sort at least two network nodes based on the consensus weight of each network node, and obtain N consensus nodes from at least two network nodes according to the sorting result; the number of consensus nodes is used to represent the consensus nodes that constitute the consensus network , and N is the number of consensus nodes.

其中,全节点表包括每个网络节点的身份标签;Wherein, the full node table includes the identity label of each network node;

检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点,包括:Detect the connection status of at least two consensus nodes, and record the consensus node whose connection status is disconnected as the consensus node to be connected, including:

从全节点表中获取N个共识节点分别对应的身份标签,将身份标签不为共识标签的共识节点的连接状态确定为连接断开状态;Obtain the identity labels corresponding to N consensus nodes from the full node table, and determine the connection state of the consensus node whose identity label is not the consensus label as the disconnected state;

将连接状态为连接断开状态的共识节点记作待连接共识节点。The consensus node whose connection state is disconnected is recorded as the consensus node to be connected.

其中,该方法还包括:Wherein, the method also includes:

从全节点表中获取身份标签为共识标签的历史共识节点;Obtain historical consensus nodes whose identity labels are consensus labels from the full node table;

若历史共识节点不属于N个共识节点,则断开历史共识节点的网络连接,将全节点表中的历史共识节点的身份标签更新为数据标签,执行检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点的步骤。If the historical consensus node does not belong to N consensus nodes, disconnect the network connection of the historical consensus node, update the identity label of the historical consensus node in the full node table to the data label, perform detection of the connection status of at least two consensus nodes, and set the A consensus node whose connection state is disconnected is recorded as the step to be connected to a consensus node.

其中,该方法还包括:Wherein, the method also includes:

从全节点表中,获取至少两个共识节点的节点标识,根据至少两个共识节点的节点标识生成共识节点表;Obtain the node identifiers of at least two consensus nodes from the full node table, and generate a consensus node table according to the node identifiers of the at least two consensus nodes;

根据共识节点表生成共识网络区块,若对共识网络区块共识通过,则将共识网络区块添加至节点管理区块链中,执行检测至少两个共识节点的连接状态的步骤。The consensus network block is generated according to the consensus node table. If the consensus on the consensus network block is passed, the consensus network block is added to the node management block chain, and the step of detecting the connection status of at least two consensus nodes is performed.

其中,该方法还包括:Wherein, the method also includes:

获取网络节点的虚拟抵押权益及历史共识次数,根据虚拟抵押权益及历史共识次数确定网络节点的共识权重;Obtain the virtual mortgage rights and historical consensus times of network nodes, and determine the consensus weight of network nodes according to the virtual mortgage rights and historical consensus times;

若对共识权重共识通过,则将共识权重添加至节点管理区块链中,将共识权重与网络节点的关联关系添加至全节点表中。If the consensus on the consensus weight is passed, the consensus weight is added to the node management blockchain, and the association between the consensus weight and the network nodes is added to the full node table.

其中,该方法还包括:Wherein, the method also includes:

获取目标网络节点发送的节点入网请求;节点入网请求包括目标网络节点的目标节点标识、目标身份标签及目标节点地址信息;Obtain the node network access request sent by the target network node; the node network access request includes the target node identifier, the target identity label and the target node address information of the target network node;

根据目标节点标识及目标节点地址信息对目标网络节点进行验证,若目标网络节点的目标节点地址信息合法,则获取目标身份标签;Verify the target network node according to the target node identifier and the target node address information, and obtain the target identity label if the target node address information of the target network node is legal;

对目标身份标签进行共识,若共识通过,则根据目标节点标识、目标身份标签及目标节点地址信息生成节点信息区块,将节点信息区块添加至节点管理区块链中;Consensus is carried out on the target identity label. If the consensus is passed, the node information block is generated according to the target node identification, target identity label and target node address information, and the node information block is added to the node management blockchain;

将目标节点标识、目标身份标签及目标节点地址信息加入全节点表中。Add the target node identification, target identity label and target node address information to the full node table.

其中,对目标身份标签进行共识,包括:Among them, the consensus on the target identity label, including:

若目标身份标签为共识标签,则获取目标身份标签的目标虚拟抵押权益;If the target identity label is a consensus label, obtain the target virtual mortgage rights of the target identity label;

获取共识权益阈值,若目标虚拟抵押权益小于共识权益阈值,则确定对目标身份标签共识失败,向目标网络节点发送标签异常消息;Obtain the consensus equity threshold. If the target virtual mortgage equity is less than the consensus equity threshold, it is determined that the consensus on the target identity label has failed, and a label exception message is sent to the target network node;

若目标虚拟抵押权益大于或等于共识权益阈值,则根据目标虚拟抵押权益生成目标网络节点的目标共识权重,确定对目标身份标签共识通过。If the target virtual mortgage equity is greater than or equal to the consensus equity threshold, the target consensus weight of the target network node is generated according to the target virtual mortgage equity, and it is determined that the consensus on the target identity label is passed.

其中,全节点表还包括每个网络节点的节点签名;Wherein, the full node table also includes the node signature of each network node;

该方法还包括:The method also includes:

若从至少两个网络节点中检测到异常节点,则获取异常节点的公钥;If an abnormal node is detected from at least two network nodes, obtain the public key of the abnormal node;

采用异常节点的公钥对异常节点在全节点表中对应的节点签名进行验签,若验签通过,则向异常节点发送节点确认消息;节点确认消息用于向异常节点获取异常数据;Use the public key of the abnormal node to verify the signature of the node corresponding to the abnormal node in the full node table. If the verification is passed, a node confirmation message is sent to the abnormal node; the node confirmation message is used to obtain abnormal data from the abnormal node;

若对异常节点的节点签名验签不通过,则断开与异常节点之间的网络连接,从全节点表中删除与异常节点关联的数据。If the node signature verification of the abnormal node fails, the network connection with the abnormal node is disconnected, and the data associated with the abnormal node is deleted from the full node table.

本申请实施例一方面提供了一种区块链节点管理装置,上述装置包括:On the one hand, the embodiments of the present application provide a block chain node management device, and the above device includes:

权重获取模块,用于获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的共识权重;The weight obtaining module is used to obtain at least two network nodes in the blockchain network, and obtain the consensus weight of each network node from the full node table;

节点选取模块,用于基于每个网络节点的共识权重,从至少两个网络节点中获取至少两个共识节点;The node selection module is used to obtain at least two consensus nodes from at least two network nodes based on the consensus weight of each network node;

连接建立模块,用于检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点,从全节点表中获取待连接共识节点的节点地址信息,基于节点地址信息在待连接共识节点之间建立网络连接,得到共识网络;The connection establishment module is used to detect the connection status of at least two consensus nodes, record the consensus node whose connection status is disconnected as the consensus node to be connected, and obtain the node address information of the consensus node to be connected from the full node table. The node address information establishes a network connection between the consensus nodes to be connected to obtain a consensus network;

节点退网模块,用于当获取到待处理网络节点的退网请求时,从全节点表中获取待处理网络节点的共识权重,将待处理网络节点的共识权重发送至待处理网络节点,删除全节点表中的待处理网络节点,若发起退网请求的待处理网络节点属于共识网络,则更新该共识网络;待处理网络节点属于至少两个网络节点。The node de-networking module is used to obtain the consensus weight of the to-be-processed network node from the full node table when the de-network request of the to-be-processed network node is obtained, send the consensus weight of the to-be-processed network node to the to-be-processed network node, and delete For the network nodes to be processed in the full node table, if the network node to be processed that initiates the withdrawal request belongs to the consensus network, the consensus network is updated; the network nodes to be processed belong to at least two network nodes.

其中,该全节点表包括每个网络节点的身份标签及共识权重;Among them, the full node table includes the identity label and consensus weight of each network node;

该权重获取模块,包括:The weight acquisition module includes:

标签获取单元,用于获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的身份标签,从至少两个网络节点中获取身份标签为共识标签的网络节点,得到候选共识节点;The label obtaining unit is used to obtain at least two network nodes in the blockchain network, obtain the identity label of each network node from the full node table, and obtain the network node whose identity label is the consensus label from the at least two network nodes, Get candidate consensus nodes;

权重获取单元,用于从全节点表中获取候选共识节点的共识权重;The weight acquisition unit is used to acquire the consensus weight of candidate consensus nodes from the full node table;

该节点选取模块,具体用于:This node selects the module, which is specifically used for:

获取共识节点数量,基于候选共识节点的共识权重及共识节点数量,从候选共识节点中确定N个共识节点;共识节点数量用于表示组成共识网络的共识节点的数量,N为共识节点数量。Obtain the number of consensus nodes, and determine N consensus nodes from the candidate consensus nodes based on the consensus weight of the candidate consensus nodes and the number of consensus nodes; the number of consensus nodes is used to represent the number of consensus nodes that form a consensus network, and N is the number of consensus nodes.

其中,该节点选取模块,具体用于:Among them, the node selection module is specifically used for:

获取共识节点数量,基于每个网络节点的共识权重对至少两个网络节点进行排序,根据排序结果从至少两个网络节点中获取N个共识节点;共识节点数量用于表示组成共识网络的共识节点的数量,N为共识节点数量。Obtain the number of consensus nodes, sort at least two network nodes based on the consensus weight of each network node, and obtain N consensus nodes from at least two network nodes according to the sorting result; the number of consensus nodes is used to represent the consensus nodes that constitute the consensus network , and N is the number of consensus nodes.

其中,全节点表包括每个网络节点的身份标签;Wherein, the full node table includes the identity label of each network node;

在检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点方面,该连接建立模块包括:In terms of detecting the connection status of at least two consensus nodes, and recording the consensus node whose connection status is disconnected as the consensus node to be connected, the connection establishment module includes:

状态确定单元,用于从全节点表中获取N个共识节点分别对应的身份标签,将身份标签不为共识标签的共识节点的连接状态确定为连接断开状态;The state determination unit is used to obtain the identity labels corresponding to the N consensus nodes from the full node table, and determine the connection state of the consensus node whose identity label is not the consensus label as the disconnected state;

共识确定单元,用于将连接状态为连接断开状态的共识节点记作待连接共识节点。The consensus determination unit is used to record the consensus node whose connection state is in the disconnected state as the consensus node to be connected.

其中,该装置还包括:Wherein, the device also includes:

历史获取模块,用于从全节点表中获取身份标签为共识标签的历史共识节点;The history acquisition module is used to obtain the historical consensus nodes whose identity label is the consensus label from the full node table;

标签更新模块,用于若历史共识节点不属于N个共识节点,则断开历史共识节点的网络连接,将全节点表中的历史共识节点的身份标签更新为数据标签,执行检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点的步骤。The label update module is used to disconnect the network connection of the historical consensus node if the historical consensus node does not belong to N consensus nodes, update the identity label of the historical consensus node in the full node table to the data label, and perform detection of at least two consensuses The connection status of the node, the consensus node whose connection status is disconnected is recorded as the step to be connected to the consensus node.

其中,该装置还包括:Wherein, the device also includes:

表生成模块,用于从全节点表中,获取至少两个共识节点的节点标识,根据至少两个共识节点的节点标识生成共识节点表;The table generation module is used to obtain the node identifiers of at least two consensus nodes from the full node table, and generate a consensus node table according to the node identifiers of the at least two consensus nodes;

数据存储模块,用于根据共识节点表生成共识网络区块,若对共识网络区块共识通过,则将共识网络区块添加至节点管理区块链中,执行检测至少两个共识节点的连接状态的步骤。The data storage module is used to generate a consensus network block according to the consensus node table. If the consensus on the consensus network block is passed, the consensus network block will be added to the node management blockchain, and the connection status of at least two consensus nodes will be detected. A step of.

其中,该装置还包括:Wherein, the device also includes:

权重确定模块,用于获取网络节点的虚拟抵押权益及历史共识次数,根据虚拟抵押权益及历史共识次数确定网络节点的共识权重;The weight determination module is used to obtain the virtual mortgage rights and historical consensus times of network nodes, and determine the consensus weights of network nodes according to the virtual mortgage rights and historical consensus times;

数据上链模块,用于若对共识权重共识通过,则将共识权重添加至节点管理区块链中,将共识权重与网络节点的关联关系添加至全节点表中。The data uploading module is used to add the consensus weight to the node management blockchain if the consensus on the consensus weight is passed, and add the association between the consensus weight and the network nodes to the full node table.

其中,该装置还包括:Wherein, the device also includes:

请求获取模块,用于获取目标网络节点发送的节点入网请求;节点入网请求包括目标网络节点的目标节点标识、目标身份标签及目标节点地址信息;A request obtaining module is used to obtain the node network access request sent by the target network node; the node network access request includes the target node identifier, the target identity label and the target node address information of the target network node;

节点验证模块,用于根据目标节点标识及目标节点地址信息对目标网络节点进行验证,若目标网络节点的目标节点地址信息合法,则获取目标身份标签;The node verification module is used to verify the target network node according to the target node identifier and the target node address information, and obtain the target identity label if the target node address information of the target network node is legal;

标签验证模块,用于对目标身份标签进行共识,若共识通过,则根据目标节点标识、目标身份标签及目标节点地址信息生成节点信息区块,将节点信息区块添加至节点管理区块链中;The label verification module is used to reach a consensus on the target identity label. If the consensus is passed, the node information block will be generated according to the target node identification, target identity label and target node address information, and the node information block will be added to the node management blockchain. ;

节点添加模块,用于将目标节点标识、目标身份标签及目标节点地址信息加入全节点表中。The node adding module is used to add target node identification, target identity label and target node address information to the full node table.

其中,在对目标身份标签进行共识方面,该标签验证模块包括:Among them, in terms of consensus on the target identity label, the label verification module includes:

权益获取单元,用于若目标身份标签为共识标签,则获取目标身份标签的目标虚拟抵押权益;The equity acquisition unit is used to acquire the target virtual mortgage equity of the target identity label if the target identity label is a consensus label;

消息发送单元,用于获取共识权益阈值,若目标虚拟抵押权益小于共识权益阈值,则确定对目标身份标签共识失败,向目标网络节点发送标签异常消息;The message sending unit is used to obtain the consensus equity threshold. If the target virtual mortgage equity is less than the consensus equity threshold, it is determined that the consensus on the target identity label has failed, and a label exception message is sent to the target network node;

验证通过单元,用于若目标虚拟抵押权益大于或等于共识权益阈值,则根据目标虚拟抵押权益生成目标网络节点的目标共识权重,确定对目标身份标签共识通过。The verification pass unit is used to generate the target consensus weight of the target network node according to the target virtual mortgage equity if the target virtual mortgage equity is greater than or equal to the consensus equity threshold, and determine that the consensus on the target identity label is passed.

其中,全节点表还包括每个网络节点的节点签名;Wherein, the full node table also includes the node signature of each network node;

该装置还包括:The device also includes:

公钥获取模块,用于若从至少两个网络节点中检测到异常节点,则获取异常节点的公钥;a public key acquisition module, configured to acquire the public key of the abnormal node if an abnormal node is detected from at least two network nodes;

节点验签模块,用于采用异常节点的公钥对异常节点在全节点表中对应的节点签名进行验签,若验签通过,则向异常节点发送节点确认消息;节点确认消息用于向异常节点获取异常数据;The node signature verification module is used to verify the signature of the abnormal node in the full node table by using the public key of the abnormal node. If the signature is passed, it will send a node confirmation message to the abnormal node; The node obtains abnormal data;

该节点验签模块,还用于若对异常节点的节点签名验签不通过,则断开与异常节点之间的网络连接,从全节点表中删除与异常节点关联的数据。The node signature verification module is further configured to disconnect the network connection with the abnormal node if the node signature verification of the abnormal node fails, and delete the data associated with the abnormal node from the full node table.

本申请实施例一方面提供了一种计算机设备,包括处理器、存储器、输入输出接口;An aspect of the embodiments of the present application provides a computer device, including a processor, a memory, and an input and output interface;

上述处理器分别与上述存储器和上述输入输出接口相连,其中,上述输入输出接口用于区块链中各个网络节点的数据交互,上述存储器用于存储程序代码,上述处理器用于调用上述程序代码,以执行本申请实施例一方面中实现的区块链节点管理方法。The processor is connected to the memory and the input-output interface respectively, wherein the input-output interface is used for data interaction of each network node in the blockchain, the memory is used to store the program code, and the processor is used to call the program code, To execute the blockchain node management method implemented in one aspect of the embodiments of the present application.

本申请实施例一方面提供了一种计算机可读存储介质,上述计算机可读存储介质存储有计算机程序,上述计算机程序包括程序指令,上述程序指令被处理器执行时,执行本申请实施例一方面中实现的区块链节点管理方法。An aspect of an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, an aspect of the embodiments of the present application is executed. The blockchain node management method implemented in .

本申请实施例一方面提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行本申请实施例一方面中的各种可选方式中提供的方法。In one aspect, embodiments of the present application provide a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in various optional manners in one aspect of the embodiments of the present application.

实施本申请实施例,将具有如下有益效果:Implementing the embodiments of the present application will have the following beneficial effects:

本申请实施例通过获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的共识权重;基于每个网络节点的共识权重,从至少两个网络节点中获取至少两个共识节点;检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点,从全节点表中获取待连接共识节点的节点地址信息,基于节点地址信息与待连接共识节点之间建立网络连接,得到共识网络;当获取到待处理网络节点的退网请求时,从全节点表中获取待处理网络节点的共识权重,将待处理网络节点的共识权重发送至待处理网络节点,删除全节点表中的待处理网络节点,若发起退网请求的待处理网络节点属于共识网络,则更新该共识网络;待处理网络节点属于至少两个网络节点。通过以上过程,在区块链网络中引入全节点表,该全节点表中存储有该区块链网络中各个网络节点的节点信息(如共识权重)等,当该区块链网络中的各个网络节点发生变化时,可以直接从该全节点表中获取发生变化的网络节点的数据,基于全节点表建立共识网络,而无需重新统计各个网络节点的节点信息,无需重新实现对区块链网络的部署,减少了在区块链网络发生变化时,对区块链网络进行更新所耗费的时间及资源,提高了对区块链网络中的网络节点管理的灵活性。In the embodiment of the present application, the consensus weight of each network node is obtained from the full node table by obtaining at least two network nodes in the blockchain network; based on the consensus weight of each network node, at least two network nodes are obtained from the at least two network nodes. Two consensus nodes; detect the connection status of at least two consensus nodes, record the consensus node whose connection status is disconnected as the consensus node to be connected, and obtain the node address information of the consensus node to be connected from the full node table. A network connection is established between the address information and the consensus node to be connected, and a consensus network is obtained; when the logout request of the network node to be processed is obtained, the consensus weight of the network node to be processed is obtained from the full node table, and the consensus weight of the network node to be processed is obtained. The consensus weight is sent to the pending network node, and the pending network node in the full node table is deleted. If the pending network node that initiated the withdrawal request belongs to the consensus network, the consensus network is updated; the pending network node belongs to at least two network nodes . Through the above process, a full node table is introduced into the blockchain network, and the full node table stores the node information (such as consensus weight) of each network node in the blockchain network. When the network nodes change, the data of the changed network nodes can be directly obtained from the full node table, and a consensus network can be established based on the full node table, without the need to re-count the node information of each network node, and without the need to re-implement the blockchain network. The deployment of the blockchain network reduces the time and resources required to update the blockchain network when the blockchain network changes, and improves the flexibility of network node management in the blockchain network.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

图1是本申请实施例提供的一种区块结构的一个可选的示意图;1 is an optional schematic diagram of a block structure provided by an embodiment of the present application;

图2是本申请实施例提供的一种区块链节点管理的网络架构示意图;2 is a schematic diagram of a network architecture for block chain node management provided by an embodiment of the present application;

图3是本申请实施例提供的一种区块链节点管理场景示意图;3 is a schematic diagram of a blockchain node management scenario provided by an embodiment of the present application;

图4是本申请实施例提供的一种区块链节点管理方法流程图;4 is a flowchart of a method for managing a blockchain node provided by an embodiment of the present application;

图5是本申请实施例提供的一种共识网络确定示意图;FIG. 5 is a schematic diagram of a consensus network determination provided by an embodiment of the present application;

图6是本申请实施例提供的另一种共识网络确定示意图;FIG. 6 is a schematic diagram of another consensus network determination provided by an embodiment of the present application;

图7是本申请实施例提供的一种区块链节点管理装置示意图;7 is a schematic diagram of a block chain node management device provided by an embodiment of the present application;

图8是本申请实施例提供的一种计算机设备的结构示意图。FIG. 8 is a schematic structural diagram of a computer device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

其中,本申请实施例可以基于云技术对本申请中所提及的网络节点(如共识节点或普通的网络节点等)中所产生的数据等进行存储和传输,适用于大数据中的数据传输领域。例如,采用云存储技术存储本申请中所产生的数据,采用云技术中的数据传输技术实现各个网络节点之间的数据交互。Among them, the embodiments of this application can store and transmit data generated in the network nodes (such as consensus nodes or common network nodes, etc.) mentioned in this application based on cloud technology, and are applicable to the field of data transmission in big data . For example, cloud storage technology is used to store the data generated in this application, and data transmission technology in cloud technology is used to realize data interaction between various network nodes.

其中,云技术(Cloud technology)是指在广域网或局域网内将硬件、软件、网络等系列资源统一起来,实现数据的计算、储存、处理和共享的一种托管技术。Among them, cloud technology refers to a kind of hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize the calculation, storage, processing and sharing of data.

云技术(Cloud technology)基于云计算商业模式应用的网络技术、信息技术、整合技术、管理平台技术、应用技术等的总称,可以组成资源池,按需所用,灵活便利。云计算技术将变成重要支撑。技术网络系统的后台服务需要大量的计算、存储资源,如视频网站、图片类网站和更多的门户网站。伴随着互联网行业的高度发展和应用,将来每个物品都有可能存在自己的识别标志,都需要传输到后台系统进行逻辑处理,不同程度级别的数据将会分开处理,各类行业数据皆需要强大的系统后盾支撑,只能通过云计算来实现。Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology based on cloud computing business models. Cloud computing technology will become an important support. Background services of technical network systems require a lot of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the back-end system for logical processing. Data of different levels will be processed separately, and all kinds of industry data need to be strong. The system backing support can only be achieved through cloud computing.

其中,在本申请中,一个区块链网络中可能存在大量的网络节点,每个网络节点中可能产生或存储大量的数据,各个网络节点之间也可能产生较多的数据交互,因此,在本申请中,可以采用大数据技术对本申请中所产生的数据进行管理,如数据传输、数据存储或数据更新等。Among them, in this application, there may be a large number of network nodes in a blockchain network, each network node may generate or store a large amount of data, and there may also be a lot of data interaction between each network node. Therefore, in In this application, big data technology can be used to manage the data generated in this application, such as data transmission, data storage or data update.

其中,大数据(Big data)是指无法在一定时间范围内用常规软件工具进行捕捉、管理和处理的数据集合,是需要新处理模式才能具有更强的决策力、洞察发现力和流程优化能力的海量、高增长率和多样化的信息资产。随着云时代的来临,大数据也吸引了越来越多的关注,大数据需要特殊的技术,以有效地处理大量的容忍经过时间内的数据。适用于大数据的技术,包括大规模并行处理数据库、数据挖掘、分布式文件系统、分布式数据库、云计算平台、互联网和可扩展的存储系统。当区块链网络中存在多条区块链,或者区块链中存在较多的区块等时,实现本申请的方案,会出现产生大量的数据的情况,可以采用大数据技术,提高本申请的方案的实现效率。Among them, big data refers to the collection of data that cannot be captured, managed and processed by conventional software tools within a certain time frame. It requires new processing modes to have stronger decision-making, insight and process optimization capabilities. of massive, high-growth and diversified information assets. With the advent of the cloud era, big data is also attracting more and more attention, and big data requires special technologies to efficiently process a large amount of data that tolerates elapsed time. Technologies applicable to big data, including massively parallel processing databases, data mining, distributed file systems, distributed databases, cloud computing platforms, the Internet, and scalable storage systems. When there are multiple blockchains in the blockchain network, or there are many blocks in the blockchain, the implementation of the solution of this application will generate a large amount of data. Big data technology can be used to improve the cost Efficiency of the implementation of the scheme applied for.

其中,区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层。区块链,包括一系列按照产生的先后时间顺序相互接续的区块(Block),新区块一旦加入到区块链中就不会再被移除,区块中记录了区块链系统中节点提交的记录数据。Among them, blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain (Blockchain) is essentially a decentralized database, which is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer. The blockchain includes a series of blocks (Blocks) that follow each other in chronological order. Once a new block is added to the blockchain, it will not be removed. The block records the nodes in the blockchain system. Submitted record data.

其中,可以参见图1,图1是本申请实施例提供的一种区块结构(Block Structure)的一个可选的示意图,每个区块中包括本区块存储交易记录的哈希值(本区块的哈希值)、以及前一区块的哈希值,各区块通过哈希值连接形成区块链。另外,区块中还可以包括有区块生成时的时间戳或该区块的区块高度等信息。其中,区块可以包括区块头和区块体,如图1所示,区块1中包括区块头和区块体,该区块1的区块体中可以存储交易数据1,该区块1的区块头中可以包括前一区块哈希及本区块哈希,其中,该前一区块哈希为区块1的前一个区块的哈希,例如,在图1中,区块1为该区块链中的第一个区块,则该区块1中的前一区块哈希可以为空。区块2的区块体中包括交易数据2,区块2的区块头中包括前一区块哈希及本区块哈希,其中,该前一区块哈希为区块2的前一个区块(即区块1)的哈希。区块3的区块体中包括交易数据3,区块3的区块头中包括前一区块哈希及本区块哈希,其中,该前一区块哈希为区块3的前一个区块(即区块2)的哈希。1 is an optional schematic diagram of a block structure (Block Structure) provided by an embodiment of the present application, and each block includes the hash value of the transaction record stored in this block (this The hash value of the block), and the hash value of the previous block, each block is connected by the hash value to form a blockchain. In addition, the block may also include information such as the timestamp when the block was generated or the block height of the block. The block may include a block header and a block body. As shown in Figure 1, a block 1 includes a block header and a block body. The block body of the block 1 can store transaction data 1. The block 1 The block header can include the hash of the previous block and the hash of the current block, where the hash of the previous block is the hash of the previous block of block 1. For example, in Figure 1, the block 1 is the first block in the blockchain, then the hash of the previous block in block 1 can be empty. The block body of block 2 includes transaction data 2, and the block header of block 2 includes the hash of the previous block and the hash of this block, wherein the hash of the previous block is the previous block of block 2. The hash of the block (i.e. block 1). The block body of block 3 includes transaction data 3, and the block header of block 3 includes the hash of the previous block and the hash of this block, wherein the hash of the previous block is the previous block of block 3. The hash of the block (i.e. block 2).

其中,在本申请实施例中,区块链网络包括至少两个网络节点,各个网络节点之间可以存在网络连接,各个网络节点可以基于该网络连接进行数据交互。其中,至少两个网络节点中的各个网络节点可以携带不同的身份标签,如共识标签、数据标签或轻量标签等。具体请参见图2,图2是本申请实施例提供的一种区块链节点管理的网络架构示意图。如图2所示,当网络节点201添加至区块链网络中时,将该网络节点201的数据添加至全节点表中,其中,可以将该网络节点201的数据记做该网络节点201的节点信息。其中,该节点信息可以包括网络节点201的节点标识,可选的,该节点信息还可以包括网络节点201的身份标签。其中,将该网络节点201添加至全节点表中时,可以将该网络节点201所发送的身份标签添加至全节点表中,若该网络节点201所发送的身份标签为空,则可以将该网络节点201的身份标签默认为数据标签或轻量标签。其中,数据标签用于表示对应的网络节点具备获取区块链网络中的交易区块的权限,而不具备对交易区块的共识权限;轻量标签用于表示对应的网络节点具备获取区块链网络中的部分交易区块的权限,且不具备共识权限。Wherein, in the embodiment of the present application, the blockchain network includes at least two network nodes, there may be network connections between each network node, and each network node may perform data interaction based on the network connection. Wherein, each of the at least two network nodes may carry different identity labels, such as consensus labels, data labels, or lightweight labels. For details, please refer to FIG. 2 , which is a schematic diagram of a network architecture of a blockchain node management provided by an embodiment of the present application. As shown in FIG. 2 , when the network node 201 is added to the blockchain network, the data of the network node 201 is added to the full node table, wherein the data of the network node 201 can be recorded as the data of the network node 201 Node information. The node information may include the node identifier of the network node 201 , and optionally, the node information may also include the identity label of the network node 201 . Wherein, when the network node 201 is added to the full node table, the identity label sent by the network node 201 can be added to the full node table, and if the identity label sent by the network node 201 is empty, the identity label sent by the network node 201 can be added. The identity tag of the network node 201 is a data tag or a lightweight tag by default. Among them, the data label is used to indicate that the corresponding network node has the authority to obtain the transaction block in the blockchain network, but does not have the consensus authority to the transaction block; the lightweight label is used to indicate that the corresponding network node has the authority to obtain the block. The authority of some transaction blocks in the chain network, and does not have consensus authority.

其中,当开始一个新的共识周期时,可以获取该区块链网络中的全节点表中的各个网络节点的节点信息,基于节点信息对各个网络节点中进行选取,确定新的共识周期内,组成共识网络202的共识节点,包括共识节点2021、共识节点2022及共识节点2023等,其中,各个共识节点属于全节点表中对应的网络节点,共识网络是区块链网络中的一部分。具体的,该全节点表中包括各个网络节点的共识权重,基于该共识权重可以获取每个网络节点作为共识节点的概率,从而可以从至少两个网络节点中获取到至少两个共识节点,将至少两个共识节点组成共识网络。进一步地,该全节点表中还可以包括各个网络节点的节点地址信息,可以基于该节点地址信息建立各个共识节点之间的网络连接,以得到共识网络。其中,在全节点表中,网络节点的共识权重及节点地址信息等可以记作该网络节点的节点信息,即,该全节点表中存储有该区块链网络中的各个网络节点的节点信息,可以基于各个网络节点的节点信息选取共识网络、建立网络连接或进行数据交互等,使得在区块链网络中的网络节点发生变化时,可以直接基于该全节点表更新区块链网络,减少了对区块链网络更新过程中所耗费的时间和资源,提高了对区块链网络的网络节点管理的灵活性。Among them, when a new consensus cycle starts, the node information of each network node in the full node table in the blockchain network can be obtained, and each network node is selected based on the node information, and the new consensus cycle is determined. The consensus nodes constituting the consensus network 202 include a consensus node 2021, a consensus node 2022, and a consensus node 2023, among which, each consensus node belongs to the corresponding network node in the full node table, and the consensus network is a part of the blockchain network. Specifically, the full node table includes the consensus weight of each network node. Based on the consensus weight, the probability of each network node being a consensus node can be obtained, so that at least two consensus nodes can be obtained from at least two network nodes. At least two consensus nodes form a consensus network. Further, the full node table may also include node address information of each network node, and a network connection between each consensus node may be established based on the node address information to obtain a consensus network. Among them, in the full node table, the consensus weight and node address information of the network node can be recorded as the node information of the network node, that is, the full node table stores the node information of each network node in the blockchain network , based on the node information of each network node, a consensus network can be selected, a network connection can be established, or data interaction can be performed, etc., so that when the network nodes in the blockchain network change, the blockchain network can be updated directly based on the full node table. It reduces the time and resources spent in the update process of the blockchain network, and improves the flexibility of the network node management of the blockchain network.

其中,上述网络节点可以是服务器或终端设备,也可以是服务器和终端设备组成的系统,其中,以上所提及的终端设备可以是一种电子设备,包括但不限于手机、平板电脑、台式电脑、笔记本电脑、掌上电脑、可穿戴设备(例如智能手表、智能手环等)、增强现实/虚拟现实(Augmented Reality/Virtual Reality,AR/VR)设备、头盔显示器、智能音箱、数码相机、摄像头及其他具备网络接入能力的移动互联网设备(mobile internet device,MID)等。其中,以上所提及的服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content DeliveryNetwork,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器等。The above-mentioned network node may be a server or a terminal device, or a system composed of a server and a terminal device, wherein the terminal device mentioned above may be an electronic device, including but not limited to a mobile phone, a tablet computer, a desktop computer , laptops, PDAs, wearable devices (such as smart watches, smart bracelets, etc.), Augmented Reality/Virtual Reality (AR/VR) devices, head-mounted displays, smart speakers, digital cameras, cameras and Other mobile internet devices (mobile internet devices, MIDs) with network access capability, etc. The server mentioned above may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud service, cloud database, cloud computing, cloud function, cloud storage, Network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms.

具体的,可以参见图3,图3是本申请实施例提供的一种区块链节点管理场景示意图。如图3所示,当网络节点301添加至区块链网络中时,获取该网络节点301的节点信息,包括该网络节点301的节点标识及身份标签等,该节点标识可以为网络节点301的网际互连协议(Internet Protocol,ip)地址、设备标识或其他的唯一标识等。计算机设备将该网络节点301的节点信息添加至全节点表303中,并将该网络节点301添加至区块链网络302中,其中,若该网络节点301的身份标签为空,则可以将该网络节点301的身份标签默认为数据标签或轻量标签。其中,该全节点表可以参见下表1:Specifically, reference may be made to FIG. 3 , which is a schematic diagram of a blockchain node management scenario provided by an embodiment of the present application. As shown in FIG. 3 , when the network node 301 is added to the blockchain network, the node information of the network node 301 is obtained, including the node identifier and the identity label of the network node 301 , and the node identifier can be the network node 301 Internet Protocol (Internet Protocol, ip) address, device identification or other unique identification, etc. The computer device adds the node information of the network node 301 to the full node table 303, and adds the network node 301 to the blockchain network 302, wherein, if the identity label of the network node 301 is empty, the The identity tag of the network node 301 is a data tag or a lightweight tag by default. The full node table can be found in Table 1 below:

表1Table 1

节点名称node name 节点标识Node ID 身份标签identity tag 共识权重consensus weight 网络节点Anetwork node A 192.154.26.31192.154.26.31 共识标签Consensus label 2525 网络节点Bnetwork node B 152.54.35.25152.54.35.25 数据标签data labels 24twenty four 网络节点301network node 301 153.241.54.152153.241.54.152 数据标签data labels 3030 ...... ...... ...... ... ...

当开始新的共识周期或者共识网络发生变化时,计算机设备可以确定共识节点数量,从全节点表中获取各个网络节点的共识权重,根据各个网络节点的共识权重选取至少两个共识节点,至少两个共识节点包括的共识节点的数量为共识节点数量。将至少两个共识节点的节点信息添加至共识节点表304中,或者,将至少两个共识节点的节点名称及节点标识添加至共识节点表304中。即,该共识节点表304中可以包括各个共识节点的节点名称及节点标识,或者,还可以包括各个共识节点的身份标签及共识权重。其中,当共识节点表304中包括的共识节点的节点信息包括节点名称及节点标识时,该共识节点表304可以如下表2所示:When a new consensus cycle starts or the consensus network changes, the computer equipment can determine the number of consensus nodes, obtain the consensus weight of each network node from the full node table, and select at least two consensus nodes according to the consensus weight of each network node, at least two The number of consensus nodes included in each consensus node is the number of consensus nodes. The node information of the at least two consensus nodes is added to the consensus node table 304 , or the node names and node identifiers of the at least two consensus nodes are added to the consensus node table 304 . That is, the consensus node table 304 may include the node name and node identifier of each consensus node, or may also include the identity label and consensus weight of each consensus node. Wherein, when the node information of the consensus nodes included in the consensus node table 304 includes node names and node identifiers, the consensus node table 304 may be shown in Table 2 below:

表2Table 2

节点名称node name 节点标识Node ID 网络节点Anetwork node A 192.154.26.31192.154.26.31 网络节点301network node 301 153.241.54.152153.241.54.152 ...... ... ...

当选取出至少两个共识节点后,从全节点表中获取至少两个共识节点的节点信息,将该全节点表中各个共识节点的节点信息中的身份标签更新为共识标签,将更新前的身份标签不是共识标签的共识节点作为待连接共识节点,建立该待连接共识节点与其他共识节点间的网络连接,以组成共识网络305。此时,该共识网络305中的各个共识节点(如共识节点3051、共识节点3052、共识节点3053及共识节点3054等)间可以进行数据交互,并对获取到的交易区块进行共识。After selecting at least two consensus nodes, obtain the node information of at least two consensus nodes from the full node table, update the identity label in the node information of each consensus node in the full node table to the consensus label, and update the identity before the update. A consensus node whose label is not a consensus label is used as a consensus node to be connected, and a network connection between the consensus node to be connected and other consensus nodes is established to form a consensus network 305 . At this time, each consensus node (eg, consensus node 3051, consensus node 3052, consensus node 3053, consensus node 3054, etc.) in the consensus network 305 can perform data exchange, and conduct consensus on the acquired transaction blocks.

进一步地,请参见图4,图4是本申请实施例提供的一种区块链节点管理方法流程图。如图4所示,该方法的执行主体可以是区块链网络中的任意一个网络节点,将该执行主体记作计算机设备,该区块链节点管理方法的过程包括如下步骤:Further, please refer to FIG. 4 , which is a flowchart of a method for managing a blockchain node provided by an embodiment of the present application. As shown in Figure 4, the execution body of the method can be any network node in the blockchain network, and the execution body is denoted as computer equipment, and the process of the blockchain node management method includes the following steps:

步骤S401,获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的共识权重。In step S401, at least two network nodes in the blockchain network are obtained, and the consensus weight of each network node is obtained from the full node table.

在本申请实施例中,计算机设备响应针对共识网络的更新请求,可以获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的共识权重。其中,该共识网络存在共识周期,该共识周期用于表示该共识网络的更新时间周期,当一个共识周期结束时,开始新的共识周期,生成针对共识网络的更新请求,可选的,可以基于智能合约检测共识周期,当开始新的共识周期时,触发智能合约,基于该智能合约获取针对共识网络的更新请求;或者,该共识网络中存在共识节点发生变化(如共识节点退网或共识节点信息变更等)时,生成针对共识网络的更新请求。换句话说,当该共识网络发生变化时,生成针对共识网络的更新请求。例如,以共识周期为例,假定该共识周期以区块高度范围进行表示,则当生成区块高度范围中的起始区块高度对应的区块时,触发智能合约,基于该智能合约获取全节点表,从全节点表中获取每个网络节点的共识权重,例如,该区块高度范围为区块高度10至区块高度40,即起始区块高度为区块高度10,结束区块高度为区块高度40,调用智能合约监测该区块链网络中的区块生成情况,当区块高度为9的区块添加到节点管理区块链后,基于智能合约获取起始区块高度为区块高度10的区块高度范围所对应的共识周期,在该共识周期内,获取至少两个网络节点,从全节点表中获取每个网络节点的共识权重。其中,在一个共识周期结束后,直接开始部署新的共识网络,而无需等待新的共识周期开始时触发共识网络的部署过程,可以减少共识周期过渡的时间,提高共识网络切换的流畅性,进而可以提高共识网络的切换效率。In the embodiment of the present application, in response to the update request for the consensus network, the computer device can obtain at least two network nodes in the blockchain network, and obtain the consensus weight of each network node from the full node table. Among them, the consensus network has a consensus cycle, which is used to represent the update time period of the consensus network. When a consensus cycle ends, a new consensus cycle is started, and an update request for the consensus network is generated. Optionally, it can be based on The smart contract detects the consensus cycle. When a new consensus cycle starts, the smart contract is triggered, and the update request for the consensus network is obtained based on the smart contract; When the information changes, etc.), an update request for the consensus network is generated. In other words, when the consensus network changes, an update request to the consensus network is generated. For example, taking the consensus cycle as an example, assuming that the consensus cycle is represented by the block height range, when a block corresponding to the starting block height in the block height range is generated, the smart contract is triggered, and the full block is obtained based on the smart contract. Node table, obtain the consensus weight of each network node from the full node table. For example, the block height ranges from block height 10 to block height 40, that is, the starting block height is block height 10, and the end block height The height is block height 40, and the smart contract is called to monitor the block generation in the blockchain network. When a block with a block height of 9 is added to the node management blockchain, the starting block height is obtained based on the smart contract. is the consensus period corresponding to the block height range of block height 10. During this consensus period, at least two network nodes are obtained, and the consensus weight of each network node is obtained from the full node table. Among them, after a consensus cycle ends, the new consensus network can be deployed directly without waiting for the deployment process of the consensus network to be triggered at the beginning of the new consensus cycle, which can reduce the transition time of the consensus cycle and improve the smoothness of consensus network switching. It can improve the switching efficiency of the consensus network.

其中,该全节点表中可以包括各个网络节点的节点信息,该节点信息可以包括对应网络节点的共识权重,可选的,该节点信息还可以包括对应网络节点的节点名称、节点标识、身份标签或节点地址信息等。在确定组成共识网络的共识节点时,一种情况下,计算机设备可以从至少两个网络节点中获取至少两个共识节点,计算机设备可以从全节点表中获取每个网络节点的共识权重;另一种情况下,计算机设备可以基于各个网络节点的身份标签确定至少两个共识节点,具体的,计算机设备可以获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的身份标签,从至少两个网络节点中获取身份标签为共识标签的网络节点,得到候选共识节点,从全节点表中获取候选共识节点的共识权重。The full node table may include node information of each network node, the node information may include the consensus weight of the corresponding network node, and optionally, the node information may also include the node name, node identifier, and identity label of the corresponding network node or node address information, etc. When determining the consensus nodes constituting the consensus network, in one case, the computer device can obtain at least two consensus nodes from at least two network nodes, and the computer device can obtain the consensus weight of each network node from the full node table; In one case, the computer device can determine at least two consensus nodes based on the identity labels of each network node. Specifically, the computer device can obtain at least two network nodes in the blockchain network, and obtain each network node from the full node table. The identity label of the node, the network node whose identity label is the consensus label is obtained from at least two network nodes, the candidate consensus node is obtained, and the consensus weight of the candidate consensus node is obtained from the full node table.

步骤S402,基于每个网络节点的共识权重,从至少两个网络节点中获取至少两个共识节点。Step S402, based on the consensus weight of each network node, obtain at least two consensus nodes from at least two network nodes.

在本申请实施例中,在步骤S401中,从至少两个网络节点中获取至少两个共识节点时,计算机设备可以获取共识节点数量,基于每个网络节点的共识权重对至少两个网络节点进行排序,根据排序结果从至少两个网络节点中获取N个共识节点;共识节点数量用于表示组成共识网络的共识节点的数量,N为共识节点数量。In this embodiment of the present application, in step S401, when obtaining at least two consensus nodes from at least two network nodes, the computer device may obtain the number of consensus nodes, and perform a calculation on the at least two network nodes based on the consensus weight of each network node. Sort, obtain N consensus nodes from at least two network nodes according to the sorting result; the number of consensus nodes is used to represent the number of consensus nodes that constitute the consensus network, and N is the number of consensus nodes.

其中,在步骤S401中,计算机设备基于各个网络节点的身份标签确定至少两个共识节点时,计算机设备可以获取共识节点数量,基于候选共识节点的共识权重及共识节点数量,从候选共识节点中确定N个共识节点;共识节点数量用于表示组成共识网络的共识节点的数量,N为共识节点数量。可选的,若候选共识节点的数量小于共识节点数量,则可以从全节点表中获取身份标签不为共识标签的网络节点,记作备用节点,从全节点表中获取备用节点对应的共识权重,基于备用节点的共识权重从备用节点中获取M个共识节点,M为正整数,M与候选共识节点的数量之和为共识节点数量。Wherein, in step S401, when the computer device determines at least two consensus nodes based on the identity labels of each network node, the computer device can obtain the number of consensus nodes, and determine from the candidate consensus nodes based on the consensus weight of the candidate consensus nodes and the number of consensus nodes. N consensus nodes; the number of consensus nodes is used to represent the number of consensus nodes forming the consensus network, and N is the number of consensus nodes. Optionally, if the number of candidate consensus nodes is less than the number of consensus nodes, network nodes whose identity labels are not consensus labels can be obtained from the full node table, which are recorded as backup nodes, and the consensus weight corresponding to the backup nodes can be obtained from the full node table. , based on the consensus weight of the standby node, M consensus nodes are obtained from the standby node, M is a positive integer, and the sum of M and the number of candidate consensus nodes is the number of consensus nodes.

其中,该共识节点数量可以是一个默认节点数量,也可以根据至少两个网络节点的节点数量生成,或者可以根据该区块链网络中所包括的区块数量生成,或者可以根据区块链网络中所包括的区块数量及至少两个网络节点的数量生成等,在此不做限制。例如,获取至少两个网络节点的节点数量及节点选取比例,基于该节点选取比例及至少两个网络节点的节点数量,确定共识节点数量,假定至少两个网络节点的节点数量为80,节点选取比例为0.1,则确定共识节点数量为8。The number of consensus nodes may be a default number of nodes, or may be generated according to the number of nodes of at least two network nodes, or may be generated according to the number of blocks included in the blockchain network, or may be generated according to the blockchain network The number of blocks included in the , and the number of at least two network nodes generated, etc., are not limited here. For example, the number of nodes and the node selection ratio of at least two network nodes are obtained, and the number of consensus nodes is determined based on the node selection ratio and the node number of at least two network nodes. Assuming that the node number of at least two network nodes is 80, the node selection If the ratio is 0.1, the number of consensus nodes is determined to be 8.

例如,该共识节点数量为一个默认节点数量时,该共识节点数量可以由管理人员所提交的,举例来说,参见图5,图5是本申请实施例提供的一种共识网络确定示意图。如图5所示,计算机设备响应针对共识节点数量的提交操作,获取数量获取页面501中所输入的共识节点数量及节点管理周期,其中,该节点管理周期用于表示对应的共识节点数量所关联的共识周期。例如,该节点管理周期为共识周期5至共识周期10,共识节点数量为7,则在开始共识周期5时,获取到共识节点数量为7;可选的,该节点管理周期可以通过区块高度范围进行表示,例如,该节点管理周期为区块高度10至区块高度40,共识节点数量为7,则表示在区块高度10至区块高度40所对应的区块,需要7个共识节点对区块进行共识。进一步地,可以根据该共识节点数量及节点管理周期生成智能合约502,根据该智能合约502生成合约区块503,对该合约区块503进行共识,若共识通过,则将该合约区块503添加至节点管理区块链504中。其中,当开始目标节点管理周期时,触发智能合约,采用该智能合约从节点管理区块链504中获取目标节点管理周期所关联的目标合约区块505,基于该目标合约区块505确定共识节点数量。基于每个网络节点的共识权重及共识节点数量,从至少两个网络节点506中获取至少两个共识节点507,包括共识节点5071、共识节点5072、共识节点5073及共识节点5074等。For example, when the number of consensus nodes is a default number of nodes, the number of consensus nodes can be submitted by an administrator. For example, see FIG. 5 , which is a schematic diagram of determining a consensus network provided by an embodiment of the present application. As shown in FIG. 5 , in response to the submission operation for the number of consensus nodes, the computer device obtains the number of consensus nodes and the node management period entered in the number acquisition page 501 , where the node management period is used to indicate that the corresponding number of consensus nodes is associated with consensus cycle. For example, if the node management period is from consensus period 5 to consensus period 10, and the number of consensus nodes is 7, then when consensus period 5 starts, the number of consensus nodes obtained is 7; optionally, the node management period can be determined by the block height For example, if the node management period is from block height 10 to block height 40, and the number of consensus nodes is 7, it means that 7 consensus nodes are required for the block corresponding to block height 10 to block height 40. Consensus on blocks. Further, a smart contract 502 can be generated according to the number of consensus nodes and the node management period, a contract block 503 can be generated according to the smart contract 502, and a consensus can be made on the contract block 503. If the consensus is passed, the contract block 503 is added. into the node management blockchain 504. Among them, when the target node management cycle is started, a smart contract is triggered, and the smart contract is used to obtain the target contract block 505 associated with the target node management cycle from the node management blockchain 504, and the consensus node is determined based on the target contract block 505. quantity. Based on the consensus weight of each network node and the number of consensus nodes, at least two consensus nodes 507 are obtained from at least two network nodes 506, including consensus node 5071, consensus node 5072, consensus node 5073, consensus node 5074, and the like.

举例来说,步骤S401至步骤S402可以参见图6,图6是本申请实施例提供的另一种共识网络确定示意图。如图6所示,第①种情况下,计算机设备获取至少两个网络节点601,从全节点表中获取每个网络节点的共识权重,基于共识权重从至少两个网络节点601中获取至少两个共识节点602。第②种情况下,计算机设备可以从全节点表中获取身份标签为共识标签的网络节点,作为候选共识节点603,从全节点表中获取候选共识节点603的共识权重,基于共识权重从候选共识节点603中获取至少两个共识节点602。假定该至少两个共识节点602包括共识节点6021、共识节点6022、共识节点6023及共识节点6024等。For example, for steps S401 to S402, reference may be made to FIG. 6 , which is a schematic diagram of another consensus network determination provided by an embodiment of the present application. As shown in FIG. 6, in the first case, the computer device obtains at least two network nodes 601, obtains the consensus weight of each network node from the full node table, and obtains at least two network nodes 601 from the at least two network nodes 601 based on the consensus weight. consensus nodes 602 . In the second case, the computer device can obtain the network node whose identity label is the consensus label from the full node table, as the candidate consensus node 603, obtain the consensus weight of the candidate consensus node 603 from the full node table, and obtain the consensus weight of the candidate consensus node 603 from the full node table based on the consensus weight. At least two consensus nodes 602 are obtained from the node 603 . It is assumed that the at least two consensus nodes 602 include a consensus node 6021, a consensus node 6022, a consensus node 6023, a consensus node 6024, and the like.

步骤S403,检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点,从全节点表中获取待连接共识节点的节点地址信息,基于节点地址信息在待连接共识节点之间建立网络连接,得到共识网络。Step S403: Detect the connection status of at least two consensus nodes, record the consensus node whose connection status is disconnected as the consensus node to be connected, and obtain the node address information of the consensus node to be connected from the full node table, based on the node address information Establish network connections between consensus nodes to be connected to obtain a consensus network.

在本申请实施例中,计算机设备从全节点表中获取N个共识节点分别对应的身份标签,将身份标签不为共识标签的共识节点的连接状态确定为连接断开状态;将连接状态为连接断开状态的共识节点记作待连接共识节点。可选的,计算机设备可以获取历史共识网络,将N个共识节点中不属于历史共识网络的共识节点的连接状态确定为连接断开状态,将连接状态为连接断开状态的共识节点记作待连接共识节点。In the embodiment of the present application, the computer device obtains the identity labels corresponding to N consensus nodes from the full node table, and determines the connection state of the consensus node whose identity label is not the consensus label as the disconnected state; the connection state is the connected state. The consensus node in the disconnected state is recorded as the consensus node to be connected. Optionally, the computer device can obtain the historical consensus network, determine the connection status of the consensus nodes that do not belong to the historical consensus network among the N consensus nodes as the disconnected state, and record the consensus nodes whose connection status is the disconnected state as pending. Connect to consensus nodes.

进一步地,当计算机设备从至少两个网络节点中获取至少两个共识节点时,计算机设备可以从全节点表中获取身份标签为共识标签的历史共识节点。若该历史共识节点不属于N个共识节点,则表示该历史共识节点不参与本次的共识过程,断开历史共识节点的网络连接,将全节点表中的历史共识节点的身份标签更新为数据标签,再检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点。具体的,在断开历史共识节点的网络连接时,该计算机设备可以从全节点表中获取该历史共识节点的节点地址信息,基于该节点地址信息向历史共识节点发送网络断开请求,以断开与历史共识节点之间的网络连接。可选的,若计算机设备属于历史共识节点,则计算机设备从全节点表中获取N个共识节点分别对应的节点地址信息,基于节点地址信息向对应的共识节点发送网络断开请求,以断开与N个共识节点之间的网络连接。Further, when the computer device acquires at least two consensus nodes from at least two network nodes, the computer device can acquire historical consensus nodes whose identity tags are consensus tags from the full node table. If the historical consensus node does not belong to N consensus nodes, it means that the historical consensus node does not participate in this consensus process, disconnect the network connection of the historical consensus node, and update the identity label of the historical consensus node in the full node table to data Label, and then detect the connection status of at least two consensus nodes, and record the consensus node whose connection status is disconnected as the consensus node to be connected. Specifically, when disconnecting the network connection of the historical consensus node, the computer device can obtain the node address information of the historical consensus node from the full node table, and send a network disconnection request to the historical consensus node based on the node address information to disconnect the Open network connections with historical consensus nodes. Optionally, if the computer device belongs to a historical consensus node, the computer device obtains the node address information corresponding to each of the N consensus nodes from the full node table, and sends a network disconnection request to the corresponding consensus node based on the node address information to disconnect. Network connection with N consensus nodes.

进一步地,从全节点表中获取待连接共识节点的节点地址信息,基于节点地址信息在待连接共识节点之间建立网络连接,以得到共识网络。如图6所示,假定至少两个共识节点包括共识节点6021、共识节点6022、共识节点6023及共识节点6024等,计算机设备获取全节点表604,从全节点表604中获取其他共识节点的节点地址信息,基于节点地址信息建立与其他共识节点之间的网络连接,假定计算机设备为共识节点6022,计算机设备从全节点表604中获取共识节点6021的节点地址信息,基于共识节点6021的节点地址信息,向共识节点6021发送网络连接请求,共识节点6021接收到该网络连接请求,向计算机设备发送网络连接确认消息,基于网络连接确认消息建立计算机设备与共识节点6021之间的网络连接,同理,可以建立与待连接共识节点(如共识节点6023或共识节点6024)之间的网络连接,得到共识网络605。Further, the node address information of the consensus nodes to be connected is obtained from the full node table, and a network connection is established between the consensus nodes to be connected based on the node address information to obtain a consensus network. As shown in FIG. 6 , it is assumed that at least two consensus nodes include a consensus node 6021 , a consensus node 6022 , a consensus node 6023 , and a consensus node 6024 . Address information, based on the node address information to establish network connections with other consensus nodes, assuming that the computer device is the consensus node 6022, the computer device obtains the node address information of the consensus node 6021 from the full node table 604, based on the node address of the consensus node 6021 information, send a network connection request to the consensus node 6021, the consensus node 6021 receives the network connection request, sends a network connection confirmation message to the computer device, and establishes a network connection between the computer device and the consensus node 6021 based on the network connection confirmation message. , a network connection with a consensus node to be connected (such as a consensus node 6023 or a consensus node 6024 ) can be established to obtain a consensus network 605 .

进一步地,计算机设备可以从全节点表中,获取至少两个共识节点的节点标识,根据至少两个共识节点的节点标识生成共识节点表,可选的,还可以将各个共识节点的共识权重等添加至共识节点表中。计算机设备根据共识节点表生成共识网络区块,若对共识网络区块共识通过,则将共识网络区块添加至节点管理区块链中,确定至少两个共识节点可以组成共识网络,检测所述至少两个共识节点的连接状态,基于连接状态建立各个共识节点之间的网络连接,生成共识网络。Further, the computer device can obtain the node identifiers of at least two consensus nodes from the full node table, and generate the consensus node table according to the node identifiers of the at least two consensus nodes. Optionally, the consensus weight of each consensus node can also be calculated. Added to the consensus node table. The computer equipment generates a consensus network block according to the consensus node table. If the consensus on the consensus network block is passed, the consensus network block is added to the node management block chain, and it is determined that at least two consensus nodes can form a consensus network. The connection status of at least two consensus nodes, and the network connection between each consensus node is established based on the connection status to generate a consensus network.

进一步地,该全节点表的生成过程可以如下所示:Further, the generation process of the full node table can be as follows:

以一个网络节点为例,计算机设备可以获取目标网络节点发送的节点入网请求;该节点入网请求包括目标网络节点的目标节点标识、目标身份标签及目标节点地址信息。计算机设备可以根据目标节点标识及目标节点地址信息对目标网络节点进行验证,例如,基于目标节点地址信息向目标网络节点发送节点确认请求,若获取到该目标网络节点发送的节点确认消息,则确定该目标网络节点的目标节点地址信息合法;若在发送节点确认请求后经过消息反馈时长,计算机设备仍未获取到目标网络节点发送的节点确认消息,则确定该目标网络节点的目标节点地址信息非法。Taking a network node as an example, the computer device can obtain the node network access request sent by the target network node; the node network access request includes the target node identifier, target identity label and target node address information of the target network node. The computer device can verify the target network node according to the target node identifier and the target node address information, for example, send a node confirmation request to the target network node based on the target node address information, and determine if the node confirmation message sent by the target network node is obtained. The target node address information of the target network node is legal; if the computer device has not obtained the node confirmation message sent by the target network node after the message feedback time has elapsed after the node confirmation request is sent, it is determined that the target node address information of the target network node is illegal. .

其中,若目标网络节点的目标节点地址信息非法,则拒绝该目标网络节点的节点入网请求,向该目标网络节点发送节点地址信息异常消息。若目标网络节点的目标节点地址信息合法,则获取目标身份标签;计算机设备对目标身份标签进行共识,若共识通过,则根据目标节点标识、目标身份标签及目标节点地址信息生成节点信息区块,将节点信息区块添加至节点管理区块链中;将目标节点标识、目标身份标签及目标节点地址信息加入全节点表中。可选的,该节点入网请求还可以包括目标网络节点的目标节点签名,计算机设备可以获取目标网络节点的公钥,采用该目标网络节点的公钥对目标节点签名进行验签,若验签通过,且对目标身份标签共识通过,则根据目标节点标识、目标身份标签、目标节点地址信息及目标节点签名生成节点信息区块,将节点信息区块添加至节点管理区块链中;若目标网络节点的目标节点地址信息非法,或者对目标身份标签共识不通过,或者对目标节点签名验签不通过,则拒绝该目标网络节点的节点入网请求,向目标网络节点发送异常消息,例如,当目标网络节点的目标节点地址信息非法时,该异常消息为节点地址信息异常消息;当对目标身份标签共识不通过时,该异常消息为标签异常消息;当对目标节点签名验签不通过时,该异常消息为签名异常消息等。Wherein, if the target node address information of the target network node is illegal, the node network access request of the target network node is rejected, and a node address information exception message is sent to the target network node. If the target node address information of the target network node is legal, the target identity label is obtained; the computer equipment reaches a consensus on the target identity label, and if the consensus is passed, the node information block is generated according to the target node identity, target identity label and target node address information, Add the node information block to the node management blockchain; add the target node identification, target identity label and target node address information to the full node table. Optionally, the node's network access request may also include the target node signature of the target network node, and the computer device may obtain the public key of the target network node, and use the public key of the target network node to verify the signature of the target node. , and the consensus on the target identity label is passed, the node information block is generated according to the target node identification, target identity label, target node address information and target node signature, and the node information block is added to the node management blockchain; if the target network If the target node address information of the node is illegal, or the consensus on the target identity label fails, or the signature verification of the target node fails, the node access request of the target network node is rejected, and an abnormal message is sent to the target network node. For example, when the target When the target node address information of the network node is illegal, the abnormal message is the node address information abnormal message; when the consensus on the target identity label fails, the abnormal message is the label abnormal message; when the signature verification of the target node fails, the abnormal message The exception message is a signed exception message or the like.

其中,在对目标身份标签进行共识时,计算机设备可以获取该目标身份标签,若目标身份标签为共识标签,则获取目标身份标签的目标虚拟抵押权益;获取共识权益阈值,若目标虚拟抵押权益小于共识权益阈值,则确定对目标身份标签共识失败,向目标网络节点发送标签异常消息;若目标虚拟抵押权益大于或等于共识权益阈值,则根据目标虚拟抵押权益生成目标网络节点的目标共识权重,确定对目标身份标签共识通过。可选的,计算机设备可以获取该目标网络节点所属的节点集群,基于节点集群对目标身份标签进行共识,其中,若该节点集群为第一节点集群,则该目标身份标签可以是共识标签、数据标签或轻量标签;若该节点集群为第二节点集群,则该目标身份标签可以是数据标签或轻量标签;若该节点集群为第三节点集群,则该目标身份标签可以是轻量标签。在对目标身份标签进行共识时,可以获取该目标网络节点所属的节点集群,若该目标网络节点所属的节点集群与目标身份标签相匹配,则确定对目标身份标签共识通过;若该目标网络节点所属的节点集群与目标身份标签不匹配,则确定对目标身份标签共识失败,向目标网络节点发送标签异常消息。其中,第一节点集群中的网络节点的管理权限大于第二节点集群中的网络节点的管理权限,第二节点集群中的网络节点的管理权限大于第三节点集群中的网络节点的管理权限。Among them, when a consensus is performed on the target identity tag, the computer device can obtain the target identity tag, and if the target identity tag is a consensus tag, the target virtual mortgage rights and interests of the target identity tag are obtained; the threshold value of the consensus rights and interests is obtained, if the target virtual mortgage rights and interests are less than If the target virtual mortgage equity is greater than or equal to the consensus equity threshold, the target consensus weight of the target network node is generated according to the target virtual mortgage equity, and the target consensus weight is determined. The consensus on the target identity tag is passed. Optionally, the computer device may obtain the node cluster to which the target network node belongs, and perform consensus on the target identity label based on the node cluster, wherein, if the node cluster is the first node cluster, the target identity label may be a consensus label, data label or lightweight label; if the node cluster is the second node cluster, the target identity label can be a data label or a lightweight label; if the node cluster is a third node cluster, the target identity label can be a lightweight label . When the target identity label is consensus, the node cluster to which the target network node belongs can be obtained. If the node cluster to which the target network node belongs matches the target identity label, it is determined that the consensus on the target identity label has passed; if the target network node If the node cluster to which it belongs does not match the target identity label, it is determined that the consensus on the target identity label fails, and a label exception message is sent to the target network node. The management authority of the network nodes in the first node cluster is greater than the management authority of the network nodes in the second node cluster, and the management authority of the network nodes in the second node cluster is greater than the management authority of the network nodes in the third node cluster.

其中,目标网络节点可以获取目标节点信息,该目标节点信息可以包括目标节点标识、目标节点地址信息、目标身份标签或目标共识权重等中的任意一项或至少两项,目标网络节点可以采用该目标网络节点的私钥对目标节点信息进行签名,生成目标节点签名。其中,若该节点入网请求中不包括目标身份标签或者该目标身份标签为空,则将该目标身份标签确定为数据标签或轻量标签,具体的,可以获取该目标网络节点的目标共识权重,若该目标共识权重属于轻量权重范围,则将该目标网络节点的目标身份标签确定为轻量标签,若该目标共识权重属于数据权重范围,则将该目标网络节点的目标身份标签确定为数据标签。The target network node can obtain target node information, and the target node information can include any one or at least two of the target node identifier, target node address information, target identity label or target consensus weight, etc. The target network node can use the The private key of the target network node signs the target node information to generate the target node signature. Wherein, if the node's network access request does not include the target identity label or the target identity label is empty, then the target identity label is determined as a data label or a lightweight label. Specifically, the target consensus weight of the target network node can be obtained, If the target consensus weight belongs to the light weight range, the target identity label of the target network node is determined as the light weight label; if the target consensus weight belongs to the data weight range, the target identity label of the target network node is determined as the data Label.

其中,在本申请中的共识权重可以是基于对应网络节点的数据生成的,具体的,以一个网络节点为例,计算机设备可以获取该网络节点的虚拟抵押权益及历史共识次数,根据虚拟抵押权益及历史共识次数确定网络节点的共识权重,例如,可以基于权重算法对虚拟抵押权益及历史共识次数进行处理,得到该网络节点的共识权重。可选的,计算机设备还可以获取该网络节点的虚拟抵押权益、历史共识次数及随机数等确定网络节点的共识权重,其中,该虚拟抵押权益可以是该网络节点提供的虚拟资产,该历史共识次数可以是该网络节点参与共识的次数,或者,该网络节点参与的共识周期的周期数等。其中,该随机数可以根据系统网络时间、节点管理区块链中的最大区块高度或者节点管理区块链中的某个区块的哈希值等生成。The consensus weight in this application can be generated based on the data of the corresponding network node. Specifically, taking a network node as an example, a computer device can obtain the virtual mortgage rights and historical consensus times of the network node. According to the virtual mortgage rights and the historical consensus times to determine the consensus weight of the network node. For example, the virtual mortgage rights and historical consensus times can be processed based on the weight algorithm to obtain the consensus weight of the network node. Optionally, the computer device may also obtain the virtual mortgage rights, historical consensus times and random numbers of the network nodes to determine the consensus weights of the network nodes, wherein the virtual mortgage rights can be virtual assets provided by the network nodes, and the historical consensus The number of times may be the number of times the network node participates in the consensus, or the number of cycles of the consensus cycle in which the network node participates, and so on. The random number may be generated according to the system network time, the maximum block height in the node management blockchain, or the hash value of a certain block in the node management blockchain.

可选的,该区块链网络中存在抵押账户,可以从网络节点的账户中获取虚拟资产,将该虚拟资产添加至抵押账户中,将该虚拟资产作为对应的网络节点的虚拟抵押权益;或者,可以缓存该虚拟资产,对网络节点验证通过后,将该虚拟资产添加至抵押账户中,若对网络节点验证不通过,则将该虚拟资产返回至对应网络节点的账户中。Optionally, there is a mortgage account in the blockchain network, virtual assets can be obtained from the account of the network node, the virtual asset is added to the mortgage account, and the virtual asset is used as the virtual mortgage rights and interests of the corresponding network node; or , the virtual asset can be cached. After the verification of the network node is passed, the virtual asset is added to the mortgage account. If the verification of the network node fails, the virtual asset is returned to the account of the corresponding network node.

步骤S404,当获取到待处理网络节点的退网请求时,从全节点表中获取该待处理网络节点的共识权重,将待处理网络节点的共识权重发送至待处理网络节点,删除该全节点表中的待处理网络节点。Step S404, when the logout request of the to-be-processed network node is obtained, the consensus weight of the to-be-processed network node is obtained from the full node table, the consensus weight of the to-be-processed network node is sent to the to-be-processed network node, and the full node is deleted The pending network nodes in the table.

在本申请实施例中,若发起退网请求的待处理网络节点属于共识网络,则更新该共识网络,其中,删除该全节点表中的待处理网络节点是指删除该待处理网络节点在全节点表中的所有数据(即待处理网络节点的节点信息)。具体的,计算机设备可以基于该退网请求,从全节点表中获取该待处理网络节点的身份标签,若该待处理网络节点的身份标签为共识标签,则触发针对共识网络的更新请求,执行上述步骤S401至步骤S403,以更新共识网络;或者,从共识节点表中查找待处理网络节点,若在共识节点表中查找到该待处理网络节点,则触发针对共识网络的更新请求,执行步骤S401至步骤S403中的过程,以更新共识网络。当触发了针对共识网络的更新请求,或者,该待处理网络节点的身份标签不为共识标签,或者,共识节点表中不存在该待处理网络节点时,计算机设备可以从全节点表中获取该待处理网络节点的共识权重,该待处理网络节点的共识权重包括待处理网络节点的虚拟抵押权益,将该虚拟抵押权益发送至待处理网络节点。其中,若该虚拟抵押权益为虚拟资产,则将该虚拟资产发送至待处理网络节点的账户中。进一步地,删除全节点表中与待处理网络节点相关的数据(即待处理网络节点的节点信息)。其中,该待处理网络节点属于至少两个网络节点。可选的,也可以先删除全节点表中与待处理网络节点相关的数据,再检测该待处理网络节点是否属于共识网络,若该待处理网络节点属于共识网络,则触发针对共识网络的更新请求,对该共识网络进行更新。In this embodiment of the present application, if the to-be-processed network node that initiates the withdrawal request belongs to the consensus network, the consensus network is updated, wherein deleting the to-be-processed network node in the full node table refers to deleting the to-be-processed network node in the entire node table. All data in the node table (that is, the node information of the network node to be processed). Specifically, the computer device can obtain the identity label of the network node to be processed from the full node table based on the network withdrawal request, and if the identity label of the network node to be processed is a consensus label, trigger an update request for the consensus network, execute The above steps S401 to S403 are to update the consensus network; or, look up the to-be-processed network node from the consensus node table, and if the to-be-processed network node is found in the consensus node table, trigger an update request for the consensus network, and execute the steps The process from S401 to step S403 is to update the consensus network. When an update request for the consensus network is triggered, or the identity label of the network node to be processed is not a consensus label, or the network node to be processed does not exist in the consensus node table, the computer device can obtain the network node from the full node table. The consensus weight of the network node to be processed, the consensus weight of the network node to be processed includes the virtual mortgage rights and interests of the network nodes to be processed, and the virtual mortgage rights and interests are sent to the network nodes to be processed. Wherein, if the virtual mortgage interest is a virtual asset, the virtual asset is sent to the account of the network node to be processed. Further, the data related to the network node to be processed (ie, the node information of the network node to be processed) in the full node table is deleted. Wherein, the network node to be processed belongs to at least two network nodes. Optionally, the data related to the network node to be processed in the full node table can also be deleted first, and then it is detected whether the network node to be processed belongs to the consensus network. If the network node to be processed belongs to the consensus network, an update for the consensus network is triggered. Request to update the consensus network.

其中,当获取到待处理网络节点的退网请求时,计算机设备可以对发送该退网请求的网络节点进行身份验证,若对发送该退网请求的网络节点身份验证通过,则表示发送该退网请求的网络节点为该退网请求所请求的网络节点,从全节点表中获取该待处理网络节点的共识权重,将待处理网络节点的共识权重发送至待处理网络节点,删除该全节点表中的待处理网络节点。例如,网络节点A发送了退网请求,该退网请求用于表示网络节点B要退出区块链网络,计算机设备获取到网络节点A发送的退网请求时,对网络节点A进行身份验证,发现该网络节点A请求将其他网络节点进行退网,则可以确定对该网络节点A的身份验证不通过,可选的,可以向网络节点A发送节点异常消息。Wherein, when acquiring the logout request of the network node to be processed, the computer device can perform identity verification on the network node that sent the logout request. The network node requested by the network request is the network node requested by the network withdrawal request, obtains the consensus weight of the network node to be processed from the full node table, sends the consensus weight of the network node to be processed to the network node to be processed, and deletes the full node The pending network nodes in the table. For example, when network node A sends a logout request, the logout request is used to indicate that network node B wants to log out of the blockchain network. When the computer device obtains the logout request sent by network node A, it authenticates network node A. If it is found that the network node A requests to withdraw other network nodes from the network, it can be determined that the identity verification of the network node A fails, and optionally, a node exception message can be sent to the network node A.

其中,该全节点表中包括每个网络节点的节点签名。进一步地,若从至少两个网络节点中检测到异常节点,则获取异常节点的公钥。采用异常节点的公钥对异常节点在全节点表中对应的节点签名进行验签,若验签通过,则表示该异常节点未被替换,向异常节点发送节点确认消息,该节点确认消息用于向异常节点获取异常数据;若对异常节点的节点签名验签不通过,则表示该异常节点不是全节点表中的原网络节点,或者,该异常节点身份不明,断开与异常节点之间的网络连接,从全节点表中删除与异常节点关联的数据(即该异常节点的节点信息)。Wherein, the full node table includes the node signature of each network node. Further, if an abnormal node is detected from at least two network nodes, the public key of the abnormal node is obtained. Use the public key of the abnormal node to verify the signature of the node corresponding to the abnormal node in the full node table. If the verification is passed, it means that the abnormal node has not been replaced, and a node confirmation message is sent to the abnormal node. The node confirmation message is used for Obtain abnormal data from the abnormal node; if the node signature verification of the abnormal node fails, it means that the abnormal node is not the original network node in the full node table, or the abnormal node is unknown and disconnected from the abnormal node. Network connection, delete the data associated with the abnormal node (that is, the node information of the abnormal node) from the full node table.

本申请实施例通过获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的共识权重;基于每个网络节点的共识权重,从至少两个网络节点中获取至少两个共识节点;检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点,从全节点表中获取待连接共识节点的节点地址信息,基于节点地址信息在待连接共识节点之间建立网络连接,得到共识网络。通过以上过程,在区块链网络中引入全节点表,该全节点表中存储有该区块链网络中各个网络节点的节点信息(如共识权重)等,当该区块链网络中的各个网络节点发生变化时,可以直接从该全节点表中获取发生变化的网络节点的数据,基于全节点表建立共识网络,而无需重新统计各个网络节点的节点信息,无需重新实现对区块链网络的部署,减少了在区块链网络发生变化时,对区块链网络进行更新所耗费的时间及资源,提高了对区块链网络中的网络节点管理的灵活性。In the embodiment of the present application, the consensus weight of each network node is obtained from the full node table by obtaining at least two network nodes in the blockchain network; based on the consensus weight of each network node, at least two network nodes are obtained from the at least two network nodes. Two consensus nodes; detect the connection status of at least two consensus nodes, record the consensus node whose connection status is disconnected as the consensus node to be connected, and obtain the node address information of the consensus node to be connected from the full node table. The address information establishes a network connection between the consensus nodes to be connected to obtain a consensus network. Through the above process, a full node table is introduced into the blockchain network, and the full node table stores the node information (such as consensus weight) of each network node in the blockchain network. When the network nodes change, the data of the changed network nodes can be directly obtained from the full node table, and a consensus network can be established based on the full node table, without the need to re-count the node information of each network node, and without the need to re-implement the blockchain network. The deployment of the blockchain network reduces the time and resources required to update the blockchain network when the blockchain network changes, and improves the flexibility of network node management in the blockchain network.

进一步地,参见图7,图7是本申请实施例提供的一种区块链节点管理装置示意图。上述区块链节点管理装置可以是运行于计算机设备中的一个计算机程序(包括程序代码),例如该区块链节点管理装置为一个应用软件;该装置可以用于执行本申请实施例提供的方法中的相应步骤。如图7所示,该区块链节点管理装置700可以用于上述图4所对应实施例中的计算机设备,具体的,该区块链节点管理装置700可以包括:权重获取模块11、节点选取模块12、连接建立模块13及节点退网模块14。Further, referring to FIG. 7 , FIG. 7 is a schematic diagram of a block chain node management apparatus provided by an embodiment of the present application. The above-mentioned blockchain node management device may be a computer program (including program code) running in a computer device, for example, the blockchain node management device is an application software; the device may be used to execute the method provided by the embodiments of the present application corresponding steps in . As shown in FIG. 7 , the block chain node management apparatus 700 can be used for the computer equipment in the embodiment corresponding to FIG. 4 . Specifically, the block chain node management apparatus 700 may include: a weight acquisition module 11 , a node selection Module 12 , connection establishment module 13 and node withdrawal module 14 .

权重获取模块11,用于获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的共识权重;The weight obtaining module 11 is used to obtain at least two network nodes in the blockchain network, and obtain the consensus weight of each network node from the full node table;

节点选取模块12,用于基于每个网络节点的共识权重,从至少两个网络节点中获取至少两个共识节点;The node selection module 12 is configured to obtain at least two consensus nodes from at least two network nodes based on the consensus weight of each network node;

连接建立模块13,用于检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点,从全节点表中获取待连接共识节点的节点地址信息,基于节点地址信息在待连接共识节点之间建立网络连接,得到共识网络;The connection establishment module 13 is used to detect the connection status of at least two consensus nodes, record the consensus node whose connection status is disconnected as the consensus node to be connected, and obtain the node address information of the consensus node to be connected from the full node table, Establish network connections between consensus nodes to be connected based on node address information to obtain a consensus network;

节点退网模块14,用于当获取到待处理网络节点的退网请求时,从全节点表中获取待处理网络节点的共识权重,将待处理网络节点的共识权重发送至待处理网络节点,删除全节点表中的待处理网络节点,若发起退网请求的待处理网络节点属于共识网络,则更新该共识网络;待处理网络节点属于至少两个网络节点。The node de-networking module 14 is configured to obtain the consensus weight of the to-be-processed network node from the full node table when the de-network request of the to-be-processed network node is obtained, and send the consensus weight of the to-be-processed network node to the to-be-processed network node, Delete the to-be-processed network node in the full node table, if the to-be-processed network node that initiates the withdrawal request belongs to the consensus network, update the consensus network; the to-be-processed network node belongs to at least two network nodes.

其中,该全节点表包括每个网络节点的身份标签及共识权重;Among them, the full node table includes the identity label and consensus weight of each network node;

该权重获取模块11,包括:The weight acquisition module 11 includes:

标签获取单元111,用于获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的身份标签,从至少两个网络节点中获取身份标签为共识标签的网络节点,得到候选共识节点;The label obtaining unit 111 is configured to obtain at least two network nodes in the blockchain network, obtain the identity label of each network node from the full node table, and obtain the network node whose identity label is the consensus label from the at least two network nodes , get candidate consensus nodes;

权重获取单元112,用于从全节点表中获取候选共识节点的共识权重;a weight obtaining unit 112, configured to obtain consensus weights of candidate consensus nodes from the full node table;

该节点选取模块12,具体用于:The node selection module 12 is specifically used for:

获取共识节点数量,基于候选共识节点的共识权重及共识节点数量,从候选共识节点中确定N个共识节点;共识节点数量用于表示组成共识网络的共识节点的数量,N为共识节点数量。Obtain the number of consensus nodes, and determine N consensus nodes from the candidate consensus nodes based on the consensus weight of the candidate consensus nodes and the number of consensus nodes; the number of consensus nodes is used to represent the number of consensus nodes that form a consensus network, and N is the number of consensus nodes.

其中,该节点选取模块12,具体用于:Among them, the node selection module 12 is specifically used for:

获取共识节点数量,基于每个网络节点的共识权重对至少两个网络节点进行排序,根据排序结果从至少两个网络节点中获取N个共识节点;共识节点数量用于表示组成共识网络的共识节点的数量,N为共识节点数量。Obtain the number of consensus nodes, sort at least two network nodes based on the consensus weight of each network node, and obtain N consensus nodes from at least two network nodes according to the sorting result; the number of consensus nodes is used to represent the consensus nodes that constitute the consensus network , and N is the number of consensus nodes.

其中,全节点表包括每个网络节点的身份标签;Wherein, the full node table includes the identity label of each network node;

在检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点方面,该连接建立模块13包括:In terms of detecting the connection status of at least two consensus nodes, and recording the consensus node whose connection status is disconnected as the consensus node to be connected, the connection establishment module 13 includes:

状态确定单元131,用于从全节点表中获取N个共识节点分别对应的身份标签,将身份标签不为共识标签的共识节点的连接状态确定为连接断开状态;The state determination unit 131 is configured to obtain the identity labels corresponding to the N consensus nodes from the full node table, and determine the connection state of the consensus node whose identity label is not the consensus label as the disconnected state;

共识确定单元132,用于将连接状态为连接断开状态的共识节点记作待连接共识节点。The consensus determination unit 132 is configured to record the consensus nodes whose connection state is in the disconnected state as the consensus nodes to be connected.

其中,该装置700还包括:Wherein, the device 700 further includes:

历史获取模块15,用于从全节点表中获取身份标签为共识标签的历史共识节点;The history acquisition module 15 is used to acquire historical consensus nodes whose identity labels are consensus labels from the full node table;

标签更新模块16,用于若历史共识节点不属于N个共识节点,则断开历史共识节点的网络连接,将全节点表中的历史共识节点的身份标签更新为数据标签,执行检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点的步骤。The label update module 16 is used to disconnect the network connection of the historical consensus node if the historical consensus node does not belong to N consensus nodes, update the identity label of the historical consensus node in the full node table to the data label, and perform detection of at least two The connection status of the consensus node, the consensus node whose connection status is disconnected is recorded as the step to be connected to the consensus node.

其中,该装置700还包括:Wherein, the device 700 further includes:

表生成模块17,用于从全节点表中,获取至少两个共识节点的节点标识,根据至少两个共识节点的节点标识生成共识节点表;The table generation module 17 is configured to obtain the node identifiers of at least two consensus nodes from the full node table, and generate a consensus node table according to the node identifiers of the at least two consensus nodes;

数据存储模块18,用于根据共识节点表生成共识网络区块,若对共识网络区块共识通过,则将共识网络区块添加至节点管理区块链中,执行检测至少两个共识节点的连接状态的步骤。The data storage module 18 is used for generating a consensus network block according to the consensus node table. If the consensus on the consensus network block is passed, the consensus network block is added to the node management blockchain, and the connection of at least two consensus nodes is detected. Status steps.

其中,该装置700还包括:Wherein, the device 700 further includes:

权重确定模块19,用于获取网络节点的虚拟抵押权益及历史共识次数,根据虚拟抵押权益及历史共识次数确定网络节点的共识权重;The weight determination module 19 is used to obtain the virtual mortgage rights and historical consensus times of network nodes, and determine the consensus weights of network nodes according to the virtual mortgage rights and historical consensus times;

数据上链模块20,用于若对共识权重共识通过,则将共识权重添加至节点管理区块链中,将共识权重与网络节点的关联关系添加至全节点表中。The data uploading module 20 is used to add the consensus weight to the node management block chain if the consensus on the consensus weight is passed, and add the association relationship between the consensus weight and the network nodes to the full node table.

其中,该装置700还包括:Wherein, the device 700 further includes:

请求获取模块21,用于获取目标网络节点发送的节点入网请求;节点入网请求包括目标网络节点的目标节点标识、目标身份标签及目标节点地址信息;The request obtaining module 21 is used to obtain the node network access request sent by the target network node; the node network access request includes the target node identifier, the target identity label and the target node address information of the target network node;

节点验证模块22,用于根据目标节点标识及目标节点地址信息对目标网络节点进行验证,若目标网络节点的目标节点地址信息合法,则获取目标身份标签;The node verification module 22 is used to verify the target network node according to the target node identifier and the target node address information, and obtain the target identity label if the target node address information of the target network node is legal;

标签验证模块23,用于对目标身份标签进行共识,若共识通过,则根据目标节点标识、目标身份标签及目标节点地址信息生成节点信息区块,将节点信息区块添加至节点管理区块链中;The label verification module 23 is used for consensus on the target identity label. If the consensus is passed, a node information block is generated according to the target node identification, target identity label and target node address information, and the node information block is added to the node management blockchain. middle;

节点添加模块24,用于将目标节点标识、目标身份标签及目标节点地址信息加入全节点表中。The node adding module 24 is used for adding target node identification, target identity label and target node address information to the full node table.

其中,在对目标身份标签进行共识方面,该标签验证模块23包括:Among them, in terms of consensus on the target identity tag, the tag verification module 23 includes:

权益获取单元231,用于若目标身份标签为共识标签,则获取目标身份标签的目标虚拟抵押权益;an equity acquisition unit 231, configured to acquire the target virtual mortgage equity of the target identity label if the target identity label is a consensus label;

消息发送单元232,用于获取共识权益阈值,若目标虚拟抵押权益小于共识权益阈值,则确定对目标身份标签共识失败,向目标网络节点发送标签异常消息;The message sending unit 232 is configured to obtain a consensus equity threshold. If the target virtual mortgage equity is less than the consensus equity threshold, it is determined that the consensus on the target identity label has failed, and a label exception message is sent to the target network node;

验证通过单元233,用于若目标虚拟抵押权益大于或等于共识权益阈值,则根据目标虚拟抵押权益生成目标网络节点的目标共识权重,确定对目标身份标签共识通过。The verification passing unit 233 is configured to generate the target consensus weight of the target network node according to the target virtual mortgage equity if the target virtual mortgage equity is greater than or equal to the consensus equity threshold, and determine that the consensus on the target identity label is passed.

其中,全节点表还包括每个网络节点的节点签名;Wherein, the full node table also includes the node signature of each network node;

该装置700还包括:The apparatus 700 also includes:

公钥获取模块25,用于若从至少两个网络节点中检测到异常节点,则获取异常节点的公钥;a public key acquisition module 25, configured to acquire the public key of the abnormal node if an abnormal node is detected from at least two network nodes;

节点验签模块26,用于采用异常节点的公钥对异常节点在全节点表中对应的节点签名进行验签,若验签通过,则向异常节点发送节点确认消息;节点确认消息用于向异常节点获取异常数据;The node signature verification module 26 is used to verify the signature of the node corresponding to the abnormal node in the full node table by using the public key of the abnormal node, and if the signature is passed, send a node confirmation message to the abnormal node; The abnormal node obtains abnormal data;

该节点验签模块26,还用于若对异常节点的节点签名验签不通过,则断开与异常节点之间的网络连接,从全节点表中删除与异常节点关联的数据。The node signature verification module 26 is further configured to disconnect the network connection with the abnormal node if the node signature verification of the abnormal node fails, and delete the data associated with the abnormal node from the full node table.

本申请实施例描述了区块链节点管理装置,上述装置以至少两个网络节点中的任意一个网络节点,实现了对区块链网络中的网络节点的管理,包括共识网络的生成及节点信息的存储等,在区块链网络中引入全节点表,该全节点表中存储有该区块链网络中各个网络节点的节点信息(如共识权重)等,当该区块链网络中的各个网络节点发生变化时,可以直接从该全节点表中获取发生变化的网络节点的数据,基于全节点表建立共识网络,而无需重新统计各个网络节点的节点信息,无需重新实现对区块链网络的部署,减少了在区块链网络发生变化时,对区块链网络进行更新所耗费的时间及资源,提高了对区块链网络中的网络节点管理的灵活性。The embodiments of the present application describe a blockchain node management device. The above device uses any one of at least two network nodes to manage network nodes in a blockchain network, including the generation of consensus networks and node information. The full node table is introduced into the blockchain network, and the full node table stores the node information (such as consensus weight) of each network node in the blockchain network. When the network nodes change, the data of the changed network nodes can be directly obtained from the full node table, and a consensus network can be established based on the full node table, without the need to re-count the node information of each network node, and without the need to re-implement the blockchain network. The deployment of the blockchain network reduces the time and resources required to update the blockchain network when the blockchain network changes, and improves the flexibility of network node management in the blockchain network.

参见图8,图8是本申请实施例提供的一种计算机设备的结构示意图。如图8所示,本申请实施例中的计算机设备800可以包括:一个或多个处理器801、存储器802和输入输出接口803。上述处理器801、存储器802和输入输出接口803通过总线804连接。存储器802用于存储计算机程序,该计算机程序包括程序指令,输入输出接口803用于区块链中的各个网络节点之间进行数据交互;处理器801用于执行存储器802存储的程序指令,执行如下操作:Referring to FIG. 8, FIG. 8 is a schematic structural diagram of a computer device provided by an embodiment of the present application. As shown in FIG. 8 , the computer device 800 in this embodiment of the present application may include: one or more processors 801 , a memory 802 , and an input-output interface 803 . The above-mentioned processor 801 , memory 802 and input/output interface 803 are connected through a bus 804 . The memory 802 is used to store a computer program, and the computer program includes program instructions, and the input and output interface 803 is used for data interaction between each network node in the blockchain; the processor 801 is used to execute the program instructions stored in the memory 802. The execution is as follows operate:

获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的共识权重;Obtain at least two network nodes in the blockchain network, and obtain the consensus weight of each network node from the full node table;

基于每个网络节点的共识权重,从至少两个网络节点中获取至少两个共识节点;Obtain at least two consensus nodes from at least two network nodes based on the consensus weight of each network node;

检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点,从全节点表中获取待连接共识节点的节点地址信息,基于节点地址信息在待连接共识节点之间建立网络连接,得到共识网络;Detect the connection status of at least two consensus nodes, record the consensus node whose connection status is disconnected as the consensus node to be connected, and obtain the node address information of the consensus node to be connected from the full node table. Establish network connections between consensus nodes to obtain a consensus network;

当获取到待处理网络节点的退网请求时,从全节点表中获取待处理网络节点的共识权重,将待处理网络节点的共识权重发送至待处理网络节点,删除全节点表中的待处理网络节点,若发起退网请求的待处理网络节点属于共识网络,则更新该共识网络;待处理网络节点属于至少两个网络节点。When the logout request of the network node to be processed is obtained, the consensus weight of the network node to be processed is obtained from the full node table, the consensus weight of the network node to be processed is sent to the network node to be processed, and the pending network node is deleted from the full node table. The network node, if the pending network node that initiates the withdrawal request belongs to the consensus network, the consensus network is updated; the pending network node belongs to at least two network nodes.

在一些可行的实施方式中,上述处理器801可以是中央处理单元(centralprocessing unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(digitalsignal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。In some feasible implementation manners, the above-mentioned processor 801 may be a central processing unit (central processing unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (digital signal processors, DSP), application-specific integrated circuits ( application specific integrated circuit, ASIC), off-the-shelf programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

该存储器802可以包括只读存储器和随机存取存储器,并向处理器801和输入输出接口803提供指令和数据。存储器802的一部分还可以包括非易失性随机存取存储器。例如,存储器802还可以存储设备类型的信息。The memory 802 may include read-only memory and random access memory, and provides instructions and data to the processor 801 and the input-output interface 803 . A portion of memory 802 may also include non-volatile random access memory. For example, memory 802 may also store device type information.

具体实现中,上述计算机可通过其内置的各个功能模块执行如上述图4中各个步骤所提供的实现方式,具体可参见上述图4中各个步骤所提供的实现方式,在此不再赘述。In specific implementation, the above-mentioned computer can execute the implementation manner provided by each step in FIG. 4 through its built-in functional modules. For details, please refer to the implementation manner provided by each step in FIG. 4 , which will not be repeated here.

本申请实施例通过提供一种计算机设备,包括:处理器、输入输出接口、存储器,通过处理器获取存储器中的计算机指令,执行上述图4中所示方法的各个步骤,进行区块链节点管理操作。通过存储器中的计算机指令,处理器执行以下步骤:获取区块链网络中的至少两个网络节点,从全节点表中获取每个网络节点的共识权重;基于每个网络节点的共识权重,从至少两个网络节点中获取至少两个共识节点;检测至少两个共识节点的连接状态,将连接状态为连接断开状态的共识节点记作待连接共识节点,从全节点表中获取待连接共识节点的节点地址信息,基于节点地址信息在待连接共识节点之间建立网络连接,得到共识网络。通过以上过程,在区块链网络中引入全节点表,该全节点表中存储有该区块链网络中各个网络节点的节点信息(如共识权重)等,当该区块链网络中的各个网络节点发生变化时,可以直接从该全节点表中获取发生变化的网络节点的数据,基于全节点表建立共识网络,而无需重新统计各个网络节点的节点信息,无需重新实现对区块链网络的部署,减少了在区块链网络发生变化时,对区块链网络进行更新所耗费的时间及资源,提高了对区块链网络中的网络节点管理的灵活性。The embodiments of the present application provide a computer device including: a processor, an input and output interface, and a memory, and the processor obtains computer instructions in the memory, executes each step of the method shown in FIG. 4 above, and manages blockchain nodes operate. Through the computer instructions in the memory, the processor performs the following steps: obtaining at least two network nodes in the blockchain network, obtaining the consensus weight of each network node from the full node table; based on the consensus weight of each network node, from Obtain at least two consensus nodes from at least two network nodes; detect the connection status of at least two consensus nodes, record the consensus node whose connection status is disconnected as the consensus node to be connected, and obtain the consensus to be connected from the full node table The node address information of the node, based on the node address information, establishes a network connection between the consensus nodes to be connected to obtain a consensus network. Through the above process, a full node table is introduced into the blockchain network, and the full node table stores the node information (such as consensus weight) of each network node in the blockchain network. When the network nodes change, the data of the changed network nodes can be directly obtained from the full node table, and a consensus network can be established based on the full node table, without the need to re-count the node information of each network node, and without the need to re-implement the blockchain network. The deployment of the blockchain network reduces the time and resources required to update the blockchain network when the blockchain network changes, and improves the flexibility of network node management in the blockchain network.

本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序包括程序指令,当该程序指令被上述处理器执行时,可以实现图4中各个步骤所提供的区块链节点管理方法,具体可参见上述图4中各个步骤所提供的实现方式,在此不再赘述。另外,对采用相同方法的有益效果描述,也不再进行赘述。对于本申请所涉及的计算机可读存储介质实施例中未披露的技术细节,请参照本申请方法实施例的描述。作为示例,程序指令可被部署为在一个计算机设备上执行,或者在位于一个地点的多个计算机设备上执行,又或者,在分布在多个地点且通过通信网络互连的多个计算机设备上执行,分布在多个地点且通过通信网络互连的多个计算设备可以组成区块链网络。Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by the above-mentioned processor, each step in FIG. 4 can be implemented. For the provided blockchain node management method, specific reference may be made to the implementation manner provided by each step in FIG. 4 above, which will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments involved in the present application, please refer to the description of the method embodiments of the present application. By way of example, program instructions may be deployed to execute on one computer device, or on multiple computer devices located at one site, or alternatively, on multiple computer devices distributed across multiple sites and interconnected by a communications network Implemented, multiple computing devices distributed in multiple locations and interconnected by a communication network can form a blockchain network.

上述计算机可读存储介质可以是前述任一实施例提供的区块链节点管理装置或者上述计算机的内部存储单元,例如计算机的硬盘或内存。该计算机可读存储介质也可以是该计算机的外部存储设备,例如该计算机上配备的插接式硬盘,智能存储卡(smartmedia card,SMC),安全数字(secure digital,SD)卡,闪存卡(flash card)等。进一步地,该计算机可读存储介质还可以既包括该计算机的内部存储单元也包括外部存储设备。该计算机可读存储介质用于存储该计算机程序以及该计算机所需的其他程序和数据。该计算机可读存储介质还可以用于暂时地存储已经输出或者将要输出的数据。The above-mentioned computer-readable storage medium may be the blockchain node management apparatus provided in any of the foregoing embodiments or an internal storage unit of the above-mentioned computer, such as a hard disk or a memory of the computer. The computer-readable storage medium may also be an external storage device of the computer, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash memory card ( flash card), etc. Further, the computer-readable storage medium may also include both an internal storage unit of the computer and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer. The computer-readable storage medium can also be used to temporarily store data that has been or will be output.

本申请实施例还提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行图4中的各种可选方式中所提供的方法,实现了对区块链网络中的网络节点的管理,包括生成共识网络及对网络节点的节点信息管理等,其中,在区块链网络中引入全节点表,该全节点表中存储有该区块链网络中各个网络节点的节点信息(如共识权重)等,当该区块链网络中的各个网络节点发生变化时,可以直接从该全节点表中获取发生变化的网络节点的数据,基于全节点表建立共识网络,而无需重新统计各个网络节点的节点信息,无需重新实现对区块链网络的部署,减少了在区块链网络发生变化时,对区块链网络进行更新所耗费的时间及资源,提高了对区块链网络中的网络节点管理的灵活性。Embodiments of the present application also provide a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various optional manners in FIG. The management of network nodes in the network, including the generation of consensus networks and the management of node information for network nodes, etc., among which, a full node table is introduced into the blockchain network, and the full node table stores each network in the blockchain network. The node information of the node (such as consensus weight), etc. When each network node in the blockchain network changes, the data of the changed network node can be directly obtained from the full node table, and a consensus network can be established based on the full node table. , without the need to re-statistic the node information of each network node, without the need to re-implement the deployment of the blockchain network, reducing the time and resources spent on updating the blockchain network when the blockchain network changes, improving the Flexibility in the management of network nodes in a blockchain network.

本申请实施例的说明书和权利要求书及附图中的术语“第一”、“第二”等是用于区别不同对象,而非用于描述特定顺序。此外,术语“包括”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、装置、产品或设备没有限定于已列出的步骤或模块,而是可选地还包括没有列出的步骤或模块,或可选地还包括对于这些过程、方法、装置、产品或设备固有的其他步骤单元。The terms "first", "second" and the like in the description and claims of the embodiments of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. Furthermore, the term "comprising" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product or device comprising a series of steps or units is not limited to the listed steps or modules, but optionally also includes unlisted steps or modules, or optionally also includes For other step units inherent to these processes, methods, apparatus, products or equipment.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. Interchangeability, the above description has generally described the components and steps of each example in terms of function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.

本申请实施例提供的方法及相关装置是参照本申请实施例提供的方法流程图和/或结构示意图来描述的,具体可由计算机程序指令实现方法流程图和/或结构示意图的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。这些计算机程序指令可提供到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或结构示意图一个方框或多个方框中指定的功能的装置。这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或结构示意图一个方框或多个方框中指定的功能。这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或结构示意一个方框或多个方框中指定的功能的步骤。The methods and related apparatuses provided by the embodiments of the present application are described with reference to the method flowcharts and/or schematic structural diagrams provided in the embodiments of the present application. Specifically, each process and/or the schematic structural diagrams of the method flowcharts and/or structural schematic diagrams can be implemented by computer program instructions. or blocks, and combinations of processes and/or blocks in flowcharts and/or block diagrams. 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 device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce a function An apparatus for implementing the functions specified in one or more of the flowcharts and/or one or more blocks of the structural diagrams. These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in one or more of the flowcharts and/or one or more blocks of the structural diagram. These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the block or blocks of the flowchart and/or structural representation.

以上所揭露的仅为本申请较佳实施例而已,当然不能以此来限定本申请之权利范围,因此依本申请权利要求所作的等同变化,仍属本申请所涵盖的范围。The above disclosures are only the preferred embodiments of the present application, and of course, the scope of the rights of the present application cannot be limited by this. Therefore, equivalent changes made according to the claims of the present application are still within the scope of the present application.

Claims (15)

1. A block link point management method, the method comprising:
acquiring at least two network nodes in a block chain network, and acquiring a consensus weight of each network node from a full node table; the consensus weights comprise virtual mortgage interests;
acquiring at least two consensus nodes from the at least two network nodes based on the consensus weight of each network node;
detecting the connection state of the at least two consensus nodes, recording the consensus node with the connection state being a disconnection state as a consensus node to be connected, acquiring node address information of the consensus node to be connected from the whole node table, and establishing network connection between the consensus nodes to be connected based on the node address information to obtain a consensus network;
when a network quitting request of a network node to be processed is obtained, acquiring a consensus weight of the network node to be processed from the whole node table, sending a virtual mortgage interest in the consensus weight of the network node to be processed to the network node to be processed, deleting the network node to be processed in the whole node table, and updating the consensus network if the network node to be processed initiating the network quitting request belongs to the consensus network; the network node to be processed belongs to the at least two network nodes.
2. The method of claim 1, wherein the full node table includes an identity label and a consensus weight for each of the network nodes;
the acquiring at least two network nodes in the blockchain network, acquiring the consensus weight of each network node from the full node table, includes:
acquiring at least two network nodes in a block chain network, acquiring an identity label of each network node from the full node table, and acquiring the network nodes of which the identity labels are consensus labels from the at least two network nodes to obtain candidate consensus nodes;
acquiring consensus weights of the candidate consensus nodes from the full node table;
the obtaining at least two consensus nodes from the at least two network nodes based on the consensus weight of each network node comprises:
acquiring the number of consensus nodes, and determining N consensus nodes from the candidate consensus nodes based on the consensus weights of the candidate consensus nodes and the number of the consensus nodes; the number of the consensus nodes is used for representing the number of the consensus nodes forming the consensus network, and N is the number of the consensus nodes.
3. The method of claim 1, wherein the obtaining at least two consensus nodes from the at least two network nodes based on the consensus weight for each network node comprises:
acquiring the number of consensus nodes, sequencing the at least two network nodes based on the consensus weight of each network node, and acquiring N consensus nodes from the at least two network nodes according to a sequencing result; the number of the consensus nodes is used for representing the number of the consensus nodes forming the consensus network, and N is the number of the consensus nodes.
4. The method of claim 3, wherein the full node table includes an identity tag for each of the network nodes;
the detecting the connection state of the at least two consensus nodes, and recording the consensus node with the connection state being the disconnection state as the consensus node to be connected, includes:
acquiring identity labels corresponding to the N consensus nodes from the full node table, and determining the connection state of the consensus nodes of which the identity labels are not the consensus labels as a connection disconnection state;
and recording the common identification node with the connection state being the disconnection state as a common identification node to be connected.
5. The method of claim 4, wherein the method further comprises:
acquiring a history consensus node with the identity label as a consensus label from the whole node table;
if the historical consensus nodes do not belong to the N consensus nodes, disconnecting the network connection of the historical consensus nodes, updating the identity labels of the historical consensus nodes in the whole node table to be data labels, executing the step of detecting the connection states of the at least two consensus nodes, and recording the consensus nodes with the connection states being the connection disconnection states as the consensus nodes to be connected.
6. The method of claim 1, wherein the method further comprises:
acquiring node identifications of the at least two consensus nodes from the full node table, and generating a consensus node table according to the node identifications of the at least two consensus nodes;
and generating a consensus network block according to the consensus node table, if the consensus passes through the consensus network block, adding the consensus network block into a node management block chain, and executing the step of detecting the connection state of the at least two consensus nodes.
7. The method of claim 1, wherein the method further comprises:
acquiring the virtual mortgage interest and the historical consensus number of the network node, and determining the consensus weight of the network node according to the virtual mortgage interest and the historical consensus number;
and if the consensus weight passes the consensus, adding the consensus weight into a node management block chain, and adding the association relation between the consensus weight and the network node into the full node table.
8. The method of claim 1, wherein the method further comprises:
acquiring a node network access request sent by a target network node; the node network access request comprises a target node identification, a target identity label and target node address information of the target network node;
verifying the target network node according to the target node identification and the target node address information, and if the target node address information of the target network node is legal, acquiring the target identity tag;
performing consensus on the target identity tag, if the consensus passes, generating a node information block according to the target node identifier, the target identity tag and the target node address information, and adding the node information block to a node management block chain;
and adding the target node identification, the target identity label and the target node address information into the full node table.
9. The method of claim 8, wherein the consensus on the target identity tag comprises:
if the target identity label is a consensus label, acquiring a target virtual mortgage right of the target identity label;
acquiring a consensus right interest threshold, if the target virtual mortgage right interest is smaller than the consensus right interest threshold, determining that the target identity label consensus fails, and sending a label abnormal message to the target network node;
and if the target virtual mortgage interest is larger than or equal to the consensus interest threshold, generating a target consensus weight of the target network node according to the target virtual mortgage interest, and determining that the target identity label is agreed.
10. The method of claim 1, wherein the full node table further includes a node signature for the each network node;
the method further comprises the following steps:
if an abnormal node is detected from the at least two network nodes, acquiring a public key of the abnormal node;
adopting the public key of the abnormal node to check the signature of the node corresponding to the abnormal node in the whole node table, and if the signature passes, sending a node confirmation message to the abnormal node; the node confirmation message is used for acquiring abnormal data from the abnormal node;
and if the node signature of the abnormal node fails to pass the verification, disconnecting the network connection with the abnormal node, and deleting the data associated with the abnormal node from the full node table.
11. A block link point management apparatus, the apparatus comprising:
the weight acquisition module is used for acquiring at least two network nodes in the block chain network and acquiring the consensus weight of each network node from the whole node table; the consensus weights comprise virtual mortgage interests;
the node selection module is used for acquiring at least two consensus nodes from the at least two network nodes based on the consensus weight of each network node;
the connection establishing module is used for detecting the connection state of the at least two consensus nodes, recording the consensus node with the connection state being in a disconnection state as a consensus node to be connected, acquiring the node address information of the consensus node to be connected from the whole node table, and establishing network connection between the consensus nodes to be connected based on the node address information to obtain a consensus network;
the node network quitting module is used for acquiring the consensus weights of the network nodes to be processed from the whole node table when network quitting requests of the network nodes to be processed are acquired, sending the virtual mortgage benefits in the consensus weights of the network nodes to be processed to the network nodes to be processed, deleting the network nodes to be processed in the whole node table, and updating the consensus network if the network nodes to be processed initiating the network quitting requests belong to the consensus network; the network node to be processed belongs to the at least two network nodes.
12. The apparatus of claim 11, wherein the full node table comprises an identity label and a consensus weight for each of the network nodes;
the weight obtaining module comprises:
a tag obtaining unit, configured to obtain at least two network nodes in a block chain network, obtain an identity tag of each network node from the full node table, and obtain a network node whose identity tag is a consensus tag from the at least two network nodes, so as to obtain a candidate consensus node;
a weight obtaining unit, configured to obtain a consensus weight of the candidate consensus node from the full node table;
the node selection module is specifically configured to:
acquiring the number of consensus nodes, and determining N consensus nodes from the candidate consensus nodes based on the consensus weights of the candidate consensus nodes and the number of the consensus nodes; the number of the consensus nodes is used for representing the number of the consensus nodes forming the consensus network, and N is the number of the consensus nodes.
13. The apparatus of claim 11, wherein the node selection module is specifically configured to:
acquiring the number of consensus nodes, sequencing the at least two network nodes based on the consensus weight of each network node, and acquiring N consensus nodes from the at least two network nodes according to a sequencing result; the number of the consensus nodes is used for representing the number of the consensus nodes forming the consensus network, and N is the number of the consensus nodes.
14. A computer device comprising a processor, a memory, an input output interface;
the processor is connected to the memory and the input/output interface respectively, wherein the input/output interface is used for data interaction between network nodes in a block chain, the memory is used for storing program codes, and the processor is used for calling the program codes to execute the method of any one of claims 1 to 10.
15. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method of any of claims 1-10.
CN202011397915.2A 2020-12-03 2020-12-03 Blockchain node management method, device, computer and readable storage medium Active CN112200680B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011397915.2A CN112200680B (en) 2020-12-03 2020-12-03 Blockchain node management method, device, computer and readable storage medium
CN202110189183.6A CN113162971B (en) 2020-12-03 2020-12-03 Block link point management method, device, computer and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011397915.2A CN112200680B (en) 2020-12-03 2020-12-03 Blockchain node management method, device, computer and readable storage medium

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202110189183.6A Division CN113162971B (en) 2020-12-03 2020-12-03 Block link point management method, device, computer and readable storage medium

Publications (2)

Publication Number Publication Date
CN112200680A CN112200680A (en) 2021-01-08
CN112200680B true CN112200680B (en) 2021-03-05

Family

ID=74033819

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202011397915.2A Active CN112200680B (en) 2020-12-03 2020-12-03 Blockchain node management method, device, computer and readable storage medium
CN202110189183.6A Active CN113162971B (en) 2020-12-03 2020-12-03 Block link point management method, device, computer and readable storage medium

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202110189183.6A Active CN113162971B (en) 2020-12-03 2020-12-03 Block link point management method, device, computer and readable storage medium

Country Status (1)

Country Link
CN (2) CN112200680B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113067707B (en) * 2021-06-02 2021-08-31 腾讯科技(深圳)有限公司 Blockchain-based data processing method, device, device and readable storage medium
CN115378803B (en) * 2022-04-13 2023-12-12 网易(杭州)网络有限公司 Log management method, device, blockchain node and storage medium
CN114884977B (en) * 2022-05-09 2023-07-04 深圳嘉业产业发展有限公司 Block chain-based data sharing method and system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107171829A (en) * 2017-04-24 2017-09-15 杭州趣链科技有限公司 A kind of dynamic node management method for algorithm realization of being known together based on BFT
CN108712276A (en) * 2018-04-19 2018-10-26 上海分布信息科技有限公司 Common recognition network management, device, equipment and storage medium based on block chain technology
CN111291060A (en) * 2020-01-14 2020-06-16 腾讯科技(深圳)有限公司 Method, device and computer readable medium for managing block chain nodes
CN111444210A (en) * 2020-03-26 2020-07-24 腾讯科技(深圳)有限公司 Block chain consensus node management method, device, equipment and storage medium
CN111461885A (en) * 2020-03-31 2020-07-28 财付通支付科技有限公司 Consensus network management method, device, computer and readable storage medium
CN111464353A (en) * 2020-03-31 2020-07-28 财付通支付科技有限公司 Block link point management method, device, computer and readable storage medium
CN111654415A (en) * 2020-05-28 2020-09-11 腾讯科技(深圳)有限公司 Block chain based information processing method, device, equipment and readable storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10304143B2 (en) * 2016-05-05 2019-05-28 Lance Timothy Kasper Consensus system for manipulation resistant digital record keeping
US10764031B2 (en) * 2017-12-07 2020-09-01 International Business Machines Corporation Blockchain system for pattern recognition
CN112492006B (en) * 2018-10-31 2023-12-05 创新先进技术有限公司 A node management method and device based on blockchain
CN109559120B (en) * 2018-12-03 2021-11-19 国网电子商务有限公司 Weight-based block chain consensus method, system, storage medium and electronic device
CN109872152B (en) * 2019-01-11 2022-07-15 平安科技(深圳)有限公司 Block chain consensus method based on share authorization certification mechanism and related equipment
CN110730204B (en) * 2019-09-05 2022-09-02 创新先进技术有限公司 Method for deleting nodes in block chain network and block chain system
CN110727731B (en) * 2019-09-05 2021-12-21 创新先进技术有限公司 Method for adding node in block chain network and block chain system
CN110708171B (en) * 2019-12-13 2020-06-12 腾讯科技(深圳)有限公司 Block chain consensus voting method, device, equipment and storage medium
CN111786812B (en) * 2020-05-27 2023-06-20 金蝶软件(中国)有限公司 Node management method, device, computer equipment and storage medium
CN111383021B (en) * 2020-05-29 2020-09-15 腾讯科技(深圳)有限公司 Node management method, device, equipment and medium based on block chain network

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107171829A (en) * 2017-04-24 2017-09-15 杭州趣链科技有限公司 A kind of dynamic node management method for algorithm realization of being known together based on BFT
CN108712276A (en) * 2018-04-19 2018-10-26 上海分布信息科技有限公司 Common recognition network management, device, equipment and storage medium based on block chain technology
CN111291060A (en) * 2020-01-14 2020-06-16 腾讯科技(深圳)有限公司 Method, device and computer readable medium for managing block chain nodes
CN111444210A (en) * 2020-03-26 2020-07-24 腾讯科技(深圳)有限公司 Block chain consensus node management method, device, equipment and storage medium
CN111461885A (en) * 2020-03-31 2020-07-28 财付通支付科技有限公司 Consensus network management method, device, computer and readable storage medium
CN111464353A (en) * 2020-03-31 2020-07-28 财付通支付科技有限公司 Block link point management method, device, computer and readable storage medium
CN111654415A (en) * 2020-05-28 2020-09-11 腾讯科技(深圳)有限公司 Block chain based information processing method, device, equipment and readable storage medium

Also Published As

Publication number Publication date
CN113162971A (en) 2021-07-23
CN112200680A (en) 2021-01-08
CN113162971B (en) 2022-07-22

Similar Documents

Publication Publication Date Title
CN109472696B (en) Asset transaction method, device, storage medium and computer equipment
KR102566892B1 (en) Blockchain consensus method, device and system
WO2023020242A1 (en) Blockchain-based data processing method and apparatus, computer device, computer-readable storage medium, and computer program product
CN108683668B (en) Resource checking method, device, storage medium and equipment in content distribution network
CN111523890A (en) Data processing method and device based on block chain, storage medium and equipment
CN112200680B (en) Blockchain node management method, device, computer and readable storage medium
CN111400112A (en) Writing method, device and readable storage medium of distributed cluster storage system
CN111597567B (en) Data processing method, data processing device, node equipment and storage medium
CN110910143B (en) Identity generation method, device, related nodes and medium
CN110855688B (en) Block chain information processing method and related equipment
CN111163130A (en) A network service system and data transmission method thereof
CN111367923A (en) Data processing method, data processing device, node equipment and storage medium
CN111292057A (en) A blockchain-based business processing method
CN113961600A (en) A data query method, device, computer equipment and storage medium
CN114610504A (en) Message processing method and device, electronic equipment and storage medium
US20250190629A1 (en) Blockchain-based data processing method, device, and readable storage medium
CN115829731A (en) A transaction information processing method and device
CN117407437A (en) Block chain-based data processing method, equipment and readable storage medium
CN111125187B (en) Data management method and device based on blockchain
HK40037786B (en) Method and apparatus for managing blockchain node, computer and readable storage medium
HK40037786A (en) Method and apparatus for managing blockchain node, computer and readable storage medium
HK40048726B (en) Method and apparatus for managing blockchain node, computer, and readable storage medium
HK40048726A (en) Method and apparatus for managing blockchain node, computer, and readable storage medium
CN110889040B (en) Method and device for pushing information
CN119722301A (en) Digital resource interactive processing method, system, device and equipment based on blockchain

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40037786

Country of ref document: HK