CN108650333B - Method, medium, device and system for distributing node load in block chain system - Google Patents

Method, medium, device and system for distributing node load in block chain system Download PDF

Info

Publication number
CN108650333B
CN108650333B CN201810857274.0A CN201810857274A CN108650333B CN 108650333 B CN108650333 B CN 108650333B CN 201810857274 A CN201810857274 A CN 201810857274A CN 108650333 B CN108650333 B CN 108650333B
Authority
CN
China
Prior art keywords
node
nodes
logic
network connection
data storage
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
CN201810857274.0A
Other languages
Chinese (zh)
Other versions
CN108650333A (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.)
Ke'an (Xiamen) Technology Co.,Ltd.
Original Assignee
Tailian Xiamen Technology 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 Tailian Xiamen Technology Co ltd filed Critical Tailian Xiamen Technology Co ltd
Priority to CN201810857274.0A priority Critical patent/CN108650333B/en
Publication of CN108650333A publication Critical patent/CN108650333A/en
Application granted granted Critical
Publication of CN108650333B publication Critical patent/CN108650333B/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
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method for dispersing node load of a block chain system, which comprises the following steps: configuring at least two functional nodes, and combining the functional nodes into a logic node with unique identification information in a blockchain network; when the logic node is in an active state, controlling a node with a network connection function in the logic node to wait for other nodes with the network connection function to connect, controlling the network connection node to try to establish connection with other network connection nodes based on a configured node list, controlling a data storage operation node in the logic node to start block production based on an initial block producer list, and controlling a user request node in the logic node to open a port to wait for the transmission of a user task request data packet; correspondingly, the invention also discloses a medium, a device and a block chain system; the functions of the single node can be differentiated, so that the operation load of the single node is reduced, and the stability of the block chain system is improved.

Description

