A blockchain node cluster monitoring method and device based on federated learning
By using a combination of federated learning and smart contracts in the blockchain node cluster, decentralized node behavior monitoring is achieved, privacy risks and single point failures are solved, and the security and data privacy of the blockchain cluster are ensured. Identify and predict illegal nodes and protect blockchain assets.
Patent Information
- Application Number
- CN202111167018.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-01
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2041-10-01
AI Technical Summary
In the existing technology, the monitoring of blockchain node clusters has privacy risks and single point of failure problems, making it difficult to effectively predict and monitor illegal node behavior, affecting the security of the blockchain cluster.
Adopting a blockchain node cluster monitoring method based on federated learning, each node locally trains the federated learning model, uses private transactions to synchronize model parameters and behavioral portrait results, and combines smart contracts and adaptation layers to achieve decentralized monitoring of node behavior. and predictions, ensuring data privacy and security.
On the premise of ensuring the privacy of node data, it can effectively monitor and predict the behavior of blockchain cluster nodes, identify illegal nodes, ensure the security of blockchain assets, eliminate the risk of single point failure, and improve the system's fault tolerance and Data privacy protection.
Smart Images

Figure CN113992694B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain node cluster monitoring method and device based on federated learning. Background Art
[0002] Blockchain technology has been widely used in finance, people's livelihood, government affairs, justice, enterprises and other fields. However, blockchain also faces its own problems and challenges. There are a large number of node clusters in the blockchain, and some illegal nodes may conduct illegal behaviors in the cluster, causing harm to the entire blockchain cluster. Therefore, a method that can monitor and predict the behavior of blockchain cluster nodes is particularly important.
[0003] Federated learning enables participating institutions to collaboratively train machine learning models without directly exchanging raw data. In existing engineering technologies, collaborative training among institutions relies on centralized third-party collaboration nodes to achieve control, aggregation, and key management, which poses privacy risks and single point failure issues. Summary of the invention
[0004] The purpose of the present invention is to provide a blockchain node cluster monitoring method and device based on federated learning to address the deficiencies in the prior art.
[0005] To achieve the above object, the present invention has the following technical solutions:
[0006] On the one hand, the present invention provides a blockchain node cluster monitoring method based on federated learning, comprising:
[0007] In the blockchain cluster, each node trains the node monitoring federated learning training model of the local node based on the multi-dimensional portrait dataset of the local node;
[0008] After the local model training is completed, the latest model parameters are sent to the federated learning model synchronization smart contract through a private transaction, and the node behavior profiling results are sent to the business contract through a private transaction, uploaded to the chain, and recorded in the ledger after consensus;
[0009] Between blockchain nodes, the model parameters are synchronized through the federated learning model synchronization smart contract, and the local nodes are triggered to update the local models, so that the nodes in the chain synchronize the latest node monitoring federated learning training model.
[0010] Furthermore, the data dimensions of the multi-dimensional portrait data set include: transaction object, transaction amount, transaction time, transaction frequency, number of transactions, number of node broadcasts, block size, block landing time, consensus time, consensus signature verification result, consensus voting, network load, and network communication delay.
[0011] Furthermore, the multi-dimensional portrait dataset is mainly collected from the blockchain cluster and serves as the training data of the node monitoring federated learning training model. The portrait dataset can be specified through a configuration file, and a portrait dataset configuration interface is designed to achieve dynamic configuration, and a dataset collection interface is designed.
[0012] Furthermore, the portrait data set configuration interface can read the configuration file and send the configuration information to the blockchain node through a transaction. After consensus, the node monitoring federated learning training model parameters will be updated.
[0013] Furthermore, the data set collection interface realizes the acquisition of cluster node monitoring multi-dimensional portrait data from the blockchain cluster.
[0014] Furthermore, the design of the federated learning model synchronization smart contract includes: initializing parameters; receiving the latest model parameters sent by the local node; synchronizing the latest model parameters to each node in the blockchain cluster, and triggering each node to update the local model; and querying the model parameters.
[0015] Furthermore, the design of the business contract includes: uploading the node behavior portrait results to the chain and querying the node behavior portrait results.
[0016] Furthermore, the federated learning training results, i.e., the blockchain cluster node portraits, are stored on the blockchain nodes, and the monitoring results are displayed through the blockchain interface adaptation layer.
[0017] Furthermore, the adaptation layer is responsible for the interaction between the node behavior portrait results and the blockchain cluster node monitoring display, including the server and the adaptation layer interface, obtaining the node behavior portrait results from the blockchain cluster, and then sending the portrait results to the front end through the server for display in the display layer; the adaptation layer interface includes: obtaining the node operation status, obtaining the node multi-dimensional portrait data set, obtaining whether the node is attacked, obtaining node abnormal warning information and other interfaces.
[0018] On the other hand, the present invention provides a computer device, comprising: a memory and a processor; the memory stores a computer program that can be executed by the processor; when the processor runs the computer program, it executes the steps of the above-mentioned blockchain node cluster monitoring method based on federated learning.
[0019] The beneficial effects of the present invention are as follows: the present invention utilizes the characteristics of federated learning to protect the privacy of distributed data nodes, designs a federated learning model synchronization smart contract for node monitoring, and through privacy transactions, under the premise that cluster node data is not exchanged, while ensuring the privacy security of node data, can predict and monitor the node behavior in the blockchain cluster, give illegal abnormal node portraits, and identify the behavior of cluster nodes in advance to ensure the security of blockchain assets. Through the multi-dimensional portraits composed of the transaction amount, transaction object, consensus situation, transaction frequency, broadcast number, network bandwidth, etc. of the node, the jitter, legality judgment results and other behavioral portraits of the target blockchain node are output. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 The overall architecture diagram of the blockchain node cluster monitoring method based on federated learning provided by the present invention;
[0021] Figure 2 A flowchart of a blockchain node cluster monitoring method based on federated learning provided by the present invention;
[0022] Figure 3 A schematic diagram of the design of a node monitoring federated learning training model provided in an embodiment of the present invention;
[0023] Figure 4 A schematic diagram of a multi-dimensional portrait data set design provided by an embodiment of the present invention;
[0024] Figure 5 A schematic diagram of the design of a federated learning model synchronization smart contract provided in an embodiment of the present invention;
[0025] Figure 6 A schematic diagram of the adaptation layer design provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0027] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0028] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0029] The overall architecture of the blockchain node cluster monitoring method based on federated learning provided by the present invention is as follows: Figure 1 As shown, it mainly includes node monitoring federated learning training model, federated learning model synchronization smart contract, interface adaptation layer, and monitoring display layer.
[0030] In the blockchain cluster, each node is trained based on the data set of its own local node. The data dimensions mainly include: transaction object, transaction amount, transaction frequency, number of transactions, number of broadcasts, block size, consensus time, consensus signature verification results, consensus voting, block landing time, network load, etc. These data will only be executed locally on the node and will not be shared with other nodes to ensure the privacy and security of the data. After the node monitoring federated learning training model of the local node is trained, the model parameters are uploaded to the federated learning model synchronization smart contract.
[0031] Taking advantage of the data sharing feature of nodes within the blockchain, when one of the nodes completes training the local model and sends the latest model parameters to the federated learning model synchronization smart contract through a privacy transaction, it will be synchronized to other nodes after consensus. After receiving the relevant parameters of the updated model, other nodes will perform local synchronization to achieve synchronization of the federated learning training model.
[0032] The federated learning training results are stored on the blockchain nodes, and the monitoring results are displayed through the blockchain interface adaptation layer.
[0033] Under the premise of ensuring the data privacy of each node, the present invention realizes the synchronization of node monitoring federated learning training models through smart contracts, realizes behavioral profiling of blockchain cluster nodes, can ensure the safe operation of blockchain clusters, and predictively profile cluster nodes to identify illegal nodes in advance, thereby ensuring the security of on-chain assets.
[0034] like Figure 2 As shown, the implementation process of the method of the present invention is specifically as follows:
[0035] 1. The local node of the blockchain collects multi-dimensional data and sends it to the node monitoring federated learning training model of the local node for training;
[0036] 2. After the local model training is completed, the model parameters are sent to the federated learning model synchronization smart contract through a private transaction, and the node behavior profile results are sent to the business contract through a private transaction, which is then uploaded to the chain and recorded in the ledger after consensus;
[0037] 3. Blockchain nodes synchronize training models through the federated learning model synchronization smart contract, and trigger local nodes to update local training models, so that the nodes in the chain synchronize the latest node monitoring federated learning training model, and display the monitoring results through the adaptation layer.
[0038] The specific design of each part is introduced in detail below.
[0039] 1. Design of node monitoring federated learning training model, such as Figure 3 As shown, specifically:
[0040] 1. Each participant uses local data to train the model, sends the model parameters to the federated learning model synchronization smart contract, and uploads them to the chain. The model parameters are synchronized to each node of the blockchain through the federated learning model synchronization smart contract;
[0041] 2. Each participating node updates the local model.
[0042] In traditional federated learning, it can be seen as sample-based distributed model training, distributing all data to different machines. Each machine downloads the model from the server, and then uses local data to train the model, and then returns the parameters that need to be updated to the server; the server aggregates the parameters returned by each machine, updates the model, and then feeds the latest model back to each machine. This approach of aggregating models through a central server is prone to single point failure risks. For example, when a server node fails or is exploited by an attacker, it is easy to cause the entire training system to be paralyzed. The present invention combines federated learning with blockchain and designs a synchronous smart contract to achieve the decentralization of the convergence of each participant, eliminate the risk of single point failure, and improve the fault tolerance of federated learning. At the same time, the isolation of data between blockchain nodes is used to ensure that the data of each participant is not shared, which improves data privacy protection. The characteristics of data sharing between blockchain chains are used to achieve synchronization of model parameters and achieve a decentralized effect.
[0043] At the same time, for blockchain clusters, federated learning can achieve the training effect of shared data without sharing data. It greatly improves the accuracy of training while ensuring data privacy, monitors the behavior of cluster nodes, ensures the safe operation of the entire blockchain system, and identifies some abnormal nodes, which plays a predictive role, prevents problems before they occur, and ensures the security of blockchain assets.
[0044] 2. Design of Multidimensional Portrait Dataset
[0045] The multi-dimensional portrait dataset is mainly collected from the blockchain cluster as the training data of the node monitoring federated learning training model. The portrait dataset can be specified through the configuration file. When different data sets are selected, the focus of the monitoring portrait is also different. The portrait dataset configuration interface is designed to realize dynamic configuration and design the dataset collection interface, such as Figure 4 shown.
[0046] The multi-dimensional portrait data set mainly includes: transaction object, transaction amount, transaction time, transaction frequency, number of transactions, number of node broadcasts, block size, block landing time, consensus time, consensus signature verification results, consensus voting, network load, network communication delay, etc.
[0047] The design of data set interface mainly includes portrait data set configuration interface and data set collection interface.
[0048] The portrait dataset configuration interface can read the configuration file and send the configuration information to the blockchain node through transactions. After consensus, the federated learning model parameters will be updated.
[0049] The data set collection interface is mainly used to obtain multi-dimensional portrait data of cluster node monitoring from the blockchain cluster, mainly including: obtaining transaction object interface, obtaining transaction amount interface, obtaining transaction time interface, obtaining transaction frequency interface, obtaining transaction number interface, obtaining node broadcast number interface, obtaining block size interface, obtaining block landing time interface, obtaining consensus time interface, obtaining consensus signature verification result interface, obtaining consensus voting result interface, obtaining network load interface, and obtaining network communication delay interface.
[0050] 3. Design of smart contract for synchronization of federated learning model
[0051] The contract uses a private transaction method to ensure the privacy of data on each node. Figure 5 As shown, it mainly includes:
[0052] Initialization: Initialization parameters;
[0053] Receive synchronization parameters: receive model parameters sent by the node;
[0054] Model synchronization: responsible for synchronizing the latest model parameters to each node and triggering each node to update the local model;
[0055] Model parameter query: responsible for querying model parameters.
[0056] 4. Business Contract Design
[0057] The main function of the business contract is to upload the node behavior portrait of the training results to the chain and query the portrait results, etc., mainly including:
[0058] Training results on-chain: Node behavior profiling results on-chain;
[0059] Training result query: query the node behavior profiling results.
[0060] 5. Adaptation layer design
[0061] like Figure 6As shown in the figure, it is mainly responsible for the interaction between the blockchain node behavior portrait results and the blockchain cluster node monitoring display, including the server program and the adaptation layer interface, obtaining the user portrait results from the blockchain cluster, and then sending the portrait results to the front end through the server to display them in the display layer. It mainly includes the following interfaces: obtaining node operation status, obtaining node multi-dimensional portrait data sets, obtaining whether the node is attacked, obtaining node abnormal warning information, etc.
[0062] 6. Monitoring display design
[0063] Mainly responsible for the related display of node monitoring, including front-end program and node monitoring portrait display function, mainly including: displaying the operation status of cluster nodes, displaying the multi-dimensional portrait data set of cluster nodes, displaying whether the cluster nodes are attacked, displaying cluster node abnormal warning information, etc.
[0064] In one embodiment, a computer device is proposed, including a memory and a processor, wherein computer-readable instructions are stored in the memory. When the computer-readable instructions are executed by the processor, the processor executes the steps in the blockchain node cluster monitoring method based on federated learning in the above-mentioned embodiments.
[0065] In one embodiment, a storage medium storing computer-readable instructions is proposed. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps in the blockchain node cluster monitoring method based on federated learning in the above embodiments. The storage medium may be a non-volatile storage medium.
[0066] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0067] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.
Claims
1. A blockchain node cluster monitoring method based on federated learning, It is characterized in that include: In the blockchain cluster, each node trains the node monitoring federated learning training model of the local node based on the multi-dimensional portrait dataset of the local node; The data dimensions of the multi-dimensional portrait data set include: transaction object, transaction amount, transaction time, transaction frequency, transaction number, node broadcast number, block size, block landing time, consensus time, consensus node signature verification result, consensus vote, network load, network communication delay. These data will only be executed locally on the node and will not be shared with other nodes. After the local model training is completed, the latest model parameters are sent to the federated learning model synchronization smart contract through a private transaction, and the node behavior profiling results are sent to the business contract through a private transaction, uploaded to the chain, and recorded in the ledger after consensus; The federated learning model synchronization smart contract adopts the privacy transaction method to ensure the privacy of the data on each node. The design of the federated learning model synchronization smart contract includes: initializing parameters; receiving the latest model parameters sent by the local node; synchronizing the latest model parameters to each node of the blockchain cluster, and triggering each node to update the local model; model parameter query; Between blockchain nodes, the federated learning model synchronization smart contract synchronizes model parameters and triggers local nodes to update local models, so that the nodes in the chain synchronize the latest node monitoring federated learning training model; The results of federated learning training, i.e., the blockchain cluster node portraits, are stored on the blockchain nodes, and the monitoring results are displayed through the blockchain interface adaptation layer; The adaptation layer is responsible for the interaction between the node behavior portrait results and the blockchain cluster node monitoring display, including the server and the adaptation layer interface, obtaining the node behavior portrait results from the blockchain cluster, and then sending the portrait results to the front end through the server for display in the display layer; the adaptation layer interface includes: obtaining the node operation status, obtaining the node multi-dimensional portrait data set, obtaining whether the node is attacked, and obtaining the node abnormal warning information interface.
2. According to a blockchain node cluster monitoring method based on federated learning according to claim 1, It is characterized in that The multi-dimensional portrait dataset is collected from the blockchain cluster and serves as the training data of the node monitoring federated learning training model. The multi-dimensional portrait dataset is specified through a configuration file; Design the portrait dataset configuration interface to implement dynamic configuration, and design the dataset collection interface.
3. According to a blockchain node cluster monitoring method based on federated learning according to claim 2, It is characterized in that The portrait data set configuration interface is used to read the configuration file and send the configuration information to the blockchain node through a transaction. After consensus, the node monitoring federated learning training model parameters will be updated.
4. According to a blockchain node cluster monitoring method based on federated learning according to claim 2, It is characterized in that The data set acquisition interface is used to obtain cluster node monitoring multi-dimensional portrait data from the blockchain cluster.
5. According to a method for monitoring a blockchain node cluster based on federated learning according to claim 1, It is characterized in that The design of the business contract includes: uploading the node behavior portrait results to the chain and querying the node behavior portrait results.
6. A computer device, include: Memory and processor; The memory stores a computer program executable by the processor; When the processor runs the computer program, the processor performs the method according to any one of claims 1 to 5.
