Background
The blockchain is summarized to mean that a reliable database is maintained collectively in a decentralized and distrust-free mode, a distributed network is an infrastructure of the blockchain, data generated on each node is broadcast to other nodes through the distributed network, and the other nodes verify the authenticity of the data through workload certification. The distributed network is a precondition for ensuring the characteristics of decentralization, non-falsification and traceability of the block chain, and in the bit currency network, just because of verification nodes distributed in the world, the workload certification mechanism of the bit currency is approved, and people can also recognize the value of the block chain.
In the public block chain network of the bitcoin and the Ether house, permission is not needed for the accessed nodes, any node can be accessed to the block chain network, and any node can exit from the block chain network.
However, in the private blockchain network, any accessed node needs to be permitted, that is, any accessed node needs to be guaranteed to be trusted, in order to guarantee the authority of the blockchain-based distributed network, the node should not be allowed to randomly exit the network, and the node needs to be managed to guarantee that the node operates normally.
Therefore, it is a problem to be solved by the industry that a distributed network intelligent monitoring system based on a block chain, which can monitor the data state and the network state of a block chain distributed network and maintain the normal operation of the distributed network by intelligently identifying the state change in the distributed network, is provided.
Disclosure of Invention
The invention aims to provide a distributed network intelligent monitoring system based on a block chain, which comprises: the access permission module is used for issuing access permission to a node to be connected to a distributed network constructed by a block chain so as to enable the node to be connected to the distributed network to form an access node; the monitoring support module is used for monitoring the identity and the authority of the access node; and the front-end monitoring module is used for monitoring the state of the access node, analyzing effective state information and displaying the state information.
Optionally, the front-end monitoring module comprises: the data state tracking unit is used for sending a data state detection request to the access node in a timing manner, and summarizing and analyzing the returned data state information of the access node; the network state tracking unit is used for sending a network state detection request to the access node in a timing manner, and summarizing and analyzing the returned network state information of the access node; the configuration management unit is used for modifying the configuration file of the access node through a graphical interface; and the node control unit is used for eliminating the failed nodes in the distributed network and restarting the block chain service of the specified nodes.
Optionally monitoring the support module comprises: an identity authentication unit for authenticating the identity of the access node; an access authority unit for setting access authority of the access node; and a log management unit for managing a system log of the block chain.
Optionally, the method further comprises: the data state monitoring module is used for detecting the data state of the block chain at regular time to obtain system data state information and summarizing and analyzing the system data state information; the network state monitoring module is used for detecting the network state of the block chain at regular time to obtain system network state information and summarizing and analyzing the system network state information; and the configuration management module is used for modifying the configuration file of the block chain through the graphical interface.
Optionally, the method further comprises: the message queue module is used for caching and forwarding data to be exchanged between the block chain and the access node; a serialization module for data transmitted between the structured block chain and the access node; and a protocol encoding and parsing module for defining a format of a communication protocol between the block chain and the access node, and encoding and decoding the communication protocol in a communication process.
Optionally, the message queue module is set to any one of the following: constructing a queue by adopting a Java queue object, providing message queue service by adopting SpringMQ, or providing message queue service by adopting RabbitMQ; the serialization module is set to adopt a Protocol Buffer format; the specification of the communication protocol includes at least one of the following specifications: obtaining data coherency state specifications, obtaining network state specifications, deleting node specifications, adding node specifications, restarting blockchain service specifications, and modifying profile specifications.
Optionally, the method further comprises: a bottom layer communication module for establishing connection, maintaining connection, and transmitting data between the blockchain and the access node; and the data storage module is used for storing the user information and the log information of the access node.
Optionally, the bottom layer communication module is set as a Netty component; the data storage module is set to adopt a MySql server.
The second objective of the present invention is to provide a monitoring method for a distributed network intelligent monitoring system based on a block chain, including: the method comprises the steps that an access permission is issued to a node to be connected so that the node to be connected is connected to a distributed network to form an access node; monitoring the identity and authority of the access node; and monitoring the state of the access node, analyzing the effective state information and displaying the state information.
Optionally, monitoring the state of the access node comprises: sending a data state detection request to the access node in a timing manner, and summarizing and analyzing the returned data state information of the access node; sending a network state detection request to the access node in a timing manner, and summarizing and analyzing the returned network state information of the access node; modifying the configuration file of the access node through a graphical interface; and eliminating the failed nodes in the distributed network, and restarting the block chain service of the specified nodes.
Optionally, the method further comprises: detecting the data state of the block chain at regular time to obtain system data state information, and summarizing and analyzing the system data state information; detecting the network state of the block chain at regular time to obtain system network state information, and summarizing and analyzing the system network state information; and modifying the configuration file of the block chain through the graphical interface.
The invention has the beneficial effects that: (1) the connection state and the disconnection state between the nodes and the block chain are effectively controlled, so that the authority of the block chain distributed network is guaranteed, and the normal operation of the nodes is guaranteed; (2) monitoring the data state and the network state of the nodes through an artificial intelligence technology, intelligently identifying the state change of the distributed network, and ensuring the normal operation of the distributed network; (3) the whole system is low in cost, flexible and diverse in applicable scenes and strong in expandability.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
Referring to fig. 1, the block chain-based distributed network intelligent monitoring system of the present invention is a typical MVC architecture, and includes: a bottom layer communication module 100, a data storage module 200, an access permission module 300, a monitoring support module 400, and a front end monitoring module 500.
Among other things, the underlying communication module 100 is responsible for establishing connections, maintaining connections, and transmitting data between blockchains and access nodes connected in a distributed network constructed by the blockchains. The underlying communication module 100 employs a Netty server, one of the most popular NIO frameworks in the industry, as a web application framework and tool that provides asynchronous, event-driven.
The data storage module 200 may employ a MySql server to store user information and log information of each access node.
When a certain node to be connected to the distributed network, the access permission module 300 issues an access permission for the node to be connected, and the node to be connected with the access permission can access the distributed network to form an access node, thereby ensuring the authority of the block chain distributed network.
After the node to be connected is connected to the distributed network to form an access node, the monitoring support module 400 including the identity authentication unit 410, the access right unit 420 and the log management unit 430 monitors the identity and right of the access node. The identity authentication unit 410 authenticates the identity of the access node, the access authority unit 420 sets the access authority of the access node, and the log management unit 430 manages the system log of the block chain.
As shown in fig. 1, the front-end monitoring module 500 includes a data state tracking unit 510, a network state tracking unit 520, a configuration management unit 530, and a node control unit 540. The data state tracking unit 510 may send a data state detection request to the access nodes of the entire network in a fixed time, and summarize the data state information of all the returned access nodes, analyze the valid data state information, and display the valid data state information. Similarly, the network status tracking unit 520 sends a network status detection request to the access nodes of the whole network at regular time, and summarizes the network status information of all the returned access nodes, analyzes the effective network status information, and displays the effective network status information. The configuration management unit 530 may modify the configuration file of the access node through a graphical interface. For a bad node and a failed node in the distributed network, the node control unit 540 may directly remove the bad node and the failed node, and meanwhile, the node control unit 540 may restart the block chain service of the designated node.
As an alternative embodiment, the message queue module 600 is further included, and for large-scale data exchange, the message queue module 600 undertakes buffering and forwarding of data to be exchanged between the block chain and the access node. As a non-limiting application example, the message queue module 600 of the present invention may use Java queue objects to construct queues, and may also use SpringMQ or RabbitMQ to provide message queue services.
As another alternative, a serialization module 700 is also included, which may employ Protocol Buffer format to structure the data transmitted between the block chain and the access node.
In communication between a node and a block chain, the present invention defines a format of a communication protocol between the block chain and the node using the protocol encoding and parsing module 800, and encodes and decodes the communication protocol during the communication.
As a non-limiting example of an application, a description of the communication protocol is shown in table 1.
TABLE 1
As shown in fig. 2A to 2D, the intelligent monitoring system for a block chain-based distributed network of the present invention can directly obtain a data state consistency state, a network consistency state, or provide operations of restarting a block chain service and modifying a configuration file from any access node of the distributed network by using the protocol in table 1.
As a further alternative, in order to monitor the system itself, the system further comprises: the system comprises a data state monitoring module 900, a network state monitoring module 1000, and a configuration management module 1100, wherein the data state monitoring module 900 may periodically detect the data state of a block chain to obtain system data state information, and meanwhile, summarize and analyze the system data state information. Similarly, the network status monitoring module 1000 may detect the network status of the block chain at regular time to obtain the system network status information, and collect and analyze the system network status information. The configuration management module 1100 modifies the configuration file of the blockchain through a graphical interface.
Based on the same idea, the present invention further provides a monitoring method of a distributed network intelligent monitoring system based on a block chain, as shown in fig. 3, in step S10, an access permission is issued to a node to be connected, so that the node to be connected is connected to a distributed network to form an access node. In step S20, the identity and authority of the access node are monitored, and finally, in step S30, the state of the access node is monitored, and the valid state information is analyzed and displayed.
As a non-limiting application example, in step S30, the monitoring the state of the access node includes: sending a data state detection request to the access node in a timing manner, and summarizing and analyzing the returned data state information of the access node; sending a network state detection request to the access node in a timing manner, and summarizing and analyzing the returned network state information of the access node; modifying the configuration file of the access node through a graphical interface; and eliminating the failed nodes in the distributed network, and restarting the block chain service of the specified nodes.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.