Method, medium, device and system for distributing node load in block chain system
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a method, medium, and apparatus for distributing node loads in a blockchain system, and a blockchain system.
Background
The blockchain is a technical scheme for collectively maintaining a reliable database in a decentralized and distrust-free mode. In the existing blockchain system, transactions that a single node needs to process are often multiple (for example, a task request of a user, sending and receiving of network data, operation and storage of data, and the like); the load of a single node is large, and the load is easy to cause the node breakdown when exceeding the acceptable range of the node, thereby affecting the normal operation of the blockchain system.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the art described above. Therefore, an objective of the present invention is to provide a distributed node load method for a blockchain system, which can differentiate functions of a single node to reduce the operation load of the single node, thereby improving the stability of the blockchain system.
A second object of the invention is to propose a computer-readable storage medium.
The third objective of the present invention is to provide a distributed node loading apparatus for a block chain system.
A fourth objective of the present invention is to provide a block chain system.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides a method for distributing node loads in a blockchain system, including the following steps: configuring at least two functional nodes and combining the at least two functional nodes into a logic node, wherein the at least two functional nodes have a data storage operation function, a network connection function and a user request function, and the logic node has unique identification information in a blockchain network; when the logic nodes are in an active state, opening ports of the nodes with the network connection function in the logic nodes to wait for other nodes with the network connection function to be connected, controlling the nodes with the network connection function in the logic nodes to try to establish a connection relation with the nodes with the network connection function in the other logic nodes based on a configured logic node list, controlling the nodes with the data storage operation function in the logic nodes to start block production based on an initial block producer list, and controlling the nodes with the user request function in the logic nodes to open ports to wait for the incoming of user task request data packets.
According to the distributed node load method of the block chain system, at least two functional nodes are configured, and the at least two functional nodes are combined into one logic node, wherein the at least two functional nodes have a data storage operation function, a network connection function and a user request function, and the logic node has unique identification information in a block chain network; then, when the logic node is in an active state, controlling a node with a network connection function in the logic node to open a port to wait for other nodes with the network connection function to connect, controlling a node with the network connection function in the logic node to try to establish a connection relation with nodes with the network connection function in other logic nodes based on a configured logic node list, controlling a node with a data storage operation function in the logic node to start block production based on an initial block producer list, and controlling a node with a user request function in the logic node to open a port to wait for the transmission of a user task request data packet; therefore, the functions of the single node are differentiated, so that the operation load of the single node is reduced, and the stability of the block chain system is improved.
In addition, the method for distributing node load in a blockchain system according to the above embodiment of the present invention may further have the following additional technical features:
optionally, the number of the at least two functional nodes is three, the three functional nodes are respectively a data storage operation node, a network connection node and a user request node, and the data storage operation node, the network connection node and the user request node are interacted in pairs, wherein any one of the data storage operation node, the network connection node and the user request node periodically sends an inquiry data packet to the other two nodes to inquire whether the connection between the data storage operation node, the network connection node and the user request node is normal or not; if any node receives two pieces of information with normal response, the logic node is judged to be in an active state; and if the any node receives at least one piece of information responding to the abnormity or cannot be connected with other nodes, judging that the logic node is in a dormant state.
Optionally, when a new logical node needs to access the blockchain network, a network connection node address set is configured on a network connection node in the new logical node, and after all functional nodes in the new logical node are started, the network connection node in the new logical node is connected to a network connection node of a corresponding logical node in the blockchain network according to the configured network connection node address set, so as to connect the new logical node to the blockchain network.
Optionally, when the user task request data packet is transmitted, a user request node to be transmitted is acquired, and the task request is packaged and signed and then transmitted to the user request node to be transmitted, wherein the user request node to be transmitted analyzes the user task request data packet based on a user public key to obtain a task request, and transmits the task request to a data storage operation node in a corresponding logic node, and simultaneously transmits the task request to a network connection node in the corresponding logic node, so that the task request is broadcasted in the block chain network through the network connection node in the corresponding logic node; and when the corresponding logic node has the accounting right, the data storage operation node in the corresponding logic node stores the task request and performs operation.
Optionally, when a network connection node in any one of the logic nodes in the block chain network receives a broadcast data packet, the network connection node in the logic node forwards the broadcast data packet to a data storage operation node in the logic node, where when the broadcast data packet is a block synchronization packet, the data storage operation node in the logic node directly stores the broadcast data packet; and when the broadcast data packet is a task request packet and the logic node has a block production right, the data storage operation node in the logic node performs block production according to the task request in the task request packet.
Optionally, when the block chain network triggers a dpss block producer voting event, each logical node in the block chain network participates as a whole in voting for block production right, wherein when a block production condition is triggered, a data storage operation node in the logical node having the block production right performs task recording and block production to generate a synchronization block, and forwards the synchronization block to a network connection node in the logical node having the block production right, so that the network connection node in the logical node having the block production right packs the synchronization block into a block synchronization packet and broadcasts the block synchronization packet in the block chain network.
To achieve the above object, a second aspect of the present invention provides a computer readable storage medium, on which a distributed node load program of a blockchain system is stored, and when executed by a processor, the distributed node load program of the blockchain system implements the distributed node load method of the blockchain system as described above.
In order to achieve the above object, a third aspect of the present invention provides a distributed node loading apparatus for a block chain system, including: the system comprises a configuration module and a load dispersion module, wherein the configuration module is used for configuring at least two functional nodes and combining the at least two functional nodes into a logic node, the at least two functional nodes have a data storage operation function, a network connection function and a user request function, and the logic node has unique identification information in a block chain network; the load dispersing module is used for controlling a node with a network connection function in the logic nodes to open a port to wait for other nodes with the network connection function to connect when the logic nodes are in an active state, controlling the nodes with the network connection function in the logic nodes to try to establish a connection relation with the nodes with the network connection function in the other logic nodes based on a configured logic node list, controlling the nodes with a data storage operation function in the logic nodes to start block production based on an initial block producer list, and controlling the nodes with a user request function in the logic nodes to open a port to wait for the transmission of a user task request data packet.
According to the distributed node load device of the block chain system, the configuration module is used for configuring at least two functional nodes and combining the at least two functional nodes into one logic node, wherein the at least two functional nodes have a data storage operation function, a network connection function and a user request function, and the logic node has unique identification information in a block chain network; the load dispersing module is used for controlling a node with a network connection function in the logic nodes to open a port to wait for other nodes with the network connection function to be connected when the logic nodes are in an active state, controlling the nodes with the network connection function in the logic nodes to try to establish a connection relation with the nodes with the network connection function in the other logic nodes based on a configured logic node list, controlling the nodes with a data storage operation function in the logic nodes to start block production based on an initial block producer list, and controlling the node with a user request function in the logic nodes to open a port to wait for a user task request data packet to be transmitted; therefore, the functions of the single node are differentiated, so that the operation load of the single node is reduced, and the stability of the block chain system is improved.
In addition, the distributed node load apparatus of the blockchain system proposed by the above embodiment of the present invention may further have the following additional technical features:
optionally, the load device of the distributed node comprises at least two functional nodes, the three functional nodes are respectively a data storage operation node, a network connection node and a user request node, the data storage operation node, the network connection node and the user request node are interacted in pairs, any one of the data storage operation node, the network connection node and the user request node periodically sends a query data packet to the other two nodes to query whether the connection between the nodes is normal or not, and the load device of the distributed node further comprises a judging module, wherein the judging module is used for judging that the logic node is in an active state if the any one node receives two pieces of information with normal response; and if the arbitrary node receives at least one piece of information responding to the abnormity, judging that the logic node is in a dormant state.
In order to achieve the above object, a fourth aspect of the present invention provides a blockchain system, including the above distributed node load apparatus of the blockchain system.
Drawings
FIG. 1 is a flowchart illustrating a method for distributing node load in a blockchain system according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for determining an active status of a logical node according to an embodiment of the present invention;
fig. 3 is a flow diagram of a logical node access blockchain network according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart illustrating a task request submitted by a user according to an embodiment of the present invention;
FIG. 5 is a flow chart illustrating a broadcast packet processing according to an embodiment of the present invention;
FIG. 6 is a block production flow diagram according to an embodiment of the present invention;
fig. 7 is a block diagram illustrating a distributed node load apparatus of a blockchain system according to an embodiment of the present invention.
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.
In the existing block chain system, the single node has many and complicated matters to be processed, which easily causes the node to be overloaded and crashed, thereby affecting the normal operation of the block chain system; the method for distributing the node load of the block chain system comprises the following steps of firstly, configuring at least two functional nodes to combine into a logic node, wherein the at least two functional nodes have a data storage cloud function, a network connection function and a user request function; then, controlling a node with a network connection function in the logic nodes to open a port to wait for other nodes with the network connection function to connect, controlling the nodes with the network connection function in the logic nodes to try to establish a connection relation with the nodes with the network connection function in the other logic nodes based on the configured logic node list, controlling the nodes with the data storage operation function in the logic nodes to start block production based on the initial block producer list, and controlling the nodes with the user request function in the logic nodes to open a port to wait for the transmission of a user task request data packet; therefore, the functions of the single node are differentiated, so that the operation load of the single node is reduced, and the stability of the block chain system is improved.
In order to better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Fig. 1 is a flowchart illustrating a method for distributing node loads in a blockchain system according to an embodiment of the present invention, where the method for distributing node loads in a blockchain system includes the following steps:
s101, configuring at least two function nodes and combining the at least two function nodes into a logic node, wherein the at least two function nodes have a data storage operation function, a network connection function and a user request function, and the logic node has unique identification information in a block chain network.
That is, the number of the functional nodes needs to be at least two, the at least two functional nodes are combined into one logical node, and the logical node has unique identification information in the blockchain network; the at least two functional nodes can realize data storage operation, establish network connection with other nodes and receive user request information.
As an example, the number of the functional nodes is two, and the connection between the functional nodes is established to combine the two functional nodes into one logical node, wherein one functional node is set as a data storage operation node with a data storage operation function, and the other functional node is set as a network connection node with a network connection function and a user request function, so that transactions which originally need to be processed by a single node are processed by the two functional nodes in a functional differentiation manner, and the load of the single node is reduced.
As another example, the number of functional nodes is three, and the three functional nodes are combined into one logical node; the three functional nodes are respectively a data storage operation node with a data storage budget function, a network connection node with a network connection function and a user request node with a user request receiving function; therefore, the three functional nodes are combined into one logic node, and the functions of the three functional nodes are differentiated, so that the operation load of a single node is reduced.
S102, when the logic node is in an active state, controlling a node with a network connection function in the logic node to open a port to wait for other nodes with the network connection function to connect, controlling a node with the network connection function in the logic node to try to establish a connection relation with nodes with the network connection function in other logic nodes based on a configured logic node list, controlling a node with a data storage operation function in the logic node to start block production based on an initial block producer list, and controlling a node with a user request function in the logic node to open a port to wait for a user task request data packet to be transmitted.
That is, when the state of the logical node is active, the node with the network connection function in the logical node is controlled to open the port, so that other nodes with the network connection function establish connection with the logical node through the open port; controlling a node with a network connection function in the logic nodes to try to establish a connection relation with nodes with the network connection function in other logic nodes based on the configured logic node list so as to establish connection with each logic node in the list through the node with the network connection function according to the logic node list; and then, controlling a node with a data storage operation function in the logic nodes to start block production according to the initial block producer list, and controlling a node with a user request function in the logic nodes to open a port so that a user can transmit a task through the opened port.
There are various ways to determine whether a logical node is in an active state, for example: when the number of the functional nodes is two, the two functional nodes send inquiry data packets to each other at intervals of preset time to inquire whether the mutual connection is normal, and when any one of the functional nodes receives information of response abnormity or the other node cannot be connected, the logical node is judged to be in a dormant state; or, the query data packet is sent only through one functional node according to the preset time, and when the functional node receives the information of response abnormity or another node does not receive the query data packet in the preset time, the logic node is judged to be in the dormant state.
In summary, according to the method for distributing node load in a blockchain system in an embodiment of the present invention, at least two functional nodes are configured, and the at least two functional nodes are combined into one logical node, where the at least two functional nodes have a data storage operation function, a network connection function, and a user request function, and the logical node has unique identification information in a blockchain network; then, when the logic node is in an active state, controlling a node with a network connection function in the logic node to open a port to wait for other nodes with the network connection function to connect, controlling a node with the network connection function in the logic node to try to establish a connection relation with nodes with the network connection function in other logic nodes based on a configured logic node list, controlling a node with a data storage operation function in the logic node to start block production based on an initial block producer list, and controlling a node with a user request function in the logic node to open a port to wait for the transmission of a user task request data packet; therefore, the functions of the single node are differentiated, so that the operation load of the single node is reduced, and the stability of the block chain system is improved.
As shown in fig. 2, in some embodiments, in the distributed node load method of the block chain system according to an embodiment of the present invention, when there are three at least two functional nodes, the three functional nodes are a data storage operation node, a network connection node, and a user request node, and the data storage operation node, the network connection node, and the user request node interact with each other; the specific way of judging whether the logic node is in an active state is as follows:
s201, any one of a data storage operation node, a network connection node and a user request node periodically sends an inquiry data packet to the other two nodes to inquire whether the connection between the nodes is normal or not; if any node receives two pieces of information with normal response, the logic node is judged to be in an active state; and if the any node receives at least one piece of information responding to the abnormity or cannot be connected with other nodes, judging that the logic node is in a dormant state.
That is, when the number of the functional nodes is three, the three functional nodes are respectively a data storage operation node, a network connection node and a user request node; the data storage operation node, the network connection node and the user request node are interacted in pairs; any one of the data storage operation node, the network connection node and the user request node can regularly send inquiry data packets to the other two functional nodes to inquire whether the mutual connection is normal or not; when the other two functional nodes receive the inquiry data packet, judging whether the connection with other functional nodes except the other functional nodes is normal or not, if so, responding to normal information, and if not, responding to abnormal information; then, if any node receives two pieces of information which respond normally, the logic node is judged to be in an active state; and if any node receives at least one piece of information responding to the abnormity or cannot be connected with other nodes, judging that the logic node is in a dormant state. Therefore, when abnormal connection occurs among all functional nodes in the logic nodes, the logic nodes are closed, and the normal operation of the block chain system is ensured.
In summary, according to the load distribution method of the block chain system in the embodiment of the present invention, any one of the data storage operation node, the network connection node, and the user request node periodically sends an inquiry packet to another two nodes to inquire whether the connections between the nodes are normal; if any node receives two pieces of information with normal response, the logic node is judged to be in an active state; if the arbitrary node receives at least one piece of information responding to the abnormity or can not be connected with other nodes, the logic node is judged to be in a dormant state; therefore, when abnormal connection occurs among all functional nodes in the logic nodes, the logic nodes are closed, and the normal operation of the block chain system is ensured.
As shown in fig. 3, in some embodiments, in the method for load balancing of a blockchain system according to an embodiment of the present invention, when a new logical node needs to access a blockchain network, the method for load balancing of the blockchain system further includes the following steps:
s301, a network connection node address set is configured on the network connection node in the new logic node, and after all the functional nodes in the new logic node are started, the network connection node in the new logic node is connected to the network connection node of the corresponding logic node in the blockchain network according to the configured network connection node address set, so that the new logic node is connected to the blockchain network.
That is, when a new logical node needs to access the blockchain network, a node address set with the network connection node function in the blockchain network to which the new logical node is to be connected is configured on the node with the network connection function in the new logical node, so that the new logical node establishes connection between the node with the network connection function and the node address set node according to the configured node address set; after all functional nodes of the new logic node are started, establishing connection between the nodes with the network connection function and the nodes in the node address set according to the configured node address set; to connect the new logical node to the blockchain network.
As shown in fig. 4, in some embodiments, in the method for distributing node load in a blockchain system provided in an embodiment of the present invention, when a user needs to submit a task request to a blockchain network, the method for distributing node load in a blockchain system further includes the following steps:
s401, obtaining a user request node to be transmitted, packaging and signing the task request, and transmitting the task request to the user request node to be transmitted.
That is to say, when a user needs to transmit a task request into the blockchain system, a user request node to be transmitted is obtained first, and then the task request is packaged and signed and then is transmitted to the user request node to be transmitted.
There are various ways to obtain the user request node to be transmitted.
As an example, the user selects the user request node to be introduced according to the user request node address set issued by the block chain system official website, it should be noted that the state of each user request node (for example, the connection signal strength between the user node and each user request node, the computing capability of each user request node, the idle state, and the like) may be shown in the user request node address set issued by the system official website, so that the user selects the user request node to be introduced according to the state of each user request node.
It should be noted that the task request packaging and signing means that a user packages a task request to be transmitted through a blockchain system and signs the packaged task request through a private key owned by the user, so as to ensure the security of task request transmission.
S402, the user request node to be transmitted analyzes the user task request data packet based on the user public key to obtain the task request.
That is to say, after the user request node to be transmitted receives the task request data packet with the packed signature, the public key corresponding to the user private key is used for analyzing the task request data packet to obtain the task request.
And S403, forwarding the task request to a data storage operation node in the corresponding logic node, and forwarding the task request to a network connection node in the corresponding logic node, so that the task request is broadcasted in the block chain network through the network connection node in the corresponding logic node.
That is to say, after the user request node analyzes the task request data packet and obtains the task request, the user request node forwards the task request to the data storage operation node in the corresponding logic node, so that the logic node processes the task request when having the accounting right; meanwhile, the user request node also forwards the task request to a network connection node in the corresponding logic node so as to broadcast the task request in the blockchain network.
S404, when the corresponding logic node has the accounting right, the data storage operation node in the corresponding logic node stores the task request and performs operation.
That is to say, after receiving the task request forwarded by the user request node, the data storage operation node determines whether the logic node where the data storage operation node is located has the accounting right, and when the determination result is yes, the data storage operation node stores and operates the task request.
As shown in fig. 5, in some embodiments, in the distributed node load method of the blockchain system according to embodiments of the present invention, when a network connection node in any one of the logical nodes in the blockchain network receives a broadcast packet, where the broadcast packet includes a blockchain synchronization packet and a task request packet; the method for distributing node loads in the block chain system further comprises the following steps:
s501, the network connection node in the logic node forwards the broadcast data packet to the data storage operation node in the logic node.
S502, when the data storage operation node determines that the broadcast data packet is a block synchronization packet, step S503 is executed, and when the broadcast data packet is determined to be a task request packet, step S504 is executed.
That is, when receiving the broadcast data packet, the data storage operation node determines the type of the broadcast data packet, and determines that the broadcast data packet is a block synchronization packet or a task request packet, so as to perform different processing on different broadcast data packets.
And S503, directly storing the block synchronization packet by the data storage operation node in the logic node.
That is, when the broadcast data packet is a block synchronization packet, the data storage operation node directly stores the block synchronization packet, so that each logical node synchronously updates the block chain file.
S504, judge whether the logical node has the block production right, and when the judged result is yes, the data storage operation node in the logical node carries on the block production according to the task request in the task request packet.
That is, when the broadcast data packet is a task request packet, it is determined whether the logical node has a block production right, and when the determination result is yes, the data storage operation node in the logical node performs block production according to the task request in the task request packet.
There are various ways to determine whether a logical node has a block production right.
As an example, a block production right identifier is allocated to a logical node having a block production right by allocating the block production right identifier, and the block production right identifier is stored by a data storage operation node; when the data storage operation node receives a task request packet forwarded by the network connection node, judging whether a block production right identifier is stored in the data storage operation node, if so, judging that a logic node corresponding to the data storage operation node has a block production right.
The data storage operation node performs block production according to the task request in the task request packet, namely, the data storage operation node performs storage and operation on the task request according to the task request in the task request packet, and generates a block after a preset condition is reached.
As shown in fig. 6, in some embodiments, in the distributed node load method of the blockchain system provided by the present invention, a blockchain producer triggers a dpss blockchain producer voting event generation through a blockchain network, and each logical node in the blockchain network participates in voting as a whole to compete for blockchain production rights, wherein when a blockchain production condition is triggered, the distributed node load method of the blockchain system further includes the following steps:
s601, the data storage operation node in the logic node with the block production right performs task recording and block production to generate a synchronous block.
That is, when the tile production condition is triggered, the data storage operation node in the logical node having the tile production right records the task and packages the task after the previous tile timeline to generate the sync tile.
Among them, there are various ways to trigger the block production conditions, for example; through the preset block production time, when the interval between the previous block time line and the current time reaches the preset block production time, triggering a block production event; or, the task storage quantity of each block is preset, and when the task quantity after the last block timeline in the block chain system reaches the preset task storage quantity of each block, a block production event is triggered.
S602, the synchronization block is forwarded to a network connection node in the logical node having the block production right.
That is, after the data storage operation node in the logical node having the block production right packages the task and generates the synchronization block, the synchronization block is forwarded to the network connection node in the corresponding logical node.
S603, the network connection node in the logical node with block production right packs the synchronization blocks into block synchronization packets and broadcasts the block synchronization packets in the block chain network.
That is, after receiving the synchronization block sent by the data storage operation node, the network connection node in the logical node with block production right packages the synchronization block into a block synchronization packet, and broadcasts the block synchronization packet into the blockchain network, so that other logical nodes perform block chain synchronization according to the block synchronization packet.
To achieve the above embodiments, an embodiment of the present invention provides a computer-readable storage medium, on which a distributed node load program of a blockchain system is stored, and when executed by a processor, the distributed node load program of the blockchain system implements the above distributed node load method of the blockchain system.
To achieve the above embodiments, the present invention provides a distributed node loading apparatus of a blockchain system, as shown in fig. 7, the distributed node loading apparatus of the blockchain system includes: a configuration module 10 and a load distribution module 20.
The configuration module 10 is configured to configure at least two functional nodes, and combine the at least two functional nodes into one logical node, where the at least two functional nodes have a data storage operation function, a network connection function, and a user request function, and the logical node has unique identification information in a blockchain network
The load distribution module 20 is configured to, when a logic node is in an active state, control a node with a network connection function in the logic node to open a port to wait for another node with the network connection function to connect, control a node with the network connection function in the logic node to attempt to establish a connection relationship with a node with the network connection function in the other logic node based on a configured logic node list, control a node with a data storage operation function in the logic node to start block production based on an initial block producer list, and control a node with a user request function in the logic node to open a port to wait for an incoming user task request packet.
According to the distributed node load device of the block chain system, the configuration module is used for configuring at least two functional nodes and combining the at least two functional nodes into one logic node, wherein the at least two functional nodes have a data storage operation function, a network connection function and a user request function, and the logic node has unique identification information in a block chain network; the load dispersing module is used for controlling a node with a network connection function in the logic nodes to open a port to wait for other nodes with the network connection function to be connected when the logic nodes are in an active state, controlling the nodes with the network connection function in the logic nodes to try to establish a connection relation with the nodes with the network connection function in the other logic nodes based on a configured logic node list, controlling the nodes with a data storage operation function in the logic nodes to start block production based on an initial block producer list, and controlling the node with a user request function in the logic nodes to open a port to wait for a user task request data packet to be transmitted; therefore, the functions of the single node are differentiated, so that the operation load of the single node is reduced, and the stability of the block chain system is improved.
In some embodiments, in the distributed node load apparatus of the block chain system provided in the embodiments of the present invention, at least two functional nodes are three, the three functional nodes are respectively a data storage operation node, a network connection node, and a user request node, and the data storage operation node, the network connection node, and the user request node interact with each other two by two, and any one of the data storage operation node, the network connection node, and the user request node periodically sends a query packet to the other two nodes to query whether the connection therebetween is normal, where the distributed node load apparatus further includes a determination module configured to determine that a logical node is in an active state if the any one node receives two pieces of normal response information; and if the arbitrary node receives at least one piece of information responding to the abnormity, judging that the logic node is in a dormant state.
In order to implement the foregoing embodiments, an embodiment of the present invention provides a blockchain system, which includes the above-mentioned distributed node load apparatus of the blockchain system.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
In the description of the present invention, it is to be understood that the terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; either directly or indirectly through intervening media, either internally or in any other relationship. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
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, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above should not be understood to necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. 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.

Claims (10)

1. A method for distributing node load in a block chain system is characterized by comprising the following steps:
configuring at least two functional nodes and combining the at least two functional nodes into one logic node, wherein the logic node formed by combining the at least two functional nodes has a data storage operation function, a network connection function and a user request function, and the logic node has unique identification information in a block chain network;
when the logic nodes are in an active state, opening ports of the nodes with the network connection function in the logic nodes to wait for other nodes with the network connection function to be connected, controlling the nodes with the network connection function in the logic nodes to try to establish a connection relation with the nodes with the network connection function in the other logic nodes based on a configured logic node list, controlling the nodes with the data storage operation function in the logic nodes to start block production based on an initial block producer list, and controlling the nodes with the user request function in the logic nodes to open ports to wait for the incoming of user task request data packets.
2. The method as claimed in claim 1, wherein the at least two functional nodes are three, the three functional nodes are a data storage operation node, a network connection node and a user request node, and the data storage operation node, the network connection node and the user request node are interacted with each other two by two, wherein,
any one of the data storage operation node, the network connection node and the user request node periodically sends an inquiry data packet to the other two nodes to inquire whether the connection between the nodes is normal or not;
if any node receives two pieces of information with normal response, the logic node is judged to be in an active state;
and if the any node receives at least one piece of information responding to the abnormity or cannot be connected with other nodes, judging that the logic node is in a dormant state.
3. The method according to claim 1 or 2, wherein when a new logical node needs to access the blockchain network, a network connection node address set is configured on a network connection node in the new logical node, and after all functional nodes in the new logical node are started, the network connection node in the new logical node is connected to the network connection node of the corresponding logical node in the blockchain network according to the configured network connection node address set, so as to connect the new logical node to the blockchain network.
4. The method as claimed in claim 1 or 2, wherein, when the user task request data packet is transmitted, the user request node to be transmitted is obtained, and the task request is sent to the user request node to be transmitted after being packaged and signed, wherein,
the user request node to be transmitted analyzes the user task request data packet based on a user public key to obtain a task request, forwards the task request to a data storage operation node in a corresponding logic node, and forwards the task request to a network connection node in the corresponding logic node so as to broadcast the task request in the block chain network through the network connection node in the corresponding logic node;
and when the corresponding logic node has the accounting right, the data storage operation node in the corresponding logic node stores the task request and performs operation.
5. The method as claimed in claim 4, wherein when a network connection node in any one of the logic nodes in the blockchain network receives a broadcast packet, the network connection node in the logic node forwards the broadcast packet to a data storage operation node in the logic node, wherein,
when the broadcast data packet is a block synchronization packet, the data storage operation node in the logic node directly stores the data;
and when the broadcast data packet is a task request packet and the logic node has a block production right, the data storage operation node in the logic node performs block production according to the task request in the task request packet.
6. The method of decentralized node load for a blockchain system according to claim 5, wherein each logical node in the blockchain network participates in a vote as a whole to vote for blockchain production when the blockchain network triggers a dpss blockproducer voting event, wherein,
when the block production condition is triggered, the data storage operation node in the logic node with the block production right performs task recording and block production to generate a synchronous block, and forwards the synchronous block to the network connection node in the logic node with the block production right, so that the network connection node in the logic node with the block production right packs the synchronous block into a block synchronous packet and broadcasts the block synchronous packet in the block chain network.
7. A computer-readable storage medium, having stored thereon a distributed node load program of a blockchain system, which when executed by a processor implements the distributed node load method of the blockchain system according to any one of claims 1 to 6.
8. A distributed node load device of a block chain system is characterized by comprising a configuration module and a load distribution module, wherein,
the configuration module is used for configuring at least two functional nodes and combining the at least two functional nodes into one logic node, wherein the logic node formed by combining the at least two functional nodes has a data storage operation function, a network connection function and a user request function, and the logic node has unique identification information in a blockchain network;
the load dispersing module is used for controlling a node with a network connection function in the logic nodes to open a port to wait for other nodes with the network connection function to connect when the logic nodes are in an active state, controlling the nodes with the network connection function in the logic nodes to try to establish a connection relation with the nodes with the network connection function in the other logic nodes based on a configured logic node list, controlling the nodes with a data storage operation function in the logic nodes to start block production based on an initial block producer list, and controlling the nodes with a user request function in the logic nodes to open a port to wait for the transmission of a user task request data packet.
9. The distributed node load apparatus of a block chain system according to claim 8, wherein the number of the at least two functional nodes is three, the three functional nodes are a data storage operation node, a network connection node and a user request node, the data storage operation node, the network connection node and the user request node interact with each other in pairs, any one of the data storage operation node, the network connection node and the user request node periodically sends query packets to the other two nodes to query whether the connection therebetween is normal, wherein the distributed node load apparatus further comprises a determination module, the determination module is configured to,
if any node receives two pieces of information with normal response, the logic node is judged to be in an active state;
and if the arbitrary node receives at least one piece of information responding to the abnormity, judging that the logic node is in a dormant state.
10. A blockchain system comprising the distributed node load apparatus of the blockchain system according to claim 8 or 9.
CN201810857274.0A 2018-07-31 2018-07-31 Method, medium, device and system for distributing node load in block chain system Active CN108650333B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810857274.0A CN108650333B (en) 2018-07-31 2018-07-31 Method, medium, device and system for distributing node load in block chain system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810857274.0A CN108650333B (en) 2018-07-31 2018-07-31 Method, medium, device and system for distributing node load in block chain system

Publications (2)

Publication Number Publication Date
CN108650333A CN108650333A (en) 2018-10-12
CN108650333B true CN108650333B (en) 2021-02-02

Family

ID=63760461

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810857274.0A Active CN108650333B (en) 2018-07-31 2018-07-31 Method, medium, device and system for distributing node load in block chain system

Country Status (1)

Country Link
CN (1) CN108650333B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109240826B (en) * 2018-08-15 2020-10-23 泰链(厦门)科技有限公司 Method for allocating computing resources when nodes share computing equipment in multi-block chain network
CN109525678B (en) * 2018-12-25 2022-09-27 众安信息技术服务有限公司 Block chain network system and corresponding node device discovery method
CN111563129B (en) * 2020-07-15 2020-10-27 江苏荣泽信息科技股份有限公司 Distributed storage area block chain account book method
CN114978619B (en) * 2022-05-07 2023-08-04 国电南瑞科技股份有限公司 Cross-safety-zone data integration monitoring method, system and medium for multi-element load regulation and control system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364996A (en) * 2008-07-23 2009-02-11 西安电子科技大学 Hybrid layering P2P static network
CN103348638A (en) * 2011-02-07 2013-10-09 日本电气株式会社 Communication system, control device, communication node, and communication method
WO2016205748A1 (en) * 2015-06-18 2016-12-22 Jie Diao Conveying attention information in virtual conference
CN106530083A (en) * 2016-10-27 2017-03-22 上海亿账通区块链科技有限公司 Multi-chain management method and system based on block chain
CN106790513A (en) * 2016-12-19 2017-05-31 杜伯仁 The method that network share service is realized based on block chain
CN107079059A (en) * 2016-12-21 2017-08-18 深圳前海达闼云端智能科技有限公司 Block chain storage method and device and node equipment
CN108012582A (en) * 2017-08-18 2018-05-08 达闼科技成都有限公司 block chain system and authority management method thereof
KR20180075450A (en) * 2018-06-15 2018-07-04 정기영 Peer to peer transmission based data marketplace with cryptocurrency payment, building method of the same

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180197155A1 (en) * 2016-12-12 2018-07-12 Topl, Llc Method and Apparatus for Processing Mobile Payment Using Blockchain Techniques

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364996A (en) * 2008-07-23 2009-02-11 西安电子科技大学 Hybrid layering P2P static network
CN103348638A (en) * 2011-02-07 2013-10-09 日本电气株式会社 Communication system, control device, communication node, and communication method
WO2016205748A1 (en) * 2015-06-18 2016-12-22 Jie Diao Conveying attention information in virtual conference
CN106530083A (en) * 2016-10-27 2017-03-22 上海亿账通区块链科技有限公司 Multi-chain management method and system based on block chain
CN106790513A (en) * 2016-12-19 2017-05-31 杜伯仁 The method that network share service is realized based on block chain
CN107079059A (en) * 2016-12-21 2017-08-18 深圳前海达闼云端智能科技有限公司 Block chain storage method and device and node equipment
CN108012582A (en) * 2017-08-18 2018-05-08 达闼科技成都有限公司 block chain system and authority management method thereof
KR20180075450A (en) * 2018-06-15 2018-07-04 정기영 Peer to peer transmission based data marketplace with cryptocurrency payment, building method of the same

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"A topology-aware load balancing algorithm for P2P systems";Seyed Iman Mirrezaei等;《2009 Fourth International Conference on Digital Information Management》;20091218;第1-6页 *
"多节点集群P2P系统研究";申新鹏;《计算机科学》;20100419;第37卷(第2期);第71-74页 *

Also Published As

Publication number Publication date
CN108650333A (en) 2018-10-12

Similar Documents

Publication Publication Date Title
CN108650333B (en) Method, medium, device and system for distributing node load in block chain system
US11381383B2 (en) Methods and apparatuses for processing service using blockchain
CN106817250B (en) Dynamic election method and system
CN112767152B (en) Double-park disaster recovery system and method applied to alliance chain
CN109495383B (en) Data processing method, device, communication system and network equipment
CN102769556B (en) Dynamic regulation method and device for active VLAN
JP7380671B2 (en) Management device, vehicle communication system, vehicle communication management method, and vehicle communication management program
CN110532101A (en) The deployment system and method for micro services cluster
EP3813335A1 (en) Service processing method and system based on alliance chain network
WO2016173280A1 (en) Monitoring management method and apparatus
CN111401904A (en) Consensus method and system in alliance chain
WO2023050966A1 (en) Blockchain data verification
JP2024020560A (en) Setting device, communication system, and vehicle communication management method
EP4050475A1 (en) Image forming apparatus, method, and system for firmware upgrade
CN105636030A (en) Method and device for sharing access point
CN112671813A (en) Server determination method, device, equipment and storage medium
CN110635968A (en) Monitoring method, device and equipment for stacked double-active detection channel and storage medium
CN114363335A (en) Cross-chain interaction method and device
CN107483310B (en) Method and system for networking between terminal and forwarding node
CN112804233A (en) Block chain multi-channel-oriented block packing method and device and storage medium
US9967163B2 (en) Message system for avoiding processing-performance decline
CN113992685B (en) Service controller determining method, system and device
CN115767635A (en) Communication tunnel establishment method and device
CN111385324A (en) Data communication method, device, equipment and storage medium
CN108449802B (en) Mesh connection method and device

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 361000 B1F-065, Zone A, Huaxun Building, Software Park, Xiamen Torch Hi-tech Zone, Huli District, Xiamen City, Fujian Province

Patentee after: Ke'an (Xiamen) Technology Co.,Ltd.

Address before: B1f-065, zone a, Huaxun building, software park, torch hi tech Zone, Xiamen City, Fujian Province, 361000

Patentee before: TAILIAN (XIAMEN) TECHNOLOGY Co.,Ltd.